Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Member List Member URL Display - can it be displayed as Icon?
Avatar
Rebecca Rasmussen
Member
Free Members
sp_UserOfflineSmall Offline
Apr 9, 2013 - 4:10 pm

WordPress 3.5.1

SimplePress 5.2.6

SimplePress Theme - Default 1.2.2

Question about the Member List, Member URL screen. Currently the url is showing as linked text and it can get sloppy if it's a long url. I'd prefer it show as an icon. I have under profile / profile options / website link set to icon, but that only seems to affect the user info displayed to the left of the post content. I've tried different themes, but don't know if it's not theme controlled or all the themes just happen to treat it the same way but there's no difference theme to theme (deafult, css only, iforum, stacked).

Is it possible to make the "Member URL" listing "Member URL" value display a linked icon vs. linked text? And if so, which setting do I change or which file do I modify?

:0)

 post_sidebar.jpg

 

member_url.jpgImage Enlarger

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 9, 2013 - 4:58 pm

yes, its possible, but not view simple options or settings...

the entire html for the website url is available with the filter 'sph_MemberListUrl'... so you could add a filter and replace the html for the link with an icon and the link... would take a little bit of regex to accomplish...

or alternatively, you could take our sp_MemberListUrl() template function, change the name, add it to your spFunctions.php theme template file and tweak the html output to give you what you want...

perhaps we can add this to our list for future consideration.... but its the first time anyone has asked for it...

Avatar
Rebecca Rasmussen
Member
Free Members
sp_UserOfflineSmall Offline
Apr 9, 2013 - 6:30 pm

member_url_modified.jpgImage Enlarger

Awesome, thanks, that pointed me in just the right direction for the desired hack. Now working! While a core option setting would be great in the future, this hack will certainly work for now. :0)  for others who might be interested in the hack ... 

FROM CORE FILES SIMPLE PRESS version 5.2.6
IN FILE simple-press\\forum\\content\\sp-member-view-functions.php
COPY lines 432-482, or the sp_MemberListUrl() function if you've changed other things in that file and line numbers are different

PASTE TO THEME in my case NAME Default VERSION 1.2.2
IN FILE sp-resources\\forum-themes\\default\\templates\\spFunctions.php
PLACE wherever, I put at end
CHANGE function name as desired, I went with my_sp_MemberListUrl()
ADDED lines in the $defs array

'showAs' => 'text',
'icon' => 'sp_UserWebsite.png',
'iconClass' => 'spImg',
'targetNew' => 1,
'noFollow' => 0,

//ADDED lines in the "sanitize before use" section

$icon = sanitize_file_name($icon);
$iconClass = esc_attr($iconClass);
$targetNew = (int) $targetNew;
$noFollow = (int) $noFollow; 

ADDED logic to check showAs value, output as text vs. icon as appropriate

if ($showAs == 'icon' && $spThisMember->user_url != '')
{

$target = ($targetNew) ? ' target="_blank"' : '';

$follow = ($noFollow) ? ' rel="nofollow"' : '';
if(!empty($icon)) {

$out = "<div id='$tagId' class='$tagClass'>";
$out.= "<span class='$labelClass'>".sp_filter_title_display($label)."$att</span>";
$out.= "<a id='$tagId' class='$tagClass vtip' href='$spThisMember->user_url' title='$spThisMember->user_url'$target$follow><img class='$iconClass' src='".SPTHEMEICONSURL.$icon."' alt='' /></a>\n";
$out.= "</div>\n";

}
$out = apply_filters('sph_PostIndexUserWebsite', $out, $a);

}
else
{

// these were the original 5 lines
$out = "<div id='$tagId' class='$tagClass'>";
$out.= "<span class='$labelClass'>".sp_filter_title_display($label)."$att</span>";
$out.= "<span class='$dateClass'>".sp_make_clickable($spThisMember->user_url).'</span>';
$out.= "</div>\n";
$out = apply_filters('sph_MemberListUrl', $out, $a);

}

 

IN FILE sp-resources\\forum-themes\\default\\templates\\spMembersView.php
CHANGE call to core MemberListUrl to instead call modified one just added
AND PASS in the showAs value as "icon"

# Column 6 of the member row - url
# ----------------------------------------------------------------------
sp_ColumnStart('tagClass=spColumnSection spRight&width=26%');
//sp_MemberListUrl('', __sp('Member URL'));
my_sp_MemberListUrl(array('showAs' => 'icon'), __sp('Member URL'));
sp_ColumnEnd();

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

yup, perfect example of my #2 suggestion...  good job!

since you did all the work, I might be able to add it in for the next release... no promises though... ;)

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 10, 2013 - 4:58 pm

thanks! have added to SP 5.3 - although slightly optimized... ;)

Avatar
Rebecca Rasmussen
Member
Free Members
sp_UserOfflineSmall Offline
Apr 20, 2013 - 10:42 am

Fabulous, thanks!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 20, 2013 - 3:47 pm

You're welcome.

andy-signature.png
YELLOW
SWORDFISH
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