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

PHP get_username_string函数代码示例

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

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



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

示例1: get_bookmarks

    public function get_bookmarks($ext_mode = '', $forums = array())
    {
        define('POSTS_BOOKMARKS_TABLE', $this->table_prefix . 'posts_bookmarks');
        $start = $this->request->variable('start', 0);
        $sql = 'SELECT COUNT(post_id) as posts_count
			FROM ' . POSTS_BOOKMARKS_TABLE . '
			WHERE user_id = ' . $this->user->data['user_id'];
        $result = $this->db->sql_query($sql);
        $posts_count = (int) $this->db->sql_fetchfield('posts_count');
        $this->db->sql_freeresult($result);
        $sql_where = $sql_fields = '';
        if ($ext_mode != 'find') {
            $sql_where = 'LEFT JOIN ' . USERS_TABLE . ' u ON (p.poster_id = u.user_id)';
            $sql_fields = ', p.post_time, u.user_id, u.username, u.user_colour';
        }
        $pagination_url = append_sid("{$this->phpbb_root_path}postbookmark", "mode=find");
        $this->pagination->generate_template_pagination($pagination_url, 'pagination', 'start', $posts_count, $this->config['topics_per_page'], $start);
        $sql = 'SELECT b.post_id AS b_post_id, b.user_id, b.bookmark_time, b.bookmark_desc, p.post_id, p.forum_id, p.topic_id, p.poster_id, p.post_subject, t.topic_title ' . $sql_fields . '
			FROM ' . POSTS_BOOKMARKS_TABLE . ' b
			LEFT JOIN ' . POSTS_TABLE . ' p ON( b.post_id = p.post_id)
			LEFT JOIN ' . TOPICS_TABLE . ' t ON( t.topic_id = p.topic_id)
			' . $sql_where . '
			WHERE b.user_id = ' . $this->user->data['user_id'] . '
			ORDER BY b.bookmark_time ASC';
        $result = $this->db->sql_query_limit($sql, $this->config['topics_per_page'], $start);
        while ($row = $this->db->sql_fetchrow($result)) {
            $topic_author = $sql_where ? get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) : '';
            $post_time = $sql_where ? $this->user->format_date($row['post_time']) : '';
            // Send vars to template
            $this->template->assign_block_vars('postrow', array('POST_ID' => $row['b_post_id'], 'POST_TIME' => $post_time, 'BOOKMARK_TIME' => $this->user->format_date($row['bookmark_time']), 'BOOKMARK_DESC' => $row['bookmark_desc'], 'TOPIC_AUTHOR' => $topic_author, 'POST_TITLE' => $row['post_subject'] ? $row['post_subject'] : $row['topic_title'], 'U_VIEW_POST' => append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", "p=" . $row['post_id'] . "#p" . $row['post_id'] . ""), 'S_DELETED_TOPIC' => !$row['topic_id'] ? true : false, 'S_DELETED_POST' => !$row['post_id'] ? true : false, 'U_POST_BOOKMARK' => '[url=' . generate_board_url() . '/viewtopic.' . $this->php_ext . '?p=' . $row['post_id'] . '#p' . $row['post_id'] . ']' . ($row['post_subject'] ? $row['post_subject'] : $row['topic_title']) . '[/url]'));
        }
        $this->db->sql_freeresult($result);
        $this->template->assign_vars(array('TOTAL_BOOKMARKS' => $this->user->lang('TOTAL_BOOKMARKS', (int) $posts_count), 'PAGE_NUMBER' => $this->pagination->on_page($posts_count, $this->config['topics_per_page'], $start)));
    }
开发者ID:AlexSheer,项目名称:phpbb3.1-PostBookmark,代码行数:34,代码来源:helper.php


示例2: assign_block

 /**
  * Assigns an image with all data to the defined template-block
  *
  * @param string	$template_block	Name of the template-block
  * @param array	$image_data		Array with the image-data, all columns of GALLERY_IMAGES_TABLE are needed. album_name may be additionally assigned
  */
 public static function assign_block($template_block, &$image_data, $album_status, $display = 126, $album_user_id = -1)
 {
     global $auth, $template, $user;
     static $lang_loaded;
     if (!$lang_loaded) {
         $user->add_lang('mods/gallery_mcp');
         $lang_loaded = true;
     }
     $st = request_var('st', 0);
     $sk = request_var('sk', phpbb_gallery_config::get('default_sort_key'));
     $sd = request_var('sd', phpbb_gallery_config::get('default_sort_dir'));
     $image_data['rating'] = $user->lang['NOT_RATED'];
     if ($image_data['image_rates']) {
         $image_data['rating'] = sprintf($image_data['image_rates'] == 1 ? $user->lang['RATE_STRING'] : $user->lang['RATES_STRING'], $image_data['image_rate_avg'] / 100, $image_data['image_rates']);
     }
     // Hide the result, while still rating on contests
     if ($image_data['image_contest']) {
         $image_data['rating'] = $user->lang['CONTEST_RATING_HIDDEN'];
     }
     $s_user_allowed = $image_data['image_user_id'] == $user->data['user_id'] && $album_status != phpbb_gallery_album::STATUS_LOCKED;
     $s_allowed_delete = phpbb_gallery::$auth->acl_check('i_delete', $image_data['image_album_id'], $album_user_id) && $s_user_allowed || phpbb_gallery::$auth->acl_check('m_delete', $image_data['image_album_id'], $album_user_id);
     $s_allowed_edit = phpbb_gallery::$auth->acl_check('i_edit', $image_data['image_album_id'], $album_user_id) && $s_user_allowed || phpbb_gallery::$auth->acl_check('m_edit', $image_data['image_album_id'], $album_user_id);
     $s_quick_mod = $s_allowed_delete || $s_allowed_edit || phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) || phpbb_gallery::$auth->acl_check('m_move', $image_data['image_album_id'], $album_user_id);
     $template->assign_block_vars($template_block, array('IMAGE_ID' => $image_data['image_id'], 'UC_IMAGE_NAME' => $display & phpbb_gallery_block::DISPLAY_IMAGENAME ? self::generate_link('image_name', phpbb_gallery_config::get('link_image_name'), $image_data['image_id'], $image_data['image_name'], $image_data['image_album_id'], false, true, "&sk={$sk}&sd={$sd}&st={$st}") : '', 'UC_THUMBNAIL' => self::generate_link('thumbnail', phpbb_gallery_config::get('link_thumbnail'), $image_data['image_id'], $image_data['image_name'], $image_data['image_album_id']), 'U_ALBUM' => $display & phpbb_gallery_block::DISPLAY_ALBUMNAME ? phpbb_gallery_url::append_sid('album', 'album_id=' . $image_data['image_album_id']) : '', 'S_UNAPPROVED' => phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) && $image_data['image_status'] == self::STATUS_UNAPPROVED ? true : false, 'S_LOCKED' => $image_data['image_status'] == self::STATUS_LOCKED ? true : false, 'S_REPORTED' => phpbb_gallery::$auth->acl_check('m_report', $image_data['image_album_id'], $album_user_id) && $image_data['image_reported'] ? true : false, 'ALBUM_NAME' => $display & phpbb_gallery_block::DISPLAY_ALBUMNAME ? isset($image_data['album_name']) ? utf8_strlen(htmlspecialchars_decode($image_data['album_name'])) > phpbb_gallery_config::get('shortnames') + 3 ? htmlspecialchars(utf8_substr(htmlspecialchars_decode($image_data['album_name']), 0, phpbb_gallery_config::get('shortnames')) . '...') : $image_data['album_name'] : '' : '', 'ALBUM_NAME_FULL' => $display & phpbb_gallery_block::DISPLAY_ALBUMNAME ? isset($image_data['album_name']) ? $image_data['album_name'] : '' : '', 'POSTER' => $display & phpbb_gallery_block::DISPLAY_USERNAME ? $image_data['image_contest'] && !phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) ? $user->lang['CONTEST_USERNAME'] : get_username_string('full', $image_data['image_user_id'], $image_data['image_username'], $image_data['image_user_colour']) : '', 'TIME' => $display & phpbb_gallery_block::DISPLAY_IMAGETIME ? $user->format_date($image_data['image_time']) : '', 'VIEW' => $display & phpbb_gallery_block::DISPLAY_IMAGEVIEWS ? $image_data['image_view_count'] : -1, 'CONTEST_RANK' => $image_data['image_contest_rank'] ? $user->lang['CONTEST_RESULT_' . $image_data['image_contest_rank']] : '', 'CONTEST_RANK_ID' => $image_data['image_contest_rank'], 'S_RATINGS' => $display & phpbb_gallery_block::DISPLAY_RATINGS ? phpbb_gallery_config::get('allow_rates') && phpbb_gallery::$auth->acl_check('i_rate', $image_data['image_album_id'], $album_user_id) ? $image_data['rating'] : '' : '', 'U_RATINGS' => phpbb_gallery_url::append_sid('image_page', 'album_id=' . $image_data['image_album_id'] . "&image_id=" . $image_data['image_id']) . '#rating', 'L_COMMENTS' => $image_data['image_comments'] == 1 ? $user->lang['COMMENT'] : $user->lang['COMMENTS'], 'S_COMMENTS' => $display & phpbb_gallery_block::DISPLAY_COMMENTS ? phpbb_gallery_config::get('allow_comments') && phpbb_gallery::$auth->acl_check('c_read', $image_data['image_album_id'], $album_user_id) ? $image_data['image_comments'] ? $image_data['image_comments'] : $user->lang['NO_COMMENTS'] : '' : '', 'U_COMMENTS' => phpbb_gallery_url::append_sid('image_page', 'album_id=' . $image_data['image_album_id'] . "&image_id=" . $image_data['image_id']) . '#comments', 'S_MOD_ACTION' => phpbb_gallery_url::append_sid('mcp', "album_id={$image_data['image_album_id']}&image_id={$image_data['image_id']}&quickmod=1", true, $user->session_id), 'S_QUICK_MOD' => $s_quick_mod, 'S_QM_MOVE' => phpbb_gallery::$auth->acl_check('m_move', $image_data['image_album_id'], $album_user_id), 'S_QM_EDIT' => $s_allowed_edit, 'S_QM_DELETE' => $s_allowed_delete, 'S_QM_REPORT' => phpbb_gallery::$auth->acl_check('m_report', $image_data['image_album_id'], $album_user_id), 'S_QM_STATUS' => phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id), 'S_IMAGE_REPORTED' => $image_data['image_reported'], 'U_IMAGE_REPORTED' => $image_data['image_reported'] ? phpbb_gallery_url::append_sid('mcp', "mode=report_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_reported']) : '', 'S_STATUS_APPROVED' => $image_data['image_status'] == phpbb_gallery_image::STATUS_APPROVED, 'S_STATUS_UNAPPROVED' => $image_data['image_status'] == phpbb_gallery_image::STATUS_UNAPPROVED, 'S_STATUS_LOCKED' => $image_data['image_status'] == phpbb_gallery_image::STATUS_LOCKED, 'S_IP' => $display & phpbb_gallery_block::DISPLAY_IP && $auth->acl_get('a_') ? $image_data['image_user_ip'] : '', 'U_WHOIS' => phpbb_gallery_url::append_sid('mcp', 'mode=whois&ip=' . $image_data['image_user_ip']), 'U_REPORT' => phpbb_gallery::$auth->acl_check('m_report', $image_data['image_album_id'], $album_user_id) && $image_data['image_reported'] ? phpbb_gallery_url::append_sid('mcp', "mode=report_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_reported']) : '', 'U_STATUS' => phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) ? phpbb_gallery_url::append_sid('mcp', "mode=queue_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_id']) : '', 'L_STATUS' => $image_data['image_status'] == self::STATUS_UNAPPROVED ? $user->lang['APPROVE_IMAGE'] : ($image_data['image_status'] == self::STATUS_APPROVED ? $user->lang['CHANGE_IMAGE_STATUS'] : $user->lang['UNLOCK_IMAGE']), 'U_MOVE' => phpbb_gallery::$auth->acl_check('m_move', $image_data['image_album_id'], $album_user_id) ? phpbb_gallery_url::append_sid('mcp', "action=images_move&album_id={$image_data['image_album_id']}&image_id=" . $image_data['image_id'] . "&redirect=redirect") : '', 'U_EDIT' => $s_allowed_edit ? phpbb_gallery_url::append_sid('posting', "mode=image&submode=edit&album_id={$image_data['image_album_id']}&image_id=" . $image_data['image_id']) : '', 'U_DELETE' => $s_allowed_delete ? phpbb_gallery_url::append_sid('posting', "mode=image&submode=delete&album_id={$image_data['image_album_id']}&image_id=" . $image_data['image_id']) : ''));
 }
开发者ID:phpbbgallery,项目名称:phpbb-gallery,代码行数:31,代码来源:image.php


示例3: display

    /**
     * Display the user ranks page
     *
     * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
     * @access public
     */
    public function display($name)
    {
        // Get the rank details
        $sql = 'SELECT *
			FROM ' . RANKS_TABLE . '
			ORDER BY rank_special DESC, rank_min ASC, rank_title ASC';
        $result = $this->db->sql_query($sql);
        while ($row = $this->db->sql_fetchrow($result)) {
            if ($this->config['userranks_special'] || $this->config['userranks_special_admin'] && $this->auth->acl_get('a_') || !$this->config['userranks_special'] && !$row['rank_special']) {
                $rank_row = array('S_RANK_IMAGE' => $row['rank_image'] ? true : false, 'S_SPECIAL_RANK' => $row['rank_special'] ? true : false, 'RANK_IMAGE' => $this->path_helper->get_web_root_path() . $this->config['ranks_path'] . '/' . $row['rank_image'], 'RANK_TITLE' => $row['rank_title'], 'MIN_POSTS' => $row['rank_min']);
                $this->template->assign_block_vars('ranks', $rank_row);
                // Are we displaying members?
                if ($this->config['userranks_members'] || $this->config['userranks_members_admin'] && $this->auth->acl_get('a_')) {
                    $rank_users = $this->get_user_rank_data($row['rank_id']);
                    if (sizeof($rank_users) > 0) {
                        foreach ($rank_users as $row_rank) {
                            $this->template->assign_block_vars('ranks.rank_member', array('MEMBERS' => get_username_string('full', $row_rank['user_id'], $row_rank['username'], $row_rank['user_colour'])));
                        }
                    } else {
                        $this->template->assign_block_vars('ranks.rank_member', array('MEMBERS' => $this->user->lang('NO_MEMBERS')));
                    }
                }
            }
        }
        $this->db->sql_freeresult($result);
        // Assign breadcrumb template vars for the user ranks page
        $this->template->assign_block_vars('navlinks', array('U_VIEW_FORUM' => $this->helper->route('david63_userranks_main_controller', array('name' => 'ranks')), 'FORUM_NAME' => $this->user->lang('USER_RANKS')));
        // Send all data to the template file
        return $this->helper->render('user_ranks.html', $name);
    }
开发者ID:Galixte,项目名称:david63-userranks,代码行数:36,代码来源:main_controller.php


示例4: create_welcome_topic

    public function create_welcome_topic($user_id)
    {
        if (!$this->config['welcomerobot_enable']) {
            return false;
        }
        if (!function_exists('get_username_string')) {
            include $this->root_path . 'includes/functions_content.' . $this->phpEx;
        }
        if (!function_exists('submit_post')) {
            include $this->root_path . 'includes/functions_posting.' . $this->phpEx;
        }
        $sql = 'SELECT *
			FROM ' . USERS_TABLE . "\n\t\t\tWHERE user_id = " . intval($user_id) . "";
        $dbresult = $this->db->sql_query($sql);
        $row = $this->db->sql_fetchrow($dbresult);
        $this->db->sql_freeresult($dbresult);
        if (empty($row)) {
            return false;
        }
        $username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
        $clean_username = utf8_clean_string($row['username']);
        $topic_title = str_replace(array('%user', '%robot', '%board'), array($clean_username, $this->config['welcomerobot_username'], $this->config['sitename']), $this->config['welcomerobot_title']);
        $topic_content = str_replace(array('%user', '%robot', '%board'), array($clean_username, $this->config['welcomerobot_username'], $this->config['sitename']), $this->config['welcomerobot_detail']);
        $poll = $uid = $bitfield = $options = '';
        // will be modified by generate_text_for_storage
        $allow_bbcode = $allow_urls = $allow_smilies = true;
        generate_text_for_storage($topic_content, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);
        $data = array('forum_id' => $this->config['welcomerobot_forum'], 'topic_id' => 0, 'icon_id' => false, 'robot_name' => $this->config['welcomerobot_username'], 'enable_bbcode' => true, 'enable_smilies' => true, 'enable_urls' => true, 'enable_sig' => true, 'message' => $topic_content, 'message_md5' => md5($topic_content), 'bbcode_bitfield' => $bitfield, 'bbcode_uid' => $uid, 'post_edit_locked' => 0, 'topic_title' => $topic_title, 'notify_set' => false, 'notify' => false, 'post_time' => 0, 'forum_name' => '', 'enable_indexing' => true, 'force_approved_state' => true);
        submit_post('post', $topic_title, 'robot_name', POST_NORMAL, $poll, $data);
        return true;
    }
开发者ID:Elias64,项目名称:autoPost,代码行数:31,代码来源:listener.php


示例5: get_template_side

	public function get_template_side($module_id)
	{
		global $config, $db, $template;
		global $phpbb_root_path, $phpEx;

		$sql = 'SELECT user_id, username, user_posts, user_colour
			FROM ' . USERS_TABLE . '
			WHERE user_type <> ' . USER_IGNORE . "
				AND user_posts <> 0
				AND username <> ''
			ORDER BY user_posts DESC";
		$result = $db->sql_query_limit($sql, $config['board3_topposters_' . $module_id]);

		while (($row = $db->sql_fetchrow($result)))
		{
			$template->assign_block_vars('topposters', array(
				'S_SEARCH_ACTION'	=> append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $row['user_id'] . '&amp;sr=posts'),
				'USERNAME_FULL'		=> get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
				'POSTER_POSTS'		=> $row['user_posts'],
			));
		}
		$db->sql_freeresult($result);

		return 'topposters_side.html';
	}
开发者ID:gonzo1247,项目名称:hitman_roa,代码行数:25,代码来源:portal_topposters.php


示例6: get_template_side

	public function get_template_side($module_id)
	{
		global $config, $template, $db, $user;

		// Last x visited bots
		$sql = 'SELECT username, user_colour, user_lastvisit
			FROM ' . USERS_TABLE . '
			WHERE user_type = ' . USER_IGNORE . '
			AND user_lastvisit > 0
			ORDER BY user_lastvisit DESC';
		$result = $db->sql_query_limit($sql, $config['board3_last_visited_bots_number_' . $module_id]);

		$show_module = false;

		while ($row = $db->sql_fetchrow($result))
		{
			$template->assign_block_vars('last_visited_bots', array(
				'BOT_NAME'			=> get_username_string('full', '', $row['username'], $row['user_colour']),
				'LAST_VISIT_DATE'	=> $user->format_date($row['user_lastvisit']),
			));
			$show_module = true;
		}
		$db->sql_freeresult($result);

		if($show_module)
		{
			return 'latest_bots_side.html';
		}
	}
开发者ID:gonzo1247,项目名称:hitman_roa,代码行数:29,代码来源:portal_latest_bots.php


示例7: friends_function_generate_menu

function friends_function_generate_menu(&$arg)
{
    global $auth, $cache, $config, $db, $user, $template, $phpbb_root_path;
    global $user_id, $blog_template, $blog_images_path;
    $limit = 4;
    $template->assign_vars(array('ZEBRA_LIST_LIMIT' => $limit, 'IMG_PORTAL_MEMBER' => $blog_images_path . 'icon_friend.gif', 'S_CONTENT_FLOW_BEGIN' => $user->lang['DIRECTION'] == 'ltr' ? 'left' : 'right', 'S_CONTENT_FLOW_END' => $user->lang['DIRECTION'] == 'ltr' ? 'right' : 'left'));
    if ($user_id == ANONYMOUS || $user->data['is_bot']) {
        return;
    }
    // Output listing of friends online
    $menu_friends_online = $menu_friends_offline = $user_friends = 0;
    $update_time = time() - intval($config['load_online_time']) * 60;
    // lets use the cache...as this query is quite intensive
    $cache_data = false;
    //$cache->get("_zebra{$user_id}");
    if ($cache_data === false) {
        $sql = $db->sql_build_query('SELECT_DISTINCT', array('SELECT' => 'u.user_id, u.username, u.username_clean, u.user_colour, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline', 'FROM' => array(USERS_TABLE => 'u', ZEBRA_TABLE => 'z'), 'LEFT_JOIN' => array(array('FROM' => array(SESSIONS_TABLE => 's'), 'ON' => 's.session_user_id = z.zebra_id')), 'WHERE' => 'z.user_id = ' . intval($user_id) . '
				AND z.friend = 1
				AND u.user_id = z.zebra_id', 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username_clean, u.user_colour, u.username', 'ORDER_BY' => 'u.username_clean ASC'));
        $result = $db->sql_query($sql);
        $rowset = $db->sql_fetchrowset($result);
        $db->sql_freeresult($result);
        //$cache->put("_zebra{$user_id}", $rowset, 60); // cache for 1 minute
        $cache_data = $rowset;
    }
    foreach ($cache_data as $row) {
        $which = $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline')) ? 'menu_friends_online' : 'menu_friends_offline';
        ${$which}++;
        $template->assign_block_vars("{$which}", array('USER_ID' => $row['user_id'], 'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), 'U_VIEW_BLOG' => blog_url($row['user_id']), 'USER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), 'HIDE' => true));
    }
    $template->assign_vars(array('S_SHOW_NEXT_ONLINE' => $menu_friends_online > $limit ? true : false, 'S_SHOW_NEXT_OFFLINE' => $menu_friends_offline > $limit ? true : false, 'S_MENU_ZEBRA_ENABLED' => $menu_friends_online || $menu_friends_offline ? true : false));
    $arg['user_menu_extra'] .= blog_plugins::parse_template('blog/plugins/friends/friends_body.html');
}
开发者ID:EXreaction,项目名称:User-Blog-Mod,代码行数:33,代码来源:functions.php


示例8: modify_replies

    /**
     * Changes the regex replacement for second pass
     *
     * @param object $event
     * @return null
     * @access public
     */
    public function modify_replies($event)
    {
        if (!function_exists('get_username_string')) {
            include $this->root_path . 'includes/functions_content.' . $this->php_ext;
        }
        // 1. output each line with user + post-count
        // 2. output in "inline-popup" like in "mark posts read"
        $topic_row = $event['topic_row'];
        $topic_id = $topic_row['TOPIC_ID'];
        $sql = 'SELECT COUNT(p.post_id) AS posts, p.poster_id, u.username, u.user_colour
		FROM phpbb_posts p, phpbb_users u
		WHERE p.topic_id = ' . (int) $topic_id . '
		AND p.poster_id = u.user_id
		GROUP BY p.poster_id
		ORDER BY posts DESC';
        $result = $this->db->sql_query_limit($sql, 5);
        while ($row = $this->db->sql_fetchrow($result)) {
            var_dump($row);
            $post_count = $row['posts'];
            $display_username = get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour']);
            echo $display_username . ' with ' . $post_count . 'posts<br />';
        }
        $this->db->sql_freeresult($result);
        $topic_row['REPLIES'] = '<a href="#t=' . $topic_id . '" class="whoposted">' . $topic_row['REPLIES'] . '</a>';
        $event['topic_row'] = $topic_row;
    }
开发者ID:Crizz0,项目名称:whoposted,代码行数:33,代码来源:listener.php


示例9: main

    function main($id, $mode)
    {
        global $db, $user, $auth, $template;
        global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
        $error = $notify = array();
        $user->add_lang(array('mods/info_acp_emails_users_list'));
        $mode = request_var('mode', '');
        $start = request_var('start', 0);
        if ($mode == 'list') {
            // How many Users do we have?
            $sql = 'SELECT COUNT(user_id) AS total_users
	FROM ' . USERS_TABLE . '
	WHERE user_type <> ' . USER_IGNORE;
            $result = $db->sql_query($sql);
            $total_users = (int) $db->sql_fetchfield('total_users');
            $db->sql_freeresult($result);
            // want more to display...change the 20 to a higher number
            $tf = 20;
            //Pull Users from the database
            $sql = 'SELECT *
	FROM ' . USERS_TABLE . '
	WHERE user_type <> ' . USER_IGNORE . '
	ORDER BY user_id';
            $result = $db->sql_query_limit($sql, $tf, $start);
            // Assign specific vars
            while ($row = $db->sql_fetchrow($result)) {
                $template->assign_block_vars('list', array('ID' => $row['user_id'], 'EMAIL' => $row['user_email'], 'REGDATE' => $user->format_date($row['user_regdate']), 'LASTVISIT' => $user->format_date($row['user_lastvisit']), 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), 'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour'])));
            }
            $this->tpl_name = 'acp_emails_users_list';
            $this->page_title = 'EMAILS_USERS_LIST';
            $template->assign_vars(array('PAGINATION' => generate_pagination($this->u_action, $total_users, $tf, $start), 'PAGE_NUMBER' => on_page($total_users, $tf, $start), 'U_CSV_LIST' => append_sid("{$phpbb_root_path}list.{$phpEx}", 'mode=list'), 'U_ACTION' => $this->u_action, 'TOTAL_USERS' => $total_users == 1 ? $user->lang['USER_COUNT'] : sprintf($user->lang['USER_COUNTS'], $total_users)));
            $db->sql_freeresult($result);
        }
    }
开发者ID:harsha-sira,项目名称:Online-Forum,代码行数:34,代码来源:acp_emails_users_list.php


示例10: display

 /**
  * {@inheritdoc}
  */
 public function display(array $bdata, $edit_mode = false)
 {
     $content = '';
     if ($this->user->data['is_registered']) {
         $this->ptemplate->assign_vars(array('USER_AVATAR' => phpbb_get_user_avatar($this->user->data), 'USERNAME' => get_username_string('no_profile', $this->user->data['user_id'], $this->user->data['username'], $this->user->data['user_colour']), 'USERNAME_FULL' => get_username_string('full', $this->user->data['user_id'], $this->user->data['username'], $this->user->data['user_colour']), 'U_PROFILE' => append_sid($this->phpbb_root_path . 'memberlist.' . $this->php_ext, 'mode=viewprofile&amp;u=' . $this->user->data['user_id']), 'U_SEARCH_NEW' => append_sid($this->phpbb_root_path . 'search.' . $this->php_ext, 'search_id=newposts'), 'U_SEARCH_SELF' => append_sid($this->phpbb_root_path . 'search.' . $this->php_ext, 'search_id=egosearch'), 'U_PRIVATE_MSG' => append_sid($this->phpbb_root_path . 'ucp.' . $this->php_ext, 'i=pm&amp;folder=inbox'), 'U_LOGOUT' => append_sid($this->phpbb_root_path . 'ucp.' . $this->php_ext, 'mode=logout', true, $this->user->session_id), 'U_MCP' => $this->auth->acl_get('m_') ? append_sid($this->phpbb_root_path . 'mcp.' . $this->php_ext, false, true, $this->user->session_id) : '', 'U_ACP' => $this->auth->acl_get('a_') ? append_sid($this->phpbb_root_path . 'adm/index.' . $this->php_ext, 'i=-blitze-sitemaker-acp-menu_module', true, $this->user->session_id) : ''));
         $content = $this->ptemplate->render_view('blitze/sitemaker', 'blocks/member_menu.html', 'member_menu_block');
     }
     return array('title' => 'WELCOME', 'content' => $content);
 }
开发者ID:3D-I,项目名称:phpBB-ext-sitemaker,代码行数:12,代码来源:member_menu.php


示例11: display

 /**
  * {@inheritdoc}
  */
 public function display(array $settings, $edit_mode = false)
 {
     $content = '';
     $content .= $this->user->lang('TOTAL_POSTS_COUNT', (int) $this->config['num_posts']) . '<br />';
     $content .= $this->user->lang('TOTAL_TOPICS', (int) $this->config['num_topics']) . '<br />';
     $content .= $this->user->lang('TOTAL_USERS', (int) $this->config['num_users']) . '<br />';
     $content .= $this->user->lang('NEWEST_USER', get_username_string('full', $this->config['newest_user_id'], $this->config['newest_username'], $this->config['newest_user_colour']));
     return array('title' => 'STATISTICS', 'content' => $content);
 }
开发者ID:BogusCurry,项目名称:phpBB-ext-sitemaker,代码行数:12,代码来源:stats.php


示例12: get_template_side

    /**
     * {@inheritdoc}
     */
    public function get_template_side($module_id)
    {
        $sql = 'SELECT user_id, username, user_regdate, user_colour
			FROM ' . USERS_TABLE . '
			WHERE user_type <> ' . USER_IGNORE . '
				AND user_inactive_time = 0
			ORDER BY user_regdate DESC';
        $result = $this->db->sql_query_limit($sql, $this->config['board3_max_last_member_' . $module_id], 0, 600);
        while (($row = $this->db->sql_fetchrow($result)) && $row['username']) {
            $this->template->assign_block_vars('latest_members', array('USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), 'JOINED' => $this->user->format_date($row['user_regdate'], $format = 'd M')));
        }
        $this->db->sql_freeresult($result);
        return 'latest_members_side.html';
    }
开发者ID:alhitary,项目名称:Board3-Portal,代码行数:17,代码来源:latest_members.php


示例13: main

 function main($id, $mode)
 {
     global $template, $user, $db, $config, $phpEx, $phpbb_root_path, $ultimate_points, $points_config, $points_values, $auth, $check_auth;
     $adm_points = request_var('adm_points', false);
     $u_id = request_var('user_id', 0);
     $post_id = request_var('post_id', 0);
     if (empty($u_id)) {
         $message = $user->lang['EDIT_NO_ID_SPECIFIED'] . '<br /><br /><a href="' . append_sid("{$phpbb_root_path}points.{$phpEx}", "mode=bank_edit") . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>';
         trigger_error($message);
     }
     $user_id = $u_id;
     add_form_key('bank_edit');
     if ($adm_points != false && ($auth->acl_get('a_points') || $auth->acl_get('m_chg_bank'))) {
         $template->assign_block_vars('administer_bank', array());
         if (isset($_POST['submit'])) {
             if (!check_form_key('bank_edit')) {
                 trigger_error('FORM_INVALID');
             }
             $new_points = round(request_var('points', 0.0), 2);
             set_bank($u_id, $new_points);
             $sql_array = array('SELECT' => 'user_id, username, user_points, user_colour', 'FROM' => array(USERS_TABLE => 'u'), 'WHERE' => 'user_id = ' . (int) $u_id);
             $sql = $db->sql_build_query('SELECT', $sql_array);
             $result = $db->sql_query($sql);
             $points_user = $db->sql_fetchrow($result);
             add_log('admin', 'LOG_MOD_BANK', $points_user['username']);
             $message = $post_id ? sprintf($user->lang['EDIT_P_RETURN_POST'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "p=" . $post_id) . '">', '</a>') : sprintf($user->lang['EDIT_P_RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.{$phpEx}") . '">', '</a>');
             trigger_error(sprintf($user->lang['EDIT_POINTS_SET'], $config['points_name']) . $message);
         } else {
             $sql_array = array('SELECT' => 'u.user_id, u.username, u.user_points, u.user_colour, b.holding', 'FROM' => array(USERS_TABLE => 'u'), 'LEFT_JOIN' => array(array('FROM' => array(POINTS_BANK_TABLE => 'b'), 'ON' => 'u.user_id = b.user_id')), 'WHERE' => 'u.user_id = ' . (int) $u_id);
             $sql = $db->sql_build_query('SELECT', $sql_array);
             $result = $db->sql_query($sql);
             $row = $db->sql_fetchrow($result);
             if (empty($u_id)) {
                 $message = $user->lang['EDIT_USER_NOT_EXIST'] . '<br /><br /><a href="' . append_sid("{$phpbb_root_path}points.{$phpEx}", "mode=bank_edit") . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>';
                 trigger_error($message);
             }
             $hidden_fields = build_hidden_fields(array('user_id' => $u_id, 'post_id' => $post_id));
             $template->assign_vars(array('USER_NAME' => get_username_string('full', $u_id, $row['username'], $row['user_colour']), 'BANK_POINTS' => sprintf(number_format_points($row['holding'])), 'POINTS_NAME' => $config['points_name'], 'CURRENT_VALUE' => $row['holding'], 'L_POINTS_MODIFY' => sprintf($user->lang['EDIT_BANK_MODIFY'], $config['points_name']), 'L_P_BANK_TITLE' => sprintf($user->lang['EDIT_P_BANK_TITLE'], $config['points_name']), 'L_USERNAME' => $user->lang['USERNAME'], 'L_SET_AMOUNT' => $user->lang['EDIT_SET_AMOUNT'], 'U_USER_LINK' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=viewprofile&amp;u=" . $u_id), 'S_ACTION' => append_sid("{$phpbb_root_path}points.{$phpEx}", "mode=bank_edit&amp;adm_points=1"), 'S_HIDDEN_FIELDS' => $hidden_fields));
         }
     } else {
         $message = $user->lang['NOT_AUTHORISED'];
         trigger_error($message);
     }
     // Generate the page
     page_header($user->lang['EDIT_POINTS_ADMIN']);
     // Generate the page template
     $template->set_filenames(array('body' => 'points/points_bank_edit.html'));
     page_footer();
 }
开发者ID:FifoF,项目名称:phpbb3.1_ultimate_points,代码行数:49,代码来源:points_bank_edit.php


示例14: index_modify_page_title

    public function index_modify_page_title($event)
    {
        $this->user->add_lang_ext('dmzx/newestmembers', 'common');
        $sql = 'SELECT user_id, username, user_colour
			FROM ' . USERS_TABLE . '
			WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
			ORDER BY user_id DESC';
        $result = $this->db->sql_query_limit($sql, 5);
        if ($result) {
            while ($row = $this->db->sql_fetchrow($result)) {
                $this->template->assign_block_vars('newestmembers', array('NEWESTMEMBERS' => sprintf($this->user->lang['NEWEST_MEMBERS'], get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']))));
            }
        }
        $this->db->sql_freeresult($result);
    }
开发者ID:alhitary,项目名称:Newest-Members,代码行数:15,代码来源:listener.php


示例15: user_get_name

    function user_get_name($u_id)
    {
        global $db;
        $sql = 'SELECT username, user_colour
	         FROM ' . USERS_TABLE . '
	         WHERE user_id = ' . $db->sql_escape($u_id);
        $result = $result = $db->sql_query_limit($sql, 1);
        $row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        if ($row) {
            return ': ' . get_username_string('no_profile', $u_id, $row['username'], $row['user_colour']);
        } else {
            return '';
        }
    }
开发者ID:4seven,项目名称:projects,代码行数:15,代码来源:who_is_where.php


示例16: reputation_toplist

    /**
     * Display reputation toplist
     *
     * @return null
     * @access public
     */
    public function reputation_toplist()
    {
        if ($this->config['rs_enable'] && $this->config['rs_enable_toplist'] && $this->config['rs_toplist_num']) {
            $this->user->add_lang_ext('pico/reputation', 'reputation_toplist');
            $sql = 'SELECT user_id, username, user_colour, user_reputation
				FROM ' . USERS_TABLE . '
				WHERE user_reputation > 0
				ORDER BY user_reputation DESC';
            $result = $this->db->sql_query_limit($sql, $this->config['rs_toplist_num']);
            while ($row = $this->db->sql_fetchrow($result)) {
                $this->template->assign_block_vars('toplist', array('USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), 'USER_REPUTATION' => $row['user_reputation'], 'U_VIEW_USER_REPUTATION' => $this->helper->route('reputation_details_controller', array('uid' => $row['user_id'])), 'S_DIRECTION' => $this->config['rs_toplist_direction'] ? true : false));
            }
            $this->db->sql_freeresult($result);
            $this->template->assign_vars(array('S_RS_TOPLIST' => true, 'S_VIEW_REPUTATION' => $this->auth->acl_get('u_rs_view') ? true : false));
        }
    }
开发者ID:rampmaster,项目名称:phpBB-Reputation-System,代码行数:22,代码来源:index_listener.php


示例17: index_modify_page_title

 public function index_modify_page_title()
 {
     global $phpbb_dispatcher;
     $this->user->add_lang_ext('alg/wwhlight', 'wwhlight');
     $user_online_link = $rowset = array();
     $sql_ary = array('SELECT' => 'u.user_id, u.username, u.username_clean, u.user_type, u.user_colour, u.user_ip, u.user_lastvisit, u.user_allow_viewonline', 'FROM' => array(USERS_TABLE => 'u'), 'WHERE' => 'user_type <> ' . USER_IGNORE . ' AND DATE(FROM_UNIXTIME (user_lastvisit)) = CURDATE()', 'ORDER_BY' => 'u.user_lastvisit DESC');
     /**
      * Modify SQL query to obtain wwhlight users data
      *
      * @event wwhlight.obtain_users_online_string_sql
      */
     $vars = array('sql_ary');
     extract($phpbb_dispatcher->trigger_event('wwhlight.obtain_users_online_string_sql', compact($vars)));
     $result = $this->db->sql_query($this->db->sql_build_query('SELECT', $sql_ary));
     $rowset = $this->db->sql_fetchrowset($result);
     $this->db->sql_freeresult($result);
     foreach ($rowset as $row) {
         if ($row['user_allow_viewonline']) {
             $last_visit_time = sprintf($this->user->lang['WWHLIGHT_LATEST'], $this->user->format_date($row['user_lastvisit'], 'H:i'));
             $username = get_username_string($row['user_type'] != USER_IGNORE ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']);
             $user_online_link[$row['user_id']] = '<span title="' . ($last_visit_time ? $last_visit_time : '') . '">' . $username . '</span>';
             $this->counter_users_reg++;
         } else {
             if ($this->auth->acl_get('u_viewonline')) {
                 $user_online_link[$row['user_id']] = '<em>' . $row['username'] . '</em>';
             }
             $this->counter_users_hidden++;
         }
         $this->counter_users_total++;
     }
     $online_userlist = $this->user->lang['REGISTERED_USERS'] . ' ' . implode(', ', $user_online_link);
     /**
      * Modify wwhlight userlist data
      *
      * @event wwhlight.obtain_users_online_string_modify
      * @var	array	rowset				Array with wwhlight users data
      * @var	array	user_online_link	Array with wwhlight usernames
      * @var	string	online_userlist		String containing users wwhlight list
      */
     $vars = array('rowset', 'user_online_link', 'online_userlist');
     extract($phpbb_dispatcher->trigger_event('wwhlight.obtain_users_online_string_modify', compact($vars)));
     if (!sizeof($user_online_link)) {
         $online_userlist = $this->user->lang['NO_ONLINE_USERS'];
     }
     $this->template->assign_vars(array('WWHLIGHT_LIST' => $online_userlist, 'WWHLIGHT_DETAILS' => $this->obtain_users_string(), 'WWHLIGHT_RECORD' => sprintf($this->user->lang['WWHLIGHT_RECORD'], $this->config['wwhlight_record'], $this->config['wwhlight_record_time']) . '<br />'));
 }
开发者ID:alg5,项目名称:wwhlight,代码行数:46,代码来源:listener.php


示例18: display_options

    /**
     * Display Options
     *
     * Output the options available
     */
    function display_options()
    {
        global $db, $template, $user;
        // Generate a list of founders
        $sql = 'SELECT user_id, username, user_colour
			FROM ' . U 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_usernumposts函数代码示例发布时间:2022-05-15
下一篇:
PHP get_username_by_id函数代码示例发布时间: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