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


PHP sp_filter_name_display函数代码示例

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


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

示例1: sp_load_current_user

function sp_load_current_user()
{
    global $current_user, $spThisUser, $spGuestCookie;
    if (empty($current_user)) {
        $current_user = wp_get_current_user();
    }
    $spThisUser = sp_get_user($current_user->ID, true);
    # check for a cookie if a guest
    $spGuestCookie = new stdClass();
    $spGuestCookie->guest_name = '';
    $spGuestCookie->guest_email = '';
    $spGuestCookie->display_name = '';
    if ($spThisUser->guest && empty($spThisUser->offmember)) {
        # so no record of them being a current member
        $sfguests = sp_get_option('sfguests');
        if ($sfguests['storecookie']) {
            if (isset($_COOKIE['guestname_' . COOKIEHASH])) {
                $spGuestCookie->guest_name = sp_filter_name_display($_COOKIE['guestname_' . COOKIEHASH]);
            }
            if (isset($_COOKIE['guestemail_' . COOKIEHASH])) {
                $spGuestCookie->guest_email = sp_filter_email_display($_COOKIE['guestemail_' . COOKIEHASH]);
            }
            $spGuestCookie->display_name = $spGuestCookie->guest_name;
        }
    }
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:26,代码来源:sp-api-users.php

示例2: spa_display_member_roll

function spa_display_member_roll($members, $text1, $text2)
{
    $out = '';
    $cap = '';
    $first = true;
    $out .= '<fieldset class="sfsubfieldset">';
    $out .= '<legend>' . $text1 . '</legend>';
    if ($members) {
        $out .= '<p><b>' . count($members) . ' ' . spa_text('member(s) in this user group') . '</b></p>';
        for ($x = 0; $x < count($members); $x++) {
            if (strncasecmp($members[$x]->display_name, $cap, 1) != 0) {
                if (!$first) {
                    $out .= '</ul>';
                }
                $cap = substr($members[$x]->display_name, 0, 2);
                if (function_exists('mb_strwidth')) {
                    if (mb_strwidth($cap) == 2) {
                        $cap = substr($cap, 0, 1);
                    }
                } else {
                    $cap = substr($cap, 0, 1);
                }
                $out .= '<p style="clear:both;"></p><hr /><h4>' . strtoupper($cap) . '</h4>';
                $out .= '<ul class="memberlist">';
                $first = false;
            }
            $out .= '<li>' . sp_filter_name_display($members[$x]->display_name) . '</li>';
        }
        $out .= '</ul>';
    } else {
        $out .= $text2;
    }
    $out .= '</fieldset>';
    return $out;
}
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:35,代码来源:spa-ahah-usergroups.php

示例3: spa_toolbox_log_form

function spa_toolbox_log_form()
{
    $sflog = spa_get_log_data();
    #== log Tab ==========================================================
    spa_paint_open_tab(spa_text('Toolbox') . " - " . spa_text('Install Log'), true);
    if (!$sflog) {
        spa_etext("There are no Install Log Entries");
        return;
    }
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Install Log'), false);
    echo "<table class='wp-list-table widefat'><tr>";
    echo '<th>' . spa_text('Version') . '</th>';
    echo "<th class='logDetail'>" . "</th>";
    echo '<th>' . spa_text('Build') . '</th>';
    echo "<th class='logRelease'>" . spa_text('Release') . "</th>";
    echo '<th>' . spa_text('Installed') . '</th>';
    echo "<th class='logBy'>" . spa_text('By') . "</th>";
    echo '</tr>';
    foreach ($sflog as $log) {
        $idVer = 'version' . str_replace('.', '', $log['version']);
        $idQVer = str_replace('.', '-', $log['version']);
        echo '<tr>';
        echo "<td class='sflabel'>" . $log['version'] . "</td>";
        $site = SFHOMEURL . 'index.php?sp_ahah=install-log&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;log=' . $idQVer;
        $gif = SFCOMMONIMAGES . 'working.gif';
        echo '<td class="logDetail"><input type="button" class="logDetail button" value="' . spa_text('Details') . '" onclick="spjLoadAhah(\'' . $site . '\', \'' . $idVer . '\', \'' . $gif . '\');" /></td>';
        echo "<td class='sflabel'>" . $log['build'] . "</td>";
        echo "<td class='sflabel logRelease'>" . $log['release_type'] . "</td>";
        echo "<td class='sflabel'>" . sp_date('d', $log['install_date']) . "</td>";
        echo "<td class='sflabel logBy'>" . sp_filter_name_display($log['display_name']) . "</td>";
        echo '</tr>';
        echo "<tr><td style='display:none;' class='sflabel' id='" . $idVer . "' colspan='6'></td></tr>";
    }
    echo '</table>';
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_toolbox_install_panel');
    spa_paint_close_container();
    echo '<div class="sfform-panel-spacer"></div>';
    spa_paint_close_tab();
}
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:42,代码来源:spa-toolbox-log-form.php

示例4: spdb_query

    spdb_query($sql);
}
if ($action == 'show') {
    $key = sp_esc_int($_GET['key']);
    $specialRank = sp_get_sfmeta('special_rank', false, $key);
    $users = spdb_select('col', 'SELECT display_name
						  FROM ' . SFSPECIALRANKS . '
						  JOIN ' . SFMEMBERS . ' ON ' . SFSPECIALRANKS . '.user_id = ' . SFMEMBERS . '.user_id
						  WHERE special_rank = "' . $specialRank[0]['meta_key'] . '"
						  ORDER BY display_name');
    echo '<fieldset class="sfsubfieldset">';
    echo '<legend>' . spa_text('Special Rank Members') . '</legend>';
    if ($users) {
        echo '<ul class="memberlist">';
        for ($x = 0; $x < count($users); $x++) {
            echo '<li>' . sp_filter_name_display($users[$x]) . '</li>';
        }
        echo '</ul>';
    } else {
        spa_etext('No users with this special rank');
    }
    echo '</fieldset>';
}
if ($action == 'delsmiley') {
    $file = sp_esc_str($_GET['file']);
    $path = SF_STORE_DIR . '/' . $spPaths['smileys'] . '/' . $file;
    @unlink($path);
    # load smiles from sfmeta
    $meta = sp_get_sfmeta('smileys', 'smileys');
    # now cycle through to remove this entry and resave
    if (!empty($meta[0]['meta_value'])) {
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:31,代码来源:spa-ahah-components.php

示例5: sp_listview_populate_newposts

    function sp_listview_populate_newposts($topicIds)
    {
        global $spThisUser;
        $newList = array();
        # First filter topics by those in the users new post list
        $newTopicIds = array();
        foreach ($topicIds as $topic) {
            if (sp_is_in_users_newposts($topic)) {
                $newTopicIds[] = $topic;
            }
        }
        if ($newTopicIds) {
            # construct the query - need to add in sfwaiting for admins
            $where = SFPOSTS . '.topic_id IN (' . implode(',', $newTopicIds) . ') AND (post_date > "' . spdb_zone_mysql_checkdate($spThisUser->lastvisit) . '")';
            if ($spThisUser->admin || $spThisUser->moderator) {
                $wPosts = spdb_select('col', 'SELECT post_id FROM ' . SFWAITING);
                if ($wPosts) {
                    $where .= ' OR (' . SFPOSTS . '.post_id IN (' . implode(",", $wPosts) . '))';
                }
            }
            $spdb = new spdbComplex();
            $spdb->table = SFPOSTS;
            $spdb->fields = SFPOSTS . '.topic_id, ' . SFPOSTS . '.post_id, post_index, ' . spdb_zone_datetime('post_date') . ',
									guest_name, ' . SFPOSTS . '.user_id, display_name, post_count-post_index+1 AS new_post_count';
            $spdb->left_join = array(SFMEMBERS . ' ON ' . SFMEMBERS . '.user_id = ' . SFPOSTS . '.user_id');
            $spdb->join = array(SFTOPICS . ' ON ' . SFPOSTS . '.topic_id = ' . SFTOPICS . '.topic_id');
            $spdb->where = $where;
            $spdb->orderby = 'topic_id, post_id';
            $spdb = apply_filters('sph_listview_newposts_query', $spdb, $this);
            $postrecords = $spdb->select();
            if ($postrecords) {
                $cTopic = 0;
                foreach ($postrecords as $p) {
                    if ($p->topic_id != $cTopic) {
                        $cTopic = $p->topic_id;
                        $newList[$cTopic] = new stdClass();
                        $newList[$cTopic]->topic_id = $cTopic;
                        $newList[$cTopic]->new_post_count = $p->new_post_count;
                        $newList[$cTopic]->new_post_post_id = $p->post_id;
                        $newList[$cTopic]->new_post_post_index = $p->post_index;
                        $newList[$cTopic]->new_post_post_date = $p->post_date;
                        $newList[$cTopic]->new_post_user_id = $p->user_id;
                        $newList[$cTopic]->new_post_display_name = sp_filter_name_display($p->display_name);
                        $newList[$cTopic]->new_post_guest_name = sp_filter_name_display($p->guest_name);
                    }
                }
            }
        }
        return $newList;
    }
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:50,代码来源:sp-list-topic-class.php

示例6: sp_search_user

function sp_search_user()
{
    global $wpdb;
    $out = '[]';
    $query = $_GET['term'];
    $where = "display_name LIKE '%" . esc_sql($wpdb->esc_like($query)) . "%'";
    $users = spdb_table(SFMEMBERS, $where, '', 'display_name DESC', 25);
    if ($users) {
        $primary = '';
        $secondary = '';
        foreach ($users as $user) {
            $uname = sp_filter_name_display($user->display_name);
            $cUser = array('id' => $user->user_id, 'value' => $uname);
            if (strcasecmp($query, substr($uname, 0, strlen($query))) == 0) {
                $primary .= json_encode($cUser) . ',';
            } else {
                $secondary .= json_encode($cUser) . ',';
            }
        }
        if ($primary != '' || $secondary != '') {
            if ($primary != '') {
                $primary = trim($primary, ',') . ',';
            }
            if ($secondary != '') {
                $secondary = trim($secondary, ',');
            }
            $out = '[' . trim($primary . $secondary, ',') . ']';
        }
    }
    echo $out;
    die;
}
开发者ID:bself,项目名称:nuimage-wp,代码行数:32,代码来源:sp-ahah-admintools.php

示例7: spa_users_members_form


//.........这里部分代码省略.........
        # output users
        foreach ($users as $userid) {
            $data = spa_get_members_info($userid);
            if ($data) {
                ?>
									<tr id="user-delete-<?php 
                echo $userid;
                ?>
" <?php 
                echo $class;
                ?>
>
										<td data-label='<?php 
                spa_etext('ID');
                ?>
'><?php 
                echo $userid;
                ?>
</td>
										<td data-label='<?php 
                spa_etext('Login Name');
                ?>
'><?php 
                echo $data['login'];
                ?>
</td>
										<?php 
                $displayname = !empty($data['display_name']) ? $data['display_name'] : '';
                ?>
										<td data-label='<?php 
                spa_etext('Display Name');
                ?>
'><strong><?php 
                echo sp_filter_name_display($displayname);
                ?>
</strong></td>
										<td data-label='<?php 
                spa_etext('First Post');
                ?>
'><?php 
                echo $data['first'];
                ?>
</td>
										<td data-label='<?php 
                spa_etext('Last Post');
                ?>
'><?php 
                echo $data['last'];
                ?>
</td>
										<td data-label='<?php 
                spa_etext('Posts');
                ?>
'>
<?php 
                if ($data['posts'] == -1) {
                    echo '<img style="vertical-align:top" src="' . SFADMINIMAGES . 'sp_UserNoPosts.png" title="' . spa_text('User has not yet visited forum') . '" alt="" />';
                } else {
                    echo $data['posts'];
                }
                ?>
										</td>
										<td data-label='<?php 
                spa_etext('Last Visit');
                ?>
'><?php 
开发者ID:ashanrupasinghe,项目名称:govforuminstalledlocal,代码行数:67,代码来源:spa-users-members-form.php

示例8: sp_postlistview_query

    function sp_postlistview_query($where, $order, $count, $view, $type)
    {
        global $spGlobals, $spThisUser;
        # If no WHERE clause then return empty
        if (empty($where)) {
            return;
        }
        # build list of forums user can view
        $fids = sp_user_visible_forums($view);
        if (!empty($fids)) {
            $fids = implode(',', $fids);
            $where .= ' AND ' . SFPOSTS . ".forum_id IN ({$fids})";
        }
        # Check order
        if (empty($order)) {
            $order = SFPOSTS . '.post_id DESC';
        }
        $spdb = new spdbComplex();
        $spdb->table = SFPOSTS;
        $spdb->fields = SFPOSTS . '.post_id, post_content, ' . spdb_zone_datetime('post_date') . ', ' . SFPOSTS . '.topic_id, ' . SFPOSTS . '.forum_id,
								  ' . SFPOSTS . '.user_id, guest_name, post_status, post_index, forum_name, forum_slug, forum_disabled, ' . SFFORUMS . '.group_id, group_name,
								  topic_name, topic_slug, ' . SFTOPICS . '.post_count, topic_opened, display_name';
        $spdb->join = array(SFFORUMS . ' ON ' . SFFORUMS . '.forum_id = ' . SFPOSTS . '.forum_id', SFGROUPS . ' ON ' . SFGROUPS . '.group_id = ' . SFFORUMS . '.group_id', SFTOPICS . ' ON ' . SFTOPICS . '.topic_id = ' . SFPOSTS . '.topic_id');
        $spdb->left_join = array(SFMEMBERS . ' ON ' . SFMEMBERS . '.user_id = ' . SFPOSTS . '.user_id');
        $spdb->where = $where;
        $spdb->orderby = $order;
        if ($count) {
            $spdb->limits = $count;
        }
        $spdb = apply_filters('sph_post_list_query', $spdb, $this, $type);
        if (!empty($spThisUser->inspect['q_spPostListView'])) {
            $spdb->inspect = 'spPostListView';
            $spdb->show = true;
        }
        $records = $spdb->select();
        # Now check authorisations and clean up the object
        $list = array();
        # Some values we need
        # How many topics to a page?
        $ppaged = $spGlobals['display']['posts']['perpage'];
        if (empty($ppaged) || $ppaged == 0) {
            $ppaged = 20;
        }
        # establish topic sort order
        $porder = 'ASC';
        # default
        if ($spGlobals['display']['posts']['sortdesc']) {
            $porder = 'DESC';
        }
        # global override
        if ($records) {
            $listPos = 1;
            foreach ($records as $r) {
                if (sp_can_view($r->forum_id, 'forum-title')) {
                    if ($r->post_status == 0 || sp_get_auth('moderate_posts', $r->forum_id)) {
                        $p = $r->post_id;
                        $list[$p] = $r;
                        # Now apply any necessary filters and data changes
                        $list[$p]->post_content = sp_filter_content_display($r->post_content);
                        $list[$p]->post_content_raw = $r->post_content;
                        $list[$p]->forum_name = sp_filter_title_display($r->forum_name);
                        $list[$p]->forum_disabled = $r->forum_disabled;
                        $list[$p]->forum_permalink = sp_build_url($r->forum_slug, '', 1, 0);
                        $list[$p]->topic_permalink = sp_build_url($r->forum_slug, $r->topic_slug, 1, 0);
                        $list[$p]->topic_name = sp_filter_title_display($r->topic_name);
                        $list[$p]->topic_opened = $r->topic_opened;
                        $list[$p]->group_name = sp_filter_title_display($r->group_name);
                        if (sp_can_view($r->forum_id, 'post-content', $spThisUser->ID, $r->user_id, $r->topic_id, $r->post_id)) {
                            $list[$p]->post_tip = $r->post_status ? sp_text('Post awaiting moderation') : sp_filter_tooltip_display($r->post_content, $r->post_status);
                        } else {
                            $list[$p]->post_tip = '';
                        }
                        # Ensure display name is populated
                        if (empty($r->display_name)) {
                            $list[$p]->display_name = $list[$p]->guest_name;
                        }
                        $list[$p]->display_name = sp_filter_name_display($list[$p]->display_name);
                        # determine the page for the post permalink
                        if ($porder == 'ASC') {
                            $page = $r->post_index / $ppaged;
                            if (!is_int($page)) {
                                $page = intval($page + 1);
                            }
                        } else {
                            $page = $r->post_count - $r->post_index;
                            $page = $page / $ppaged;
                            $page = intval($page + 1);
                        }
                        $list[$p]->post_permalink = sp_build_url($r->forum_slug, $r->topic_slug, $page, $r->post_id, $r->post_index);
                        $list[$p]->list_position = $listPos;
                        $list[$p] = apply_filters('sph_post_list_record', $list[$p], $r, $type);
                    }
                }
                $listPos++;
            }
        }
        return $list;
    }
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:98,代码来源:sp-list-post-class.php

示例9: sp_do_sp_SideDashTag

function sp_do_sp_SideDashTag($args = '')
{
    #check if forum displayed
    if (sp_abort_display_forum()) {
        return;
    }
    global $spThisUser, $spGlobals;
    $defs = array('tagId' => 'spSideDashTag', 'tagClass' => 'spSideDashTag', 'showAvatar' => 1, 'avatarSize' => 25, 'avatarClass' => 'spAvatar', 'showAdminLink' => 1, 'showLogin' => 1, 'loginLink' => esc_url(wp_login_url()), 'showLogout' => 1, 'echo' => 1);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_SideDashTag_args', $a);
    extract($a, EXTR_SKIP);
    $tagId = esc_attr($tagId);
    $tagClass = esc_attr($tagClass);
    $showAvatar = (int) $showAvatar;
    $avatarSize = (int) $avatarSize;
    $avatarClass = esc_attr($avatarClass);
    $showAdminLink = (int) $showAdminLink;
    $showLogin = (int) $showLogin;
    $loginLink = sp_filter_title_display($loginLink);
    $showLogout = (int) $showLogout;
    $echo = (int) $echo;
    sp_forum_api_support();
    $out = '';
    $sflogin = sp_get_option('sflogin');
    if ($spThisUser->guest) {
        if (!empty($showLogin)) {
            # show any login links?
            if ($showLogin == 1) {
                # showing login form
                # display login form
                $out .= '<form action="' . esc_url(wp_login_url()) . '" method="post">';
                $out .= '<p class="spSideDashUser"><label for="spTagLog">' . __('Username: ', 'sp-ttags') . '<input type="text" name="log" id="spTagLog" value="" size="15" /></label></p>';
                $out .= '<p class="spSideDashPw"><label for="spTagPwd">' . __('Password: ', 'sp-ttags') . '<input type="password" name="pwd" id="spTagPwd" value="" size="15"  /></label></p>';
                $out .= '<p class="spSideDashRemember"><input type="checkbox" id="rememberme" name="rememberme" value="forever" /><label for="rememberme">' . __('Remember me', 'sp-ttags') . '</label></p>';
                $out .= '<input type="hidden" name="redirect_to" value="' . esc_attr($sflogin['sfloginurl']) . '" />';
                $out .= '<p><input type="submit" name="submit" id="submit" value="' . esc_attr(__('Log in', 'sp-ttags')) . '" /></p>';
                $out .= '</form>';
            } else {
                if ($showLogin == 2) {
                    # showing wp login link
                    $out .= '<a href="' . esc_url(wp_login_url($sflogin['sfloginurl'], 'login')) . '">' . __('Log In', 'sp-ttags') . '</a></p>';
                } else {
                    if ($showLogin == 3) {
                        # showing custom login link
                        $out .= '<a href="' . esc_attr($loginLink) . '">' . __('Log In', 'sp-ttags') . '</a></p>';
                    }
                }
            }
            # if registrations allowed, display register link
            $started = false;
            if (get_option('users_can_register') && !$spGlobals['lockdown']) {
                $started = true;
                $out .= '<p class="spSideDashLinks"><a href="' . esc_url(site_url('wp-login.php?action=register&amp;redirect_to=' . $sflogin['sfregisterurl'], 'login')) . '">' . __('Register', 'sp-ttags') . '</a>';
            }
            if ($started) {
                $out .= ' | ';
            } else {
                $out .= '<p class="spSideDashGuest">';
            }
            # display lost password link
            $out .= '<a href="' . esc_url(wp_lostpassword_url()) . '">' . __('Lost password', 'sp-ttags') . '</a></p>';
        }
        $out = apply_filters('sph_SideDashTagUser', $out);
    } else {
        if ($showAvatar) {
            $out .= sp_UserAvatar("tagClass={$avatarClass}&size={$avatarSize}&echo=0");
        }
        $out .= '<p class="spSideDashLoggedIn">' . __('Logged in as', 'sp-ttags') . ' <strong>' . sp_filter_name_display($spThisUser->display_name) . '</strong></p>';
        if ($showAdminLink) {
            $out .= '<p class="spSideDashAdminLink"><a href="' . SFHOMEURL . 'wp-admin' . '">' . __('Dashboard', 'sp-ttags') . '</a></p>';
        }
        if ($showLogout) {
            $out .= '<p class="spSideDashLogout"><a href="' . esc_url(wp_logout_url($sflogin['sflogouturl'])) . '">' . __('Log out', 'sp-ttags') . '</a></p>';
        }
        $out = apply_filters('sph_SideDashTagGuest', $out);
    }
    $out = apply_filters('sph_SideDashTag', $out);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:83,代码来源:sp-SideDash-tag.php

示例10: sp_groupview_query


//.........这里部分代码省略.........
                            if ($spThisUser->member && isset($spThisUser->newposts['forums'])) {
                                $c = 0;
                                if ($spThisUser->newposts['forums']) {
                                    foreach ($spThisUser->newposts['forums'] as $fnp) {
                                        if ($fnp == $fidx) {
                                            $c++;
                                        }
                                    }
                                }
                                $g[$gidx]->forums[$fidx]->unread = $c;
                            }
                            if (empty($r->children)) {
                                $cparent = 0;
                            } else {
                                $cparent = $fidx;
                                $sidx = 0;
                            }
                            # Build post id array for collecting stats at the end
                            if (!empty($thisPostid)) {
                                $p[$fidx] = $thisPostid;
                            }
                            $g[$gidx]->forums[$fidx] = apply_filters('sph_groupview_forum_records', $g[$gidx]->forums[$fidx], $r);
                        }
                        # Build special Group level flag on whether to show group RSS button or not (based on any forum in group having RSS access
                        if (sp_get_auth('view_forum', $r->forum_id) && !$r->forum_rss_private) {
                            $g[$gidx]->group_rss_active = 1;
                        }
                    }
                }
            }
        }
        if ($this->includeStats == true) {
            # Go grab the forum stats and data
            if (!empty($p)) {
                $stats = $this->sp_groupview_stats_query($p);
                if ($stats) {
                    foreach ($g as $gr) {
                        foreach ($gr->forums as $f) {
                            if (!empty($stats[$f->forum_id])) {
                                $s = $stats[$f->forum_id];
                                $f->topic_id = $s->topic_id;
                                $f->topic_name = sp_filter_title_display($s->topic_name);
                                $f->topic_slug = $s->topic_slug;
                                $f->post_id = $s->post_id;
                                $f->post_permalink = sp_build_url($f->forum_slug, $s->topic_slug, 0, $s->post_id, $s->post_index);
                                $f->post_date = $s->post_date;
                                $f->post_status = $s->post_status;
                                $f->post_index = $s->post_index;
                                # see if we can display the tooltip
                                if (sp_can_view($f->forum_id, 'post-content', $spThisUser->ID, $s->user_id, $s->topic_id, $s->post_id)) {
                                    $f->post_tip = $s->post_status ? sp_text('Post awaiting moderation') : sp_filter_tooltip_display($s->post_content, $s->post_status);
                                } else {
                                    $f->post_tip = '';
                                }
                                $f->user_id = $s->user_id;
                                $f->display_name = sp_filter_name_display($s->display_name);
                                $f->guest_name = sp_filter_name_display($s->guest_name);
                            }
                            # do we need to record a possible subforum substitute topic?
                            $fsub = $f->forum_id_sub;
                            if ($fsub != 0 && !empty($stats[$fsub])) {
                                $s = $stats[$fsub];
                                $f->topic_id_sub = $s->topic_id;
                                $f->topic_name_sub = sp_filter_title_display($s->topic_name);
                                $f->topic_slug_sub = $s->topic_slug;
                                $f->post_id_sub = $s->post_id;
                                $f->post_permalink_sub = sp_build_url($f->subforums[$fsub]->forum_slug, $s->topic_slug, 0, $s->post_id, $s->post_index);
                                $f->post_date_sub = $s->post_date;
                                $f->post_status_sub = $s->post_status;
                                $f->post_index_sub = $s->post_index;
                                # see if we can display the tooltip
                                if (sp_can_view($fsub, 'post-content', $spThisUser->ID, $s->user_id, $s->topic_id, $s->post_id)) {
                                    $f->post_tip_sub = $s->post_status ? sp_text('Post awaiting moderation') : sp_filter_tooltip_display($s->post_content, $s->post_status);
                                } else {
                                    $f->post_tip_sub = '';
                                }
                                $f->user_id_sub = $s->user_id;
                                $f->display_name_sub = sp_filter_name_display($s->display_name);
                                $f->guest_name_sub = sp_filter_name_display($s->guest_name);
                            }
                            $f = apply_filters('sph_groupview_stats_records', $f, $s);
                        }
                    }
                    unset($stats);
                }
            }
        }
        # Do we need to re-order IDs based on passed in IDs
        if ($groupids && $idOrder) {
            $n = array();
            foreach ($groupids as $gid) {
                if (array_key_exists($gid, $g)) {
                    $n[$gid] = $g[$gid];
                }
            }
            $g = $n;
            unset($n);
        }
        return $g;
    }
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:101,代码来源:sp-group-view-class.php

示例11: sp_post_login_check

function sp_post_login_check($login_name)
{
    $dname = sp_filter_name_display(sp_get_login_display_name($login_name));
    $cookiepath = preg_replace('|https?://[^/]+|i', '', user_trailingslashit(SFSITEURL));
    setcookie('sforum_' . COOKIEHASH, $dname, time() + 30000000, $cookiepath, false);
}
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:6,代码来源:sp-credentials.php

示例12: sp_UserGroupList

function sp_UserGroupList($args = '', $titleLabel = '', $userGroup = 0)
{
    if (!$userGroup) {
        return;
    }
    $defs = array('tagClass' => 'spUserGroupList', 'pTitleClass' => 'spUserGroupListTitle', 'spanClass' => 'spUserGroupListList', 'link_names' => 1, 'postCount' => 1, 'echo' => 1, 'get' => 0);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_UserGroupList_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $tagClass = esc_attr($tagClass);
    $pTitleClass = esc_attr($pTitleClass);
    $spanClass = esc_attr($spanClass);
    $link_names = (int) $link_names;
    $postCount = (int) $postCount;
    $echo = (int) $echo;
    $userGroup = (int) $userGroup;
    $get = (int) $get;
    if (!empty($titleLabel)) {
        $titleLabel = sp_filter_title_display($titleLabel);
    }
    # get user group member list
    $sql = "SELECT " . SFMEMBERSHIPS . ".user_id, display_name, posts\n\t\t\tFROM " . SFMEMBERSHIPS . "\n\t\t\tJOIN " . SFMEMBERS . " ON " . SFMEMBERS . ".user_id = " . SFMEMBERSHIPS . ".user_id\n\t\t\tWHERE " . SFMEMBERSHIPS . ".usergroup_id=" . $userGroup . "\n\t\t\tORDER BY display_name";
    $members = spdb_select('set', $sql);
    if ($get) {
        return $members;
    }
    # render the members list
    $out = "<div class='{$tagClass}'>";
    $out .= "<p class='{$pTitleClass}'><span class='{$pTitleClass}'>{$titleLabel}</span>";
    if ($members) {
        $first = true;
        $out .= "<span class='{$spanClass}'>";
        foreach ($members as $member) {
            $comma = !$first ? ', ' : '';
            if ($member->posts < 0) {
                $member->posts = 0;
            }
            $userPosts = $postCount ? ': ' . $member->posts : '';
            $out .= sp_build_name_display($member->user_id, $comma . sp_filter_name_display($member->display_name) . $userPosts);
            $first = false;
        }
        $out .= '</span>';
    }
    $out .= '</p>';
    # finish it up
    $out .= "</div>\n";
    $out = apply_filters('sph_UserGroupList', $out, $a);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:54,代码来源:sp-common-view-functions.php

示例13: sp_do_sp_AdminModeratorOnlineTag

function sp_do_sp_AdminModeratorOnlineTag($args = '')
{
    #check if forum displayed
    if (sp_abort_display_forum()) {
        return;
    }
    $defs = array('tagId' => 'spAdminModeratorOnlineTag', 'tagClass' => 'spListTag', 'moderator' => 1, 'custom' => 1, 'customClass' => 'spAdminMessageTag', 'listTags' => 1, 'listClass' => 'spListItemTag', 'onToolTip' => __('Online', 'sp-ttags'), 'onIcon' => 'sp_UserOnlineSmall.png', 'offIcon' => 'sp_UserOfflineSmall.png', 'offToolTip' => __('Offline', 'sp-ttags'), 'useAvatar' => 0, 'avatarSize' => 25, 'echo' => 1);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_AdminModeratorOnlineTag_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $tagId = esc_attr($tagId);
    $tagClass = esc_attr($tagClass);
    $moderator = (int) $moderator;
    $custom = (int) $custom;
    $customClass = esc_attr($customClass);
    $listTags = (int) $listTags;
    $listClass = esc_attr($listClass);
    $onToolTip = sp_filter_title_display($onToolTip);
    $offToolTip = sp_filter_title_display($offToolTip);
    $onIcon = sp_filter_filename_save($onIcon);
    $offIcon = sp_filter_filename_save($offIcon);
    $useAvatar = (int) $useAvatar;
    $avatarSize = (int) $avatarSize;
    $echo = (int) $echo;
    sp_forum_api_support();
    $where = 'admin=1';
    if ($moderator) {
        $where .= ' OR moderator = 1';
    }
    $spdb = new spdbComplex();
    $spdb->table = SFMEMBERS;
    $spdb->fields = 'user_id AS ID, user_email, ' . SFMEMBERS . '.display_name, admin, user_options, admin_options, ' . SFTRACK . '.id AS online';
    $spdb->left_join = array(SFTRACK . ' ON ' . SFMEMBERS . '.user_id = ' . SFTRACK . '.trackuserid', SFUSERS . ' ON ' . SFMEMBERS . '.user_id = ' . SFUSERS . '.ID');
    $spdb->where = $where;
    $spdb->orderby = 'online DESC';
    $admins = $spdb->select();
    $out = '';
    if ($admins) {
        $out .= $listTags ? "<ul id='{$tagId}' class='{$tagClass}'>" : "<div id='{$tagId}' class='{$tagClass}'>";
        foreach ($admins as $admin) {
            $noAvatar = '';
            $msg = '';
            $userOpts = unserialize($admin->user_options);
            if (!$userOpts['hidestatus']) {
                $userName = sp_build_name_display($admin->ID, sp_filter_name_display($admin->display_name));
                $icon = $admin->online ? $onIcon : $offIcon;
                $tip = $admin->online ? $onToolTip : $offToolTip;
                if (!$useAvatar) {
                    $noAvatar .= "<img src='" . sp_find_icon(SPTHEMEICONSURL, "{$icon}") . "' alt='' title='{$tip}' />";
                }
                if (!$admin->online && $custom) {
                    $userOpts = unserialize($admin->admin_options);
                    if (isset($userOpts['offline_message'])) {
                        $msg = sp_filter_text_display($userOpts['offline_message']);
                        if ($msg != '') {
                            $msg = "<div class='{$customClass}'>{$msg}</div>";
                        }
                    }
                }
                # begin loop display
                if ($listTags ? $out .= "<li class='{$listClass}'>" : ($out .= "<div class='{$listClass}'>")) {
                }
                # Avatar or Icon
                if ($useAvatar) {
                    $admin->avatar = '';
                    $out .= sp_UserAvatar("tagClass=spAvatar&imgClass=spAvatar&size={$avatarSize}&context=user&echo=0", $admin);
                } else {
                    $out .= $noAvatar;
                }
                # User name and current online status
                $out .= "<span class='spOnlineAdmin'><span class='spOnlineUser'>{$userName}</span> is <span class='admin{$tip}'>{$tip}</span>";
                # display offline message is set
                $out .= $msg;
                $out .= '</span>';
                # end loop display
                if ($listTags ? $out .= '<div style="clear:both;"></div></li>' : ($out .= '</div><div style="clear:both;"></div>')) {
                }
            }
        }
        $out .= $listTags ? '</ul>' : '</div>';
    }
    $out = apply_filters('sph_AdminModeratorOnlineTag', $out);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:89,代码来源:sp-AdminModeratorOnline-tag.php

示例14: spa_panel_header

if ($spStatus != 'ok') {
    include_once SPLOADINSTALL;
    die;
}
spa_panel_header();
spa_paint_options_init();
spa_paint_open_tab(spa_text('Special WP Admin Notice') . ' - ' . spa_text('Special WP Admin Notice'));
spa_paint_open_panel();
spa_paint_open_fieldset(spa_text('Special WP Admin Notice'), false);
echo '<tr><td colspan="3"><br /><p>';
spa_etext('Please note that while you are a WP admin, you are not currently an SP admin. By default, WP admins are not SP admins');
echo '<br />';
spa_etext('Contact one of the SP Admins listed below to see if they want to grant you SP admin access on the SP manage admins panel');
echo '</p>';
# list all current SPF Admins
$adminrecords = $spGlobals['forum-admins'];
if ($adminrecords) {
    echo '<p>';
    echo '<ul>';
    foreach ($adminrecords as $admin => $name) {
        echo '<li>' . sp_filter_name_display($name) . '</li>';
    }
    echo '</ul>';
    echo '</p><br />';
}
echo '</td></tr>';
spa_paint_close_fieldset();
spa_paint_close_panel();
spa_paint_close_container();
spa_paint_close_tab();
spa_panel_footer();
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:31,代码来源:spa-admin-notice.php

示例15: sp_NewPostListAdmin


//.........这里部分代码省略.........
                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&amp;sfnonce=" . wp_create_nonce('forum-ahah') . "&amp;pid=" . $post['post_id'] . "&amp;tid=" . $topic['topic_id'] . "&amp;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 . '&amp;action=0&amp;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;
开发者ID:bself,项目名称:nuimage-wp,代码行数:67,代码来源:sp-admin-bar-components.php


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