Adding text 'New' to newly add posts
Posted October 30th 2011, 2:26pm
Image

@phpbb3
jQuery(function(){
$('.sprite-icon_post_target_unread').replaceWith('<div style="background: none repeat scroll 0 0 #55a716;color: #ffffff;font-weight: 800;padding: 0 3px;display:inline;">New</div>');
});


@in all pages

Colour, text & related attributes are customisable
φ
Posts:
Avatar
Guest
Adding text 'New' to newly add posts
Posted October 30th 2011, 2:45pm
I want to try this out do you have a punBB code ;o
I'm only good with CSS & HTML but JS :(
φ
Posts: 71
Joined: October 14th 2011, 11:00pm
Location: CompuTalks
Likes Given: 1
Adding text 'New' to newly add posts
Posted October 30th 2011, 2:58pm
For punBB all you need to is find the className of the unread icon. and change it in the code.

Raze said:
I'm only good with CSS & HTML

...then this shouldn't be a problem for you ;)
φ
Posts: 509
Joined: July 9th 2011, 11:00pm
Location: England
Likes Given: 15
Likes Received: 26
Adding text 'New' to newly add posts
Posted October 30th 2011, 3:15pm
Can you please give me the URL for the forum from which the snapshot in the initial post in this thread is from? I want to check it out!
φ
Posts: 280
Joined: October 2nd 2011, 11:00pm
Likes Given: 27
Likes Received: 4
Adding text 'New' to newly add posts
Posted October 30th 2011, 3:28pm
@LGforum: Figured that lol I just don't know the class names. I'll try to figure it out though
φ
Posts: 71
Joined: October 14th 2011, 11:00pm
Location: CompuTalks
Likes Given: 1
Adding text 'New' to newly add posts
Posted October 30th 2011, 3:50pm
@Raze, it's HTML, CSS, & Javascript!
φ
Posts: 237
Joined: October 29th 2011, 11:00pm
Location: england, united kingdom, stoke on trent
Likes Given: 20
Likes Received: 4
Adding text 'New' to newly add posts
Posted October 30th 2011, 4:04pm
@Ryan: I know I can see that lol I need to replace .sprite-icon_post_target_unread
φ
Posts: 71
Joined: October 14th 2011, 11:00pm
Location: CompuTalks
Likes Given: 1
Adding text 'New' to newly add posts
Posted October 30th 2011, 4:10pm
Use one of the many tools outs there for finding class names and Id's.
Like IE's developer tools. Press F12 on IE to bring them up.

And are you sure it isnt the same className?
φ
Posts: 509
Joined: July 9th 2011, 11:00pm
Location: England
Likes Given: 15
Likes Received: 26
Adding text 'New' to newly add posts
Posted October 30th 2011, 4:13pm
Oh well I thought that was phpBB3 only lol
φ
Posts: 71
Joined: October 14th 2011, 11:00pm
Location: CompuTalks
Likes Given: 1
Adding text 'New' to newly add posts
Posted October 30th 2011, 4:18pm
LGforum said:
Use one of the many tools outs there for finding class names and Id's.
Like IE's developer tools. Press F12 on IE to bring them up.

And are you sure it isnt the same className?


Nothing better than Opera...DragonFly
φ
Posts:
Avatar
Guest
Adding text 'New' to newly add posts
Posted October 30th 2011, 4:28pm
I was going to reply right away, but figured I would wait to see what transpired.

I believe the .sprite-icon_post_target_unread class only exists on phpBB2 and phpBB3 boards, and in any case, if you change the "mini-post-unread" icon in Pics Management, the class goes away. EDIT: the class also exists on Invision boards.

Why does it go away? The first part of the class name should be a sign: sprite
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Adding text 'New' to newly add posts
Posted October 30th 2011, 4:56pm
sprite is a lump of many tiny images, if you rplace one ...u get replaced by all
φ
Posts:
Avatar
Guest
Adding text 'New' to newly add posts
Posted October 31st 2011, 9:50am
not entirely!
φ
Posts: 237
Joined: October 29th 2011, 11:00pm
Location: england, united kingdom, stoke on trent
Likes Given: 20
Likes Received: 4
Adding text 'New' to newly add posts
Posted November 2nd 2011, 12:26am
atleast it will reduce the avalanche of http requests required for the RICH phpbb3 CSS :twisted:
φ
Posts:
Avatar
Guest
Adding text 'New' to newly add posts
Posted November 2nd 2011, 11:13am
This script won't reduce the number of HTTP requests, for two reasons.

First, if it was required, the HTTP request would have already been made prior to the script modifying the DOM. And second, since it's loading the forumotion generic blank image (after all, it's a sprite!), that image is already in the browser's cache and no HTTP request would be made.
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Adding text 'New' to newly add posts
Posted November 2nd 2011, 12:32pm
ohh..yes you are right. But what if someone is using custom icons ...replacing sprite? Or if he uses custom CSS rules to define images(backgrounds)
φ
Posts:
Avatar
Guest
Adding text 'New' to newly add posts
Posted November 3rd 2011, 3:51pm
can this is for invision forum ?
φ
Posts:
Avatar
Guest
Adding text 'New' to newly add posts
Posted November 3rd 2011, 4:33pm
Yes...I just checked on a default Invision board, and the script in the first post will work if you have not changed the default "mini-icon-new" post. If you have changed the icon, use this script instead:

jQuery(function(){
$('p.author img[title="New post"]').replaceWith('<div style="background: none repeat scroll 0 0 #55a716;color: #ffffff;font-weight: 800;padding: 0 3px;display:inline;">New</div>');
});
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
1
#19
Adding text 'New' to newly add posts
Posted December 15th 2011, 10:16pm
for PUNBB please ?
φ
Posts:
Avatar
Guest
Adding text 'New' to newly add posts
Posted December 17th 2011, 2:30am
help someone
φ
Posts:
Avatar
Guest

Who is online

Users browsing this forum: No registered users and 1 guest