Unread post and topic titles in different color - ajax.js changes required

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
Post Reply
Pilxy
Registered User
Posts: 29
Joined: Sat Feb 11, 2012 5:22 pm

Unread post and topic titles in different color - ajax.js changes required

Post by Pilxy »

I have a custom (prosilver based) theme installed in my forum. Ever since I remember, we've allways had unread posts and topic titles in different color, si I also included this in our 3.2 template.

I've done this by adding unread class to unread forums and unread topics by applying <!-- IF forumrow.S_UNREAD_FORUM --> unread<!-- ENDIF --> and <!-- IF topicrow.S_UNREAD_TOPIC --> unread<!-- ENDIF --> to forumlist_body and viewforum_body templates.

The thing works, but not entirely as it should. What I have noticed is that in 3.2 clicking on "mark forums read" is handled by ajax.js file and by clicking on the "mark read" link does not change the color of unread posts and topics to read (the same way as it does with icons). The unread color changes however, if I refresh the page.

So, looks like I'm gonna have to add or change something in ajax.js file. Anyone here who is willing to help, as I'm not qute familiar with .js? Thanks! :)
User avatar
Toxyy
Registered User
Posts: 938
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Re: Unread post and topic titles in different color - ajax.js changes required

Post by Toxyy »

I'd need to see the ajax file but there's some jquery in here for you to remove a class from a defined div:
https://stackoverflow.com/questions/951 ... -in-jquery

if you know where to put it in the ajax function then it shouldn't be too bad.
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Some of my extensions:
[3.3][BETA] Post Form Templates || [3.3][BETA] Anonymous Posts || [3.2][3.3][BETA] ACP Merge Child Forums || [3.2][BETA] Sticky Ad || [3.2][DEV] User Delete Topics || [3.3][DEV] Moderate While Searching || [3.3][RC] Short Number Twig Extension
Pilxy
Registered User
Posts: 29
Joined: Sat Feb 11, 2012 5:22 pm

Re: Unread post and topic titles in different color - ajax.js changes required

Post by Pilxy »

It's the default file used in prosilver template. The same as used in this forum as well.

styles/prosilver/template/ajax.js?assets_version=790


I tryed using these, but I probably haven't put them in the right place as they didn't work:


// Mark forumtitles read
$('a.forumtitle[class*="unread"]').removeClass('unread').addClass('read');

// Mark topictitle read
$('a.topictitle[class*="unread"]').removeClass('unread').addClass('read');
Pilxy
Registered User
Posts: 29
Joined: Sat Feb 11, 2012 5:22 pm

Re: Unread post and topic titles in different color - ajax.js changes required

Post by Pilxy »

I think I have managed to figure it out.

Above // Mark subforums read in line 28 I added this part of code

// Mark forumtitles read
$('a.forumtitle[class*="unread"]').removeClass('unread');


and in line 92, above // Remove link to first unread post I added thi part:

// Mark topictitles read
$('a.topictitle[class*="unread"]').removeClass('unread');


Tested it out and looks like it's working... :D
Post Reply

Return to “[3.2.x] Styles Support & Discussion”