function sp_MemberListActions($args = '', $label = '', $startedToolTip = '', $postedToolTip = '') { global $spThisMember; if (!sp_get_auth('view_members_list')) { return; } $defs = array('tagId' => 'spMembersListActions%ID%', 'tagClass' => 'spInRowNumber', 'labelClass' => 'spInRowLabel', 'started' => 1, 'startedIcon' => 'sp_TopicsStarted.png', 'startedClass' => 'spIcon', 'posted' => 1, 'postedIcon' => 'sp_TopicsPosted.png', 'postedClass' => 'spIcon', 'profile' => 1, 'profileIcon' => 'sp_ProfileForm.png', 'profileClass' => 'spIcon', 'stack' => 0, 'echo' => 1); $a = wp_parse_args($args, $defs); $a = apply_filters('sph_MemberListActions_args', $a); extract($a, EXTR_SKIP); # sanitize before use $tagId = esc_attr($tagId); $tagClass = esc_attr($tagClass); $labelClass = esc_attr($labelClass); $startedClass = esc_attr($startedClass); $postedClass = esc_attr($postedClass); $profileClass = esc_attr($profileClass); $started = (int) $started; $posted = (int) $posted; $profile = (int) $profile; $startedIcon = sp_find_icon(SPTHEMEICONSURL, sanitize_file_name($startedIcon)); $postedIcon = sp_find_icon(SPTHEMEICONSURL, sanitize_file_name($postedIcon)); $profileIcon = sp_find_icon(SPTHEMEICONSURL, sanitize_file_name($profileIcon)); $echo = (int) $echo; if (!empty($startedToolTip)) { $startedToolTip = esc_attr($startedToolTip); } if (!empty($postedToolTip)) { $postedToolTip = esc_attr($postedToolTip); } $tagId = str_ireplace('%ID%', $spThisMember->user_id, $tagId); $att = $stack ? '<br />' : ''; # now render it $out = "<div id='{$tagId}' class='{$tagClass}'>"; if (!empty($label)) { $out .= "<span class='{$labelClass}'>" . sp_filter_title_display($label) . "<br /></span>"; } if ($started) { $param['forum'] = 'all'; $param['value'] = $spThisMember->user_id; $param['type'] = 5; $param['search'] = 1; $url = add_query_arg($param, sp_url()); $url = sp_filter_wp_ampersand($url); $out .= "<a href='" . esc_url($url) . "'><img class='{$startedClass} vtip' src='{$startedIcon}' title='{$startedToolTip}' alt='' />{$att}</a>"; } if ($posted) { $param['forum'] = 'all'; $param['value'] = $spThisMember->user_id; $param['type'] = 4; $param['search'] = 1; $url = add_query_arg($param, sp_url()); $url = sp_filter_wp_ampersand($url); $out .= "<a href='" . esc_url($url) . "'><img class='{$postedClass} vtip' src='{$postedIcon}' title='{$postedToolTip}' alt='' />{$att}</a>"; } if ($profile) { $link = "<img class='{$profileClass}' src='{$profileIcon}' alt='' />{$att}"; $out .= sp_attach_user_profile_link($spThisMember->user_id, $link); } $out .= "</div>\n"; $out = apply_filters('sph_MemberListActions', $out, $a); if ($echo) { echo $out; } else { return $out; } }
function sp_build_name_display($userid, $username, $linkNames = 1) { global $spThisUser, $spVars; $username = apply_filters('sph_build_name_display', $username, $userid); if ($userid) { $profile = sp_get_option('sfprofile'); if (sp_get_auth('view_profiles') && ($profile['namelink'] == 2 && $linkNames == 1)) { # link to profile return sp_attach_user_profile_link($userid, $username); } else { if ($profile['namelink'] == 3) { # link to website return sp_attach_user_web_link($userid, $username); } else { $username = apply_filters('sph_build_name_display_option', $username, $userid); } } } # neither permission or profile/web link return $username; }