Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Notification Button
Avatar
Justin Lewis
Member
Free Members
sp_UserOfflineSmall Offline
Nov 14, 2012 - 3:14 pm

Is there a way to implement a notification button inside of my actual WordPress theme?

For example, when people aren't on the forum, but rather they are inside of a course I have setup, can there be something at the top right of the page (inside of header.php) that shows them the # of unread posts they have? Or # of replies they've had?

Thanks!

Avatar
Brandon
U.S.
SP Wrangler
Free Members
sp_UserOfflineSmall Offline
Nov 14, 2012 - 8:23 pm

You could use the same type of thing that is used in the forum that shows unread posts.

screenshot_01.pngImage Enlarger

 

 

 

 

If you have a text widget and something like the Exec-PHP plugin installed you could use the same code that displays unread posts.

Something like:

<?php
    global $spThisUser;
    sp_forum_api_support();
sp_UnreadPostsInfo('tagClass=spRight spUnreadPostsInfo&spanClass=spLeft&iconClass=spLeft spIcon', __sp('%COUNT% topics with<br />unread posts'), __sp('Most recent topics with unread posts'), __sp('Mark all topics as read'));
?>

The CSS might or style may need to be adjusted but that should show the unread list on every WP page where the widget is active.

The codex entry sp_UnreadPostsInfo shows more info on that function and how you can change it if needed.

Avatar
Justin Lewis
Member
Free Members
sp_UserOfflineSmall Offline
Nov 14, 2012 - 8:53 pm

I'll try it out and let you know how it goes :D

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Nov 16, 2012 - 9:36 am

please do...

Avatar
Justin Lewis
Member
Free Members
sp_UserOfflineSmall Offline
Nov 16, 2012 - 10:45 am

It worked great actually and the code is very simple to grab.

I simply added a link to it like this

<a href="http://www.nicheoptimizer.com/forum/"><?php
 global $spThisUser;
 sp_forum_api_support();
sp_UnreadPostsInfo('tagClass=spRight spUnreadPostsInfo&spanClass=spLeft&iconClass=spLeft spIcon', __sp('%COUNT% Unread Posts'), __sp('Most recent topics with unread posts'), __sp('Mark all topics as read'));
?></a>
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 16, 2012 - 11:59 am

Looks good!

andy-signature.png
YELLOW
SWORDFISH
Avatar
almase
Member
Free Members
sp_UserOfflineSmall Offline
Feb 7, 2013 - 6:30 am

The possibility sounds good and i will try it too.

here my site: http://www.bulls-club.de

it works great but i can`t open the window with all new topics when i click the "Most recent topics with unread posts" button. i click the button but nothing happens. dosn`t work it on the sidebar?

Avatar
Brandon
U.S.
SP Wrangler
Free Members
sp_UserOfflineSmall Offline
Feb 7, 2013 - 10:22 am

almase said: it works great but i can`t open the window with all new topics when i click the "Most recent topics with unread posts" button. i click the button but nothing happens. dosn`t work it on the sidebar?

It should be a direct url link to new posts. When you hover over the icon does it show the /forum/newposts link at the bottom of your browser?

Avatar
almase
Member
Free Members
sp_UserOfflineSmall Offline
Feb 7, 2013 - 12:14 pm

No its javascript:void(0)

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 7, 2013 - 12:48 pm

Javascript:void(0) is correct. It just means the href attribute is not used. Instead the onclick attribute is used.

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: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625