Support Forum

Simple:Press Widget Idea/Add-on

MA Maximillion
Maximillion
Member

Perhaps it’s been suggested but has anyone thought of adding some functionality to the SP widget? I can see a few easy features which would drive a lot of possible traffic to a site forum from other pages.

  • Add the ability to see if you have any private messages waiting for you. (this would allow you to essentially watch the forums from other points on the site)
  • Add the ability to see if someone replied to a topic you posted to or started (same reasoning as above)
  • Add the ability to show your name, user badge and rank from the widget (people love badges and reminders of how awesome they are!)

I put this out as some ideas to help engage people more with the forums from within a site’s structure. The forum aspect is really nice but I feel a few nice tweaks to the widget might drive even more traffic to the forums.

Just some thought,

-Max

22 Answers

New Answer

MP Mr Papa
Mr Papa
Member

there are already template tags for displaying private messages waiting for you…

you can already subscribe to topics and get notification if some one posts to a topic you are subscribed to…

there is a dashboard template tag which will show your name and avatar in sidebar or where ever you want it… I can open a ticket to offer option to add badge and rank – like it…

If I am missing on something for the first two, please elaborate…

MA Maximillion
Maximillion
Member

Mr Papa said
there are already template tags for displaying private messages waiting for you…

you can already subscribe to topics and get notification if some one posts to a topic you are subscribed to…

there is a dashboard template tag which will show your name and avatar in sidebar or where ever you want it… I can open a ticket to offer option to add badge and rank – like it…

If I am missing on something for the first two, please elaborate…

OK – awesome. Sound good I guess my super obvious and possible ignorant question is how does one go about using those template tags to achieve something like that? Better yet – if you point me towards some docs or examples I can go about it myself. From what I am seeing in your answer it looks like I can get all I need except the badges to show up in a widget with some adjusting.

I guess are we talking about shortcode things or just opening up files and coding manually.

Thank you!

-Max

BR Brandon
Brandon
Member

For the display of private messages you can use a sidebar text widget for example and put this into it.

<?php sp_pm_inbox();?>

There is more info on it’s usage in the Codex towards the bottom. http://codex.simple-press.com/codex/plugins/our-plugins/available-plugins/private-messaging/

To add a Subscriptions review button you can do so similarly http://codex.simple-press.com/codex/plugins/our-plugins/available-plugins/subscriptions/ the codex entry shows the different ones but not any examples of specific different usage. They are all explained in the Subscriptions template files though. Will try and add a few examples to make it easier.

MP Mr Papa
Mr Papa
Member

most will be in the template tags plugins… or as template tags within other plugins… most can either be a template tag or a shortcode…

you can see all our plugins here: http://codex.simple-press.com/codex/plugins/our-plugins/available-plugins/

and specifically, the template tag plugin here: http://codex.simple-press.com/codex/plugins/our-plugins/the-template-tags-plugin/

not all the plugin pages are complete yet – some are still in work…

so you can add a shortcode to a page… or a template tag to a wp theme template file… or if you have exec php or other plugin that lets you put php in posts/pages/text widgets, you can use the template tag there too…

MA Maximillion
Maximillion
Member

Brandon C said
For the display of private messages you can use a sidebar text widget for example and put this into it.

<?php sp_pm_inbox();?>

There is more info on it’s usage in the Codex towards the bottom. http://codex.simple-press.com/codex/plugins/our-plugins/available-plugins/private-messaging/

To add a Subscriptions review button you can do so similarly http://codex.simple-press.com/codex/plugins/our-plugins/available-plugins/subscriptions/ the codex entry shows the different ones but not any examples of specific different usage. They are all explained in the Subscriptions template files though. Will try and add a few examples to make it easier.

Welp, gave it a whirl with a sidebar text widget and a plugin to make shortcode. (the plugin is here http://wordpress.org/extend/plugins/shortcode-exec-php/)

Had to remove both the <?php and ?> stuff from the code (as instructed) but it worked. I think a little tweaking and I will manage just fine. So, yes, a way to bring up the badge and rank would be most welcome and I think I will have the widget I desire!

Thank you sirs!

-Max

MP Mr Papa
Mr Papa
Member

I have added a ticket and accepted the task to look at adding that stuff to the dashboard template tag…

I wasnt thinking separate template tags since there is already a general template function you can use for ranks, user groups sp_UserAvatar(), sp_UserForumRank(),and sp_UserSpecialRank()… but I think there is not a general one for usergruops…

MA Maximillion
Maximillion
Member

Mr Papa said
I have added a ticket and accepted the task to look at adding that stuff to the dashboard template tag…

I wasnt thinking separate template tags since there is already a general template function you can use for ranks, user groups sp_UserAvatar(), sp_UserForumRank(),and sp_UserSpecialRank()… but I think there is not a general one for usergruops…

By the way is there some modification or prerequisites to using the above tags? The sp_UserAvatar() works fine – my Avatar will show up but I would like to get it centered and the other ones sp_UserForumRank() and sp_UserSpecialRank() just give me errors when I plug them in straightaway.

YS Yellow Swordfish
Yellow Swordfish
Member

I think – or at least I assume – that Steve posted the wrong functions. I believe he meant these two from the template tags plugin:

sp_ShowForumRankTag() and sp_ShowSpecialRanksTag()

You can get the calling details for both from this codex age: http://codex.simple-press.com/codex/plugins/our-plugins/the-template-tags-plugin/

MP Mr Papa
Mr Papa
Member

No, I actually did mean the functions I listed…  they work fine, just need to be set up…  BUT I had forgotten that we added them to the template tag plugin – so Andy’s suggestion is MUCH better than mine…  that plugin/template tags actually call the routines I referenced but do all the set up stuff for you…

And I will add a new template tag to the plugin for the usergroup info…

MA Maximillion
Maximillion
Member

Yellow Swordfish said
I think – or at least I assume – that Steve posted the wrong functions. I believe he meant these two from the template tags plugin:

sp_ShowForumRankTag() and sp_ShowSpecialRanksTag()

You can get the calling details for both from this codex age: http://codex.simple-press.com/codex/plugins/our-plugins/the-template-tags-plugin/

Hey Andy,

Tried the method you pointed out and neither the shortcode or the php code seemed to work. I checked out the codex and then used the shortcode which should have displayed my forum rank and special rank (according to user ID) and neither worked. The shortcode just got printed out like so:

[sp_ShowForumRankTag
‘3’
]
[sp_ShowSpecialRanksTag
‘3’
]
 

I did make sure the template tags were activated. Perhaps I missed something else?

-Max

MP Mr Papa
Mr Papa
Member

not sure what all those things are you posted… 

where are you putting them?  widget?  page/post?  wp theme template file? 

the template tag would be:

<?php sp_ShowForumRankTag(3); ?>

you could of course use a variable for the user id instead of the number, but I just used what you showed…

for the shortcode, it would be:

[sp_forum_rank userid="3"]

Now shortcodes are made for posts/pages…so if you use in wp theme template file or widget, you need to do:

<?php echo do_shortcode('[sp_forum_rank userid="3"]'); ?>

If you are using in text widget, you need to make sure it supports php, like the exec_php plugin…

MA Maximillion
Maximillion
Member

Mr Papa said
you could of course use a variable for the user id instead of the number, but I just used what you showed…

Hey Steve,

Got it to work – not quite sure what all that crazy formatting was in my post either – oh well.

What is the variable you are mentioning for the currently logged in user ID? I would like to be able to set it up for anyone logged in.

Thank you sir!

-Max

MP Mr Papa
Mr Papa
Member

for current user, I would use

global $current_user;

then the variable is

$current_user->ID

if its empty or 0, then its a guest or user not signed in…

MA Maximillion
Maximillion
Member

Mr Papa said
for current user, I would use

global $current_user;

then the variable is

$current_user->ID

if its empty or 0, then its a guest or user not signed in…

So this?

<?php sp_ShowForumRankTag($current_user);?>

That particular combo doesn’t seem to work for me but I am going to assume that’s my lack of knowledge.

-Max