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
add "subscribe" button on top of forum page
Avatar
Jeroen den haan
Member
Free Members
sp_UserOfflineSmall Offline
May 16, 2013 - 6:08 pm

Hi there,

I'd like to add a "subcribe to topic" button on top of the forum list. There is one such a button on the bottom of the page, but I want a duplicate on top. Which file do I have to edit to accomplish that? I cannot find the template file that displays that button

I am using the default theme.

Thnx!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 16, 2013 - 6:50 pm

we have said this a zillion times but will say it again... do not edit our themes.. make your own theme first to keep from losing changes on updates... see:  http://codex.simple-press.com/.....g-a-theme/

and dont edit core...  edit your theme...

so the template file that will be in use will be based on the current page view...  since you are looking at a bunch of posts in a topic, its topic view... so the template file is spTopicView.php...  sorry, but that is not the answer ;)   at least not for finding the code you want...

in this case, the button is output at the bottom of the page in the footer... so its output in template file spFoot.php...  this code:

        if (function_exists('sp_SubscriptionsSubscribeButton')) sp_SubscriptionsSubscribeButton('tagClass=spButton spLeft', __sp('Subscribe'), __sp('Unsubscribe'), __sp('Subscribe to this topic'), __sp('Unsubscribe from this topic'));

you can duplicate that function anywhere else you want an other button - at the top for example as you stated...

please be advised, if you want your page to pass an html validation, you will need to give each button a unique ID...  simply duplicating the code will give them the same ID...

I would point you to the Codex, but it seems to be lacking a bit covering the template function arguments...

basically, add in a unique ID to each:

tagId=top and tagId=bottom

one per template function call... ie

        if (function_exists('sp_SubscriptionsSubscribeButton')) sp_SubscriptionsSubscribeButton('tagId-top&tagClass=spButton spLeft', __sp('Subscribe'), __sp('Unsubscribe'), __sp('Subscribe to this topic'), __sp('Unsubscribe from this topic'));

 

 

Avatar
Jeroen den haan
Member
Free Members
sp_UserOfflineSmall Offline
May 21, 2013 - 9:49 am

Hi Mr. papa,

I just created my own theme with all modifications. I all works :-)
One more question: 

How can I give some forums specific icons?

In the admin panel the drop down boxes for

Custom forum icon Select icon
Custom forum icon when new posts Select icon
Custom topic icon Select icon
Custom topic icon when new posts Select icon

are empty ?!

In which folder should I place the custom icons in my custom theme without the risk of losing them with an update?

Kind regards,

Jeroen

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 21, 2013 - 11:00 am

It is on the menu to the left of the panels. 'Custom Icons'. That is where you can upload them.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Jeroen den haan
Member
Free Members
sp_UserOfflineSmall Offline
May 21, 2013 - 11:18 am

thnx!

should it be in a specific formatting? Is there an example file of what it should look like? should it be a sprite file of icons, or a zipped folder with all my custom icons?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 21, 2013 - 1:26 pm

It is a standard file uploader. That means one file at a time - no folders. It does not use a sprite file either - we have no idea what size you may choose to use so creating the CSS would not be possible.

any image format will do as long as it displays. And size is entirely up to you although the current, default icons are 32px x 32px. remember that if you change the file size then you may need to adjust the column widths in the template file.

andy-signature.png
YELLOW
SWORDFISH
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