Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
themes-topic
Change Forum & Topic Icon in case of new post
Avatar
CuberToy
Member
Free Members
sp_UserOfflineSmall Offline
Jan 28, 2012 - 10:02 am

Hi!

 

So, after taking care of my issues, I began to make my own theme editing the css-only one.

Is there any way to make the Forum Icon and Topic Icon change in case of new post ? Personnaly, I don't dislike your method (the little bubble) but most of people are used to the Icon changing and It could be usefull to add it.

 

Thanks in advance ! ^^

Avatar
Propheticus
The Netherlands
Member
Free Members
sp_UserOfflineSmall Offline
Jan 28, 2012 - 11:15 am

Sadly, using just CSS styling and the available options there currently doesn't seem to be an easy way to do this. The standard themes do not change the Class or ID for Forum/Topic icons when there's a new post. So, there's no class/id to refer to in your CSS styling.

It is possible though. It just takes quite a bit of coding in some of the template files. Our own community is lucky to have an in-house programmer that knows his way around PHP. He has recently 'hacked' this feature into our custom theme, after receiving similar requests from our user base.

I do understand some PHP and could post the code and try to explain it a bit. Nevertheless, I think it's wiser to let him elaborate on the matter if he feels like it 😛

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 28, 2012 - 12:39 pm

we have added a new class to an forum or topic row if it has unread topics/posts in it...  its in svn, but not sure it was in last update... should be tomorrow...

also thought we had a separate icon already, but will have to let Andy jump in here...

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 28, 2012 - 1:15 pm

You need to supply the alternate icon but you can change both the forum icon (Group View) and the topic icon (Forum View) by passing the argument 'iconUnread=xxxx.png' in the arguments list of the relevant function in the group and forum templates. This will then use the alternate 'unread' icon if the parent contains unread posts.

andy-signature.png
YELLOW
SWORDFISH
Avatar
CuberToy
Member
Free Members
sp_UserOfflineSmall Offline
Jan 28, 2012 - 4:35 pm

Nice ! Thanks all of you. I'll try that tomorrow (getting late here :p) and report.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 28, 2012 - 5:17 pm

we will be here! wink

Avatar
Dave
Member
sp_UserOfflineSmall Offline
Jan 29, 2012 - 5:45 am

Would you mind giving an example of iconUnread=xxxx.png in use?

Avatar
CuberToy
Member
Free Members
sp_UserOfflineSmall Offline
Jan 29, 2012 - 6:12 am

Ok so I've change the line (2245 in sp-forum-view-functions.php & 659 in sp-group-view-functions.php) and it works great. The only question is, is this possible without midifiying the core file (directly in the theme... cant find out where to put it if there's a way).

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 29, 2012 - 6:22 am

For both Dave H and CuberToy:

As we have not got the documentation up and running yet here is a quick shot at it.

You will be editing the template for the theme you are using. As always - remember that if you edit one of the supplied themes then it will be overwritten on a subsequent update so it is recommended to make your own theme by copying the exiting one you are using.

So - to make this change to the forum view (list of topics) go to the templates folder of the thee and open the template for Forum View.

If you take a little time to read through it you will see how this constructs the forum view display. It is really pretty straightforward.

In this case the function that displays the topic icon is probably in the theme as:

sp_TopicIndexIcon('tagClass=spRowIcon spLeft');

each function has a pre-defined set of arguments that can be passed but you only need to pass one if you want to change the default. To add an alternative icon  as requested then change the above to read:

sp_TopicIndexIcon('tagClass=spRowIcon spLeft&iconUnread=iconname.png');

Note the ampersand delimiter (just like WP template tag functions) and no spaces between arguments. You will, of course, have to supply the icon in the themes images folder and name it correctly in the argument above.

andy-signature.png
YELLOW
SWORDFISH
Avatar
CuberToy
Member
Free Members
sp_UserOfflineSmall Offline
Jan 29, 2012 - 6:39 am

Totally missed that line while searching. It works great.

Thanks a lot ! (Now, just have to make thess icons :p)

 

If it can help. Theses lines are in :

For Forum : spForumView.php line 143

For Group : spGroupView.php line 47

on the css-only theme.

 

Don't worry, I've created a new folder as well ^^

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625