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


PHP auth::acl_gets方法代码示例

本文整理汇总了PHP中phpbb\auth\auth::acl_gets方法的典型用法代码示例。如果您正苦于以下问题:PHP auth::acl_gets方法的具体用法?PHP auth::acl_gets怎么用?PHP auth::acl_gets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在phpbb\auth\auth的用法示例。


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

示例1: array

    /**
     * Modified version of the jumpbox, just lists authed forums (in the correct order)
     */
    function get_forum_list($ignore_id = false, $ignore_acl = false, $ignore_nonpost = false, $ignore_emptycat = true, $only_acl_post = false)
    {
        // This query is identical to the jumpbox one
        $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, forum_flags, forum_options, left_id, right_id
			FROM ' . FORUMS_TABLE . '
			ORDER BY left_id ASC';
        $result = $this->db->sql_query($sql, 600);
        // We include the forum root/index to make tree traversal easier
        $forum_list[0] = array('forum_id' => '0', 'forum_name' => $this->user->lang['FORUMS'], 'forum_type' => '0', 'link' => append_sid("{$this->root_path}index.{$this->phpEx}"), 'parent_id' => false, 'current' => false, 'current_child' => false, 'disabled' => false);
        // Sometimes it could happen that forums will be displayed here not be displayed within the index page
        // This is the result of forums not displayed at index, having list permissions and a parent of a forum with no permissions.
        // If this happens, the padding could be "broken"
        while ($row = $this->db->sql_fetchrow($result)) {
            $disabled = false;
            if (!$ignore_acl && $this->auth->acl_gets(array('f_list', 'f_read'), $row['forum_id'])) {
                if ($only_acl_post && !$this->auth->acl_get('f_post', $row['forum_id']) || !$this->auth->acl_get('m_approve', $row['forum_id']) && !$this->auth->acl_get('f_noapprove', $row['forum_id'])) {
                    $disabled = true;
                }
            } else {
                if (!$ignore_acl) {
                    continue;
                }
            }
            if (is_array($ignore_id) && in_array($row['forum_id'], $ignore_id) || $row['forum_id'] == $ignore_id || $row['forum_type'] == FORUM_CAT && $row['left_id'] + 1 == $row['right_id'] && $ignore_emptycat || $row['forum_type'] != FORUM_POST && $ignore_nonpost) {
                $disabled = true;
            }
            $u_viewforum = append_sid("{$this->root_path}viewforum.{$this->phpEx}", 'f=' . $row['forum_id']);
            $forum_list[$row['forum_id']] = array('forum_id' => $row['forum_id'], 'forum_name' => $row['forum_name'], 'forum_type' => $row['forum_type'], 'link' => $u_viewforum, 'parent_id' => $row['parent_id'], 'current' => false, 'current_child' => false, 'disabled' => $disabled);
        }
        $this->db->sql_freeresult($result);
        return $forum_list;
    }
开发者ID:Sajaki,项目名称:BreadcrumbMenu,代码行数:35,代码来源:listener.php

示例2: viewtopic_modify_page_title

 /**
  * Only display quick reply for admins and mods
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function viewtopic_modify_page_title($event)
 {
     $is_authed = $this->auth->acl_gets('a_', 'm_');
     if (!$is_authed) {
         $this->template->assign_vars(array('S_QUICK_REPLY' => false));
     }
 }
开发者ID:rmcgirr83,项目名称:phpBB-3.1-qradminsandmods,代码行数:14,代码来源:listener.php

示例3: main

 public function main($event)
 {
     if ($this->config['load_birthdays'] && $this->config['allow_birthdays'] && $this->config['allow_birthdays_ahead'] > 0 && $this->auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) {
         $this->user->add_lang_ext('rmcgirr83/upcomingbirthdays', 'upcomingbirthdays');
         $this->upcoming_birthdays();
     }
 }
开发者ID:alhitary,项目名称:phpBB-3.1-upcomingbirthdays,代码行数:7,代码来源:main_listener.php

示例4: action_conditions

 public function action_conditions($event)
 {
     $topic_data = $event['topic_data'];
     $topic_id = $topic_data['topic_id'];
     $forum_id = $topic_data['forum_id'];
     $topic_status = $topic_data['topic_status'];
     if ($this->user->data['user_id'] == $topic_data['topic_poster'] && $this->auth->acl_gets('f_topicmod', $topic_data['forum_id']) || $this->auth->acl_gets('m_edit', $topic_data['forum_id'])) {
         $this->template->assign_vars(array('S_TOPIC_CLOSED' => $topic_data['topic_status'] == 1 ? true : false, 'S_CAN_CLOSE' => true, 'U_CLOSE_TOPIC' => append_sid("{$this->phpbb_root_path}topicmod", "fid={$forum_id}&tid={$topic_id}&topic_status={$topic_status}")));
         $event['force_edit_allowed'] = true;
     }
 }
开发者ID:AlexSheer,项目名称:phpbb3.1-Topic-Moderator,代码行数:11,代码来源:listener.php

示例5: mchat_legend

    /**
     * Generates the user legend markup
     */
    public function mchat_legend()
    {
        // Grab group details for legend display for who is online on the custom page
        $order_legend = $this->config['legend_sort_groupname'] ? 'group_name' : 'group_legend';
        if ($this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) {
            $sql = 'SELECT group_id, group_name, group_colour, group_type
				FROM ' . GROUPS_TABLE . '
				WHERE group_legend <> 0
				ORDER BY ' . $order_legend . ' ASC';
        } else {
            $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
				FROM ' . GROUPS_TABLE . ' g
				LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (g.group_id = ug.group_id AND ug.user_id = ' . $this->user->data['user_id'] . ' AND ug.user_pending = 0)
				WHERE g.group_legend <> 0
					AND (g.group_type <> ' . GROUP_HIDDEN . '
					OR ug.user_id = ' . (int) $this->user->data['user_id'] . ')
				ORDER BY g.' . $order_legend . ' ASC';
        }
        $result = $this->db->sql_query($sql);
        $rows = $this->db->sql_fetchrowset($result);
        $this->db->sql_freeresult($result);
        $legend = array();
        foreach ($rows as $row) {
            $colour_text = $row['group_colour'] ? ' style="color:#' . $row['group_colour'] . '"' : '';
            $group_name = $row['group_type'] == GROUP_SPECIAL ? $this->user->lang('G_' . $row['group_name']) : $row['group_name'];
            if ($row['group_name'] == 'BOTS' || $this->user->data['user_id'] != ANONYMOUS && !$this->auth->acl_get('u_viewprofile')) {
                $legend[] = '<span' . $colour_text . '>' . $group_name . '</span>';
            } else {
                $legend[] = '<a' . $colour_text . ' href="' . append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=group&amp;g=' . $row['group_id']) . '">' . $group_name . '</a>';
            }
        }
        return $legend;
    }
开发者ID:EntropyRy,项目名称:mChat-Extension,代码行数:36,代码来源:functions_mchat.php

示例6: submit_cp_field

    /**
     * Submit profile field for validation
     */
    public function submit_cp_field($mode, $lang_id, &$cp_data, &$cp_error)
    {
        $sql_where = '';
        switch ($mode) {
            case 'register':
                // If the field is required we show it on the registration page
                $sql_where .= ' AND f.field_show_on_reg = 1';
                break;
            case 'profile':
                // Show hidden fields to moderators/admins
                if (!$this->auth->acl_gets('a_', 'm_') && !$this->auth->acl_getf_global('m_')) {
                    $sql_where .= ' AND f.field_show_profile = 1';
                }
                break;
            default:
                trigger_error('Wrong profile mode specified', E_USER_ERROR);
                break;
        }
        $sql = 'SELECT l.*, f.*
			FROM ' . $this->fields_language_table . ' l, ' . $this->fields_table . ' f
			WHERE l.lang_id = ' . (int) $lang_id . "\n\t\t\t\tAND f.field_active = 1\n\t\t\t\t{$sql_where}\n\t\t\t\tAND l.field_id = f.field_id\n\t\t\tORDER BY f.field_order";
        $result = $this->db->sql_query($sql);
        while ($row = $this->db->sql_fetchrow($result)) {
            $profile_field = $this->type_collection[$row['field_type']];
            $cp_data['pf_' . $row['field_ident']] = $profile_field->get_profile_field($row);
            $check_value = $cp_data['pf_' . $row['field_ident']];
            if (($cp_result = $profile_field->validate_profile_field($check_value, $row)) !== false) {
                // If the result is not false, it's an error message
                $cp_error[] = $cp_result;
            }
        }
        $this->db->sql_freeresult($result);
    }
开发者ID:Tarendai,项目名称:spring-website,代码行数:36,代码来源:manager.php

示例7: clear_user

    /**
     * Clear user reputation
     *
     * @param int $uid	User ID
     * @return null
     * @access public
     */
    public function clear_user($uid)
    {
        $this->user->add_lang_ext('pico/reputation', 'reputation_system');
        $is_ajax = $this->request->is_ajax();
        $submit = false;
        $sql_array = array('SELECT' => 'r.*, ut.username AS username_to', 'FROM' => array($this->reputations_table => 'r'), 'LEFT_JOIN' => array(array('FROM' => array(USERS_TABLE => 'ut'), 'ON' => 'r.user_id_to = ut.user_id ')), 'WHERE' => 'r.user_id_to = ' . $uid);
        $sql = $this->db->sql_build_query('SELECT', $sql_array);
        $result = $this->db->sql_query($sql);
        $row = $this->db->sql_fetchrow($result);
        $this->db->sql_freeresult($result);
        //We couldn't find this reputation. May be it was deleted meanwhile?
        if (empty($row)) {
            $message = $this->user->lang('RS_NO_REPUTATION');
            $json_data = array('error_msg' => $message);
            $redirect = append_sid("{$this->root_path}index.{$this->php_ext}");
            $redirect_text = 'RETURN_INDEX';
            $this->reputation_manager->response($message, $json_data, $redirect, $redirect_text, $is_ajax);
        }
        $redirect = $this->helper->route('reputation_details_controller', array('uid' => $uid));
        if ($this->request->is_set_post('cancel')) {
            redirect($redirect);
        }
        $post_ids = array();
        $post_type_id = (int) $this->reputation_manager->get_reputation_type_id('post');
        $sql = 'SELECT reputation_item_id
			FROM ' . $this->reputations_table . "\n\t\t\tWHERE user_id_to = {$uid}\n\t\t\t\tAND reputation_type_id = {$post_type_id}\n\t\t\tGROUP BY reputation_item_id";
        $result = $this->db->sql_query($sql);
        while ($post_row = $this->db->sql_fetchrow($result)) {
            $post_ids[] = $post_row['reputation_item_id'];
        }
        $this->db->sql_freeresult($result);
        $redirect_text = 'RETURN_PAGE';
        if ($this->auth->acl_gets('m_rs_moderate')) {
            if ($is_ajax) {
                $submit = true;
            } else {
                $s_hidden_fields = build_hidden_fields(array('u' => $uid));
                if (confirm_box(true)) {
                    $submit = true;
                } else {
                    confirm_box(false, $this->user->lang('RS_CLEAR_POST_CONFIRM'), $s_hidden_fields);
                }
            }
        } else {
            $message = $this->user->lang('RS_USER_CANNOT_DELETE');
            $json_data = array('error_msg' => $message);
            $this->reputation_manager->response($message, $json_data, $redirect, $redirect_text, $is_ajax);
        }
        if ($submit) {
            try {
                $this->reputation_manager->clear_user_reputation($uid, $row, $post_ids);
            } catch (\pico\reputation\exception\base $e) {
                // Catch exception
                trigger_error($e->get_message($this->user));
            }
            $message = $this->user->lang('RS_CLEARED_USER');
            $json_data = array('clear_user' => true, 'post_ids' => $post_ids, 'poster_id' => $uid, 'user_reputation' => 0, 'post_reputation' => 0, 'reputation_class' => 'neutral');
            $this->reputation_manager->response($message, $json_data, $redirect, $redirect_text, $is_ajax);
        }
    }
开发者ID:rampmaster,项目名称:phpBB-Reputation-System,代码行数:67,代码来源:action_controller.php

示例8: get_topic_auth

	/**
	* Determine whether the user is allowed to read and/or moderate the forum of the topic
	*
	* @param	array	$topic_ids	Array with the topic ids
	*
	* @return	array		Returns an array with two keys 'm_' and 'read_f' which are also an array of topic_id => forum_id sets when the permissions are given. Sample:
	*						array(
	*							'permission' => array(
	*								topic_id => forum_id
	*							),
	*						),
	*/
	protected function get_topic_auth(array $topic_ids)
	{
		$forum_auth = array('f_read' => array(), 'm_' => array());
		$topic_ids = array_unique($topic_ids);

		$sql = 'SELECT topic_id, forum_id
			FROM ' . TOPICS_TABLE . '
			WHERE ' . $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids));
		$result = $this->db->sql_query($sql);

		while ($row = $this->db->sql_fetchrow($result))
		{
			$row['topic_id'] = (int) $row['topic_id'];
			$row['forum_id'] = (int) $row['forum_id'];

			if ($this->auth->acl_get('f_read', $row['forum_id']))
			{
				$forum_auth['f_read'][$row['topic_id']] = $row['forum_id'];
			}

			if ($this->auth->acl_gets('a_', 'm_', $row['forum_id']))
			{
				$forum_auth['m_'][$row['topic_id']] = $row['forum_id'];
			}
		}
		$this->db->sql_freeresult($result);

		return $forum_auth;
	}
开发者ID:abhinay100,项目名称:phpbb2_app,代码行数:41,代码来源:log.php

示例9: make_forum_select2

    private function make_forum_select2($select_id = false, $ignore_id = false, $ignore_acl = false, $ignore_nonpost = false, $ignore_emptycat = true, $only_acl_post = false, $return_array = false)
    {
        $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, forum_flags, forum_options, left_id, right_id
			FROM ' . FORUMS_TABLE . '
			ORDER BY left_id ASC';
        $result = $this->db->sql_query($sql, 600);
        $right = 0;
        $padding_store = array('0' => '');
        $padding = '';
        $forum_list = $return_array ? array() : '';
        while ($row = $this->db->sql_fetchrow($result)) {
            if ($row['left_id'] < $right) {
                $padding .= '&nbsp; &nbsp;';
                $padding_store[$row['parent_id']] = $padding;
            } else {
                if ($row['left_id'] > $right + 1) {
                    $padding = isset($padding_store[$row['parent_id']]) ? $padding_store[$row['parent_id']] : '';
                }
            }
            $right = $row['right_id'];
            $disabled = false;
            if (!$ignore_acl && $this->auth->acl_get('f_list', $row['forum_id'])) {
                if ($only_acl_post && !$this->auth->acl_get('f_post', $row['forum_id']) || !$this->auth->acl_get('m_approve', $row['forum_id']) && !$this->auth->acl_get('f_noapprove', $row['forum_id'])) {
                    $disabled = true;
                } else {
                    if (!$only_acl_post && !$this->auth->acl_gets(array('f_list', 'a_forum', 'a_forumadd', 'a_forumdel'), $row['forum_id'])) {
                        $disabled = true;
                    }
                }
            } else {
                if (!$ignore_acl) {
                    continue;
                }
            }
            if (is_array($ignore_id) && in_array($row['forum_id'], $ignore_id) || $row['forum_id'] == $ignore_id || $row['forum_type'] == FORUM_CAT && $row['left_id'] + 1 == $row['right_id'] && $ignore_emptycat || $row['forum_type'] != FORUM_POST && $ignore_nonpost) {
                $disabled = true;
            }
            if ($return_array) {
                $selected = is_array($select_id) ? in_array($row['forum_id'], $select_id) ? true : false : ($row['forum_id'] == $select_id ? true : false);
                $forum_list[$row['forum_id']] = array_merge(array('padding' => $padding, 'selected' => $selected && !$disabled, 'disabled' => $disabled), $row);
            } else {
                $selected = is_array($select_id) ? in_array($row['forum_id'], $select_id) ? ' selected="selected"' : '' : ($row['forum_id'] == $select_id ? ' selected="selected"' : '');
                $forum_list .= '<option value="posting.php?mode=post&amp;f=' . $row['forum_id'] . '"' . ($disabled ? ' disabled="disabled" class="disabled-option"' : $selected) . '>' . $padding . $row['forum_name'] . '</option>';
            }
        }
        return $forum_list;
    }
开发者ID:phpbb-es,项目名称:New-Topic,代码行数:47,代码来源:listener.php

示例10: info

 public function info($user_id)
 {
     if (!$this->auth->acl_gets('u_viewprofile')) {
         trigger_error('NOT_AUTHORISED');
     }
     $sql_ary = array('SELECT' => 'u.username, u.user_colour, u.user_regdate, u.user_posts, u.user_lastvisit, u.user_rank, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height', 'FROM' => array(USERS_TABLE => 'u'), 'WHERE' => 'u.user_id = ' . (int) $user_id);
     /**
      * Modify SQL query in tas2580 AJAX userinfo extension
      *
      * @event tas2580.userinfo_modify_sql
      * @var    string		sql_ary	The SQL query
      * @var    int		user_id	The ID of the user
      * @since 0.2.3
      */
     $vars = array('sql_ary', 'user_id');
     extract($this->phpbb_dispatcher->trigger_event('tas2580.userinfo_modify_sql', compact($vars)));
     $result = $this->db->sql_query_limit($this->db->sql_build_query('SELECT', $sql_ary), 1);
     $this->data = $this->db->sql_fetchrow($result);
     $this->db->sql_freeresult($result);
     if (!function_exists('phpbb_get_user_rank')) {
         include $this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext;
     }
     $user_rank_data = phpbb_get_user_rank($this->data, $this->data['user_posts']);
     // Get the avatar
     // Wen need to use the full URL here because we don't know the path where userinfo is called
     define('PHPBB_USE_BOARD_URL_PATH', true);
     $avatar = phpbb_get_user_avatar($this->data);
     $avatar = empty($avatar) ? '<img src="' . generate_board_url() . '/styles/' . $this->user->style['style_name'] . '/theme/images/no_avatar.gif" width="100" height="100" alt="' . $this->user->lang('USER_AVATAR') . '">' : $avatar;
     $memberdays = max(1, round((time() - $this->data['user_regdate']) / 86400));
     $posts_per_day = $this->data['user_posts'] / $memberdays;
     $percentage = $this->config['num_posts'] ? min(100, $this->data['user_posts'] / $this->config['num_posts'] * 100) : 0;
     $result = array('userinfo_header' => sprintf($this->user->lang['VIEWING_PROFILE'], $this->data['username']), 'username' => get_username_string('no_profile', $user_id, $this->data['username'], $this->data['user_colour']), 'regdate' => $this->user->format_date($this->data['user_regdate']), 'posts' => $this->data['user_posts'], 'lastvisit' => $this->user->format_date($this->data['user_lastvisit']), 'avatar' => $avatar, 'rank' => empty($user_rank_data['title']) ? $this->user->lang('NA') : $user_rank_data['title'], 'postsperday' => $this->user->lang('POST_DAY', $posts_per_day), 'percentage' => $this->user->lang('POST_PCT', $percentage));
     /**
      * Modify return data in tas2580 AJAX userinfo extension
      *
      * @event tas2580.userinfo_modify_result
      * @var    array	result	The result array
      * @var    int	user_id	The ID of the user
      * @since 0.2.3
      */
     $vars = array('result', 'user_id');
     extract($this->phpbb_dispatcher->trigger_event('tas2580.userinfo_modify_result', compact($vars)));
     return new JsonResponse($result);
 }
开发者ID:Crizz0,项目名称:userinfo,代码行数:44,代码来源:user.php

示例11: main

    public function main()
    {
        $topic_id = $this->request->variable('tid', 0);
        $forum_id = $this->request->variable('fid', 0);
        $topic_status = $this->request->variable('topic_status', 0);
        $action = $topic_status ? 0 : 1;
        $url = append_sid("{$this->phpbb_root_path}viewtopic." . $this->php_ext . "", "f={$forum_id}&amp;t={$topic_id}");
        if ($this->auth->acl_gets('f_topicmod', $forum_id) || $this->auth->acl_gets('m_edit', $forum_id)) {
            $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_status = ' . $action . '
				WHERE topic_id = ' . $topic_id . '';
            $this->db->sql_query($sql);
            $message = $topic_status ? $this->user->lang['OPEN_SUCCESS'] : $this->user->lang['CLOSE_SUCCESS'];
        } else {
            $message = $this->user->lang['CANNOT_MANAGE_TOPIC'];
        }
        $message .= '<br /><br />' . sprintf($this->user->lang['RETURN_PAGE'], '<a href="' . $url . '">', '</a> ');
        meta_refresh(3, $url);
        trigger_error($message);
        return new Response('', 200);
    }
开发者ID:AlexSheer,项目名称:phpbb3.1-Topic-Moderator,代码行数:20,代码来源:topicmod.php

示例12: userdetails

    /**
     * User details controller
     *
     * @param int $uid			User ID taken from the URL
     * @param string $sort_key	Sort key: id|username|time|point|action (default: id)
     * @param string $sort_dir	Sort direction: dsc|asc (descending|ascending) (default: dsc)
     * @return Symfony\Component\HttpFoundation\Response A Symfony Response object
     * @access public
     */
    public function userdetails($uid, $sort_key, $sort_dir)
    {
        $this->user->add_lang_ext('pico/reputation', array('reputation_system', 'reputation_rating'));
        $is_ajax = $this->request->is_ajax();
        $referer = $this->symfony_request->get('_referer');
        if (empty($this->config['rs_enable'])) {
            if ($is_ajax) {
                $json_response = new \phpbb\json_response();
                $json_data = array('error_msg' => $this->user->lang('RS_DISABLED'));
                $json_response->send($json_data);
            }
            redirect(append_sid("{$this->root_path}index.{$this->php_ext}"));
        }
        $sql = 'SELECT user_id, username, user_colour
			FROM ' . USERS_TABLE . '
			WHERE user_type <> 2
				AND user_id =' . (int) $uid;
        $result = $this->db->sql_query($sql);
        $user_row = $this->db->sql_fetchrow($result);
        $this->db->sql_freeresult($result);
        if (empty($user_row)) {
            $message = $this->user->lang('RS_NO_USER_ID');
            $json_data = array('error_msg' => $message);
            $redirect = append_sid("{$this->root_path}index.{$this->php_ext}");
            $redirect_text = 'RETURN_INDEX';
            $this->reputation_manager->response($message, $json_data, $redirect, $redirect_text, $is_ajax);
        }
        if (!$this->auth->acl_get('u_rs_view')) {
            $message = $this->user->lang('RS_VIEW_DISALLOWED');
            $json_data = array('error_msg' => $message);
            $redirect = append_sid("memberlist.{$this->php_ext}", 'mode=viewprofile&amp;u=' . $uid);
            $redirect_text = 'RETURN_PAGE';
            $this->reputation_manager->response($message, $json_data, $redirect, $redirect_text, $is_ajax);
        }
        $sort_key_sql = array('username' => 'u.username_clean', 'time' => 'r.reputation_time', 'point' => 'r.reputation_points', 'action' => 'rt.reputation_type_name', 'id' => 'r.reputation_id');
        // Sql order depends on sort key
        $order_by = $sort_key_sql[$sort_key] . ' ' . ($sort_dir == 'dsc' ? 'DESC' : 'ASC');
        $reputation_type_id = (int) $this->reputation_manager->get_reputation_type_id('post');
        $sql_array = array('SELECT' => 'r.*, rt.reputation_type_name, u.username, u.user_colour, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, p.post_id, p.forum_id, p.post_subject', 'FROM' => array($this->reputations_table => 'r', $this->reputation_types_table => 'rt'), 'LEFT_JOIN' => array(array('FROM' => array(USERS_TABLE => 'u'), 'ON' => 'u.user_id = r.user_id_from'), array('FROM' => array(POSTS_TABLE => 'p'), 'ON' => 'p.post_id = r.reputation_item_id
						AND r.reputation_type_id = ' . $reputation_type_id)), 'WHERE' => 'r.user_id_to = ' . $uid . '
				AND r.reputation_type_id = rt.reputation_type_id', 'ORDER_BY' => $order_by);
        $sql = $this->db->sql_build_query('SELECT', $sql_array);
        $result = $this->db->sql_query($sql);
        while ($row = $this->db->sql_fetchrow($result)) {
            $this->template->assign_block_vars('reputation', array('ID' => $row['reputation_id'], 'USERNAME' => get_username_string('full', $row['user_id_from'], $row['username'], $row['user_colour']), 'ACTION' => $this->user->lang('RS_' . strtoupper($row['reputation_type_name']) . '_RATING'), 'AVATAR' => phpbb_get_user_avatar($row), 'TIME' => $this->user->format_date($row['reputation_time']), 'COMMENT' => $row['reputation_comment'], 'POINTS' => $row['reputation_points'], 'POINTS_CLASS' => $this->reputation_helper->reputation_class($row['reputation_points']), 'POINTS_TITLE' => $this->user->lang('RS_POINTS_TITLE', $row['reputation_points']), 'U_DELETE' => $this->helper->route('reputation_delete_controller', array('rid' => $row['reputation_id'])), 'S_COMMENT' => !empty($row['reputation_comment']), 'S_DELETE' => $this->auth->acl_get('m_rs_moderate') || $row['user_id_from'] == $this->user->data['user_id'] && $this->auth->acl_get('u_rs_delete') ? true : false));
            // Generate post url
            $this->reputation_manager->generate_post_link($row);
        }
        $this->db->sql_freeresult($result);
        $this->template->assign_vars(array('USER_ID' => $uid, 'U_USER_DETAILS' => $this->helper->route('reputation_details_controller', array('uid' => $uid)), 'U_SORT_USERNAME' => $this->helper->route('reputation_user_details_controller', array('uid' => $uid, 'sort_key' => 'username', 'sort_dir' => $sort_key == 'username' && $sort_dir == 'asc' ? 'dsc' : 'asc')), 'U_SORT_TIME' => $this->helper->route('reputation_user_details_controller', array('uid' => $uid, 'sort_key' => 'time', 'sort_dir' => $sort_key == 'time' && $sort_dir == 'asc' ? 'dsc' : 'asc')), 'U_SORT_POINT' => $this->helper->route('reputation_user_details_controller', array('uid' => $uid, 'sort_key' => 'point', 'sort_dir' => $sort_key == 'point' && $sort_dir == 'asc' ? 'dsc' : 'asc')), 'U_SORT_ACTION' => $this->helper->route('reputation_user_details_controller', array('uid' => $uid, 'sort_key' => 'action', 'sort_dir' => $sort_key == 'action' && $sort_dir == 'asc' ? 'dsc' : 'asc')), 'U_CLEAR' => $this->helper->route('reputation_clear_user_controller', array('uid' => $uid)), 'U_REPUTATION_REFERER' => $referer, 'L_RS_USER_REPUTATION' => $this->user->lang('RS_USER_REPUTATION', get_username_string('username', $user_row['user_id'], $user_row['username'], $user_row['user_colour'])), 'S_RS_AVATAR' => $this->config['rs_display_avatar'] ? true : false, 'S_RS_COMMENT' => $this->config['rs_enable_comment'] ? true : false, 'S_RS_POINTS_IMG' => $this->config['rs_point_type'] ? true : false, 'S_CLEAR' => $this->auth->acl_gets('m_rs_moderate') ? true : false, 'S_IS_AJAX' => $is_ajax ? true : false));
        return $this->helper->render('userdetails.html');
    }
开发者ID:rampmaster,项目名称:phpBB-Reputation-System,代码行数:61,代码来源:details_controller.php

示例13: get_navigation_options

 /**
  * Get navigation tab options.
  *
  * @return array
  */
 protected function get_navigation_options()
 {
     /**
      * Menu Array
      *
      * 'filename' => array(
      *	'title'		=> 'nav menu title',
      * 	'url'		=> $page_url,
      *	'auth'		=> ($can_see_page) ? true : false, // Not required, always true if missing
      * ),
      */
     return array('attention' => array('title' => 'ATTENTION', 'url' => $this->helper->route('phpbb.titania.manage.attention'), 'auth' => $this->auth->acl_gets('u_titania_mod_author_mod', 'u_titania_mod_contrib_mod', 'u_titania_mod_faq_mod', 'u_titania_mod_post_mod') || $this->types->find_authed('moderate'), 'count' => $this->get_open_attention_count()), 'queue' => array('title' => 'VALIDATION_QUEUE', 'url' => $this->helper->route('phpbb.titania.queue'), 'auth' => $this->types->find_authed('view') && $this->ext_config->use_queue), 'queue_discussion' => array('title' => 'QUEUE_DISCUSSION', 'url' => $this->helper->route('phpbb.titania.queue_discussion'), 'auth' => $this->types->find_authed('queue_discussion') && $this->ext_config->use_queue), 'administration' => array('title' => 'ADMINISTRATION', 'url' => $this->helper->route('phpbb.titania.administration'), 'auth' => $this->auth->acl_get('u_titania_admin'), 'match' => array('categories')), 'categories' => array('title' => 'MANAGE_CATEGORIES', 'url' => $this->helper->route('phpbb.titania.manage.categories'), 'auth' => $this->auth->acl_get('u_titania_admin'), 'display' => false));
 }
开发者ID:Sajaki,项目名称:customisation-db,代码行数:18,代码来源:base.php

示例14: viewtopic_modify_post_row

 /**
  * Modify the viewtopic post row
  *
  * @param object $event The event object
  * @return null
  * @access public
  */
 public function viewtopic_modify_post_row($event)
 {
     $users_groups = $this->cache->get('_user_groups');
     $user_id = $event['user_poster_data']['user_id'];
     if (!empty($users_groups[$user_id])) {
         $user_in_groups = '<ul>';
         foreach ($users_groups[$user_id] as $key => $value) {
             if ($value['group_type'] == GROUP_HIDDEN && (!$this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') || $user_id != (int) $this->user->data['user_id'])) {
                 continue;
             }
             $group_name = isset($this->user->lang['G_' . $value['group_name']]) ? $this->user->lang['G_' . $value['group_name']] : $value['group_name'];
             $group_link = append_sid("{$this->root_path}memberlist.{$this->php_ext}", 'mode=group&amp;g=' . $value['group_id']);
             $group_colour = !empty($value['group_colour']) ? 'style="color:#' . $value['group_colour'] . ';"' : '';
             $user_in_groups .= '<li><a href=' . $group_link . ' ' . $group_colour . '>' . $group_name . '</a></li>';
         }
         $user_in_groups .= '</ul>';
         $event['post_row'] = array_merge($event['post_row'], array('POSTER_GROUP' => $user_in_groups));
     }
 }
开发者ID:steevo,项目名称:Groups-in-viewtopic,代码行数:26,代码来源:listener.php

示例15: assign_messages

 /**
  * Assigns all message rows to the template
  *
  * @param $rows array
  */
 protected function assign_messages($rows)
 {
     if (empty($rows)) {
         return;
     }
     // Reverse the array if messages appear at the bottom
     if (!$this->config['mchat_message_top']) {
         $rows = array_reverse($rows);
     }
     $foes = $this->functions_mchat->mchat_foes();
     $this->template->destroy_block_vars('mchatrow');
     $user_avatars = array();
     foreach ($rows as $i => $row) {
         if (!isset($user_avatars[$row['user_id']])) {
             $display_avatar = $this->display_avatars() && $row['user_avatar'];
             $user_avatars[$row['user_id']] = !$display_avatar ? '' : phpbb_get_user_avatar(array('avatar' => $row['user_avatar'], 'avatar_type' => $row['user_avatar_type'], 'avatar_width' => $row['user_avatar_width'] > $row['user_avatar_height'] ? 40 : 40 / $row['user_avatar_height'] * $row['user_avatar_width'], 'avatar_height' => $row['user_avatar_height'] > $row['user_avatar_width'] ? 40 : 40 / $row['user_avatar_width'] * $row['user_avatar_height']));
         }
     }
     foreach ($rows as $i => $row) {
         // Auth checks
         if ($row['forum_id'] != 0 && !$this->auth->acl_get('f_read', $row['forum_id'])) {
             continue;
         }
         $message_edit = $row['message'];
         decode_message($message_edit, $row['bbcode_uid']);
         $message_edit = str_replace('"', '&quot;', $message_edit);
         $message_edit = mb_ereg_replace("'", '&#146;', $message_edit);
         if (in_array($row['user_id'], $foes)) {
             $row['message'] = sprintf($this->user->lang('MCHAT_FOE'), get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')));
         }
         $row['username'] = mb_ereg_replace("'", "&#146;", $row['username']);
         $message = str_replace("'", '&rsquo;', $row['message']);
         $username_full = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST'));
         // Remove root path if we render messages for the index page
         if (strpos($this->user->data['session_page'], 'app.' . $this->php_ext) === false) {
             $username_full = str_replace('.' . $this->root_path, '', $username_full);
         }
         $this->template->assign_block_vars('mchatrow', array('S_ROW_COUNT' => $i, 'MCHAT_ALLOW_BAN' => $this->auth->acl_get('a_authusers'), 'MCHAT_ALLOW_EDIT' => $this->auth_message('u_mchat_edit', $row['user_id'], $row['message_time']), 'MCHAT_ALLOW_DEL' => $this->auth_message('u_mchat_delete', $row['user_id'], $row['message_time']), 'MCHAT_USER_AVATAR' => $user_avatars[$row['user_id']], 'U_VIEWPROFILE' => $row['user_id'] != ANONYMOUS ? generate_board_url() . append_sid("/{$this->root_path}memberlist.{$this->php_ext}", 'mode=viewprofile&amp;u=' . $row['user_id']) : '', 'MCHAT_IS_POSTER' => $row['user_id'] != ANONYMOUS && $this->user->data['user_id'] == $row['user_id'], 'MCHAT_PM' => $row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id'] && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_')) ? generate_board_url() . append_sid("/{$this->root_path}ucp.{$this->php_ext}", 'i=pm&amp;mode=compose&amp;u=' . $row['user_id']) : '', 'MCHAT_MESSAGE_EDIT' => $message_edit, 'MCHAT_MESSAGE_ID' => $row['message_id'], 'MCHAT_USERNAME_FULL' => $username_full, 'MCHAT_USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')), 'MCHAT_USERNAME_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')), 'MCHAT_USER_IP' => $row['user_ip'], 'MCHAT_U_IP' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'whois', 'ip' => $row['user_ip'])), 'MCHAT_U_BAN' => generate_board_url() . append_sid("/{$this->root_path}adm/index.{$this->php_ext}", 'i=permissions&amp;mode=setting_user_global&amp;user_id[0]=' . $row['user_id'], true, $this->user->session_id), 'MCHAT_MESSAGE' => censor_text(generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options'])), 'MCHAT_TIME' => $this->user->format_date($row['message_time'], $this->config['mchat_date']), 'MCHAT_MESSAGE_TIME' => $row['message_time'], 'MCHAT_EDIT_TIME' => $row['edit_time']));
     }
 }
开发者ID:EntropyRy,项目名称:mChat-Extension,代码行数:45,代码来源:mchat.php


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