当前位置: 首页>>代码示例>>PHP>>正文


PHP sp_get_auth函数代码示例

本文整理汇总了PHP中sp_get_auth函数的典型用法代码示例。如果您正苦于以下问题:PHP sp_get_auth函数的具体用法?PHP sp_get_auth怎么用?PHP sp_get_auth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sp_get_auth函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sp_akismet

function sp_akismet($newpost)
{
    global $spThisUser;
    if (sp_get_auth('bypass_akismet', $newpost['forumid'])) {
        return $newpost;
    }
    if (function_exists('akismet_http_post') == false) {
        return $newpost;
    }
    $akismet = sp_get_option('spAkismet');
    if (empty($akismet) || $akismet == 1) {
        return $newpost;
    }
    $spam = sp_check_akismet($newpost);
    if (true == $spam) {
        if ($akismet == 2) {
            $newpost['poststatus'] = 2;
        }
        if ($akismet == 3) {
            sp_notify(1, __('This post has been identified as spam and has been rejected', 'spab'));
            wp_redirect(sp_url());
            die;
        }
    }
    return $newpost;
}
开发者ID:bself,项目名称:nuimage-wp,代码行数:26,代码来源:sp-akismet.php

示例2: sp_check_spammath

function sp_check_spammath($forumid)
{
    # Spam Check
    $spamtest = array();
    $spamtest[0] = false;
    $usemath = true;
    if (sp_get_auth('bypass_math_question', $forumid) == false) {
        $spamtest = sp_spamcheck();
    }
    return $spamtest;
}
开发者ID:bself,项目名称:nuimage-wp,代码行数:11,代码来源:sp-post-support.php

示例3: sp_kses_array

function sp_kses_array()
{
    global $allowedforumtags, $allowedforumprotocols, $spVars, $spThisUser;
    $allowedforumprotocols = apply_filters('sph_allowed_protocols', array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'clsid', 'data'));
    $allowedforumtags = array('address' => array('class' => true), 'a' => array('class' => true, 'href' => true, 'id' => true, 'title' => true, 'rel' => true, 'rev' => true, 'name' => true, 'target' => true, 'style' => true), 'abbr' => array('class' => true, 'title' => true), 'acronym' => array('title' => true, 'class' => true), 'article' => array('align' => true, 'class' => true, 'dir' => true, 'lang' => true, 'style' => true, 'xml:lang' => true), 'aside' => array('align' => true, 'class' => true, 'dir' => true, 'lang' => true, 'style' => true, 'xml:lang' => true), 'audio' => array('autoplay' => true, 'class' => true, 'controls' => true, 'id' => true, 'loop' => true, 'muted' => true, 'poster' => true, 'preload' => true, 'src' => true, 'style' => true), 'b' => array('class' => true), 'big' => array('class' => true), 'blockquote' => array('id' => true, 'cite' => true, 'class' => true, 'lang' => true, 'xml:lang' => true, 'style' => true), 'br' => array('class' => true), 'caption' => array('align' => true, 'class' => true), 'cite' => array('class' => true, 'dir' => true, 'lang' => true, 'title' => true), 'code' => array('class' => true, 'style' => true), 'dd' => array('class' => true), 'del' => array('datetime' => true), 'details' => array('align' => true, 'class' => true, 'dir' => true, 'lang' => true, 'open' => true, 'style' => true, 'xml:lang' => true), 'div' => array('align' => true, 'class' => true, 'dir' => true, 'lang' => true, 'style' => true, 'xml:lang' => true), 'dl' => array('class' => true), 'dt' => array('class' => true), 'em' => array('class' => true), 'embed' => array('height' => true, 'name' => true, 'pallette' => true, 'src' => true, 'type' => true, 'width' => true), 'figure' => array('align' => true, 'class' => true, 'dir' => true, 'lang' => true, 'style' => true, 'xml:lang' => true), 'figcaption' => array('align' => true, 'class' => true, 'dir' => true, 'lang' => true, 'style' => true, 'xml:lang' => true), 'font' => array('color' => true, 'face' => true, 'size' => true), 'footer' => array('align' => true, 'class' => true, 'dir' => true, 'lang' => true, 'style' => true, 'xml:lang' => true), 'header' => array('align' => true, 'class' => true, 'dir' => true, 'lang' => true, 'style' => true, 'xml:lang' => true), 'hgroup' => array('align' => true, 'class' => true, 'dir' => true, 'lang' => true, 'style' => true, 'xml:lang' => true), 'h1' => array('align' => true, 'class' => true, 'id' => true, 'style' => true), 'h2' => array('align' => true, 'class' => true, 'id' => true, 'style' => true), 'h3' => array('align' => true, 'class' => true, 'id' => true, 'style' => true), 'h4' => array('align' => true, 'class' => true, 'id' => true, 'style' => true), 'h5' => array('align' => true, 'class' => true, 'id' => true, 'style' => true), 'h6' => array('align' => true, 'class' => true, 'id' => true, 'style' => true), 'hr' => array('align' => true, 'class' => true, 'noshade' => true, 'size' => true, 'width' => true), 'i' => array('class' => true), 'img' => array('alt' => true, 'title' => true, 'align' => true, 'border' => true, 'class' => true, 'height' => true, 'hspace' => true, 'longdesc' => true, 'vspace' => true, 'src' => true, 'style' => true, 'width' => true), 'ins' => array('datetime' => true, 'cite' => true), 'kbd' => array('class' => true), 'label' => array('for' => true), 'legend' => array('align' => true), 'li' => array('align' => true, 'class' => true, 'id' => true, 'style' => true), 'menu' => array('class' => true, 'style' => true, 'type' => true), 'nav' => array('align' => true, 'class' => true, 'dir' => true, 'lang' => true, 'style' => true, 'xml:lang' => true), 'object' => array('classid' => true, 'codebase' => true, 'codetype' => true, 'data' => true, 'declare' => true, 'height' => true, 'name' => true, 'param' => true, 'standby' => true, 'type' => true, 'usemap' => true, 'width' => true), 'param' => array('id' => true, 'name' => true, 'type' => true, 'value' => true, 'valuetype' => true), 'p' => array('class' => true, 'align' => true, 'dir' => true, 'lang' => true, 'style' => true, 'xml:lang' => true), 'pre' => array('class' => true, 'style' => true, 'width' => true), 'q' => array('cite' => true), 's' => array('class' => true), 'section' => array('align' => true, 'class' => true, 'dir' => true, 'lang' => true, 'style' => true, 'xml:lang' => true), 'small' => array('class' => true), 'source' => array('class' => true, 'id' => true, 'media' => true, 'src' => true, 'style' => true, 'type' => true), 'span' => array('class' => true, 'dir' => true, 'align' => true, 'lang' => true, 'style' => true, 'title' => true, 'xml:lang' => true, 'id' => true), 'strike' => array('class' => true), 'strong' => array('class' => true), 'sub' => array('class' => true), 'summary' => array('align' => true, 'class' => true, 'dir' => true, 'lang' => true, 'style' => true, 'xml:lang' => true), 'sup' => array('class' => true), 'table' => array('align' => true, 'bgcolor' => true, 'border' => true, 'cellpadding' => true, 'cellspacing' => true, 'class' => true, 'dir' => true, 'id' => true, 'rules' => true, 'style' => true, 'summary' => true, 'width' => true), 'tbody' => array('align' => true, 'char' => true, 'charoff' => true, 'valign' => true), 'td' => array('abbr' => true, 'align' => true, 'axis' => true, 'bgcolor' => true, 'char' => true, 'charoff' => true, 'class' => true, 'colspan' => true, 'dir' => true, 'headers' => true, 'height' => true, 'nowrap' => true, 'rowspan' => true, 'scope' => true, 'style' => true, 'valign' => true, 'width' => true), 'tfoot' => array('align' => true, 'char' => true, 'class' => true, 'charoff' => true, 'valign' => true), 'th' => array('abbr' => true, 'align' => true, 'axis' => true, 'bgcolor' => true, 'char' => true, 'charoff' => true, 'class' => true, 'colspan' => true, 'headers' => true, 'height' => true, 'nowrap' => true, 'rowspan' => true, 'scope' => true, 'valign' => true, 'width' => true), 'thead' => array('align' => true, 'char' => true, 'charoff' => true, 'class' => true, 'valign' => true), 'title' => array('class' => true), 'tr' => array('align' => true, 'bgcolor' => true, 'char' => true, 'charoff' => true, 'class' => true, 'style' => true, 'valign' => true), 'tt' => array('class' => true), 'u' => array('class' => true), 'ul' => array('class' => true, 'style' => true, 'type' => true), 'ol' => array('class' => true, 'start' => true, 'style' => true, 'type' => true), 'var' => array('class' => true), 'video' => array('autoplay' => true, 'class' => true, 'controls' => true, 'height' => true, 'id' => true, 'loop' => true, 'muted' => true, 'poster' => true, 'preload' => true, 'src' => true, 'style' => true, 'width' => true));
    $target = isset($spVars['forumid']) ? $spVars['forumid'] : 'global';
    if (isset($spThisUser) && sp_get_auth('can_use_iframes', $target, $spThisUser->ID)) {
        $allowedforumtags['iframe'] = array('width' => true, 'height' => true, 'frameborder' => true, 'src' => true, 'frameborder' => true, 'marginwidth' => true, 'marginheight' => true);
    }
    $allowedforumtags = apply_filters('sph_kses_allowed_tags', $allowedforumtags);
}
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:11,代码来源:sp-api-kses.php

示例4: sp_update_users_newposts

function sp_update_users_newposts()
{
    global $spThisUser;
    # Check the users checktime against the last post timestamp to see if we need to do this
    $checkTime = spdb_zone_mysql_checkdate($spThisUser->checktime);
    $postTime = sp_get_option('poststamp');
    if (strtotime($checkTime) > strtotime($postTime) && !isset($_GET['mark-read'])) {
        return;
    }
    # so there must have been a new post since the last page load for this user
    $newPostList = $spThisUser->newposts;
    if (empty($newPostList['topics'])) {
        # clean it up to be on the safe side
        unset($newPostList);
        $newPostList = array();
        $newPostList['topics'] = array();
        $newPostList['forums'] = array();
    }
    # create new holding array and new checktime (now)
    $addPostList = array();
    $addPostList['topics'] = array();
    $addPostList['forums'] = array();
    sp_set_server_timezone();
    $newCheckTime = sp_apply_timezone(time(), 'mysql');
    # Use the current checktime for any new posts since users session began
    $records = spdb_select('set', "SELECT DISTINCT topic_id, forum_id FROM " . SFPOSTS . "\n\t\t\t\t\t\t\t\t   WHERE post_status = 0 AND post_date > '" . $checkTime . "' AND user_id != " . $spThisUser->ID . "\n\t\t\t\t\t\t\t\t   ORDER BY post_id DESC LIMIT " . $spThisUser->unreadposts . ";", ARRAY_A);
    if ($records) {
        foreach ($records as $r) {
            if (sp_get_auth('view_forum', $r['forum_id']) && !in_array($r['topic_id'], $newPostList['topics'])) {
                $addPostList['topics'][] = $r['topic_id'];
                $addPostList['forums'][] = $r['forum_id'];
            }
        }
    }
    $addPostList = apply_filters('sph_new_post_list', $addPostList, $newPostList);
    # now merge the arrays and truncate if necessary
    $newPostList['topics'] = array_merge($addPostList['topics'], $newPostList['topics']);
    $newPostList['forums'] = array_merge($addPostList['forums'], $newPostList['forums']);
    if (count($newPostList['topics']) > $spThisUser->unreadposts) {
        array_splice($newPostList['topics'], $spThisUser->unreadposts);
        array_splice($newPostList['forums'], $spThisUser->unreadposts);
    }
    # update sfmembers - do it here to ensure both are updated together
    spdb_query("UPDATE " . SFMEMBERS . " SET newposts='" . serialize($newPostList) . "', checktime='" . $newCheckTime . "' WHERE user_id=" . $spThisUser->ID);
    $spThisUser->newpostlist = true;
    $spThisUser->checktime = $newCheckTime;
    $spThisUser->newposts = $newPostList;
}
开发者ID:ashanrupasinghe,项目名称:govforuminstalledlocal,代码行数:48,代码来源:sp-db-newposts.php

示例5: sp_do_sp_AddNewTopicLinkTag

function sp_do_sp_AddNewTopicLinkTag($args = '')
{
    #check if forum displayed
    if (sp_abort_display_forum()) {
        return;
    }
    $defs = array('tagId' => 'spAddNewTopicLinkTag', 'tagClass' => 'spLinkTag', 'forumId' => '', 'linkText' => '%FORUMNAME%', 'beforeLink' => __('Add new topic in the ', 'sp-ttags'), 'afterLink' => __(' forum', 'sp-ttags'), 'echo' => 1);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_AddNewTopicLinkTag_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $tagId = esc_attr($tagId);
    $tagClass = esc_attr($tagClass);
    $forumId = (int) $forumId;
    $linkText = esc_attr($linkText);
    $beforeLink = sp_filter_title_display($beforeLink);
    $afterLink = sp_filter_title_display($afterLink);
    $echo = (int) $echo;
    if (!$forumId) {
        return;
    }
    if (!empty($beforeLink)) {
        $beforeLink = trim($beforeLink) . ' ';
    }
    if (!empty($afterLink)) {
        $afterLink = ' ' . trim($afterLink);
    }
    sp_forum_api_support();
    if (sp_get_auth('start_topics', $forumId)) {
        $forum = spdb_table(SFFORUMS, "forum_id={$forumId}", 'row');
        $linkText = str_replace("%FORUMNAME%", sp_filter_title_display($forum->forum_name), $linkText);
        $url = sp_build_url($forum->forum_slug, '', 0, 0);
        $url = sp_get_sfqurl($url) . 'new=topic';
        $out = "<span id='{$tagId}' class='{$tagClass}'>";
        $out .= $beforeLink . '<a href="' . $url . '">' . $linkText . '</a>' . $afterLink;
        $out .= '</span>';
        $out = apply_filters('sph_AddNewTopicLinkTag', $out);
        if ($echo) {
            echo $out;
        } else {
            return $out;
        }
    }
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:44,代码来源:sp-AddNewTopicLink-tag.php

示例6: sp_ForumIndexAddIcon

function sp_ForumIndexAddIcon($args = '', $toolTip = '')
{
    global $spThisForum, $spGlobals, $spThisUser;
    $defs = array('tagId' => 'spForumIndexAddIcon%ID%', 'tagClass' => 'spIcon', 'icon' => 'sp_ForumStatusAdd.png', 'echo' => 1, 'get' => 0);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_ForumIndexAddIcon_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $tagId = esc_attr($tagId);
    $tagClass = esc_attr($tagClass);
    $icon = sanitize_file_name($icon);
    $echo = (int) $echo;
    $tagId = str_ireplace('%ID%', $spThisForum->forum_id, $tagId);
    $out = '';
    # add new topic icon
    if (sp_get_auth('start_topics', $spThisForum->forum_id) && (!$spThisForum->forum_status && !$spGlobals['lockdown'] || $spThisUser->admin)) {
        $url = sp_build_url($spThisForum->forum_slug, '', 1, 0) . sp_add_get() . 'new=topic';
        $out .= "<a id='{$tagId}' class='{$tagClass} vtip' title='{$toolTip}' href='{$url}'>\n";
        if (!empty($icon)) {
            $out .= "<img src='" . sp_find_icon(SPTHEMEICONSURL, "{$icon}") . "' alt='' />\n";
        }
        $out .= "</a>\n";
        $out = apply_filters('sph_ForumIndexAddIcon', $out, $a);
    }
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:30,代码来源:sp-group-view-functions.php

示例7: sp_post_editor_smileys_options

function sp_post_editor_smileys_options($out, $spThisTopic, $a, $toolbar)
{
    global $spGlobals, $spVars, $spThisUser;
    extract($a, EXTR_SKIP);
    # sanitize
    $controlInput = esc_attr($controlInput);
    $labelSmileys = sp_filter_title_display($labelSmileys);
    $labelOptions = sp_filter_title_display($labelOptions);
    $labelOptionTime = sp_filter_title_display($labelOptionTime);
    $smileysBox = '';
    $optionsBox = '';
    # work out what we need to display
    $display = array();
    $display['smileys'] = false;
    $display['options'] = false;
    if (sp_get_auth('can_use_smileys', $spThisTopic->forum_id)) {
        $display['smileys'] = true;
    }
    if ((sp_get_auth('lock_topics', $spThisTopic->forum_id) || sp_get_auth('pin_posts', $spThisTopic->forum_id)) && $spVars['displaymode'] != 'edit' || $spThisUser->admin || $spThisUser->moderator) {
        $display['options'] = true;
    }
    $display = apply_filters('sph_post_editor_display_options', $display);
    # Now start the displays
    $class = $toolbar == 'toolbar' ? ' spInlineSection' : '';
    if ($display['smileys'] || $display['options']) {
        $out .= sp_InsertBreak('echo=0') . "<div>\n";
    }
    # Smileys
    if ($display['smileys']) {
        $smileysBox = apply_filters('sph_post_smileys_display', $smileysBox, $spThisTopic, $a);
        if ($display['options'] && $toolbar == 'inline') {
            $smileysBox .= "<div id='spSmileysBox' class='spEditorSection spEditorSectionLeft{$class}'>\n";
        } else {
            $smileysBox .= "<div id='spSmileysBox' class='spEditorSection{$class}'>\n";
        }
        $smileysBox .= "<div class='spEditorHeading'>{$labelSmileys}\n";
        $smileysBox = apply_filters('sph_post_smileys_header_add', $smileysBox, $spThisTopic, $a);
        $smileysBox .= '</div>';
        $smileysBox .= '<div class="spEditorSmileys">' . "\n";
        $smileysBox .= sp_render_smileys();
        $smileysBox .= '</div>';
        $smileysBox = apply_filters('sph_post_smileys_add', $smileysBox, $spThisTopic, $a);
        if ($toolbar == 'toolbar') {
            $smileysBox .= sp_InsertBreak('direction=both&spacer=6px&echo=0');
        }
        $smileysBox .= '</div>' . "\n";
    }
    # Options
    if ($display['options']) {
        $optionsBox = apply_filters('sph_post_options_display', $optionsBox, $spThisTopic, $a);
        if ($display['smileys'] && $toolbar == 'inline') {
            $optionsBox .= "<div id='spOptionsBox' class='spEditorSection spEditorSectionRight{$class}'>\n";
        } else {
            $optionsBox .= "<div id='spOptionsBox' class='spEditorSection{$class}'>\n";
        }
        $optionsBox .= "<div class='spEditorHeading'>{$labelOptions}\n";
        $optionsBox = apply_filters('sph_post_options_header_add', $optionsBox, $spThisTopic, $a);
        $optionsBox .= '</div>';
        if ($spVars['displaymode'] != 'edit') {
            $labelOptionLock = sp_filter_title_display($labelOptionLock);
            $labelOptionPin = sp_filter_title_display($labelOptionPin);
            if (sp_get_auth('lock_topics', $spThisTopic->forum_id)) {
                $optionsBox .= "<input type='checkbox' class='{$controlInput}' name='topiclock' id='sftopiclock' tabindex='110' />\n";
                $optionsBox .= "<label class='spLabel spCheckbox' for='sftopiclock'>{$labelOptionLock}</label>\n";
                $optionsBox .= "<br />\n";
            }
            if (sp_get_auth('pin_topics', $spThisTopic->forum_id)) {
                $optionsBox .= "<input type='checkbox' class='{$controlInput}' name='postpin' id='sfpostpin' tabindex='111' />\n";
                $optionsBox .= "<label class='spLabel spCheckbox' for='sfpostpin'>{$labelOptionPin}</label>\n";
                $optionsBox .= "<br />\n";
            }
        }
        if ($spThisUser->admin) {
            $optionsBox .= "<input type='checkbox' class='{$controlInput}' tabindex='112' id='sfeditTimestamp' name='editTimestamp' onchange='spjToggleLayer(\"spHiddenTimestamp\");'/>\n";
            $optionsBox .= "<label class='spLabel spCheckbox' for='sfeditTimestamp'>{$labelOptionTime}</label>\n";
            $optionsBox .= "<br />\n";
        }
        if ($spThisUser->admin) {
            global $wp_locale, $month, $spThisPost;
            $time_adj = time() + get_option('gmt_offset') * 3600;
            $dd = gmdate('d', $time_adj);
            $mm = gmdate('m', $time_adj);
            $yy = gmdate('Y', $time_adj);
            $hh = gmdate('H', $time_adj);
            $mn = gmdate('i', $time_adj);
            $ss = gmdate('s', $time_adj);
            $optionsBox .= '<div id="spHiddenTimestamp">' . "\n";
            $optionsBox .= "<select class='{$controlInput}' tabindex='114' name='tsMonth' onchange='editTimestamp.checked=true'>\n";
            for ($i = 1; $i < 13; $i = $i + 1) {
                $optionsBox .= "\t\t\t<option value=\"{$i}\"";
                if ($i == $mm) {
                    $optionsBox .= " selected='selected'";
                }
                if (class_exists('WP_Locale')) {
                    $optionsBox .= '>' . $wp_locale->get_month($i) . '</option>';
                } else {
                    $optionsBox .= '>' . $month[$i] . '</option>';
                }
            }
            $optionsBox .= '</select> ';
//.........这里部分代码省略.........
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:101,代码来源:sp-form-components.php

示例8: sp_profile_get_tabs

 # get all the tabs meta info
 $tabs = sp_profile_get_tabs();
 if (!empty($tabs)) {
     foreach ($tabs as $tab) {
         # find the pressed tab in the list of tabs
         if ($tab['slug'] == $thisTab) {
             # now output the menu and content
             $first = true;
             $thisForm = '';
             $thisName = '';
             $thisSlug = '';
             $out = '';
             if (!empty($tab['menus'])) {
                 foreach ($tab['menus'] as $menu) {
                     # do we need an auth check?
                     $authCheck = empty($menu['auth']) ? true : sp_get_auth($menu['auth'], '', $userid);
                     # is this menu being displayed and does user have auth to see it?
                     if ($authCheck && $menu['display']) {
                         $current = '';
                         # if tab press, see if its the first
                         if ($first && empty($thisMenu)) {
                             $current = 'current';
                             $thisName = $menu['name'];
                             $thisForm = $menu['form'];
                             $thisSlug = $menu['slug'];
                             $first = false;
                         } else {
                             if (!empty($thisMenu)) {
                                 # if this menu was pressed, make it the current form
                                 if ($menu['slug'] == $thisMenu) {
                                     $current = 'current';
开发者ID:bself,项目名称:nuimage-wp,代码行数:31,代码来源:sp-ahah-profile.php

示例9: sp_forumview_stats_query

    function sp_forumview_stats_query($topics, $forumid)
    {
        if (empty($topics)) {
            return;
        }
        global $spThisUser;
        $t = implode(',', $topics);
        $spdb = new spdbComplex();
        $spdb->table = SFPOSTS;
        $spdb->fields = SFPOSTS . '.post_id, ' . SFPOSTS . '.topic_id, ' . spdb_zone_datetime('post_date') . ',
								guest_name, ' . SFPOSTS . '.user_id, post_content, post_status, ' . SFMEMBERS . '.display_name, post_index';
        $spdb->join = array(SFTOPICS . ' ON ' . SFTOPICS . '.topic_id = ' . SFPOSTS . '.topic_id');
        $spdb->left_join = array(SFMEMBERS . ' ON ' . SFPOSTS . '.user_id = ' . SFMEMBERS . '.user_id');
        # only show posts awaiting moderation to admins/mods
        if (sp_get_auth('moderate_posts', $forumid)) {
            $spdb->where = SFPOSTS . '.topic_id IN (' . $t . ') AND (post_index = 1 OR ' . SFPOSTS . '.post_id = ' . SFTOPICS . '.post_id)';
        } else {
            $spdb->where = SFPOSTS . '.topic_id IN (' . $t . ') AND (post_index = 1 OR ' . SFPOSTS . '.post_id = ' . SFTOPICS . '.post_id_held)';
        }
        $spdb->orderby = SFPOSTS . '.topic_id, ' . SFPOSTS . '.post_id';
        $spdb = apply_filters('sph_forumview_stats_query', $spdb, $this);
        if (!empty($spThisUser->inspect['q_spForumViewStats'])) {
            $spdb->inspect = 'spForumViewStats';
            $spdb->show = true;
        }
        $records = $spdb->select();
        return $records;
    }
开发者ID:bself,项目名称:nuimage-wp,代码行数:28,代码来源:sp-forum-view-class.php

示例10: sp_ProfileShowEmail

function sp_ProfileShowEmail($args = '', $label = '')
{
    global $spProfileUser, $spThisUser;
    if (!sp_get_auth('view_profiles')) {
        return;
    }
    $defs = array('tagClass' => 'spProfileShowLink', 'leftClass' => 'spColumnSection spProfileLeftCol', 'middleClass' => 'spColumnSection spProfileSpacerCol', 'rightClass' => 'spColumnSection spProfileRightCol', 'adminOnly' => 1, 'echo' => 1, 'get' => 0);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_ProfileShowLink_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $tagClass = esc_attr($tagClass);
    $leftClass = esc_attr($leftClass);
    $middleClass = esc_attr($middleClass);
    $rightClass = esc_attr($rightClass);
    $adminOnly = (int) $adminOnly;
    # this should really be bypass permission or let anyone view
    $label = sp_filter_title_display($label);
    $echo = (int) $echo;
    $get = (int) $get;
    if ($get) {
        return $spProfileUser->user_email;
    }
    if (sp_get_auth('view_email') || !$adminOnly) {
        $out = '';
        $out .= "<div class='{$leftClass}'>";
        $out .= "<p class='{$tagClass}'>{$label}:</p>";
        $out .= '</div>';
        $out .= "<div class='{$middleClass}'></div>";
        $out .= "<div class='{$rightClass}'>";
        $out .= "<p class='{$tagClass}'>{$spProfileUser->user_email}</p>";
        $out .= "</div>\n";
        $out = apply_filters('sph_ProfileShowEmail', $out, $spProfileUser, $a);
        if ($echo) {
            echo $out;
        } else {
            return $out;
        }
    }
}
开发者ID:ashanrupasinghe,项目名称:govforuminstalledlocal,代码行数:40,代码来源:sp-profile-view-functions.php

示例11: sp_filter_rss_display

function sp_filter_rss_display($content)
{
    global $spVars;
    #save unedited content
    $original = $content;
    # 1: Backwards compatible make links clickable
    $content = sp_filter_display_links($content);
    # 3: Convert Chars
    $content = sp_filter_display_chars($content);
    # 4: Format the paragraphs
    $content = sp_filter_display_paragraphs($content);
    # 5: strip shortcodes
    if (sp_get_option('sffiltershortcodes')) {
        $content = sp_filter_display_shortcodes($content);
    }
    # 6: hide links
    if (!sp_get_auth('view_links', $spVars['forumid'])) {
        $content = sp_filter_display_hidelinks($content);
    }
    # 7: apply any users custom filters
    $content = apply_filters('sph_display_rss_content_filter', $content, $original);
    return $content;
}
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:23,代码来源:sp-api-filters.php

示例12: sp_render_common_tools

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 .= '<img class="spIcon" src="' . sp_find_icon(SPTHEMEICONSURL, 'sp_ToolsLock.png') . '" alt="" title="" />';
        $ajaxUrl = SFHOMEURL . 'index.php?sp_ahah=admintools&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;action=lock-topic&amp;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 .= '<img class="spIcon" src="' . sp_find_icon(SPTHEMEICONSURL, 'sp_ToolsPin.png') . '" alt="" title="" />';
        $ajaxUrl = SFHOMEURL . 'index.php?sp_ahah=admintools&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;action=pin-topic&amp;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 .= '<img class="spIcon" src="' . sp_find_icon(SPTHEMEICONSURL, 'sp_ToolsPin.png') . '" alt="" title="" />';
        $site = SFHOMEURL . 'index.php?sp_ahah=admintools&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;action=order-pins&amp;topicid=' . $topic['topic_id'] . '&amp;forumid=' . $forum['forum_id'] . '&amp;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 .= '<img class="spIcon" src="' . sp_find_icon(SPTHEMEICONSURL, 'sp_ToolsEdit.png') . '" alt="" title="" />';
        $site = SFHOMEURL . 'index.php?sp_ahah=admintools&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;action=edit-title&amp;topicid=' . $topic['topic_id'] . '&amp;forumid=' . $forum['forum_id'] . '&amp;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 .= '<img class="spIcon" src="' . sp_find_icon(SPTHEMEICONSURL, 'sp_ToolsDelete.png') . '" alt="" title="" />';
        $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&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;action=delete-topic&amp;killtopic=' . $topic['topic_id'] . '&amp;killtopicforum=' . $forum['forum_id'] . '&amp;page=' . $page . "&amp;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 .= '<img class="spIcon" src="' . sp_find_icon(SPTHEMEICONSURL, 'sp_ToolsMove.png') . '" alt="" title="" />';
        $site = SFHOMEURL . 'index.php?sp_ahah=admintools&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;action=move-topic&amp;topicid=' . $topic['topic_id'] . '&amp;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;
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:58,代码来源:sp-ahah-admintoollinks.php

示例13: validateData

 function validateData()
 {
     $this->abort = false;
     $this->newpost['action'] = $this->action;
     # Check flood control (done here vice validatePermission() so we can use the return to post feature)
     if (!sp_get_auth('bypass_flood_control', $this->newpost['forumid'], $this->userid)) {
         $flood = sp_get_cache('floodcontrol');
         if (!empty($flood) && time() < $flood) {
             $this->abort = true;
             $this->message = sp_text('Flood control exceeded, please slow down - Post cannot be saved yet');
             return;
         }
     }
     # Check topic name
     if (empty($this->newpost['topicname'])) {
         $this->abort = true;
         $this->message = sp_text('No topic name has been entered and post cannot be saved');
         return;
     } else {
         $this->newpost['topicname'] = sp_filter_title_save($this->newpost['topicname'], SFTOPICS, 'topic_name');
     }
     # Check Post Content
     if (empty($this->newpost['postcontent'])) {
         $this->abort = true;
         $this->message = sp_text('No topic post has been entered and post cannot be saved');
         return;
     } else {
         $this->newpost['postcontent_unescaped'] = sp_filter_content_save($this->newpost['postcontent'], 'new', false, SFPOSTS, 'post_content');
         $this->newpost['postcontent'] = sp_filter_content_save($this->newpost['postcontent'], 'new', true, SFPOSTS, 'post_content');
     }
     # Check and set user names/ids etc
     if ($this->guest) {
         $sfguests = sp_get_option('sfguests');
         if (empty($this->newpost['guestname']) || (empty($this->newpost['guestemail']) || !is_email($this->newpost['guestemail'])) && $sfguests['reqemail']) {
             $this->abort = true;
             $this->message = sp_text('Guest name and valid email address required');
             return;
         }
         # force maximum lengths
         $this->newpost['guestname'] = substr(sp_filter_name_save($this->newpost['guestname']), 0, 20);
         $this->newpost['guestemail'] = substr(sp_filter_email_save($this->newpost['guestemail']), 0, 50);
         $this->newpost['postername'] = $this->newpost['guestname'];
         $this->newpost['posteremail'] = $this->newpost['guestemail'];
         # check for blacklisted guest name
         $blockedGuest = sp_get_option('guest-name');
         if (!empty($blockedGuest)) {
             $names = explode(',', $blockedGuest);
             foreach ($names as $name) {
                 if (strtolower(trim($name)) == strtolower($this->newpost['guestname'])) {
                     $this->abort = true;
                     $this->message = sp_text('The guest name you have chosen is not allowed on this site');
                     return;
                 }
             }
         }
         # check that the guest name is not the same as a current user
         $checkdupe = spdb_table(SFMEMBERS, "display_name='" . $this->newpost['guestname'] . "'", 'display_name');
         if (!empty($checkdupe)) {
             $this->abort = true;
             $this->message = sp_text('This user name already belongs to a forum member');
             return;
         }
     }
     # Check if links allowed or if maxmium links have been exceeded
     $sffilters = sp_get_option('sffilters');
     if (!$this->admin) {
         $links = $this->count_links();
         if (sp_get_auth('create_links', $this->newpost['forumid'], $this->userid)) {
             if ($sffilters['sfmaxlinks'] > 0 && $links > $sffilters['sfmaxlinks']) {
                 $this->abort = true;
                 $this->message = sp_text('Maximum number of allowed links exceeded') . ': ' . $sffilters['sfmaxlinks'] . ' ' . sp_text('allowed');
                 return;
             }
         } else {
             if ($links > 0) {
                 $this->abort = true;
                 $this->message = sp_text('You are not allowed to put links in post content');
                 return;
             }
         }
     }
     # Check if maxmium smileys have been exceeded
     if (!$this->admin) {
         if (isset($sffilters['sfmaxsmileys']) && $sffilters['sfmaxsmileys'] > 0 && $this->count_smileys() > $sffilters['sfmaxsmileys']) {
             $this->abort = true;
             $this->message = sp_text('Maximum number of allowed smileys exceeded') . ': ' . $sffilters['sfmaxsmileys'] . ' ' . sp_text('allowed');
             return;
         }
     }
     # Check for duplicate post of option is set
     if ($this->member && $sffilters['sfdupemember'] == true || $this->guest && $sffilters['sfdupeguest'] == true) {
         # But not admin or moderator
         if (!$this->admin && !$this->moderator) {
             $dupecheck = spdb_table(SFPOSTS, 'forum_id = ' . $this->newpost['forumid'] . ' AND topic_id=' . $this->newpost['topicid'] . " AND post_content='" . $this->newpost['postcontent'] . "' AND poster_ip='" . $this->newpost['posterip'] . "'", 'row', '', '', ARRAY_A);
             if ($dupecheck) {
                 $this->abort = true;
                 $this->message = sp_text('Duplicate post refused');
                 return;
             }
         }
//.........这里部分代码省略.........
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:101,代码来源:sp-api-class-post.php

示例14: sp_captcha_do_check_post

function sp_captcha_do_check_post($newpost)
{
    if (!sp_get_auth('bypass_captcha', $newpost['forumid'])) {
        if (!session_id()) {
            session_start();
        }
        if (isset($_POST['captcha']) && $_POST['captcha'] == $_SESSION['captcha']) {
            unset($_SESSION['captcha']);
        } else {
            $newpost['error'] = __('Post cannot be saved - captcha not properly completed', 'sp-cap');
        }
    }
    return $newpost;
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:14,代码来源:sp-captcha-components.php

示例15: sp_build_name_display

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;
}
开发者ID:ashanrupasinghe,项目名称:govforuminstalledlocal,代码行数:21,代码来源:sp-api-common-display.php


注:本文中的sp_get_auth函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。