function sp_ProfilePermissionsForum($thisForum, $userid) { global $thisAlt; # Start the 'forum' section $out = "<div class='spGroupForumSection {$thisAlt}'>"; # Column 1 of the forum row $out .= '<div class="spColumnSection spProfilePermissionIcon">'; $icon = !empty($thisForum->forum_icon) ? sp_paint_custom_icon('spRowIcon', SFCUSTOMURL . $thisForum->forum_icon) : sp_paint_icon('spRowIcon', SPTHEMEICONSURL, 'sp_ForumIcon.png'); $out .= $icon; $out .= '</div>'; # Column 2 of the forum row $out .= '<div class="spColumnSection spProfilePermissionForum">'; $out .= "<div class='spRowName'>" . $thisForum->forum_name . "</div>"; $desc = !empty($thisForum->forum_desc) ? $thisForum->forum_desc : ''; $out .= "<div class='spRowName'>" . $desc . "</div>"; $out .= '</div>'; # Column 3 of the forum row $site = SFHOMEURL . "index.php?sp_ahah=permissions&sfnonce=" . wp_create_nonce('forum-ahah') . "&forum=" . $thisForum->forum_id . '&userid=' . $userid; $img = SFCOMMONIMAGES . '/working.gif'; $out .= '<div class="spColumnSection spProfilePermissionButton">'; $out .= '<a rel="nofollow" href="javascript:void(null)" onclick="spjLoadTool(\'' . $site . '\', \'perm' . $thisForum->forum_id . '\', \'' . $img . '\');">'; $out .= '<input type="submit" class="spSubmit" value="' . sp_text('View') . '" />'; $out .= '</a>'; $out .= '</div>'; $out .= sp_InsertBreak('echo=0'); $out .= '</div>'; # hidden area for the permissions for this forum $out .= '<div id="perm' . $thisForum->forum_id . '" class="spHiddenSection spProfilePermission"></div>'; $thisAlt = $thisAlt == 'spOdd' ? 'spEven' : 'spOdd'; return $out; }
function sp_AdminLinksTag($args = '', $label = '', $toolTip = '') { global $spThisUser, $spDevice; # bail if not admin or moderator if (!$spThisUser->admin) { return; } # is this admin showing the admin bar? if (!isset($spThisUser->sfadminbar) || $spThisUser->sfadminbar == false) { return; } $defs = array('tagId' => 'spAdminLinks', 'tagClass' => 'spAdminLinks', 'icon' => 'sp_AdminLinks.png', 'iconClass' => 'spAdminLinks'); $a = wp_parse_args($args, $defs); $a = apply_filters('sph_AdminLinks_args', $a); extract($a, EXTR_SKIP); $p = $spDevice == 'mobile' && current_theme_supports('sp-theme-responsive') ? SPABIMAGESMOB : SPABIMAGES; # sanitize before use $tagId = esc_attr($tagId); $tagClass = esc_attr($tagClass); $iconClass = esc_attr($iconClass); $icon = sp_paint_icon($iconClass, $p, sanitize_file_name($icon)); $toolTip = esc_attr($toolTip); $label = sp_filter_title_display($label); $site = SFHOMEURL . "index.php?sp_ahah=admin-bar-links&sfnonce=" . wp_create_nonce('forum-ahah') . "&action=manage"; $out = "<a class='{$tagClass}' id='{$tagId}' title='{$toolTip}' rel='nofollow' href='javascript:void(null)' onclick='spjDialogAjax(this, \"{$site}\", \"{$label}\", 250, 0, 0);'>"; if (!empty($icon)) { $out .= $icon; } if (!empty($label)) { $out .= $label; } $out .= "</a>\n"; $out = apply_filters('sph_AdminLinks', $out, $a); echo $out; }
function sp_ForumIndexSubForums($args = '', $label = '', $toolTip = '') { global $spThisForum, $spThisForumSubs; if (empty($spThisForumSubs)) { return; } $defs = array('tagId' => 'spForumIndexSubForums%ID%', 'tagClass' => 'spInRowSubForums', 'labelClass' => 'spInRowLabel', 'linkClass' => 'spInRowSubForumlink', 'icon' => 'sp_SubForumIcon.png', 'unreadIcon' => 'sp_SubForumIcon.png', 'iconClass' => 'spIconSmall', 'iconWidth' => 20, 'topicCount' => 1, 'allNested' => 1, 'stack' => 0, 'truncate' => 0, 'echo' => 1, 'get' => 0); $a = wp_parse_args($args, $defs); $a = apply_filters('sph_ForumIndexSubForums_args', $a); extract($a, EXTR_SKIP); # sanitize before use $tagId = esc_attr($tagId); $tagClass = esc_attr($tagClass); $labelClass = esc_attr($labelClass); $linkClass = esc_attr($linkClass); $icon = sanitize_file_name($icon); $unreadIcon = sanitize_file_name($unreadIcon); $iconClass = esc_attr($iconClass); $iconWidth = (int) $iconWidth; $topicCount = (int) $topicCount; $allNested = (int) $allNested; $stack = (int) $stack; $truncate = (int) $truncate; $echo = (int) $echo; $get = (int) $get; $toolTip = esc_attr($toolTip); $thisTagId = str_ireplace('%ID%', $spThisForum->forum_id, $tagId); if ($get) { return $spThisForumSubs; } $out = "<div id='{$thisTagId}' class='{$tagClass}'>\n"; if ($stack) { $out .= "<ul class='{$labelClass}'><li>" . sp_filter_title_display($label) . "<ul>"; } else { $out .= "<span class='{$labelClass}'>" . sp_filter_title_display($label) . "</span>\n"; } foreach ($spThisForumSubs as $sub) { # Check if a custom icon $path = SPTHEMEICONSDIR; $url = SPTHEMEICONSURL; if ($sub->unread) { $fIcon = sanitize_file_name($unreadIcon); if (!empty($sub->forum_icon_new)) { $fIcon = sanitize_file_name($sub->forum_icon_new); $path = SFCUSTOMDIR; $url = SFCUSTOMURL; } } else { $fIcon = sanitize_file_name($icon); if (!empty($sub->forum_icon)) { $fIcon = sanitize_file_name($sub->forum_icon); $path = SFCUSTOMDIR; $url = SFCUSTOMURL; } } if (!file_exists($path . $fIcon)) { $fIcon = sp_paint_icon($iconClass, SPTHEMEICONSURL, sanitize_file_name($icon)); } else { $fIcon = sp_paint_custom_icon($iconClass, $url . $fIcon); } if ($sub->parent == $spThisForum->forum_id || $allNested == true) { $thisToolTip = str_ireplace('%NAME%', htmlspecialchars($sub->forum_name, ENT_QUOTES, SFCHARSET), $toolTip); if ($stack) { $out .= "<li>"; } $out .= str_replace("<img ", "<img width='" . $iconWidth . "' ", $fIcon); $thisTagId = str_ireplace('%ID%', $sub->forum_id, $tagId); $out .= "<a href='{$sub->forum_permalink}' id='{$thisTagId}' class='{$linkClass}' title='{$thisToolTip}'>" . sp_truncate($sub->forum_name, $truncate) . "</a>\n"; if ($topicCount) { $out .= " ({$sub->topic_count})\n"; } if ($stack) { $out .= "</li>"; } } } if ($stack) { $out .= "</ul></li></ul>"; } $out .= "</div>\n"; $out = apply_filters('sph_ForumIndexSubForums', $out, $a); if ($echo) { echo $out; } else { return $out; } }
function sp_TopicForumToolButton($args = '', $label = '', $toolTip = '') { global $spThisForum, $spThisTopic, $spThisUser, $spGlobals; if ($spGlobals['lockdown'] == true && $spThisUser->admin == false) { return; } $show = false; if ($spThisUser->admin || $spThisUser->moderator) { $show = true; } else { if (sp_get_auth('lock_topics', $spThisForum->forum_id) || sp_get_auth('pin_topics', $spThisForum->forum_id) || sp_get_auth('edit_any_topic_titles', $spThisForum->forum_id) || sp_get_auth('delete_topics', $spThisForum->forum_id) || sp_get_auth('move_topics', $spThisForum->forum_id) || sp_get_auth('edit_own_topic_titles', $spThisForum->forum_id) && $spThisTopic->first_user_id == $spThisUser->ID) { $show = true; } } $show = apply_filters('sph_forum_tools_forum_show', $show); if (!$show) { return; } $defs = array('tagId' => 'spForumToolButton%ID%', 'tagClass' => 'spToolsButton', 'icon' => 'sp_ForumTools.png', 'iconClass' => 'spIcon', 'hide' => 1, 'containerClass' => 'spForumTopicSection'); $a = wp_parse_args($args, $defs); $a = apply_filters('sph_TopicForumToolButton_args', $a); extract($a, EXTR_SKIP); # sanitize before use $tagId = esc_attr($tagId); $tagClass = esc_attr($tagClass); $icon = sanitize_file_name($icon); $iconClass = esc_attr($iconClass); $containerClass = esc_attr($containerClass); $hide = (int) $hide; $toolTip = esc_attr($toolTip); $label = sp_filter_title_display($label); $tagId = str_ireplace('%ID%', $spThisTopic->topic_id, $tagId); $addStyle = ''; if ($hide) { $addStyle = " style='display:none;' "; } $site = SFHOMEURL . 'index.php?sp_ahah=admintoollinks&sfnonce=' . wp_create_nonce('forum-ahah') . "&action=topictools&topic={$spThisTopic->topic_id}&forum={$spThisForum->forum_id}&page={$spThisForum->display_page}"; $out = "<a class='{$tagClass}' id='{$tagId}' title='{$toolTip}' rel='nofollow' href='javascript:void(null)' {$addStyle} "; $title = esc_js(sp_text('Forum Tools')); $out .= "onclick='spjDialogAjax(this, \"{$site}\", \"{$title}\", 250, 0, 0);' >"; if (!empty($icon)) { $out .= sp_paint_icon($iconClass, SPTHEMEICONSURL, $icon); } if (!empty($label)) { $out .= $label; } $out .= "</a>\n"; $out = apply_filters('sph_TopicForumToolButton', $out, $a); echo $out; # Add script to hover admin buttons - just once if ($spThisForum->tools_flag && $hide) { ?> <script type='text/javascript'> /* <![CDATA[ */ var sptb = { toolclass : '.<?php echo $containerClass; ?> ' }; /* ]]> */ </script> <?php add_action('wp_footer', 'spjs_AddTopicToolsHover'); $spThisForum->tools_flag = false; } }
function sp_PostForumToolButton($args = '', $label = '', $toolTip = '') { global $spThisTopic, $spThisPost, $spThisPostUser, $spThisUser, $spGuestCookie, $spGlobals; if ($spGlobals['lockdown'] == true && $spThisUser->admin == false) { return; } $show = false; if ($spThisUser->admin || $spThisUser->moderator) { $show = true; } else { $edit_days = sp_get_option('editpostdays'); $post_date = strtotime(sp_date('d', $spThisPost->post_date)); $date_diff = floor((time() - $post_date) / (60 * 60 * 24)); if (sp_get_auth('view_email', $spThisTopic->forum_id) || sp_get_auth('pin_posts', $spThisTopic->forum_id) || sp_get_auth('edit_any_post', $spThisTopic->forum_id) || sp_get_auth('edit_own_posts_forever', $spThisTopic->forum_id) && $spThisUser->member && $spThisPostUser->ID == $spThisUser->ID || sp_get_auth('edit_own_posts_forever', $spThisTopic->forum_id) && $spThisUser->guest && $spThisPost->guest_email == $spGuestCookie->guest_email || sp_get_auth('edit_own_posts_reply', $spThisTopic->forum_id) && $spThisUser->member && $spThisPostUser->ID == $spThisUser->ID && $spThisPost->last_post || sp_get_auth('edit_own_posts_reply', $spThisTopic->forum_id) && $spThisUser->guest && $spThisPost->guest_email == $spGuestCookie->guest_email && $spThisPost->last_post || sp_get_auth('edit_own_posts_for_time', $spThisTopic->forum_id) && $spThisUser->member && $spThisPostUser->ID == $spThisUser->ID && $date_diff <= $edit_days || sp_get_auth('move_posts', $spThisTopic->forum_id) || sp_get_auth('reassign_posts', $spThisTopic->forum_id) || sp_get_auth('delete_any_post', $spThisTopic->forum_id) || sp_get_auth('delete_own_posts', $spThisTopic->forum_id) && $spThisPostUser->user_id == $spThisUser->ID || sp_get_auth('moderate_posts', $spThisTopic->forum_id) && $spThisPost->post_status != 0) { $show = true; } } $show = apply_filters('sph_forum_tools_topic_show', $show); if (!$show) { return; } $defs = array('tagId' => 'spForumToolButton%ID%', 'tagClass' => 'spToolsButton', 'icon' => 'sp_ForumTools.png', 'iconClass' => 'spIcon', 'hide' => 1, 'containerClass' => 'spTopicPostSection'); $a = wp_parse_args($args, $defs); $a = apply_filters('sph_PostForumToolButton_args', $a); extract($a, EXTR_SKIP); # sanitize before use $tagId = esc_attr($tagId); $tagClass = esc_attr($tagClass); $icon = sanitize_file_name($icon); $iconClass = esc_attr($iconClass); $containerClass = esc_attr($containerClass); $hide = (int) $hide; $toolTip = esc_attr($toolTip); $label = sp_filter_title_display($label); $tagId = str_ireplace('%ID%', $spThisPost->post_id, $tagId); $addStyle = ''; if ($hide) { $addStyle = " style='display: none;' "; } $last = $spThisPost->last_post ? 1 : 0; $site = SFHOMEURL . 'index.php?sp_ahah=admintoollinks&sfnonce=' . wp_create_nonce('forum-ahah') . "&action=posttools&post={$spThisPost->post_id}&page={$spThisTopic->display_page}&postnum={$spThisPost->post_index}&name=" . urlencode($spThisPostUser->display_name) . "&forum={$spThisTopic->forum_id}&last={$last}"; $out = "<a class='{$tagClass}' id='{$tagId}' title='{$toolTip}' rel='nofollow' href='javascript:void(null)' {$addStyle} "; $title = esc_js(sp_text('Forum Tools')); $out .= "onclick='spjDialogAjax(this, \"" . $site . "\", \"" . $title . "\", 350, 0, 0);' >"; if (!empty($icon)) { $out .= sp_paint_icon($iconClass, SPTHEMEICONSURL, $icon); } if (!empty($label)) { $out .= $label; } $out .= "</a>\n"; $out = apply_filters('sph_PostForumToolButton', $out, $a); echo $out; # Add script to hover admin buttons - just once if ($spThisTopic->tools_flag && $hide) { ?> <script type='text/javascript'> /* <![CDATA[ */ var sptb = { toolclass : '.<?php echo $containerClass; ?> ' }; /* ]]> */ </script> <?php add_action('wp_footer', 'spjs_AddPostToolsHover'); $spThisTopic->tools_flag = false; } }
function sp_SearchPageLinks($args = '', $label = '', $toolTip = '') { global $spSearchView, $spVars; $items_per_page = $spSearchView->searchShow; if (!$items_per_page) { $items_per_page = 30; } if ($items_per_page >= $spSearchView->searchCount) { return ''; } $defs = array('tagClass' => 'spPageLinks', 'prevIcon' => 'sp_ArrowLeft.png', 'nextIcon' => 'sp_ArrowRight.png', 'iconClass' => 'spIcon', 'pageLinkClass' => 'spPageLinks', 'curPageClass' => 'spCurrent', 'showLinks' => 4, 'echo' => 1); $a = wp_parse_args($args, $defs); $a = apply_filters('sph_SearchPageLinks_args', $a); extract($a, EXTR_SKIP); # sanitize before use $tagClass = esc_attr($tagClass); $iconClass = esc_attr($iconClass); $pageLinkClass = esc_attr($pageLinkClass); $curPageClass = esc_attr($curPageClass); $showLinks = (int) $showLinks; $label = sp_filter_title_display($label); $toolTip = esc_attr($toolTip); $echo = (int) $echo; if (!empty($prevIcon)) { $prevIcon = sp_paint_icon($iconClass, SPTHEMEICONSURL, sanitize_file_name($prevIcon), $toolTip); } if (!empty($nextIcon)) { $nextIcon = sp_paint_icon($iconClass, SPTHEMEICONSURL, sanitize_file_name($nextIcon), $toolTip); } $curToolTip = str_ireplace('%PAGE%', $spVars['searchpage'], $toolTip); $out = "<div class='{$tagClass}'>"; $totalPages = $spSearchView->searchCount / $items_per_page; if (!is_int($totalPages)) { $totalPages = intval($totalPages) + 1; } $out .= "<span class='{$pageLinkClass}'>{$label}</span>"; $out .= sp_page_prev($spVars['searchpage'], $showLinks, $spSearchView->searchPermalink, $pageLinkClass, $iconClass, $prevIcon, $nextIcon, $toolTip, $spVars['searchpage']); $url = $spSearchView->searchPermalink; if ($spVars['searchpage'] > 1) { $url = user_trailingslashit(trailingslashit($spSearchView->searchPermalink) . '&search=' . $spVars['searchpage']); } $out .= "<a href='{$url}' class='{$pageLinkClass} {$curPageClass}' title='{$curToolTip}'>" . $spVars['searchpage'] . '</a>'; $out .= sp_page_next($spVars['searchpage'], $totalPages, $showLinks, $spSearchView->searchPermalink, $pageLinkClass, $iconClass, $prevIcon, $nextIcon, $toolTip, $spVars['searchpage']); $out .= "</div>\n"; $out = apply_filters('sph_SearchPageLinks', $out, $a); if ($echo) { echo $out; } else { return $out; } }
function sp_forum_unavailable() { global $current_user; $out = ''; $out .= '<div id="spMainContainer">'; $out .= '<div class="spMessage">'; $out .= '<p>' . sp_paint_icon('', SPTHEMEICONSURL, 'sp_Information.png') . '</p>'; $out .= '<p>' . sp_text('Sorry, the forum is temporarily unavailable while it is being upgraded to a new version.') . '</p>'; if (sp_is_forum_admin($current_user->ID)) { $out .= '<a href="' . SFADMINUPGRADE . '">' . sp_text('Click here to perform the upgrade') . '</a>'; } $out .= '</div>'; $out .= '</div>'; $out = apply_filters('sph_forum_unavailable', $out); return $out; }
function sp_ListFirstPost($args = '', $label = '') { global $spThisListTopic; $defs = array('tagId' => 'spListFirstPost%ID%', 'tagClass' => 'spListPostLink', 'labelClass' => 'spListLabel', 'linkClass' => 'spLink', 'iconClass' => 'spIcon', 'icon' => 'sp_ArrowRight.png', 'labelLink' => 0, 'tip' => 1, 'niceDate' => 1, 'date' => 0, 'time' => 0, 'user' => 1, 'truncateUser' => 0, 'break' => 0, 'echo' => 1, 'get' => 0); $a = wp_parse_args($args, $defs); $a = apply_filters('sph_ListFirstPost_args', $a); extract($a, EXTR_SKIP); # sanitize before use $tagId = esc_attr($tagId); $tagClass = esc_attr($tagClass); $labelClass = esc_attr($labelClass); $linkClass = esc_attr($linkClass); $iconClass = esc_attr($iconClass); $labelLink = (int) $labelLink; $tip = (int) $tip; $niceDate = (int) $niceDate; $date = (int) $date; $time = (int) $time; $user = (int) $user; $truncateUser = (int) $truncateUser; $break = (int) $break; $icon = sanitize_file_name($icon); $echo = (int) $echo; $get = (int) $get; $tagId = str_ireplace('%ID%', $spThisListTopic->topic_id, $tagId); if ($tip && !empty($spThisListTopic->first_post_tip)) { $title = "title='{$spThisListTopic->first_post_tip}'"; $linkClass .= ''; } else { $title = ''; } $sp = ' '; $out = "<div id='{$tagId}' class='{$tagClass}'>\n"; if ($labelLink) { $out .= "<a class='{$linkClass}' {$title} href='{$spThisListTopic->first_post_permalink}'>\n"; } $out .= "<span class='{$labelClass}'>" . sp_filter_title_display($label) . " \n"; if ($labelLink) { $out .= "</a>\n"; } # Link to post $out .= "<a class='{$linkClass}' {$title} href='{$spThisListTopic->first_post_permalink}'>\n"; $out .= sp_paint_icon($iconClass, SPTHEMEICONSURL, $icon); $out .= "</a></span>\n"; # user $poster = sp_build_name_display($spThisListTopic->first_user_id, sp_truncate($spThisListTopic->first_display_name, $truncateUser)); if (empty($poster)) { $poster = sp_truncate($spThisListTopic->first_guest_name, $truncateUser); } if ($user) { $out .= "<span class='{$labelClass}'>{$poster}</span>\n"; } if ($get) { $getData = new stdClass(); $getData->permalink = $spThisListTopic->first_post_permalink; $getData->topic_name = $spThisListTopic->topic_name; $getData->post_date = $spThisListTopic->first_post_date; $getData->tooltip = $spThisListTopic->first_post_tip; $getData->user = $poster; return $getData; } if ($break) { $sp = "<br />"; } # date/time if ($niceDate) { $out .= "<span class='{$labelClass}'>" . $sp . sp_nicedate($spThisListTopic->first_post_date) . "</span>\n"; } else { if ($date) { $out .= "<span class='{$labelClass}'>" . $sp . sp_date('d', $spThisListTopic->first_post_date); if ($time) { $out .= '-' . sp_date('t', $spThisListTopic->first_post_date); } $out .= "</span>\n"; } } $out .= "</div>\n"; $out = apply_filters('sph_ListFirstPost', $out, $a); if ($echo) { echo $out; } else { return $out; } }
function sp_render_common_tools($forum, $topic, $post = 0, $page = 0) { global $spThisUser; $out = ''; if (sp_get_auth('lock_topics', $forum['forum_id'])) { $out .= '<div class="spForumToolsLock">'; $locktext = $topic['topic_status'] ? sp_text('Unlock this topic') : sp_text('Lock this topic'); $out .= sp_paint_icon('spIcon', SPTHEMEICONSURL, 'sp_ToolsLock.png'); $ajaxUrl = SFHOMEURL . 'index.php?sp_ahah=admintools&sfnonce=' . wp_create_nonce('forum-ahah') . '&action=lock-topic&topic=' . $topic['topic_id']; $out .= "<a href='javascript:void(null)' onclick='spjLockTopic(\"{$ajaxUrl}\");'>{$locktext}</a>"; $out .= '</div>'; } if (sp_get_auth('pin_topics', $forum['forum_id'])) { $out .= '<div class="spForumToolsPin">'; $pintext = $topic['topic_pinned'] ? sp_text('Unpin this topic') : sp_text('Pin this topic'); $out .= sp_paint_icon('spIcon', SPTHEMEICONSURL, 'sp_ToolsPin.png'); $ajaxUrl = SFHOMEURL . 'index.php?sp_ahah=admintools&sfnonce=' . wp_create_nonce('forum-ahah') . '&action=pin-topic&topic=' . $topic['topic_id']; $out .= "<a href='javascript:void(null)' onclick='spjPinTopic(\"{$ajaxUrl}\");'>{$pintext}</a>"; $out .= '</div>'; } if (sp_get_auth('pin_topics', $forum['forum_id']) && $topic['topic_pinned']) { $out .= '<div class="spForumToolsPin">'; $pintext = sp_text('Promote this pinned topic'); $out .= sp_paint_icon('spIcon', SPTHEMEICONSURL, 'sp_ToolsPin.png'); $site = SFHOMEURL . 'index.php?sp_ahah=admintools&sfnonce=' . wp_create_nonce('forum-ahah') . '&action=order-pins&topicid=' . $topic['topic_id'] . '&forumid=' . $forum['forum_id'] . '&userid=' . $topic['user_id']; $title = sp_text('Order Pinned Topics'); $out .= '<a rel="nofollow" href="javascript:void(null)" onclick="spjDialogAjax(this, \'' . $site . '\', \'' . esc_js($title) . '\', 400, 0, \'center\');">' . $title . '</a>'; $out .= '</div>'; } if (sp_get_auth('edit_own_topic_titles', $forum['forum_id']) && $topic['user_id'] == $spThisUser->ID || sp_get_auth('edit_any_topic_titles', $forum['forum_id'])) { $out .= '<div class="spForumToolsEdit">'; $out .= sp_paint_icon('spIcon', SPTHEMEICONSURL, 'sp_ToolsEdit.png'); $site = SFHOMEURL . 'index.php?sp_ahah=admintools&sfnonce=' . wp_create_nonce('forum-ahah') . '&action=edit-title&topicid=' . $topic['topic_id'] . '&forumid=' . $forum['forum_id'] . '&userid=' . $topic['user_id']; $title = sp_text('Edit topic title'); $out .= '<a rel="nofollow" href="javascript:void(null)" onclick="spjDialogAjax(this, \'' . $site . '\', \'' . esc_js($title) . '\', 400, 0, \'center\');">' . $title . '</a>'; $out .= '</div>'; } if (sp_get_auth('delete_topics', $forum['forum_id'])) { $out .= '<div class="spForumToolsDelete">'; $out .= sp_paint_icon('spIcon', SPTHEMEICONSURL, 'sp_ToolsDelete.png'); $msg = esc_js(sp_text('Are you sure you want to delete this topic?')); $view = !empty($post) ? 'topic' : 'forum'; $ajaxUrl = SFHOMEURL . 'index.php?sp_ahah=admintools&sfnonce=' . wp_create_nonce('forum-ahah') . '&action=delete-topic&killtopic=' . $topic['topic_id'] . '&killtopicforum=' . $forum['forum_id'] . '&page=' . $page . "&view={$view}"; $out .= "<a href='javascript:void(null)' onclick='spjDeleteTopic(\"{$ajaxUrl}\", {$topic['topic_id']}, {$forum['forum_id']});'>"; $out .= sp_text('Delete this topic'); $out .= '</a>'; } if (sp_get_auth('move_topics', $forum['forum_id'])) { $out .= '<div class="spForumToolsMove">'; $out .= sp_paint_icon('spIcon', SPTHEMEICONSURL, 'sp_ToolsMove.png'); $site = SFHOMEURL . 'index.php?sp_ahah=admintools&sfnonce=' . wp_create_nonce('forum-ahah') . '&action=move-topic&topicid=' . $topic['topic_id'] . '&forumid=' . $forum['forum_id']; $title = sp_text('Move this topic'); $out .= '<a rel="nofollow" href="javascript:void(null)" onclick="spjDialogAjax(this, \'' . $site . '\', \'' . esc_js($title) . '\', 400, 0, \'center\');">' . $title . '</a>'; $out .= '</div>'; } $out = apply_filters('sph_add_common_tools', $out, $forum, $topic, $post, $page); return $out; }
function sp_MemberListPageLinks($args = '', $label = '', $toolTip = '') { if (!sp_get_auth('view_members_list')) { return; } global $spMembersList; $defs = array('tagId' => 'spMemberPageLinks', 'tagClass' => 'spPageLinks', 'prevIcon' => 'sp_ArrowLeft.png', 'nextIcon' => 'sp_ArrowRight.png', 'iconClass' => 'spIcon', 'pageLinkClass' => 'spPageLinks', 'curPageClass' => 'spCurrent', 'showLinks' => 4, 'echo' => 1); $a = wp_parse_args($args, $defs); $a = apply_filters('sph_MemberListPageLinks_args', $a); extract($a, EXTR_SKIP); # sanitize before use $tagId = esc_attr($tagId); $tagClass = esc_attr($tagClass); $iconClass = esc_attr($iconClass); $pageLinkClass = esc_attr($pageLinkClass); $curPageClass = esc_attr($curPageClass); $showLinks = (int) $showLinks; $label = sp_filter_title_display($label); $toolTip = esc_attr($toolTip); $echo = (int) $echo; if (!empty($prevIcon)) { $prevIcon = sp_paint_icon($iconClass, SPTHEMEICONSURL, sanitize_file_name($prevIcon), $toolTip); } if (!empty($nextIcon)) { $nextIcon = sp_paint_icon($iconClass, SPTHEMEICONSURL, sanitize_file_name($nextIcon), $toolTip); } global $spVars; $curToolTip = str_ireplace('%PAGE%', $spVars['page'], $toolTip); if (isset($_POST['allmembers'])) { $search = ''; $ug = ''; } else { if (isset($_GET['page'])) { $spVars['page'] = sp_esc_int($_GET['page']); } $search = !empty($_POST['msearch']) ? sp_esc_str($_POST['msearch']) : ''; $search = !empty($_GET['msearch']) ? sp_esc_str($_GET['msearch']) : $search; $ug = !empty($_POST['ug']) ? sp_esc_int($_POST['ug']) : ''; $ug = !empty($_GET['ug']) ? sp_esc_int($_GET['ug']) : $ug; } $out = "<div id='{$tagId}' class='{$tagClass}'>"; $totalPages = $spMembersList->totalMemberCount / $spMembersList->membersNumber; if (!is_int($totalPages)) { $totalPages = intval($totalPages) + 1; } $out .= "<span class='{$pageLinkClass}'>{$label}</span>"; $out .= sp_page_prev($spVars['page'], $showLinks, SPMEMBERLIST, $pageLinkClass, $iconClass, $prevIcon, $nextIcon, $toolTip, $search, $ug); $url = SPMEMBERLIST; if ($spVars['page'] > 1) { $url = user_trailingslashit(trailingslashit($url) . 'page-' . $spVars['page']); } if (!empty($search)) { $param['msearch'] = $search; $url = add_query_arg($param, esc_url($url)); $url = sp_filter_wp_ampersand($url); } if (!empty($ug)) { $param['ug'] = $ug; $url = add_query_arg($param, esc_url($url)); $url = sp_filter_wp_ampersand($url); } $out .= "<a href='{$url}' class='{$pageLinkClass} {$curPageClass}' title='{$curToolTip}'>" . $spVars['page'] . '</a>'; $out .= sp_page_next($spVars['page'], $totalPages, $showLinks, SPMEMBERLIST, $pageLinkClass, $iconClass, $prevIcon, $nextIcon, $toolTip, $search, $ug); $out .= "</div>\n"; $out = apply_filters('sph_MemberListPageLinks', $out, $a); if ($echo) { echo $out; } else { return $out; } }
global $spGlobals; $curcol = 1; $category = ''; foreach ($authlist as $a) { $auth_id = $a->auth_id; $auth_name = $a->auth_name; if ($category != $a->authcat_name) { $category = $a->authcat_name; $curcol = 1; echo '<div class="spAuthCat">' . spa_text($category) . '</div>'; } echo '<div class="spColumnSection">'; if (sp_get_auth($auth_name, $forumid, $userid)) { echo sp_paint_icon('', SPTHEMEICONSURL, 'sp_PermissionYes.png') . ' ' . spa_text($spGlobals['auths'][$auth_id]->auth_desc); } else { echo sp_paint_icon('', SPTHEMEICONSURL, 'sp_PermissionNo.png') . ' ' . spa_text($spGlobals['auths'][$auth_id]->auth_desc); } echo '</div>'; $curcol++; if ($curcol > 2) { $curcol = 1; } } echo '<p><a href="javascript:void(null)" onclick="spjClearIt(\'perm' . $forumid . '\'); spjSetProfileDataHeight();">'; echo '<input type="button" id="spClosePerms" class="spSubmit" value="' . sp_text('Close') . '" />'; echo '</a></p>'; ?> <script type="text/javascript"> jQuery(document).ready(function() { baseHeight = Math.max(jQuery("#spProfileData").outerHeight(true) + 10, jQuery("#spProfileMenu").outerHeight(true)); jQuery("#spProfileContent").height(baseHeight + jQuery("#spProfileHeader").outerHeight(true));
function sp_NewPostListAdmin($newposts) { global $spVars, $spThisUser, $spGlobals, $spDevice; $alt = ''; $nourl = ''; if ($newposts) { $index = array(); foreach ($newposts as $newpost) { $forumid = $newpost['forum_id']; $index[$forumid] = count($newpost['topics']); } # Set up the autoupdate url (for quicklinks refreshing) $updateUrl = SFHOMEURL . 'index.php?sp_ahah=autoupdate&sfnonce=' . wp_create_nonce('forum-ahah'); # Display section heading echo '<div class="spAdminQueueHeader">'; echo '<a id="newpoststop"></a>'; $options = sp_get_option('spAdminBar'); if ($spThisUser->admin || $spThisUser->moderator) { $p = $spDevice == 'mobile' && current_theme_supports('sp-theme-responsive') ? SPABIMAGESMOB : SPABIMAGES; echo '<form class="sfsubhead" action="' . sp_url() . '" method="post" name="removequeue">'; echo '<input type="hidden" name="doqueue" value="1" />'; echo '<p class="spLeft">' . __('New/Unread Posts Management', 'spab') . '</p>'; echo '<a class="spButton spRight" href="javascript:document.removequeue.submit();">' . sp_paint_icon('', $p, "sp_markRead.png") . __('Empty the Admin Postbag', 'spab') . '</a>'; echo '</form>'; $removal = true; $canremove = '1'; } echo '</div>'; # Start actual listing display echo '<div class="spInlineSection spMessageSuccess" id="spAdminQueueMsg"></div>'; # Display new posts heading sp_SectionStart('tagClass=spAdminQueueSection', 'AdminQueue'); echo '<p style="text-align:center" class="spAdminBarTitle">' . __('Forums and Topics', 'spab') . '</p>'; # Start with main forum header foreach ($newposts as $newpost) { # Display forum name echo '<div id="spAdminQueueForum' . $newpost['forum_id'] . '" class="spAdminQueueForum">'; sp_ColumnStart('tagClass=spColumnSection spLeft&height=30px&width=9%'); $icon = !empty($newpost['forum_icon']) ? sp_paint_custom_icon('spRopwIcon', SFCUSTOMURL . $newpost['forum_icon']) : sp_paint_icon('spTowIcon', SPTHEMEICONSURL, 'sp_ForumIcon.png'); echo $icon; sp_ColumnEnd(); sp_ColumnStart('tagClass=spColumnSection spLeft&height=30px&width=90%'); echo '<p class="spAdminForum">'; echo '<a class="spRowName" href="' . sp_build_url($newpost['forum_slug'], '', 1, 0) . '">Forum: ' . $newpost['forum_name'] . '</a>'; echo '</p>'; echo '<input type="hidden" id="tcount' . $newpost['forum_id'] . '" value="' . $index[$newpost['forum_id']] . '" />'; sp_ColumnEnd(); echo '<div class="spClear"></div>'; echo '</div>'; # Now for each topic with new posts foreach ($newpost['topics'] as $topic) { $postcountmod = 0; $postcountord = 0; # a quick first pass to load the post count variables and check for spam $is_spam = false; foreach ($topic['posts'] as $post) { if ($post['post_status'] != 0 ? $postcountmod++ : $postcountord++) { } if ($post['post_status'] == 2) { $is_spam = true; } $lastpost_id = $post['post_id']; } # Display topics in forum $class = $postcountmod ? 'spSubmit spModButton' : 'spSubmit spUnreadButton'; echo '<div id="spAdminQueueTopic' . $topic['topic_id'] . '" class="spAdminQueueTopic">'; sp_ColumnStart('tagClass=spColumnSection spLeft&height=30px&width=10%'); echo "<input type='button' name='openicon" . $topic['topic_id'] . "' class='" . $class . "' value='"; echo esc_attr(__('View', 'spab')); if ($is_spam) { echo "\n" . esc_attr(__('Spam', 'spab')); } echo "' onclick='spjToggleLayer(\"spAdminQueueThisTopic" . $topic['topic_id'] . "\");' />"; echo '<input type="hidden" id="pcount' . $topic['topic_id'] . '" value="' . $topic['post_count'] . '" />'; echo '<input type="hidden" id="pcountmod' . $topic['topic_id'] . '" value="' . $postcountmod . '" />'; echo '<input type="hidden" id="pcountord' . $topic['topic_id'] . '" value="' . $postcountord . '" />'; sp_ColumnEnd(); sp_ColumnStart('tagClass=spColumnSection spLeft&height=30px&width=90%'); echo '<p>' . sp_get_topic_newpost_url($newpost['forum_slug'], $topic['topic_slug'], $topic['topic_name'], $lastpost_id, $post['post_index']) . '</p>'; $nourl = ''; if ($topic['post_count'] == 1) { $note = __('There is 1 new post in this topic', 'spab'); } else { $note = sprintf(__('There are %s new posts in this topic', 'spab'), $topic['post_count']); } echo '<p class="spLabelSmall">' . $note . '</p>'; sp_ColumnEnd(); echo '<div class="spClear"></div>'; echo '</div>'; # Start display of post information echo '<div id="spAdminQueuePost' . $topic['topic_id'] . '" class="spAdminQueuePost">'; echo '<div id="spAdminQueueThisTopic' . $topic['topic_id'] . '" class="spPostSection spInlineSection">'; echo '<p style="text-align:center" class="spAdminBarTitle">' . __('Post Details', 'spab') . '</p>'; $pindex = 0; $mod_required = false; # Start the post display loop foreach ($topic['posts'] as $post) { $is_spam = false; if ($pindex > 0) { echo '<hr>'; } echo '<div id="spAdminQueueThisPost' . $post['post_id'] . '" class="spAdminQueueThisPost">'; $pindex++; $lastpost = $pindex == $topic['post_count'] ? true : false; if ($post['post_status'] != 0) { $mod_required = true; echo '<div class="spAdminQueueMod spRight">' . __('Awaiting moderation', 'spab'); if ($post['post_status'] == 2) { $is_spam = true; echo '<br />' . __('Akismet marked as spam', 'spab'); } echo '</div>'; } echo '<b>' . sp_filter_name_display($post['display_name']) . '</b><br /><small>' . $post['user_type'] . '</small>'; echo '<br /><small>' . sprintf(__('Post %s in Topic', 'spab'), $post['post_index']) . '</small>'; echo '<hr />' . sp_filter_content_display($post['post_content']) . '</td>'; echo '</div>'; # Set up the ahah base url $basesite = SFHOMEURL . "index.php?sp_ahah=moderation&sfnonce=" . wp_create_nonce('forum-ahah') . "&pid=" . $post['post_id'] . "&tid=" . $topic['topic_id'] . "&fid=" . $newpost['forum_id']; echo '<div id="spAdminQueueThisPostButtons' . $post['post_id'] . '" class="spAdminQueueThisPostButtons">'; echo '<table><tr>'; if ($topic['post_count'] == 1) { $label = __('This Post', 'spab'); } else { $label = __('All Posts', 'spab'); } if ($lastpost) { $site = $basesite . '&action=0&canremove=' . $canremove; if ($mod_required) { if (sp_get_auth('moderate_posts', $newpost['forum_id'])) { $posturl = sp_build_url($newpost['forum_slug'], $topic['topic_slug'], 0, $post['post_id'], $post['post_index']); } } else { $posturl = sp_build_url($newpost['forum_slug'], $topic['topic_slug'], 0, $post['post_id'], $post['post_index']); } if ($mod_required) { $m = $spDevice == 'mobile' ? esc_attr(__("Approve & Load", 'spab')) : sp_splice(esc_attr(sprintf(__("Mark %s Approved and go to Topic", 'spab'), $label)), 2); echo '<td><input type="button" class="spSubmit" name="g0-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spabModeratePost(\'' . $posturl . '\', \'' . $site . '\', \'' . $removal . '\', \'' . $post['post_id'] . '\', \'' . $newpost['forum_id'] . '\', \'' . $topic['topic_id'] . '\', \'' . $post['post_status'] . '\', \'9\', \'' . $updateUrl . '\');" /></td>'; $m = $spDevice == 'mobile' ? esc_attr(__("Approve & Close", 'spab')) : sp_splice(esc_attr(sprintf(__("Mark %s Approved and Close", 'spab'), $label)), 2); echo '<td><input type="button" class="spSubmit" name="a0-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spabModeratePost(\'' . $nourl . '\', \'' . $site . '\', \'' . $removal . '\', \'' . $post['post_id'] . '\', \'' . $newpost['forum_id'] . '\', \'' . $topic['topic_id'] . '\', \'' . $post['post_status'] . '\', \'0\', \'' . $updateUrl . '\');" /></td>'; if ($spDevice == 'mobile') { echo '</tr></tr>'; } $m = $spDevice == 'mobile' ? esc_attr(__("Approve & Reply", 'spab')) : sp_splice(esc_attr(sprintf(__("Mark %s Approved and Quick Reply", 'spab'), $label)), 2); echo '<td><input type="button" class="spSubmit" name="q0-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spjToggleLayer(\'sfqform' . $topic['topic_id'] . '\');" /></td>'; $qaction = 0; } else { $site = $basesite . '&action=1&canremove=' . $canremove; $m = $spDevice == 'mobile' ? esc_attr(__("Mark Read & Load", 'spab')) : sp_splice(esc_attr(sprintf(__("Mark %s as Read and go to Topic", 'spab'), $label)), 2); echo '<td><input type="button" class="spSubmit" name="g1-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spabModeratePost(\'' . $posturl . '\', \'' . $site . '\', \'' . $removal . '\', \'' . $post['post_id'] . '\', \'' . $newpost['forum_id'] . '\', \'' . $topic['topic_id'] . '\', \'' . $post['post_status'] . '\', \'1\', \'' . $updateUrl . '\');" /></td>'; $m = $spDevice == 'mobile' ? esc_attr(__("Mark Read & Close", 'spab')) : sp_splice(esc_attr(sprintf(__("Mark %s as Read and Close", 'spab'), $label)), 2); echo '<td><input type="button" class="spSubmit" name="a1-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spabModeratePost(\'' . $nourl . '\', \'' . $site . '\', \'' . $removal . '\', \'' . $post['post_id'] . '\', \'' . $newpost['forum_id'] . '\', \'' . $topic['topic_id'] . '\', \'' . $post['post_status'] . '\', \'1\', \'' . $updateUrl . '\');" /></td>'; if ($spDevice == 'mobile') { echo '</tr></tr>'; } $m = $spDevice == 'mobile' ? esc_attr(__("Mark Read & Reply", 'spab')) : sp_splice(esc_attr(sprintf(__("Mark %s as Read and Quick Reply", 'spab'), $label)), 2); echo '<td><input type="button" class="spSubmit" name="a1-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spjToggleLayer(\'sfqform' . $topic['topic_id'] . '\');" /></td>'; $qaction = 1; } } if ($removal) { $remsite = $basesite . '&action=2&canremove=' . $canremove; $msg = esc_js(__('Are you sure you want to delete this Post?', 'spab')); $m = $spDevice == 'mobile' ? esc_attr(__("Delete Post", 'spab')) : sp_splice(esc_attr(__("Delete this Post", 'spab')), 0); echo '<td><input type="button" class="spSubmit" name="a2-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="javascript: if(confirm(\'' . $msg . '\')) {spabModeratePost(\'' . $nourl . '\', \'' . $remsite . '\', \'' . $removal . '\', \'' . $post['post_id'] . '\', \'' . $newpost['forum_id'] . '\', \'' . $topic['topic_id'] . '\', \'' . $post['post_status'] . '\', \'2\', \'' . $updateUrl . '\');}" /></td>'; if ($post['user_type'] == 'Member' && $is_spam) { $actionUrl = SFHOMEURL . 'index.php?sp_ahah=remove-spam&sfnonce=' . wp_create_nonce('forum-ahah') . '&postid=' . $post['post_id'] . '&userid=' . $post['user_id']; $updateUrl = SFHOMEURL . 'index.php?sp_ahah=admin-bar-update&target=newposts&sfnonce=' . wp_create_nonce('forum-ahah'); echo '</tr></tr>'; $m = $spDevice == 'mobile' ? esc_attr(__("Remove Member & All Their Posts", 'spab')) : sp_splice(esc_attr(__("Remove this Member and All their Posts", 'spab')), 2); echo '<td colspan="2"><input type="button" class="spSubmit" name="delSpam-' . $post['post_id'] . '" value="' . $m . '" style="white-space: pre;" onclick="spabRemoveSpam(\'' . $actionUrl . '\', \'' . $updateUrl . '\');" /></td>'; } } echo '</tr></table>'; # Quick Reply Form if ($lastpost) { $qsavesite = SFHOMEURL . "index.php?sp_ahah=quickreply&sfnonce=" . wp_create_nonce('forum-ahah') . "&tid=" . $topic['topic_id'] . "&fid=" . $newpost['forum_id']; echo '<div id="sfqform' . $topic['topic_id'] . '" class="spInlineSection">'; echo '<form action="' . sp_url() . '" method="post" name="addpost' . $topic['topic_id'] . '" onsubmit="return spabSaveQuickReply(this, \'' . $qsavesite . '\', \'' . $site . '\', \'' . $post['post_id'] . '\', \'' . $newpost['forum_id'] . '\', \'' . $topic['topic_id'] . '\', \'' . $post['post_status'] . '\', \'' . $qaction . '\', \'' . $updateUrl . '\')">'; echo '<textarea tabindex="1" class="spControl" name="postitem' . $topic['topic_id'] . '" id="postitem' . $topic['topic_id'] . '" cols="60" rows="8"></textarea>'; echo '<br /><input type="submit" tabindex="2" class="spSubmit" id="sfsave' . $topic['topic_id'] . '" name="newpost' . $topic['topic_id'] . '" value="' . esc_attr(__('Save New Post', 'spab')) . '" />'; do_action('sph_quickreply_form', $newpost, $topic, $post); echo '</form><br /></div>'; } echo '</div>'; } echo '</div>'; echo '</div>'; } } sp_SectionEnd('', 'AdminQueue'); } else { echo '<div class="spMessage">'; echo __('There are no unread posts', 'spab') . '</div>'; echo "<div class='spInlineSection' id='spAdminQueueMsg'></div>\n"; } }
function sp_AddIcon($args = '', $toolTip = '') { $defs = array('tagId' => '', 'tagClass' => '', 'icon' => '', 'iconClass' => 'spIcon', 'echo' => 1); $a = wp_parse_args($args, $defs); $a = apply_filters('sph_AddIcon_args', $a); extract($a, EXTR_SKIP); # must have an icon passed $icon = sanitize_file_name($icon); if (empty($icon)) { return ''; } # sanitize before use $tagId = esc_attr($tagId); $tagClass = esc_attr($tagClass); $iconClass = esc_attr($iconClass); $echo = (int) $echo; $toolTip = esc_attr($toolTip); $out = "<div id='{$tagId}' class='{$tagClass}' title='{$toolTip}'>"; $out .= sp_paint_icon($iconClass, SPTHEMEICONSURL, $icon); $out .= "</div>\n"; $out = apply_filters('sph_AddIcon', $out, $a); if ($echo) { echo $out; } else { return $out; } }
function sp_render_inline_search_form($args) { global $spVars, $spThisUser, $spGlobals, $spDevice; extract($args, EXTR_SKIP); # sanitize before use $searchInclude = !empty($spVars['searchinclude']) ? $spVars['searchinclude'] : (int) $searchIncludeDef; $searchScope = $spVars['forumid'] == 'all' || empty($spVars['forumid']) && (int) $searchScope == 2 ? 2 : 1; $submitId2 = esc_attr($submitId2); $submitClass2 = esc_attr($submitClass2); $icon = sanitize_file_name($icon); $iconClass = esc_attr($iconClass); if (!empty($submitLabel)) { $submitLabel = sp_filter_title_display($submitLabel); } if (!empty($toolTip)) { $toolTip = esc_attr($toolTip); } if (!empty($labelLegend)) { $labelLegend = sp_filter_title_display($labelLegend); } if (!empty($labelScope)) { $labelScope = sp_filter_title_display($labelScope); } if (!empty($labelCurrent)) { $labelCurrent = sp_filter_title_display($labelCurrent); } if (!empty($labelAll)) { $labelAll = sp_filter_title_display($labelAll); } if (!empty($labelMatch)) { $labelMatch = sp_filter_title_display($labelMatch); } if (!empty($labelMatchAny)) { $labelMatchAny = sp_filter_title_display($labelMatchAny); } if (!empty($labelMatchAll)) { $labelMatchAll = sp_filter_title_display($labelMatchAll); } if (!empty($labelMatchPhrase)) { $labelMatchPhrase = sp_filter_title_display($labelMatchPhrase); } if (!empty($labelOptions)) { $labelOptions = sp_filter_title_display($labelOptions); } if (!empty($labelPostTitles)) { $labelPostTitles = sp_filter_title_display($labelPostTitles); } if (!empty($labelPostsOnly)) { $labelPostsOnly = sp_filter_title_display($labelPostsOnly); } if (!empty($labelTitlesOnly)) { $labelTitlesOnly = sp_filter_title_display($labelTitlesOnly); } if (!empty($labelWildcards)) { $labelWildcards = sp_filter_title_display($labelWildcards); } if (!empty($labelMatchAnyChars)) { $labelMatchAnyChars = sp_filter_title_display($labelMatchAnyChars); } if (!empty($labelMatchOneChar)) { $labelMatchOneChar = sp_filter_title_display($labelMatchOneChar); } if (!empty($labelMinLength)) { $labelMinLength = sp_filter_title_display($labelMinLength); } if (!empty($labelMemberSearch)) { $labelMemberSearch = sp_filter_title_display($labelMemberSearch); } if (!empty($labelTopicsPosted)) { $labelTopicsPosted = sp_filter_title_display($labelTopicsPosted); } if (!empty($labelTopicsStarted)) { $labelTopicsStarted = sp_filter_title_display($labelTopicsStarted); } $br = defined('SP_USE_PRETTY_CBOX') && SP_USE_PRETTY_CBOX == true ? '' : '<br />'; # all or current forum? $out = ''; $out .= '<fieldset class="spSearchFormAdvanced">'; $out .= '<legend>' . $labelLegend . '</legend>'; $out .= '<div class="spSearchSection spSearchSectionForm">'; $out = apply_filters('sph_SearchFormTop', $out); $out .= '<div class="spRadioSection spLeft">'; $tout = ''; $tout .= '<p class="spSearchForumScope">— ' . $labelScope . ' —</p><br />'; if (!empty($spVars['forumid']) && $spVars['forumid'] != 'all') { $tout .= '<input type="hidden" name="forumslug" value="' . esc_attr($spVars['forumslug']) . '" />'; $tout .= '<input type="hidden" name="forumid" value="' . esc_attr($spVars['forumid']) . '" />'; $tout .= '<input type="radio" id="sfradio1" name="searchoption" value="1"' . ($searchScope == 1 ? ' checked="checked"' : '') . ' /><label class="spLabel spRadio" for="sfradio1">' . $labelCurrent . '</label>' . $br; } $tout .= '<input type="radio" id="sfradio2" name="searchoption" value="2"' . ($searchScope == 2 ? ' checked="checked"' : '') . ' /><label class="spLabel spRadio" for="sfradio2">' . $labelAll . '</label>' . $br; $out .= apply_filters('sph_SearchFormForumScope', $tout); $out .= '</div>'; # search type? $tout = ''; $tout .= '<div class="spRadioSection spLeft">'; $tout .= '<p class="spSearchMatch">— ' . $labelMatch . ' —</p><br />'; $tout .= '<input type="radio" id="sfradio3" name="searchtype" value="1"' . ($spVars['searchtype'] == 1 || empty($spVars['searchtype']) ? ' checked="checked"' : '') . ' /><label class="spLabel spRadio" for="sfradio3">' . $labelMatchAny . '</label>' . $br; $tout .= '<input type="radio" id="sfradio4" name="searchtype" value="2"' . ($spVars['searchtype'] == 2 ? ' checked="checked"' : '') . ' /><label class="spLabel spRadio" for="sfradio4">' . $labelMatchAll . '</label>' . $br; $tout .= '<input type="radio" id="sfradio5" name="searchtype" value="3"' . ($spVars['searchtype'] == 3 ? ' checked="checked"' : '') . ' /><label class="spLabel spRadio" for="sfradio5">' . $labelMatchPhrase . '</label>' . $br; $out .= apply_filters('sph_SearchFormMatch', $tout); $out .= '</div>'; if ($spDevice == 'mobile') { $out .= sp_InsertBreak('echo=0&spacer=12px'); } # topic title? $tout = ''; $tout .= '<div class="spRadioSection spLeft">'; $tout .= '<p class="spSearchOptions">— ' . $labelOptions . ' —</p><br />'; $tout .= '<input type="radio" id="sfradio6" name="encompass" value="1"' . ($searchInclude == 1 ? ' checked="checked"' : '') . ' /><label class="spLabel spRadio" for="sfradio6">' . $labelPostsOnly . '</label>' . $br; $tout .= '<input type="radio" id="sfradio7" name="encompass" value="2"' . ($searchInclude == 2 ? ' checked="checked"' : '') . ' /><label class="spLabel spRadio" for="sfradio7">' . $labelTitlesOnly . '</label>' . $br; $tout .= '<input type="radio" id="sfradio8" name="encompass" value="3"' . ($searchInclude == 3 ? ' checked="checked"' : '') . ' /><label class="spLabel spRadio" for="sfradio8">' . $labelPostTitles . '</label>' . $br; $out .= apply_filters('sph_SearchFormOptions', $tout); $out .= '</div>'; $out .= '<p class="spLeft spSearchDetails">' . sprintf($labelMinLength, '<b>' . $spGlobals['mysql']['search']['min'] . '</b>', '<b>' . $spGlobals['mysql']['search']['max'] . '</b>') . "</p>"; $out .= '</div>'; $tout = '<div class="spSearchFormSubmit">'; $tout .= "<a rel='nofollow' id='{$submitId2}' class='{$submitClass2}' title='{$toolTip}' onclick='spjValidateSearch(this, \"{$submitId2}\", \"link\", {$spGlobals['mysql']['search']['min']});'>"; if (!empty($icon)) { $tout .= sp_paint_icon($iconClass, SPTHEMEICONSURL, $icon); } $tout .= "{$submitLabel}</a>"; $tout .= '</div>'; $out .= apply_filters('sph_SearchFormSubmit', $tout); $out .= '</fieldset>'; $out .= sp_InsertBreak('echo=0'); $tout = ''; if ($spThisUser->member) { $tout .= '<fieldset class="spSearchMember">'; $tout .= '<legend>' . $labelMemberSearch . '</legend>'; $tout .= '<div class="spSearchSection spSearchSectionUser">'; $tout .= sp_paint_icon('', SPTHEMEICONSURL, 'sp_Search.png'); $tout .= '<input type="hidden" name="userid" value="' . $spThisUser->ID . '" />'; $tout .= '<input type="submit" class="spSubmit" name="membersearch" value="' . $labelTopicsPosted . '" />'; $tout .= '<input type="submit" class="spSubmit" name="memberstarted" value="' . $labelTopicsStarted . '" />'; $tout .= '</div>'; $tout .= '</fieldset>'; } $out .= apply_filters('sph_SearchFormMember', $tout); $out = apply_filters('sph_SearchFormBottom', $out); return $out; }
$out .= sp_paint_icon("spIcon", SPABIMAGES, "sp_ManageUsers.png"); $out .= '<a href="' . SFADMINUSER . '">'; $out .= __('Users', 'spab') . '</a>'; $out .= '</p>'; } if (sp_current_user_can('SPF Manage Plugins')) { $out .= '<p>'; $out .= sp_paint_icon("spIcon", SPABIMAGES, "sp_ManagePlugins.png"); $out .= '<a href="' . SFADMINPLUGINS . '">'; $out .= __('Plugins', 'spab') . '</a>'; $out .= '</p>'; } if (sp_current_user_can('SPF Manage Themes')) { $out .= '<p>'; $out .= sp_paint_icon("spIcon", SPABIMAGES, "sp_ManageThemes.png"); $out .= '<a href="' . SFADMINTHEMES . '">'; $out .= __('Themes', 'spab') . '</a>'; $out .= '</p>'; } if (sp_current_user_can('SPF Manage Toolbox')) { $out .= '<p>'; $out .= sp_paint_icon("spIcon", SPABIMAGES, "sp_ManageToolbox.png"); $out .= '<a href="' . SFADMINTOOLBOX . '">'; $out .= __('Toolbox', 'spab') . '</a>'; $out .= '</p>'; } $out = apply_filters('sph_ShowAdminLinks', $out); $out .= "</div>\n"; echo $out; } die;
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 if (!empty($startedToolTip)) { $startedToolTip = esc_attr($startedToolTip); } if (!empty($postedToolTip)) { $postedToolTip = esc_attr($postedToolTip); } $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_paint_icon($startedClass, SPTHEMEICONSURL, sanitize_file_name($startedIcon), $startedToolTip); $postedIcon = sp_paint_icon($postedClass, SPTHEMEICONSURL, sanitize_file_name($postedIcon), $postedToolTip); $profileIcon = sp_paint_icon($profileClass, SPTHEMEICONSURL, sanitize_file_name($profileIcon)); $echo = (int) $echo; $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) . "'>"; $out .= $startedIcon; $out .= $att . "</a>\n"; } 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) . "'>"; $out .= $postedIcon; $out .= $att . "</a>\n"; } if ($profile) { $link = $profileIcon . $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; } }