Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
requests-topic
Show any custom field from WordPress on SimplePress
Avatar
cwwcwi0ecnuwijcowecwreiovuejwcko
Member
Free Members
sp_UserOfflineSmall Offline
Mar 18, 2011 - 7:26 am

I like the option to show userlocations on the forum beneath the username. BUT.. I don't use the simplepress forum profiles. So users cannot set their location (or any other custom fields I want).

With the Cimy User Extra Fields plugin for WordPress you can add a lot of different custom fields. For example I added the Location field. Now my users are able to add their location to their profile in the default profile editor of WordPress.

One thing left. Show these instead of the simplepress one on forum posts:

Open up sf-topic-components.php and find the function: # Inner poster details table

Find the line with the output: $out.= '<tr align="center"><td class=".$alt."></td></tr>';

BEFORE this line you should call the Location information from WordPress with the following code:

<?php $wplocation = get_cimyFieldValue($pid, 'Location'); if ( $wplocation == NULL ) { $locationecho = "Unknown Location"; } else { $locationecho = $wplocation; } ?>

Now you have captured the User Location in a variable $locationecho and you can simply output this anywhere you want on the forum. My example:

$out.= '<tr align="center"><td class=".$alt."><span class="userlocation">'.$locationecho.'</span></td></tr>';

Of course you can do this with any custom field you want. With this trick you can add everyting to a userprofile and show this directly on the forums.

Thought to share it, since I get a lot of help here too 🙂

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 18, 2011 - 8:42 pm

this will be very simple come v5.0 with themes and plugins...  thanks for sharing...

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