Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
Check if user is on topic page
Avatar
Jakob Smith
Copenhagen, Denmark
Member
Free Members
Offline
Sep 10, 2012 - 4:58 am

In my theme, I have moved the topic RSS button to the footer file, next to the all RSS button.

Now, I would like to have it shown only on topic pages. Probably using an if check in the footer file.

Is there anything like is_sp_topic_page() that I can use?

Avatar
Jakob Smith
Copenhagen, Denmark
Member
Free Members
Offline
Sep 10, 2012 - 7:26 am

I just found sp_is_topicview() and it's working for me:

if ( sp_is_topicview() ) { sp_TopicHeaderRSSButton('tagClass=spButton spLeft', __sp('Topic RSS'), __sp('Subscribe to the RSS feed for this topic')); }
            else { echo ""; };
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Sep 10, 2012 - 8:28 am

yes, that is it.. nice job!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Sep 10, 2012 - 8:28 am

actually, I am bit confused as to what you are trying to do... we only show the topic RSS button on topic view page already...

or was that just an example???

Avatar
Jakob Smith
Copenhagen, Denmark
Member
Free Members
Offline
Sep 10, 2012 - 8:39 am

Well, I just wanted the topic RSS button to be in another place. On topic views I only wanted the "Answer" button in the area where the topic RSS button resided.

So, I'm editing the theme template files. They are very nicely laid out and easy to edit.

When this installation goes live, I will post a link. It's a migration from bbPress 2.0.

Edit: I have put the code above in spFoot.php

Avatar
Yellow Swordfish
Glinton, England
SP Master
Offline
Sep 10, 2012 - 9:27 am

Looks like you did the right thing and used the right function. And we are always keen to see sites - especially when some customisation has taken place. So look forward to that.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Sep 10, 2012 - 8:19 pm

yeah, my only point was if the rss template call was in spTopicView.php, the check is redundant...  at least for the code you showed...

but like Andy anxious to see some customization!  cant wait!  holler if you have any more questions..

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: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626