• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP login_forum_box函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: login_box

$user->setup('viewforum', $forum_data['forum_style']);
// Redirect to login upon emailed notification links
if (isset($_GET['e']) && !$user->data['is_registered']) {
    login_box('', $user->lang['LOGIN_NOTIFY_FORUM']);
}
// Permissions check
if (!$auth->acl_gets('f_list', 'f_read', $forum_id) || $forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link'] && !$auth->acl_get('f_read', $forum_id)) {
    if ($user->data['user_id'] != ANONYMOUS) {
        trigger_error('SORRY_AUTH_READ');
    }
    login_box('', $user->lang['LOGIN_VIEWFORUM']);
}
// Forum is passworded ... check whether access has been granted to this
// user this session, if not show login box
if ($forum_data['forum_password']) {
    login_forum_box($forum_data);
}
// Is this forum a link? ... User got here either because the
// number of clicks is being tracked or they guessed the id
if ($forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link']) {
    // Does it have click tracking enabled?
    if ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) {
        $sql = 'UPDATE ' . FORUMS_TABLE . '
			SET forum_posts_approved = forum_posts_approved + 1
			WHERE forum_id = ' . $forum_id;
        $db->sql_query($sql);
    }
    // We redirect to the url. The third parameter indicates that external redirects are allowed.
    redirect($forum_data['forum_link'], false, true);
    return;
}
开发者ID:ZerGabriel,项目名称:phpbb,代码行数:31,代码来源:viewforum.php


示例2: upload_popup

    upload_popup($post_data['forum_style']);
    return;
}
$user->setup(array('posting', 'mcp', 'viewtopic'), $post_data['forum_style']);
if ($config['enable_post_confirm'] && !$user->data['is_registered']) {
    include $phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx;
    $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
    $captcha->init(CONFIRM_POST);
}
// Use post_row values in favor of submitted ones...
$forum_id = !empty($post_data['forum_id']) ? (int) $post_data['forum_id'] : (int) $forum_id;
$topic_id = !empty($post_data['topic_id']) ? (int) $post_data['topic_id'] : (int) $topic_id;
$post_id = !empty($post_data['post_id']) ? (int) $post_data['post_id'] : (int) $post_id;
// Need to login to passworded forum first?
if ($post_data['forum_password']) {
    login_forum_box(array('forum_id' => $forum_id, 'forum_name' => $post_data['forum_name'], 'forum_password' => $post_data['forum_password']));
}
// Check permissions
if ($user->data['is_bot']) {
    redirect(append_sid("{$phpbb_root_path}index.{$phpEx}"));
}
// Is the user able to read within this forum?
if (!$auth->acl_get('f_read', $forum_id)) {
    if ($user->data['user_id'] != ANONYMOUS) {
        trigger_error('USER_CANNOT_READ');
    }
    login_box('', $user->lang['LOGIN_EXPLAIN_POST']);
}
// Permission to do the action asked?
$is_authed = false;
switch ($mode) {
开发者ID:PetsFundation,项目名称:Pets,代码行数:31,代码来源:posting.php


示例3: trigger_error

if (!$attachment['in_message'] && !$config['allow_attachments'] || $attachment['in_message'] && !$config['allow_pm_attach']) {
    trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
}
$row = array();
if (!$attachment['in_message']) {
    $sql = 'SELECT p.forum_id, f.forum_password, f.parent_id
		FROM ' . FORUMS_POSTS_TABLE . ' p, ' . FORUMS_FORUMS_TABLE . ' f
		WHERE p.post_id = ' . $attachment['post_msg_id'] . '
			AND p.forum_id = f.forum_id';
    $result = $_CLASS['core_db']->query_limit($sql, 1);
    $row = $_CLASS['core_db']->fetch_row_assoc($result);
    $_CLASS['core_db']->free_result($result);
    if ($_CLASS['auth']->acl_gets('f_download', 'u_download', $row['forum_id'])) {
        if ($row['forum_password']) {
            // Do something else ... ?
            login_forum_box($row);
        }
    } else {
        //trigger_error('SORRY_AUTH_VIEW_ATTACH');
    }
} else {
    $row['forum_id'] = 0;
    if (!$_CLASS['auth']->acl_get('u_pm_download') || !$config['auth_download_pm']) {
        trigger_error('SORRY_AUTH_VIEW_ATTACH');
    }
}
// disallowed ?
$extensions = array();
if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions)) {
    trigger_error(sprintf($_CLASS['core_user']->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
}
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:download.php


示例4: array

*												Set it to an array to override original data.
* @since 3.1.3-RC1
*/
$vars = array('forum_id', 'topic_id', 'post_id', 'topic_data', 'overrides_f_read_check', 'overrides_forum_password_check', 'topic_tracking_info');
extract($phpbb_dispatcher->trigger_event('core.viewtopic_before_f_read_check', compact($vars)));
// Start auth check
if (!$overrides_f_read_check && !$auth->acl_get('f_read', $forum_id)) {
    if ($user->data['user_id'] != ANONYMOUS) {
        trigger_error('SORRY_AUTH_READ');
    }
    login_box('', $user->lang['LOGIN_VIEWFORUM']);
}
// Forum is passworded ... check whether access has been granted to this
// user this session, if not show login box
if (!$overrides_forum_password_check && $topic_data['forum_password']) {
    login_forum_box($topic_data);
}
// Redirect to login upon emailed notification links if user is not logged in.
if (isset($_GET['e']) && $user->data['user_id'] == ANONYMOUS) {
    login_box(build_url('e') . '#unread', $user->lang['LOGIN_NOTIFY_TOPIC']);
}
// What is start equal to?
if ($post_id) {
    $start = floor($topic_data['prev_posts'] / $config['posts_per_page']) * $config['posts_per_page'];
}
// Get topic tracking info
if (!isset($topic_tracking_info)) {
    $topic_tracking_info = array();
    // Get topic tracking info
    if ($config['load_db_lastread'] && $user->data['is_registered']) {
        $tmp_topic_data = array($topic_id => $topic_data);
开发者ID:ramukumar555,项目名称:phpbb,代码行数:31,代码来源:viewtopic.php


示例5: compose_pm


//.........这里部分代码省略.........
        if ($action == 'quotepost') {
            if ($post['forum_id'] && !$auth->acl_get('f_read', $post['forum_id']) || !$post['forum_id'] && !$auth->acl_getf_global('f_read')) {
                trigger_error('NOT_AUTHORISED');
            }
            /**
             * Get the result of querying for the post to be quoted in the pm message
             *
             * @event core.ucp_pm_compose_quotepost_query_after
             * @var	string	sql					The original SQL used in the query
             * @var	array	post				Associative array with the data of the quoted post
             * @var	array	msg_id				The post_id that was searched to get the message for quoting
             * @var	int		visibility_const	Visibility of the quoted post (one of the possible ITEM_* constant values)
             * @var	int		topic_id			Topic ID of the quoted post
             * @var	int		to_user_id			Users the message is sent to
             * @var	int		to_group_id			Groups the message is sent to
             * @var	bool	submit				Whether the user is sending the PM or not
             * @var	bool	preview				Whether the user is previewing the PM or not
             * @var	string	action				One of: post, reply, quote, forward, quotepost, edit, delete, smilies
             * @var	bool	delete				If deleting message
             * @var	int		reply_to_all		Value of reply_to_all request variable.
             * @since 3.1.0-RC5
             */
            $vars = array('sql', 'post', 'msg_id', 'visibility_const', 'topic_id', 'to_user_id', 'to_group_id', 'submit', 'preview', 'action', 'delete', 'reply_to_all');
            extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_quotepost_query_after', compact($vars)));
            // Passworded forum?
            if ($post['forum_id']) {
                $sql = 'SELECT forum_id, forum_name, forum_password
					FROM ' . FORUMS_TABLE . '
					WHERE forum_id = ' . (int) $post['forum_id'];
                $result = $db->sql_query($sql);
                $forum_data = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);
                if (!empty($forum_data['forum_password'])) {
                    login_forum_box($forum_data);
                }
            }
        }
        $msg_id = (int) $post['msg_id'];
        $folder_id = isset($post['folder_id']) ? $post['folder_id'] : 0;
        $message_text = isset($post['message_text']) ? $post['message_text'] : '';
        if ((!$post['author_id'] || $post['author_id'] == ANONYMOUS && $action != 'delete') && $msg_id) {
            trigger_error('NO_AUTHOR');
        }
        if ($action == 'quotepost') {
            // Decode text for message display
            decode_message($message_text, $post['bbcode_uid']);
        }
        if ($action != 'delete') {
            $enable_urls = $post['enable_magic_url'];
            $enable_sig = isset($post['enable_sig']) ? $post['enable_sig'] : 0;
            $message_attachment = isset($post['message_attachment']) ? $post['message_attachment'] : 0;
            $message_subject = $post['message_subject'];
            $message_time = $post['message_time'];
            $bbcode_uid = $post['bbcode_uid'];
            $quote_username = isset($post['quote_username']) ? $post['quote_username'] : '';
            $icon_id = isset($post['icon_id']) ? $post['icon_id'] : 0;
            if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !sizeof($address_list) && !$refresh && !$submit && !$preview) {
                // Add the original author as the recipient if quoting a post or only replying and not having checked "reply to all"
                if ($action == 'quotepost' || !$reply_to_all) {
                    $address_list = array('u' => array($post['author_id'] => 'to'));
                } else {
                    // We try to include every previously listed member from the TO Header - Reply to all
                    $address_list = rebuild_header(array('to' => $post['to_address']));
                    // Add the author (if he is already listed then this is no shame (it will be overwritten))
                    $address_list['u'][$post['author_id']] = 'to';
                    // Now, make sure the user itself is not listed. ;)
开发者ID:Voxel37,项目名称:phpbb,代码行数:67,代码来源:ucp_pm_compose.php


示例6: phpbb_download_handle_forum_auth

/**
* Handles authentication when downloading attachments from a post or topic
*
* @param \phpbb\db\driver\driver_interface $db The database object
* @param \phpbb\auth\auth $auth The authentication object
* @param int $topic_id The id of the topic that we are downloading from
*
* @return null
*/
function phpbb_download_handle_forum_auth($db, $auth, $topic_id)
{
    $sql_array = array('SELECT' => 't.topic_visibility, t.forum_id, f.forum_name, f.forum_password, f.parent_id', 'FROM' => array(TOPICS_TABLE => 't', FORUMS_TABLE => 'f'), 'WHERE' => 't.topic_id = ' . (int) $topic_id . '
			AND t.forum_id = f.forum_id');
    $sql = $db->sql_build_query('SELECT', $sql_array);
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $db->sql_freeresult($result);
    if ($row && $row['topic_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $row['forum_id'])) {
        send_status_line(404, 'Not Found');
        trigger_error('ERROR_NO_ATTACHMENT');
    } else {
        if ($row && $auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id'])) {
            if ($row['forum_password']) {
                // Do something else ... ?
                login_forum_box($row);
            }
        } else {
            send_status_line(403, 'Forbidden');
            trigger_error('SORRY_AUTH_VIEW_ATTACH');
        }
    }
}
开发者ID:ZerGabriel,项目名称:phpbb,代码行数:32,代码来源:functions_download.php


示例7: html_init


//.........这里部分代码省略.........
                 }
                 $this->call['forum_sql'] = $db->sql_in_set('f.forum_id', $this->actions['auth_view_list'], false, true);
             } else {
                 if ($this->actions['html_news_list'] || $this->actions['html_map_list']) {
                     // Filter $this->actions['module_sub'] var type
                     $this->actions['module_sub'] = (int) $this->actions['module_sub'];
                     if ($this->actions['module_sub'] > 0) {
                         // Forum map or news
                         $forum_id = $this->call['forum_id'] = $this->actions['module_sub'];
                         // Here we need to be able to list categories as well as forums
                         // A forum news or map is viewable when is a readable postable forum or a listable forum cat
                         // (with authed children see below)
                         $this->actions['is_auth'] = (bool) (isset($this->actions['auth_view_read'][$forum_id]) || isset($this->module_auth['forum']['skip_cat'][$forum_id]) && isset($this->actions['auth_view_list'][$forum_id]));
                         $this->actions['is_public'] = (bool) isset($this->actions['auth_guest_list'][$forum_id]);
                         $this->call['single_forum'] = true;
                         if ($this->actions['html_news_list']) {
                             $this->actions['is_active'] = true;
                             $key = 'news';
                             $this->actions['pagination_limit'] = $this->call['limit'] = $this->module_config['html_news_pagination_limit'];
                             $this->outputs['right_col'] = $this->call['display_last_topic'] = $this->module_config['html_forum_cat_news_ltopic'];
                             $this->outputs['left_col_tpl'] = 'gym_sitemaps/display_posts_list.html';
                             $this->call['file'] = 'display_posts.' . $phpEx;
                             $this->call['display_pagination'] = $this->module_config['html_news_pagination'];
                             $this->call['limit_time'] = $this->module_config['html_cat_news_time_limit'];
                             $this->call['display_order'] = $this->module_config['html_forum_news_first'];
                             $this->call['sort'] = $this->module_config['html_cat_news_sort'];
                             $this->call['method'] = 'display_posts';
                         } else {
                             if ($this->actions['html_map_list']) {
                                 $this->actions['is_active'] = true;
                                 $key = 'map';
                                 $this->actions['pagination_limit'] = $this->call['limit'] = $this->module_config['html_pagination_limit'];
                                 $this->outputs['right_col'] = $this->call['display_last_topic'] = $this->module_config['html_forum_cat_ltopic'];
                                 $this->outputs['left_col_tpl'] = 'gym_sitemaps/display_topics_list.html';
                                 $this->call['file'] = 'display_topics.' . $phpEx;
                                 $this->call['display_pagination'] = $this->module_config['html_pagination'];
                                 $this->call['limit_time'] = $this->module_config['html_cat_time_limit'];
                                 $this->call['sort'] = $this->module_config['html_cat_sort'];
                                 $this->call['display_order'] = $this->module_config['html_forum_first'];
                                 $this->call['method'] = 'display_topics';
                             }
                         }
                         // Upon single forum calls, grabb forum data separatelly to allow access to forum data when there is no topic to list
                         // As well prevent topic row from listing repeated forum data
                         if ($this->actions['is_active']) {
                             $sql = "SELECT *\n\t\t\t\t\t\t\tFROM " . FORUMS_TABLE . "\n\t\t\t\t\t\t\tWHERE forum_id = {$forum_id}";
                             $result = $db->sql_query($sql);
                             if ($row = $db->sql_fetchrow($result)) {
                                 // www.phpBB-SEO.com SEO TOOLKIT BEGIN
                                 $phpbb_seo->set_url($row['forum_name'], $forum_id, $phpbb_seo->seo_static['forum']);
                                 // www.phpBB-SEO.com SEO TOOLKIT END
                                 $this->forum_datas[$forum_id] = array_merge($row, array('forum_url' => append_sid("{$phpbb_root_path}viewforum.{$phpEx}", "f={$forum_id}"), 'm_approve' => $auth->acl_get('m_approve', $forum_id)));
                                 if ($row['forum_password']) {
                                     login_forum_box($row);
                                 }
                             } else {
                                 // Forum does not exist
                                 $this->actions['is_active'] = false;
                             }
                         }
                         if ($this->actions['is_active']) {
                             $this->call['forum_sql'] = "t.forum_id = {$forum_id}";
                             if ($this->forum_datas[$forum_id]['forum_type'] == FORUM_CAT) {
                                 $this->call['cat_forum'] = $forum_id;
                                 // lets check childrens
                                 if ($f_ids = $this->gym_master->get_forum_children($forum_id)) {
                                     $this->call['forum_sql'] = $db->sql_in_set('t.forum_id', array_keys($f_ids), false, true);
                                     $this->call['single_forum'] = false;
                                 } else {
                                     // Cat with no readable sub forums
                                     $this->actions['is_active'] = false;
                                 }
                             }
                             $this->start = $this->call['display_pagination'] ? $this->gym_master->chk_start($this->start, $this->call['limit']) : 0;
                             $this->url_settings['current'] .= $this->gym_master->html_build_url('html_forum_cat_' . $key, $phpbb_seo->seo_url['forum'][$forum_id], $forum_id);
                             $this->call['display_file'] = $this->url_settings['current'];
                             $this->url_settings['current'] .= $this->gym_master->html_add_start($this->start);
                             $this->outputs['page_title'] = sprintf($user->lang['HTML_' . strtoupper($key) . '_OF'], $this->forum_datas[$forum_id]['forum_name']);
                             if ($this->module_config['html_allow_' . $key]) {
                                 $nav_url = $this->url_settings['html_forum_' . $key];
                                 $nav_title = sprintf($user->lang['HTML_' . strtoupper($key) . '_OF'], $this->module_config['html_sitename']);
                             }
                             $this->outputs['left_col_cache_file'] = "forum_{$forum_id}{$key}";
                             // Enable forum tracking
                             $_REQUEST['f'] = $this->call['forum_id'];
                             // Track user viewing this forum
                             $this->outputs['single_traking'] = true;
                         }
                     }
                 }
             }
             break;
     }
     if ($nav_url) {
         global $template;
         // Add Module page in navigation links
         $template->assign_block_vars('navlinks', array('FORUM_NAME' => $nav_title, 'U_VIEW_FORUM' => append_sid($this->module_config['html_url'] . $nav_url)));
     }
     return;
 }
开发者ID:jverkoey,项目名称:Three20-Scope,代码行数:101,代码来源:html_forum.php


示例8: extract

extract($posting_data);
if ($posting_data['forum_type'] == FORUM_POST && !$_CLASS['auth']->acl_get('f_' . $mode, $forum_id) && !$_CLASS['auth']->acl_get('m_' . $mode, $forum_id)) {
    if ($_CLASS['core_user']->is_user) {
        trigger_error('USER_CANNOT_' . strtoupper($mode));
    }
    login_box(array('explain' => $_CLASS['core_user']->lang['LOGIN_EXPLAIN_' . strtoupper($mode)]));
}
$forum_id = (int) $posting_data['forum_id'];
$topic_id = (int) $topic_id;
$post_id = (int) $post_id;
$posting_data['post_edit_locked'] = isset($posting_data['post_edit_locked']) ? (int) $posting_data['post_edit_locked'] : false;
$_CLASS['core_user']->add_lang(array('posting', 'mcp', 'viewtopic'));
$_CLASS['core_user']->add_img();
if ($forum_password) {
    $forum_info = array('forum_id' => $forum_id, 'forum_password' => $forum_password);
    login_forum_box($forum_info);
    unset($forum_info);
}
$post_subject = in_array($mode, array('quote', 'edit', 'delete')) ? $posting_data['post_subject'] : (isset($posting_data['topic_title']) ? $posting_data['topic_title'] : '');
$topic_time_limit = isset($posting_data['topic_time_limit']) && $posting_data['topic_time_limit'] ? (int) $posting_data['topic_time_limit'] / 86400 : 0;
$poll_length = isset($poll_length) ? $poll_length ? (int) $poll_length / 86400 : (int) $poll_length : 0;
$poll_start = isset($poll_start) ? (int) $poll_start : 0;
$poll_options = array();
if (!isset($icon_id) || in_array($mode, array('quote', 'reply'))) {
    $icon_id = 0;
}
// Get Poll Data
if ($poll_start) {
    $sql = 'SELECT poll_option_text 
		FROM ' . FORUMS_POLL_OPTIONS_TABLE . "\n\t\tWHERE topic_id = {$topic_id}\n\t\tORDER BY poll_option_id";
    $result = $_CLASS['core_db']->query($sql);
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:posting.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP login_header函数代码示例发布时间:2022-05-15
下一篇:
PHP login_form函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap