Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Template Tags Error
Avatar
sterling
Member
Free Members
sp_UserOfflineSmall Offline
Apr 22, 2012 - 7:59 pm

I installed template tag plugin on 5.0.5.  When I try to add a template tag I get error that function is not found.  Am I using it wrong?

Example: <?php sp_ProfileShowDisplayName(); ?>

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 22, 2012 - 8:03 pm

sorry, what are you trying to do?  that function call is not part of the template tags plugin...  that is part of a profile...

so please explain what you would like to do and we can help...

Avatar
sterling
Member
Free Members
sp_UserOfflineSmall Offline
Apr 22, 2012 - 8:15 pm

I'm trying to display the user's name in a welcome bar.  I used to have it working with older version.

I found the function under Display Template Tags. 

http://codex.simple-press.com/.....le-view/ 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 22, 2012 - 8:23 pm

is the welcome bar on an SP page or other WP page?  If SP, specific page or any page?

Try this: 

echo $spThisUser->display_name;

Avatar
sterling
Member
Free Members
sp_UserOfflineSmall Offline
Apr 22, 2012 - 8:28 pm

Thanks for reply.  It's on another WP page.  That's why I was looking up the Display Template Tags.  

Is that section in codex incorrect?  Or am I just misunderstanding it?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 22, 2012 - 8:33 pm

did my suggestion work?

you read it half right and half wrong. wink  the tag is right, but it was in a profile view section... that means it works on profile pages...  you need it on all pages...  and actually, all the sp display template tags are for on sp pages...

if it did not work, being on another wp page, try:

global $spThisUser;
sp_forum_api_support();
echo $spThisUser->display_name;
Avatar
sterling
Member
Free Members
sp_UserOfflineSmall Offline
Apr 22, 2012 - 8:33 pm

Ah, I see.  It's only for SP themes.  Not general WP template tag.

I used to be able to use template tags in other pages like sf_show_avatar(40);  How do we do that with 5.x?

Thank you! 

Avatar
sterling
Member
Free Members
sp_UserOfflineSmall Offline
Apr 22, 2012 - 8:35 pm

We posted at same time kiss.  Thanks for info, will try that.

Where can I find available methods for $spThisUser?

Avatar
sterling
Member
Free Members
sp_UserOfflineSmall Offline
Apr 22, 2012 - 8:38 pm

That works, thanks.  I used to also display PM count in WP template.

sf_pm_tag($display=true, $usersonly=false); 

How best to do that now?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 22, 2012 - 8:40 pm

no methods for $spThisUser... its a data object...

but go to forum - toolbox - data inspector...  and turn on the display of spThisUser... will show you (on front end) whats available... similarily, you can look at other global objects on the various page views...  now if you call the sp_forum_api_support() that sets up the $spThisUser variable (you do have to do the global declaration) on non forum pages...

so... now you gonna make a liar out of me, huh? winkembarassed but a couple of the common display tags, such as sp_UserAvatar(), are available outside of SP pages... but you have to provide the data to them, ie with the $spThisUser global variable or other user object...

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