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
Adding custom options
Avatar
Dre Erwin
Member
Free Members
sp_UserOfflineSmall Offline
Dec 17, 2013 - 5:05 pm

$spThisUser->ID doesnt work

Avatar
Dre Erwin
Member
Free Members
sp_UserOfflineSmall Offline
Dec 17, 2013 - 5:06 pm

as a paying customer, a creator would be very valuable!!!   If we could chare themes...oh my it would be awesome!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 17, 2013 - 5:12 pm

Dre Erwin said
$spThisUser->ID doesnt work

OK - so where are you puttiung this code? What does it do?  What is it for?

$spThisUser=>ID returns the user ID of the currently logged in user. Depending on where you are using it you may need to make it global first.

 

andy-signature.png
YELLOW
SWORDFISH
Avatar
Dre Erwin
Member
Free Members
sp_UserOfflineSmall Offline
Dec 17, 2013 - 5:20 pm

echo '<div>';
echo '<p>Platform:</p>';
echo '</div>';
echo '<div></div>';
echo '<div>';
echo '<p>';
sp_CustomProfileFieldsDisplay('Platform', $userid=0);
echo '</p>';
echo '</div>';
echo '<div>';
echo '<p>Gamertag:</p>';
echo '</div>';
echo '<div></div>';
echo '<div>';
echo '<p>';
sp_CustomProfileFieldsDisplay('Gamertag', $userid=0);
echo '</p>';
echo '</div>';

 

I asked what I needed to do becasue this is the script I am using in the forum view and I asked and was told to replace user id with $spThisUser->ID

 

but that didnt do anything.  I want all users to be able to display their gamertags and platform in their profile while viewing topics and threads.

Avatar
Dre Erwin
Member
Free Members
sp_UserOfflineSmall Offline
Dec 17, 2013 - 5:38 pm

ive done this before..just every time a new update comes out it wipes everything away..ya I know lol make my own theme

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 17, 2013 - 5:39 pm

'Forum View'? I will assume by that you mean the spForumView.php theme template.

Well - to get the currently logged in userrs ID you need to use

$spThisUser->ID

Is this what you want? The currently logged in user?

As I said - you may have to declare the global first although you should not have to,

global $spThisUser;

What am I missing?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Dre Erwin
Member
Free Members
sp_UserOfflineSmall Offline
Dec 17, 2013 - 5:41 pm

ya sorry topic view

Avatar
Dre Erwin
Member
Free Members
sp_UserOfflineSmall Offline
Dec 17, 2013 - 5:43 pm

maybe Im missing a comma or soemthing..it just shows my profile for everyone lol

Avatar
Dre Erwin
Member
Free Members
sp_UserOfflineSmall Offline
Dec 17, 2013 - 5:45 pm

it looks like this:

 

sp_CustomProfileFieldsDisplay('Platform', $spThisUser->ID);

Avatar
Dre Erwin
Member
Free Members
sp_UserOfflineSmall Offline
Dec 17, 2013 - 5:48 pm

what would i need to do the change the color of the text as well?

 

sp_CustomProfileFieldsDisplay('Platform', $spThisUser->ID);

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