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


PHP sp_filter_title_display函数代码示例

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


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

示例1: spa_get_seo_data

function spa_get_seo_data()
{
    $sfcomps = array();
    # browser title
    $sfseo = sp_get_option('sfseo');
    $sfcomps['sfseo_overwrite'] = $sfseo['sfseo_overwrite'];
    $sfcomps['sfseo_blogname'] = $sfseo['sfseo_blogname'];
    $sfcomps['sfseo_pagename'] = $sfseo['sfseo_pagename'];
    $sfcomps['sfseo_homepage'] = $sfseo['sfseo_homepage'];
    $sfcomps['sfseo_topic'] = $sfseo['sfseo_topic'];
    $sfcomps['sfseo_forum'] = $sfseo['sfseo_forum'];
    $sfcomps['sfseo_noforum'] = $sfseo['sfseo_noforum'];
    $sfcomps['sfseo_page'] = $sfseo['sfseo_page'];
    $sfcomps['sfseo_sep'] = $sfseo['sfseo_sep'];
    $sfcomps['sfseo_og'] = $sfseo['sfseo_og'];
    $sfcomps['seo_og_attachment'] = $sfseo['seo_og_attachment'];
    $sfcomps['seo_og_type'] = empty($sfseo['seo_og_type']) ? 'website' : $sfseo['seo_og_type'];
    # meta tags
    $sfmetatags = array();
    $sfmetatags = sp_get_option('sfmetatags');
    $sfcomps['sfdescr'] = sp_filter_title_display($sfmetatags['sfdescr']);
    $sfcomps['sfdescruse'] = $sfmetatags['sfdescruse'];
    $sfcomps['sfusekeywords'] = sp_filter_title_display($sfmetatags['sfusekeywords']);
    $sfcomps['sfkeywords'] = isset($sfmetatags['sfkeywords']) ? $sfmetatags['sfkeywords'] : 0;
    return $sfcomps;
}
开发者ID:bself,项目名称:nuimage-wp,代码行数:26,代码来源:spa-components-prepare.php

示例2: sp_do_sp_ProfileLinkTag

function sp_do_sp_ProfileLinkTag($args = '')
{
    #check if forum displayed
    if (sp_abort_display_forum()) {
        return;
    }
    global $spThisUser;
    sp_forum_api_support();
    if ($spThisUser->ID == 0 && $spThisUser->ID == '') {
        return;
    }
    $defs = array('linkText' => __('Your Profile', 'sp-ttags'), 'beforeLink' => '', 'afterLink' => '', 'echo' => 1);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_ProfileLinkTag_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $linkText = sp_filter_title_display($linkText);
    $beforeLink = sp_filter_title_display($beforeLink);
    $afterLink = sp_filter_title_display($afterLink);
    $echo = (int) $echo;
    if (!empty($beforeLink)) {
        $beforeLink = trim($beforeLink) . ' ';
    }
    if (!empty($afterLink)) {
        $afterLink = ' ' . trim($afterLink);
    }
    $out = '';
    $out .= "<span>{$beforeLink}<a href='" . sp_url('profile') . "'>{$linkText}</a>{$afterLink}</span>\n";
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:34,代码来源:sp-ProfileLink-tag.php

示例3: sp_AdminLinksTag

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&amp;sfnonce=" . wp_create_nonce('forum-ahah') . "&amp;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;
}
开发者ID:bself,项目名称:nuimage-wp,代码行数:35,代码来源:sp-admin-bar-links-tag.php

示例4: sp_do_sp_ForumHomeLinkTag

function sp_do_sp_ForumHomeLinkTag($args = '')
{
    #check if forum displayed
    if (sp_abort_display_forum()) {
        return;
    }
    $defs = array('beforeLink' => '', 'afterLink' => '', 'echo' => 1);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_ForumHomeLinkTag_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $beforeLink = sp_filter_title_display($beforeLink);
    $afterLink = sp_filter_title_display($afterLink);
    $echo = (int) $echo;
    if (!empty($beforeLink)) {
        $beforeLink = trim($beforeLink) . ' ';
    }
    if (!empty($afterLink)) {
        $afterLink = ' ' . trim($afterLink);
    }
    $pid = sp_get_option('sfpage');
    $title = spdb_table(SFWPPOSTS, "ID={$pid}", 'post_title');
    $out .= '<span>' . $beforeLink . '<a href="' . get_permalink($pid) . '">' . $title . '</a>' . $afterLink . '</span>';
    $out = apply_filters('sph_ForumHomeLinkTag', $out);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:30,代码来源:sp-ForumHomeLink-tag.php

示例5: sp_do_sp_GroupLinkTag

function sp_do_sp_GroupLinkTag($args = '')
{
    #check if forum displayed
    if (sp_abort_display_forum()) {
        return;
    }
    $defs = array('groupId' => '', 'linkText' => '%GROUPNAME%', 'beforeLink' => '', 'afterLink' => '', 'listTags' => 0, 'echo' => 1);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_GroupLinkTag_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $groupId = (int) $groupId;
    $linkText = esc_attr($linkText);
    $beforeLink = sp_filter_title_display($beforeLink);
    $afterLink = sp_filter_title_display($afterLink);
    $listTags = (int) $listTags;
    $echo = (int) $echo;
    if (empty($groupId)) {
        return '';
    }
    sp_forum_api_support();
    if (!empty($beforeLink)) {
        $beforeLink = trim($beforeLink) . ' ';
    }
    if (!empty($afterLink)) {
        $afterLink = ' ' . trim($afterLink);
    }
    # check user has access to at kleast ine forum in group
    $canview = false;
    $forums = spdb_table(SFFORUMS, "group_id={$groupId}");
    if ($forums) {
        foreach ($forums as $forum) {
            if (sp_can_view($forum->forum_id, 'forum-title')) {
                $canview = true;
            }
        }
    }
    if ($forums && $canview) {
        $grouprec = spdb_table(SFGROUPS, "group_id={$groupId}", 'row');
        $out = '';
        $linkText = str_replace("%GROUPNAME%", sp_filter_title_display($grouprec->group_name), $linkText);
        if (empty($linkText)) {
            $linkText = sp_filter_title_display($grouprec->group_name);
        }
        if ($listTags) {
            $out .= '<li>';
        }
        $out .= '<span>' . $beforeLink . '<a href="' . add_query_arg(array('group' => $groupId), sp_url()) . '">' . $linkText . '</a>' . $afterLink . '</span>';
        if ($listTags) {
            $out .= '</li>';
        }
    }
    $out = apply_filters('sph_GroupLinkTag', $out);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:59,代码来源:sp-GroupLink-tag.php

示例6: sp_do_sp_TopicLinkTag

function sp_do_sp_TopicLinkTag($args = '')
{
    #check if forum displayed
    if (sp_abort_display_forum()) {
        return;
    }
    $defs = array('topicId' => '', 'linkText' => '%TOPICNAME%', 'beforeLink' => '', 'afterLink' => '', 'listTags' => 0, 'echo' => 1);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_TopicLinkTag_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $topicId = (int) $topicId;
    $linkText = esc_attr($linkText);
    $beforeLink = sp_filter_title_display($beforeLink);
    $afterLink = sp_filter_title_display($afterLink);
    $listTags = (int) $listTags;
    $echo = (int) $echo;
    if (empty($topicId)) {
        return '';
    }
    sp_forum_api_support();
    if (!empty($beforeLink)) {
        $beforeLink = trim($beforeLink) . ' ';
    }
    if (!empty($afterLink)) {
        $afterLink = ' ' . trim($afterLink);
    }
    $spdb = new spdbComplex();
    $spdb->table = SFTOPICS;
    $spdb->fields = SFTOPICS . '.topic_id, ' . SFTOPICS . '.forum_id, topic_slug, topic_name, forum_name, forum_slug';
    $spdb->join = array(SFFORUMS . ' ON ' . SFTOPICS . '.forum_id = ' . SFFORUMS . '.forum_id');
    $spdb->where = SFTOPICS . '.topic_id=' . $topicId;
    $thistopic = $spdb->select();
    $out = '';
    if ($thistopic) {
        if (sp_can_view($thistopic[0]->forum_id, 'topic-title')) {
            $out = '';
            $linkText = str_replace("%TOPICNAME%", sp_filter_title_display($thistopic[0]->topic_name), $linkText);
            if (empty($linkText)) {
                $linkText = sp_filter_title_display($thistopic[0]->topic_name);
            }
            if ($listTags) {
                $out .= '<li>';
            }
            $out .= '<span>' . $beforeLink . '<a href="' . sp_build_url($thistopic[0]->forum_slug, $thistopic[0]->topic_slug, 0, 0) . '">' . $linkText . '</a>' . $afterLink . '</span>';
            if ($listTags) {
                $out .= '</li>';
            }
        }
    } else {
        $out = sprintf(__('Topic %s not found', 'sp-ttags'), $topicId);
    }
    $out = apply_filters('sph_TopicLinkTag', $out);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:59,代码来源:sp-TopicLink-tag.php

示例7: sp_do_sp_UserGroupsTag

function sp_do_sp_UserGroupsTag($userid, $args = '', $noMembershipLabel = '', $adminLabel = '')
{
    #check if forum displayed
    if (sp_abort_display_forum()) {
        return;
    }
    global $spPaths;
    $defs = array('tagClass' => 'spUserGroupsTag', 'stacked' => 1, 'showTitle' => 1, 'showBadge' => 1, 'echo' => 1);
    $a = wp_parse_args($args, $defs);
    extract($a, EXTR_SKIP);
    $tagClass = esc_attr($tagClass);
    $stacked = (int) $stacked;
    $showTitle = (int) $showTitle;
    $showBadge = (int) $showBadge;
    $echo = (int) $echo;
    $thisUser = sp_get_user($userid);
    $show = false;
    $tout = "<span class='{$tagClass}'>";
    if (!empty($thisUser->memberships)) {
        $first = true;
        $split = $stacked ? '<br />' : ', ';
        foreach ($thisUser->memberships as $membership) {
            if (!$first) {
                $tout .= $split;
            }
            if ($showTitle) {
                $show = true;
                $tout .= $membership['usergroup_name'];
            }
            if ($showBadge && !empty($membership['usergroup_badge'])) {
                $show = true;
                if ($showTitle) {
                    $tout .= '<br />';
                }
                $tout .= "<img src='" . SF_STORE_URL . '/' . $spPaths['ranks'] . '/' . $membership['usergroup_badge'] . "' alt='' />";
            }
            $first = false;
        }
    } else {
        if ($thisUser->admin) {
            if ($showTitle) {
                $show = true;
                $tout .= sp_filter_title_display($adminLabel);
            }
        } else {
            $show = true;
            $tout .= sp_filter_title_display($noMembershipLabel);
        }
    }
    $tout .= "</span>\n";
    $out = $show ? $tout : '';
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:57,代码来源:sp-ShowUserGroups-tag.php

示例8: sp_do_sp_ForumLinkTag

function sp_do_sp_ForumLinkTag($args = '')
{
    #check if forum displayed
    if (sp_abort_display_forum()) {
        return;
    }
    $defs = array('forumId' => '', 'linkText' => '%FORUMNAME%', 'beforeLink' => '', 'afterLink' => '', 'listTags' => 0, 'echo' => 1);
    $a = wp_parse_args($args, $defs);
    $a = apply_filters('sph_ForumLinkTag_args', $a);
    extract($a, EXTR_SKIP);
    # sanitize before use
    $forumId = (int) $forumId;
    $linkText = esc_attr($linkText);
    $beforeLink = sp_filter_title_display($beforeLink);
    $afterLink = sp_filter_title_display($afterLink);
    $listTags = (int) $listTags;
    $echo = (int) $echo;
    if (empty($forumId)) {
        return '';
    }
    sp_forum_api_support();
    if (!empty($beforeLink)) {
        $beforeLink = trim($beforeLink) . ' ';
    }
    if (!empty($afterLink)) {
        $afterLink = ' ' . trim($afterLink);
    }
    if (sp_can_view($forumId, 'forum-title')) {
        $forumrec = spdb_table(SFFORUMS, "forum_id={$forumId}", 'row');
        if ($forumrec) {
            $out = '';
            $linkText = str_replace("%FORUMNAME%", sp_filter_title_display($forumrec->forum_name), $linkText);
            if (empty($linkText)) {
                $linkText = sp_filter_title_display($forumrec->forum_name);
            }
            if ($listTags) {
                $out .= '<li>';
            }
            $out .= '<span>' . $beforeLink . '<a href="' . sp_build_url($forumrec->forum_slug, '', 0, 0) . '">' . $linkText . '</a>' . $afterLink . '</span>';
            if ($listTags) {
                $out .= '</li>';
            }
        } else {
            $out = sprintf(__('Forum %s not found', 'sp-ttags'), $forumId);
        }
    }
    $out = apply_filters('sph_ForumLinkTag', $out);
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:53,代码来源:sp-ForumLink-tag.php

示例9: sp_featured_admin_options_form

function sp_featured_admin_options_form()
{
    $meta = sp_get_sfmeta('featured', 'topics');
    $topics = implode(',', $meta[0]['meta_value']);
    $meta = sp_get_sfmeta('featured', 'posts');
    $posts = implode(',', $meta[0]['meta_value']);
    spa_paint_options_init();
    spa_paint_open_tab(__('Featured Topics and Posts Plugin', 'sp-featured'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(__('Featured Topics and Posts Options', 'sp-featured'), true, 'featured-lists');
    spa_paint_input(__('List of featured topic IDs', 'sp-featured'), 'topic_list', sp_filter_title_display($topics));
    spa_paint_input(__('List of featured post IDs', 'sp-featured'), 'post_list', sp_filter_title_display($posts));
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_close_container();
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:16,代码来源:sp-featured-admin-options.php

示例10: sp_email_notifications

function sp_email_notifications($newpost)
{
    global $spGlobals, $spThisUser, $spVars;
    $out = '';
    $email_status = array();
    $eol = "\r\n";
    $tab = "\t";
    # create the email address list for admin nptifications
    $admins_email = array();
    $admins = spdb_table(SFMEMBERS, 'admin = 1 OR moderator = 1');
    if ($admins) {
        foreach ($admins as $admin) {
            if ($admin->user_id != $newpost['userid']) {
                $admin_opts = unserialize($admin->admin_options);
                if ($admin_opts['sfnotify'] && sp_get_auth('moderate_posts', $newpost['forumid'], $admin->user_id)) {
                    $email = spdb_table(SFUSERS, "ID = " . $admin->user_id, 'user_email');
                    $admins_email[$admin->user_id] = $email;
                }
            }
        }
    }
    $admins_email = apply_filters('sph_admin_email_addresses', $admins_email);
    # send the emails
    if (!empty($admins_email)) {
        # clean up the content for the plain text email - go get it from database so not in 'save' mode
        $post_content = spdb_table(SFPOSTS, 'post_id=' . $newpost['postid'], 'post_content');
        $post_content = sp_filter_email_content($post_content);
        # create message body
        $msg = sp_text('New forum post on your site') . ': ' . get_option('blogname') . $eol . $eol;
        $msg .= sp_text('From') . ': ' . $tab . $newpost['postername'] . ' [' . $newpost['posteremail'] . ']' . ', ' . sp_text('Poster IP') . ': ' . $newpost['posterip'] . $eol . $eol;
        $msg .= sp_text('Group') . ':' . $tab . sp_filter_title_display($newpost['groupname']) . $eol;
        $msg .= sp_text('Forum') . ':' . $tab . sp_filter_title_display($newpost['forumname']) . $eol;
        $msg .= sp_text('Topic') . ':' . $tab . sp_filter_title_display($newpost['topicname']) . $eol;
        $msg .= urldecode($newpost['url']) . $eol;
        $msg .= sp_text('Post') . ':' . $eol . $post_content . $eol . $eol;
        foreach ($admins_email as $id => $email) {
            $newmsg = apply_filters('sph_admin_email', $msg, $newpost, $id, 'admin');
            $replyto = apply_filters('sph_email_replyto', '', $newpost);
            $subject = sp_text('Forum Post') . ' - ' . get_option('blogname') . ': [' . sp_filter_title_display($newpost['topicname']) . ']';
            $subject = apply_filters('sph_email_subject', $subject, $newpost);
            sp_send_email($email, $subject, $newmsg, $replyto);
        }
        $out = '- ' . sp_text('Notified: Administrators/Moderators');
    }
    $out = apply_filters('sph_new_post_notifications', $out, $newpost);
    return $out;
}
开发者ID:bself,项目名称:nuimage-wp,代码行数:47,代码来源:sp-post-support.php

示例11: 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

示例12: spa_display_permission_select

function spa_display_permission_select($cur_perm = 0, $showSelect = true)
{
    ?>
	<?php 
    $roles = sp_get_all_roles();
    ?>
	<p><?php 
    spa_etext('Select permission set');
    ?>
:&nbsp;&nbsp;
	<?php 
    if ($showSelect) {
        ?>
		<select style="width:165px" class='sfacontrol' name='role'>
<?php 
    }
    $out = '';
    if ($cur_perm == 0) {
        $out = '<option value="-1">' . spa_text('Select permission set') . '</option>';
    }
    foreach ($roles as $role) {
        $selected = '';
        if ($cur_perm == $role->role_id) {
            $selected = 'selected = "selected" ';
        }
        $out .= '<option ' . $selected . 'value="' . $role->role_id . '">' . sp_filter_title_display($role->role_name) . '</option>' . "\n";
    }
    echo $out;
    if ($showSelect) {
        ?>
		</select></p>
<?php 
    }
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:34,代码来源:spa-support.php

示例13: spa_usergroups_edit_usergroup_form

function spa_usergroups_edit_usergroup_form($usergroup_id)
{
    global $spPaths;
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	jQuery('#usergrouprow-<?php 
    echo $usergroup_id;
    ?>
').addClass('inForm');
    	spjAjaxForm('sfusergroupedit<?php 
    echo $usergroup_id;
    ?>
', 'sfreloadub');
    });
</script>
<?php 
    $usergroup = spa_get_usergroups_row($usergroup_id);
    spa_paint_options_init();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=usergroups-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=editusergroup';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfusergroupedit<?php 
    echo $usergroup->usergroup_id;
    ?>
" name="sfusergroupedit<?php 
    echo $usergroup->usergroup_id;
    ?>
">
<?php 
    echo sp_create_nonce('forum-adminform_usergroupedit');
    spa_paint_open_tab(spa_text('User Groups') . ' - ' . spa_text('Manage User Groups'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Edit User Group'), 'true', 'edit-user-group');
    ?>
					<input type="hidden" name="usergroup_id" value="<?php 
    echo $usergroup->usergroup_id;
    ?>
" />
					<input type="hidden" name="ugroup_name" value="<?php 
    echo sp_filter_title_display($usergroup->usergroup_name);
    ?>
" />
					<input type="hidden" name="ugroup_desc" value="<?php 
    echo sp_filter_title_display($usergroup->usergroup_desc);
    ?>
" />
					<input type="hidden" name="ugroup_join" value="<?php 
    echo $usergroup->usergroup_join;
    ?>
" />
					<input type="hidden" name="ugroup_ismod" value="<?php 
    echo $usergroup->usergroup_is_moderator;
    ?>
" />
<?php 
    spa_paint_input(spa_text('User Group Name'), 'usergroup_name', sp_filter_title_display($usergroup->usergroup_name), false, true);
    spa_paint_input(spa_text('User Group Description'), 'usergroup_desc', sp_filter_title_display($usergroup->usergroup_desc), false, true);
    spa_paint_select_start(spa_text('Select Badge'), 'usergroup_badge', 'usergroup_badge');
    spa_select_icon_dropdown('usergroup_badge', spa_text('Select Badge'), SF_STORE_DIR . '/' . $spPaths['ranks'] . '/', $usergroup->usergroup_badge, false);
    spa_paint_select_end('<small>(' . spa_text('Upload badges on the Components - Forum Ranks admin panel') . ')</small>');
    spa_paint_checkbox(spa_text('Allow members to join usergroup'), 'usergroup_join', $usergroup->usergroup_join, false, false, false, '<small>' . spa_text('(Indicates that members are allowed to choose to join this usergroup on their profile page)') . '</small>');
    spa_paint_checkbox(spa_text('Is moderator'), 'usergroup_is_moderator', $usergroup->usergroup_is_moderator, false, false, false, '<small>' . spa_text('(Indicates that members of this usergroup are considered Moderators)') . '</small>');
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_usergroup_edit_panel');
    spa_paint_close_container();
    ?>
		<div class="sfform-submit-bar">
		<input type="submit" class="button-primary" id="sfusergroupedit<?php 
    echo $usergroup->usergroup_id;
    ?>
" name="sfusergroupedit<?php 
    echo $usergroup->usergroup_id;
    ?>
" value="<?php 
    spa_etext('Update User Group');
    ?>
" />
		<input type="button" class="button-primary" onclick="javascript:jQuery('#usergroup-<?php 
    echo $usergroup->usergroup_id;
    ?>
').html('');jQuery('#usergrouprow-<?php 
    echo $usergroup_id;
    ?>
').removeClass('inForm');" id="sfusergroupedit<?php 
    echo $usergroup->usergroup_id;
    ?>
" name="editusergroupcancel<?php 
    echo $usergroup->usergroup_id;
    ?>
" value="<?php 
    spa_etext('Cancel');
    ?>
" />
		</div>
	</form>
	<?php 
//.........这里部分代码省略.........
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:101,代码来源:spa-usergroups-edit-usergroup-form.php

示例14: sp_groupview_query

    function sp_groupview_query($groupids = '', $idOrder = false)
    {
        global $spThisUser;
        # can we get the results from the cache?
        $records = array();
        if (empty($spThisUser->inspect['q_spGroupView'])) {
            $records = sp_get_cache('group');
        }
        if (!$records) {
            $WHERE = '';
            if (!empty($groupids)) {
                $gcount = count($groupids);
                $done = 0;
                foreach ($groupids as $id) {
                    $WHERE .= '(' . SFGROUPS . ".group_id={$id})";
                    $done++;
                    if ($done < $gcount) {
                        $WHERE .= ' OR ';
                    }
                }
            }
            $this->groupViewStatus = empty($groupids) ? 'no data' : 'no access';
            # retrieve group and forum records
            $spdb = new spdbComplex();
            $spdb->table = SFGROUPS;
            $spdb->fields = SFGROUPS . '.group_id, group_name, group_desc, group_rss, group_icon, group_message,
								forum_id, forum_name, forum_slug, forum_desc, forum_status, forum_disabled, forum_icon, forum_icon_new, forum_icon_locked, forum_rss_private,
								post_id, post_id_held, topic_count, post_count, post_count_held, parent, children';
            $spdb->join = array(SFFORUMS . ' ON ' . SFGROUPS . '.group_id = ' . SFFORUMS . '.group_id');
            $spdb->where = $WHERE;
            $spdb->orderby = 'group_seq, forum_seq';
            $spdb = apply_filters('sph_groupview_query', $spdb, $this);
            if (!empty($spThisUser->inspect['q_spGroupView'])) {
                $spdb->inspect = 'spGroupView';
                $spdb->show = true;
                $spThisUser->inspect['q_spGroupView'] = false;
            }
            $records = $spdb->select();
            if ($records) {
                sp_add_cache('group', $records);
            }
        }
        $g = '';
        if ($records) {
            # Set status initially to 'no access' in case current user can view no forums
            $this->groupViewStatus = 'no access';
            $gidx = 0;
            $fidx = 0;
            $sidx = 0;
            $cparent = 0;
            $subPostId = 0;
            # define array to collect data
            $p = array();
            $g = array();
            foreach ($records as $r) {
                $groupid = $r->group_id;
                $forumid = $r->forum_id;
                if (sp_can_view($forumid, 'forum-title')) {
                    if ($gidx == 0 || $g[$gidx]->group_id != $groupid) {
                        # reset status to 'data'
                        $this->groupViewStatus = 'data';
                        $gidx = $groupid;
                        $fidx = 0;
                        $g[$gidx] = new stdClass();
                        $g[$gidx]->group_id = $r->group_id;
                        $g[$gidx]->group_name = sp_filter_title_display($r->group_name);
                        $g[$gidx]->group_desc = sp_filter_title_display($r->group_desc);
                        $g[$gidx]->group_rss = esc_url($r->group_rss);
                        $g[$gidx]->group_icon = sanitize_file_name($r->group_icon);
                        $g[$gidx]->group_message = sp_filter_text_display($r->group_message);
                        $g[$gidx]->group_rss_active = 0;
                        $g[$gidx] = apply_filters('sph_groupview_group_records', $g[$gidx], $r);
                    }
                    if (isset($r->forum_id)) {
                        # Is this a subform?
                        if ($r->parent != 0) {
                            $sidx = $r->forum_id;
                            $g[$gidx]->forums[$cparent]->subforums[$sidx] = new stdClass();
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->forum_id = $r->forum_id;
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->forum_name = sp_filter_title_display($r->forum_name);
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->forum_slug = $r->forum_slug;
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->forum_icon = sanitize_file_name($r->forum_icon);
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->forum_icon_new = sanitize_file_name($r->forum_icon_new);
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->forum_icon_locked = sanitize_file_name($r->forum_icon_locked);
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->forum_disabled = $r->forum_disabled;
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->forum_permalink = sp_build_url($r->forum_slug, '', 1, 0);
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->topic_count = $r->topic_count;
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->post_count = $r->post_count;
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->parent = $r->parent;
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->children = $r->children;
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->post_id = $r->post_id;
                            $g[$gidx]->forums[$cparent]->subforums[$sidx]->unread = 0;
                            # check if we can look at posts in moderation - if not swap for 'held' values
                            if (!sp_get_auth('moderate_posts', $r->forum_id)) {
                                $g[$gidx]->forums[$cparent]->subforums[$sidx]->post_count = $r->post_count_held;
                                $g[$gidx]->forums[$cparent]->subforums[$sidx]->post_id = $r->post_id_held;
                            }
                            # See if any forums are in the current users newpost list
                            if ($spThisUser->member && isset($spThisUser->newposts['forums'])) {
                                $c = 0;
//.........这里部分代码省略.........
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:101,代码来源:sp-group-view-class.php

示例15: sp_topicview_query

    function sp_topicview_query($topicid = 0, $cPage = 1, $forumid = 0)
    {
        global $spGlobals, $spThisUser, $spVars;
        # do we have a valid topic id
        if ($topicid == 0) {
            $this->topicViewStatus = 'no data';
            return;
        } else {
            $WHERE = SFTOPICS . '.topic_id=' . $topicid;
        }
        # default to no access
        $this->topicViewStatus = 'no access';
        # some setup vars
        $startlimit = 0;
        $lastpage = 0;
        # how many posts per page?
        $ppaged = $spGlobals['display']['posts']['perpage'];
        if (!$ppaged) {
            $ppaged = 10;
        }
        # setup where we are in the post list (paging)
        if ($cPage != 1) {
            $startlimit = ($cPage - 1) * $ppaged;
        }
        $LIMIT = $startlimit . ', ' . $ppaged;
        # Set up order by
        $setSort = false;
        $reverse = false;
        $setSort = $spGlobals['display']['posts']['sortdesc'];
        if (isset($spGlobals['sort_order']['topic'])) {
            $reverse = array_search($topicid, (array) $spGlobals['sort_order']['topic']) !== false ? true : false;
        }
        if (isset($spThisUser->postDESC) && $spThisUser->postDESC) {
            $reverse = !$reverse;
        }
        if ($setSort xor $reverse) {
            $ORDER = 'post_pinned DESC, ' . SFPOSTS . ".post_id DESC";
        } else {
            $ORDER = 'post_pinned DESC, ' . SFPOSTS . ".post_id ASC";
        }
        # add newpost/sfwaiting support for admins
        $waitCheck = ', NULL AS new_post';
        if ($spThisUser->admin || $spThisUser->moderator) {
            $waitCheck = ', ' . SFWAITING . '.post_count AS new_post';
        }
        # Discover if this topic is in users new post list
        $maybeNewPost = false;
        if ($spThisUser->member && sp_is_in_users_newposts($topicid)) {
            $maybeNewPost = true;
        }
        # retrieve topic and post records
        $spdb = new spdbComplex();
        $spdb->table = SFTOPICS;
        $spdb->found_rows = true;
        $spdb->fields = 'group_id, ' . SFTOPICS . '.topic_id, ' . SFTOPICS . '.forum_id, topic_name, topic_slug, topic_status, topic_pinned, topic_icon, topic_opened, ' . SFTOPICS . '.post_count, forum_name, forum_slug, forum_status,
							  forum_disabled, forum_rss_private, ' . SFPOSTS . '.post_id, ' . spdb_zone_datetime('post_date') . ', ' . SFPOSTS . '.user_id, ' . SFTOPICS . '.user_id AS topic_starter,
							  guest_name, guest_email, post_status, post_pinned, post_index, post_edit, poster_ip, source, post_content' . $waitCheck;
        $spdb->join = array(SFPOSTS . ' ON ' . SFTOPICS . '.topic_id=' . SFPOSTS . '.topic_id', SFFORUMS . ' ON ' . SFTOPICS . '.forum_id=' . SFFORUMS . '.forum_id');
        if ($spThisUser->admin || $spThisUser->moderator) {
            $spdb->left_join = array(SFWAITING . ' ON ' . SFPOSTS . '.post_id=' . SFWAITING . '.post_id');
        }
        $spdb->where = $WHERE;
        $spdb->orderby = $ORDER;
        $spdb->limits = $LIMIT;
        $spdb = apply_filters('sph_topicview_query', $spdb, $this);
        if (!empty($spThisUser->inspect['q_spTopicView'])) {
            $spdb->inspect = 'spTopicView';
            $spdb->show = true;
        }
        $records = $spdb->select();
        $t = array();
        if ($records) {
            $tidx = $topicid;
            $pidx = 0;
            $r = current($records);
            if (sp_get_auth('view_forum', $r->forum_id)) {
                $this->topicViewStatus = 'data';
                # construct the parent topic object
                $t[$tidx] = new stdClass();
                $t[$tidx]->topic_id = $r->topic_id;
                $t[$tidx]->forum_id = $r->forum_id;
                $t[$tidx]->group_id = $r->group_id;
                $t[$tidx]->forum_name = sp_filter_title_display($r->forum_name);
                $t[$tidx]->topic_name = sp_filter_title_display($r->topic_name);
                $t[$tidx]->topic_slug = $r->topic_slug;
                $t[$tidx]->topic_opened = $r->topic_opened;
                $t[$tidx]->forum_status = $r->forum_status;
                $t[$tidx]->topic_pinned = $r->topic_pinned;
                $t[$tidx]->forum_disabled = $r->forum_disabled;
                $t[$tidx]->forum_slug = $r->forum_slug;
                $t[$tidx]->forum_rss_private = $r->forum_rss_private;
                $t[$tidx]->topic_permalink = sp_build_url($r->forum_slug, $r->topic_slug, 1, 0);
                $t[$tidx]->topic_status = $r->topic_status;
                $t[$tidx]->topic_icon = sanitize_file_name($r->topic_icon);
                $t[$tidx]->rss = '';
                $t[$tidx]->editmode = 0;
                $t[$tidx]->tools_flag = 1;
                $t[$tidx]->display_page = $this->topicPage;
                $t[$tidx]->posts_per_page = $ppaged;
                $t[$tidx]->unread = 0;
//.........这里部分代码省略.........
开发者ID:ashanrupasinghe,项目名称:govforuminstalledlocal,代码行数:101,代码来源:sp-topic-view-class.php


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