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


PHP bp_get_forums_directory_permalink函数代码示例

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


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

示例1: bp_forums_directory_forums_setup

/**
 * Load the Forums directory.
 */
function bp_forums_directory_forums_setup()
{
    // Get BuddyPress once
    $bp = buddypress();
    if (bp_is_forums_component() && (!bp_current_action() || 'tag' == bp_current_action() && bp_action_variables()) && !bp_current_item()) {
        if (!bp_forums_has_directory()) {
            return false;
        }
        if (!bp_forums_is_installed_correctly()) {
            bp_core_add_message(__('The forums component has not been set up yet.', 'buddypress'), 'error');
            bp_core_redirect(bp_get_root_domain());
        }
        bp_update_is_directory(true, 'forums');
        do_action('bbpress_init');
        // Check to see if the user has posted a new topic from the forums page.
        if (isset($_POST['submit_topic']) && bp_is_active('forums')) {
            check_admin_referer('bp_forums_new_topic');
            $bp->groups->current_group = groups_get_group(array('group_id' => $_POST['topic_group_id']));
            if (!empty($bp->groups->current_group->id)) {
                // Auto join this user if they are not yet a member of this group
                if (!bp_current_user_can('bp_moderate') && 'public' == $bp->groups->current_group->status && !groups_is_user_member(bp_loggedin_user_id(), $bp->groups->current_group->id)) {
                    groups_join_group($bp->groups->current_group->id);
                }
                $error_message = '';
                $forum_id = groups_get_groupmeta($bp->groups->current_group->id, 'forum_id');
                if (!empty($forum_id)) {
                    if (empty($_POST['topic_title'])) {
                        $error_message = __('Please provide a title for your forum topic.', 'buddypress');
                    } else {
                        if (empty($_POST['topic_text'])) {
                            $error_message = __('Forum posts cannot be empty. Please enter some text.', 'buddypress');
                        }
                    }
                    if ($error_message) {
                        bp_core_add_message($error_message, 'error');
                        $redirect = bp_get_group_permalink($bp->groups->current_group) . 'forum';
                    } else {
                        if (!($topic = groups_new_group_forum_topic($_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id))) {
                            bp_core_add_message(__('There was an error when creating the topic', 'buddypress'), 'error');
                            $redirect = bp_get_group_permalink($bp->groups->current_group) . 'forum';
                        } else {
                            bp_core_add_message(__('The topic was created successfully', 'buddypress'));
                            $redirect = bp_get_group_permalink($bp->groups->current_group) . 'forum/topic/' . $topic->topic_slug . '/';
                        }
                    }
                    bp_core_redirect($redirect);
                } else {
                    bp_core_add_message(__('Please pick the group forum where you would like to post this topic.', 'buddypress'), 'error');
                    bp_core_redirect(add_query_arg('new', '', bp_get_forums_directory_permalink()));
                }
            } else {
                bp_core_add_message(__('Please pick the group forum where you would like to post this topic.', 'buddypress'), 'error');
                bp_core_redirect(add_query_arg('new', '', bp_get_forums_directory_permalink()));
            }
        }
        do_action('bp_forums_directory_forums_setup');
        bp_core_load_template(apply_filters('bp_forums_template_directory_forums_setup', 'forums/index'));
    }
}
开发者ID:danielcoats,项目名称:schoolpress,代码行数:62,代码来源:bp-forums-screens.php

示例2: bp_forums_directory_permalink

/**
 * Output permalink for the forum directory.
 *
 * @since BuddyPress (1.5.0)
 *
 * @uses bp_get_forums_directory_permalink()
 */
function bp_forums_directory_permalink()
{
    echo bp_get_forums_directory_permalink();
}
开发者ID:danielcoats,项目名称:schoolpress,代码行数:11,代码来源:bp-forums-template.php

示例3: bp_get_forum_directory_permalink

function bp_get_forum_directory_permalink()
{
    _deprecated_function(__FUNCTION__, '1.5', 'bp_get_forums_directory_permalink()');
    return bp_get_forums_directory_permalink();
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:5,代码来源:1.5.php

示例4: bp_forums_directory_permalink

/**
 * Output permalink for the forum directory.
 *
 * @since 1.5.0
 *
 */
function bp_forums_directory_permalink()
{
    echo esc_url(bp_get_forums_directory_permalink());
}
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:10,代码来源:bp-forums-template.php


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