Support Forum
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/.....gs-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:
I did make sure the template tags were activated. Perhaps I missed something else?
-Max
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...
Visit Cruise Talk Central and Mr Papa's World
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
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...
Visit Cruise Talk Central and Mr Papa's World
Mr Papa said
for current user, I would useglobal $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
Hmmm put it in the exec_php widget and it kinda blew up. Got this:
Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /problem-with-post-edit-buttonome/problem-with-post-edit-buttonomesite/public_html/wp-content/plugins/simple-press/sp-api/sp-api-class-user.php on line 320
Catchable fatal error: Object of class WP_User could not be converted to string in /problem-with-post-edit-buttonome/homesite/public_html/wp-content/plugins/simple-press/sp-api/sp-api-class-user.php on line 111
-Max
THANK YOU!
Got it working. I was wondering. sine I'm essentially making an info widget for the person on the site. How can I add the equivalent of these calls (from the forum)
In these two I can turn off the title part off when I show the ranking. I also notice the forum has nice overrides in that it only show the Userrank icon if there is no Special rank icon.
sp_PostIndexUserRank('tagClass=spPostUserRank spCenter&showTitle=0');sp_PostIndexUserSpecialRank('tagClass=spPostUserSpecialRank spCenter&showTitle=0');
As for these three - i just want to put that info in a widget also!
sp_PostIndexUserPosts('tagClass=spPostUserPosts spCenter', __sp('Posts: %COUNT%'));
sp_PostIndexUserRegistered('tagClass=spPostUserRegistered spCenter', __sp('Member Since:<br /> %DATE%'));
sp_PostIndexUserStatus('tagClass=spCenter spPostUserStatus', __sp('Online'), __sp('Offline'));
Thanks in advance for any help!
-Max
Afraid we don't currently have template tags that currently return any of those data items. And the problem with using those actual functions is that they would be out of context of the data object they need and will return nothing.
I can certainly talk it over with Steve to see about offering a custom template tag that does return such data..
YELLOW
SWORDFISH
|
1 Guest(s)