If new posts in X forum function

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
teebling
Registered User
Posts: 113
Joined: Sat Apr 14, 2018 7:38 pm
Contact:

If new posts in X forum function

Post by teebling »

Hello,

I'd like to make some code something like this:

Code: Select all

<!-- IF f=7 has UNREAD posts --><img src='#'><!-- ENDIF -->
Which I would be able to use on any viewforum page.

This is so that I could display a small image (indicating unread posts in X forum) next to any forum links in my navigation bar.

Could anyone help me out with the PHP bit? I am comfortable implementing this into the template itself just not the actual function.

Thanks,
Teeb
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: If new posts in X forum function

Post by david63 »

What code have you already got in your extension - is it on Github?
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
teebling
Registered User
Posts: 113
Joined: Sat Apr 14, 2018 7:38 pm
Contact:

Re: If new posts in X forum function

Post by teebling »

I don't have any code yet david63 - I understand how I will put in the IF statement into the template, but not the PHP behind that.

Teeb
User avatar
Toxyy
Registered User
Posts: 938
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Re: If new posts in X forum function

Post by Toxyy »

topicrow.S_UNREAD_TOPIC will be true per topic row on viewforum if it is unread in the templates.
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
User avatar
teebling
Registered User
Posts: 113
Joined: Sat Apr 14, 2018 7:38 pm
Contact:

Re: If new posts in X forum function

Post by teebling »

Toxyy wrote: Mon Oct 22, 2018 1:01 am topicrow.S_UNREAD_TOPIC will be true per topic row on viewforum if it is unread in the templates.
Thanks for this - will it work with other forums not currently displayed?

For example I am viewing forum ID 1, and there are unread posts in forum ID 3 (a page I am not currently viewing), and I do something like this:

Code: Select all

<!— IF topicrow.S_UNREAD and FORUM ID=3—><img src=“image.png”><!— ENDIF —>
Basically I have links to all the different forums in overall_header and would like to display an ‘unread posts’ indicator image above each if they have unread posts.
User avatar
Toxyy
Registered User
Posts: 938
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Re: If new posts in X forum function

Post by Toxyy »

teebling wrote: Mon Oct 22, 2018 6:17 am Basically I have links to all the different forums in overall_header and would like to display an ‘unread posts’ indicator image above each if they have unread posts.
I don't recall if that variable available within topic rowset but if they are you could get the array column if that and the key you need and loop through it looking for a hit, within your own mini extension of course.
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
Post Reply

Return to “Extension Writers Discussion”