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


PHP get_user_rank函数代码示例

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


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

示例1: param

 public function param()
 {
     if (!isset($_SESSION['login'])) {
         redirect('Admin/index');
     }
     // Loading and initializing the user
     $this->load->model('user_model');
     $user = $this->user_model->init_user($_SESSION['login']);
     $user->user_nomp = $this->user_model->nom_p($user->nom, $user->prenom);
     $user->user_score = $this->user_model->get_user_score($user->id);
     $user->user_rank = get_user_rank($user->user_score);
     if ($_POST) {
         $this->load->library('form_validation');
         $this->form_validation->set_rules('nom', 'Nom', 'required|alpha');
         $this->form_validation->set_rules('prenom', 'Prenom', 'required|alpha');
         $this->form_validation->set_rules('classe', 'Classe', 'alpha_numeric|exact_length[5]');
         if ($this->form_validation->run() !== false) {
             // passed
             $nom = $this->input->post('nom');
             $prenom = $this->input->post('prenom');
             $classe = $this->input->post('classe');
             $user_info = array('nom' => $nom, 'prenom' => $prenom, 'classe' => $classe);
             $this->load->model('user_model');
             if ($this->user_model->update($user, $user_info)) {
                 $this->session->set_flashdata('error_msg', 'Votre profil à été mit à jour.');
                 redirect('Admin/param');
             } else {
                 $this->session->set_flashdata('error_msg', 'Not updated');
             }
         }
     }
     $data = array('main_content' => 'param_view', 'page_title' => 'Paramètres', 'user' => $user, 'error_msg' => $this->session->flashdata('error_msg'));
     $this->load->view('includes/template_logged', $data);
 }
开发者ID:nWidart,项目名称:ci_trashsquare,代码行数:34,代码来源:Admin.php

示例2: add_user_to_user_cache

 /**
  *
  */
 public static function add_user_to_user_cache(&$user_cache, $row)
 {
     global $auth, $config, $user;
     $user_id = $row['user_id'];
     if ($user_id == ANONYMOUS) {
         $user_cache[$user_id] = array('joined' => '', 'posts' => '', 'from' => '', 'sig' => '', 'sig_bbcode_uid' => '', 'sig_bbcode_bitfield' => '', 'online' => false, 'avatar' => $user->optionget('viewavatars') ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']) : '', 'rank_title' => '', 'rank_image' => '', 'rank_image_src' => '', 'sig' => '', 'profile' => '', 'pm' => '', 'email' => '', 'www' => '', 'icq_status_img' => '', 'icq' => '', 'aim' => '', 'msn' => '', 'yim' => '', 'jabber' => '', 'search' => '', 'age' => '', 'gallery_album' => '', 'gallery_images' => '', 'gallery_search' => '', 'username' => $row['username'], 'user_colour' => $row['user_colour'], 'warnings' => 0, 'allow_pm' => 0);
         get_user_rank($row['user_rank'], false, $user_cache[$user_id]['rank_title'], $user_cache[$user_id]['rank_image'], $user_cache[$user_id]['rank_image_src']);
     } else {
         $user_sig = '';
         if ($row['user_sig'] && $config['allow_sig'] && $user->optionget('viewsigs')) {
             $user_sig = $row['user_sig'];
         }
         $id_cache[] = $user_id;
         $user_cache[$user_id] = array('joined' => $user->format_date($row['user_regdate']), 'posts' => $row['user_posts'], 'warnings' => isset($row['user_warnings']) ? $row['user_warnings'] : 0, 'from' => !empty($row['user_from']) ? $row['user_from'] : '', 'sig' => $user_sig, 'sig_bbcode_uid' => !empty($row['user_sig_bbcode_uid']) ? $row['user_sig_bbcode_uid'] : '', 'sig_bbcode_bitfield' => !empty($row['user_sig_bbcode_bitfield']) ? $row['user_sig_bbcode_bitfield'] : '', 'viewonline' => $row['user_allow_viewonline'], 'allow_pm' => $row['user_allow_pm'], 'avatar' => $user->optionget('viewavatars') ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']) : '', 'age' => '', 'rank_title' => '', 'rank_image' => '', 'rank_image_src' => '', 'user_id' => $row['user_id'], 'username' => $row['username'], 'user_colour' => $row['user_colour'], 'online' => false, 'profile' => phpbb_gallery_url::append_sid('phpbb', 'memberlist', "mode=viewprofile&u={$user_id}"), 'www' => $row['user_website'], 'aim' => $row['user_aim'] && $auth->acl_get('u_sendim') ? phpbb_gallery_url::append_sid('phpbb', 'memberlist', "mode=contact&action=aim&u={$user_id}") : '', 'msn' => $row['user_msnm'] && $auth->acl_get('u_sendim') ? phpbb_gallery_url::append_sid('phpbb', 'memberlist', "mode=contact&action=msnm&u={$user_id}") : '', 'yim' => $row['user_yim'] ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($row['user_yim']) . '&.src=pg' : '', 'jabber' => $row['user_jabber'] && $auth->acl_get('u_sendim') ? phpbb_gallery_url::append_sid('phpbb', 'memberlist', "mode=contact&action=jabber&u={$user_id}") : '', 'search' => $auth->acl_get('u_search') ? phpbb_gallery_url::append_sid('phpbb', 'search', "author_id={$user_id}&sr=posts") : '', 'gallery_album' => $row['personal_album_id'] && phpbb_gallery_config::get('viewtopic_icon') ? phpbb_gallery_url::append_sid('album', "album_id=" . $row['personal_album_id']) : '', 'gallery_images' => phpbb_gallery_config::get('viewtopic_images') ? $row['user_images'] : 0, 'gallery_search' => phpbb_gallery_config::get('viewtopic_images') && phpbb_gallery_config::get('viewtopic_link') && $row['user_images'] ? phpbb_gallery_url::append_sid('search', "user_id={$user_id}") : '');
         get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$user_id]['rank_title'], $user_cache[$user_id]['rank_image'], $user_cache[$user_id]['rank_image_src']);
         if (!empty($row['user_allow_viewemail']) || $auth->acl_get('a_email')) {
             $user_cache[$user_id]['email'] = $config['board_email_form'] && $config['email_enable'] ? phpbb_gallery_url::append_sid('phpbb', 'memberlist', "mode=email&u={$user_id}") : ($config['board_hide_emails'] && !$auth->acl_get('a_email') ? '' : 'mailto:' . $row['user_email']);
         } else {
             $user_cache[$user_id]['email'] = '';
         }
         if (!empty($row['user_icq'])) {
             $user_cache[$user_id]['icq'] = 'http://www.icq.com/people/webmsg.php?to=' . $row['user_icq'];
             $user_cache[$user_id]['icq_status_img'] = '<img src="http://web.icq.com/whitepages/online?icq=' . $row['user_icq'] . '&amp;img=5" width="18" height="18" alt="" />';
         } else {
             $user_cache[$user_id]['icq_status_img'] = '';
             $user_cache[$user_id]['icq'] = '';
         }
         if ($config['allow_birthdays'] && !empty($row['user_birthday'])) {
             list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $row['user_birthday']));
             if ($bday_year) {
                 $now = getdate(time() + $user->timezone + $user->dst - date('Z'));
                 $diff = $now['mon'] - $bday_month;
                 if ($diff == 0) {
                     $diff = $now['mday'] - $bday_day < 0 ? 1 : 0;
                 } else {
                     $diff = $diff < 0 ? 1 : 0;
                 }
                 $user_cache[$user_id]['age'] = (int) ($now['year'] - $bday_year - $diff);
             }
         }
     }
 }
开发者ID:phpbbgallery,项目名称:phpbb-gallery,代码行数:45,代码来源:helpers.php

示例3: pcp_output_rank_title

function pcp_output_rank_title($field_name, $view_userdata, $map_name = '')
{
    global $board_config, $phpbb_root_path, $phpEx, $lang, $images, $userdata;
    global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;
    if ($view_userdata['user_id'] != ANONYMOUS) {
        $rank = get_user_rank($view_userdata);
        $txt = $rank['rank_title'];
        $img = $rank['rank_image'];
        //
        // Custom Title MOD
        //
        //
        // Verify Custom Title Status
        //
        // Uncomment this section if you don't want custom title to appear even if it is defined but the user does not meet criteria
        $membertime = empty($mode) || $mode != 'register' ? time() - $userdata['user_regdate'] : 0;
        if ($view_userdata['user_custom_title_status'] == CUSTOM_TITLE_ENABLED || $view_userdata['user_custom_title_status'] == CUSTOM_TITLE_REGDATE && $membertime >= $board_config['custom_title_days'] * 86400 && $view_userdata['user_posts'] >= $board_config['custom_title_posts']) {
            if (!empty($view_userdata['user_custom_title'])) {
                switch ($board_config['custom_title_mode']) {
                    case CUSTOM_TITLE_MODE_INDEPENDENT:
                        $txt = $view_userdata['user_custom_title'] . "<br />" . $txt;
                        break;
                    case CUSTOM_TITLE_MODE_REPLACE_RANK:
                        $txt = $view_userdata['user_custom_title'];
                        break;
                    case CUSTOM_TITLE_MODE_REPLACE_BOTH:
                        $txt = $view_userdata['user_custom_title'];
                        $img = '';
                        break;
                    default:
                        break;
                }
            }
        }
        //
        // Custom Title MOD End
        //
        // result
        $res = pcp_output_format($field_name, $txt, $img, $map_name);
    }
    return $res;
}
开发者ID:BackupTheBerlios,项目名称:phpbbsfp,代码行数:42,代码来源:def_userfuncs_std.php

示例4: display_guestbook

    /**
     * Assign template variables to display a vehicles comments
     *
     * @param int $vid vehicle id to fitler on
     *
     */
    function display_guestbook($vid)
    {
        global $template, $garage_vehicle, $garage, $user, $phpEx, $auth, $phpbb_root_path, $config, $start, $garage_config, $mode, $garage_template, $db;
        //Set Required Values To Defaults If They Are Empty
        $start = empty($start) ? '0' : $start;
        $template->assign_block_vars('guestbook', array());
        //Get Vehicle Data
        $vehicle_data = $garage_vehicle->get_vehicle($vid);
        //Get All Comments Data
        $comment_data = $this->get_vehicle_comments($vid, $start, $garage_config['cars_per_page']);
        $id_cache = array();
        /*
         * First Loop Of Comments Is Just To Build User Cache So We Done Have to Recompute Reoccuring User Data
         */
        for ($i = 0, $count = sizeof($comment_data); $i < $count; $i++) {
            $poster_id = $comment_data[$i]['author_id'];
            // Cache various user specific data ... so we don't have to recompute
            // this each time the same user appears on this page
            if (!isset($user_cache[$poster_id])) {
                if ($poster_id == ANONYMOUS) {
                    $user_cache[$poster_id] = array('joined' => '', 'posts' => '', 'from' => '', 'sig' => '', 'sig_bbcode_uid' => '', 'sig_bbcode_bitfield' => '', 'online' => false, 'avatar' => '', 'rank_title' => '', 'rank_image' => '', 'rank_image_src' => '', 'sig' => '', 'profile' => '', 'pm' => '', 'email' => '', 'www' => '', 'icq_status_img' => '', 'icq' => '', 'aim' => '', 'msn' => '', 'yim' => '', 'jabber' => '', 'search' => '', 'username' => $comment_data[$i]['username'], 'user_colour' => $comment_data[$i]['user_colour'], 'allow_pm' => 0);
                } else {
                    $user_sig = '';
                    // We add the signature to every posters entry because enable_sig is post dependant
                    if ($comment_data[$i]['user_sig'] && $config['allow_sig'] && $user->optionget('viewsigs')) {
                        $user_sig = $comment_data[$i]['user_sig'];
                    }
                    $id_cache[] = $poster_id;
                    $user_cache[$poster_id] = array('joined' => $user->format_date($comment_data[$i]['user_regdate']), 'posts' => $comment_data[$i]['user_posts'], 'from' => !empty($comment_data[$i]['user_from']) ? $comment_data[$i]['user_from'] : '', 'sig' => $user_sig, 'sig_bbcode_uid' => !empty($comment_data[$i]['user_sig_bbcode_uid']) ? $comment_data[$i]['user_sig_bbcode_uid'] : '', 'sig_bbcode_bitfield' => !empty($comment_data[$i]['user_sig_bbcode_bitfield']) ? $comment_data[$i]['user_sig_bbcode_bitfield'] : '', 'viewonline' => $comment_data[$i]['user_allow_viewonline'], 'allow_pm' => $comment_data[$i]['user_allow_pm'], 'avatar' => $user->optionget('viewavatars') ? get_user_avatar($comment_data[$i]['user_avatar'], $comment_data[$i]['user_avatar_type'], $comment_data[$i]['user_avatar_width'], $comment_data[$i]['user_avatar_height']) : '', 'rank_title' => '', 'rank_image' => '', 'rank_image_src' => '', 'username' => $comment_data[$i]['username'], 'user_colour' => $comment_data[$i]['user_colour'], 'online' => false, 'profile' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=viewprofile&amp;u={$poster_id}"), 'www' => $comment_data[$i]['user_website'], 'aim' => $comment_data[$i]['user_aim'] && $auth->acl_get('u_sendim') ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=contact&amp;action=aim&amp;u={$poster_id}") : '', 'msn' => $comment_data[$i]['user_msnm'] && $auth->acl_get('u_sendim') ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=contact&amp;action=msnm&amp;u={$poster_id}") : '', 'yim' => $comment_data[$i]['user_yim'] ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($comment_data[$i]['user_yim']) . '&amp;.src=pg' : '', 'jabber' => $comment_data[$i]['user_jabber'] && $auth->acl_get('u_sendim') ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=contact&amp;action=jabber&amp;u={$poster_id}") : '', 'search' => $auth->acl_get('u_search') ? append_sid("{$phpbb_root_path}search.{$phpEx}", 'search_author=' . urlencode($comment_data[$i]['username']) . '&amp;sr=posts') : '');
                    get_user_rank($comment_data[$i]['user_rank'], $comment_data[$i]['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
                    if (!empty($comment_data[$i]['user_allow_viewemail']) || $auth->acl_get('a_email')) {
                        $user_cache[$poster_id]['email'] = $config['board_email_form'] && $config['email_enable'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=email&amp;u={$poster_id}") : ($config['board_hide_emails'] && !$auth->acl_get('a_email') ? '' : 'mailto:' . $comment_data[$i]['user_email']);
                    } else {
                        $user_cache[$poster_id]['email'] = '';
                    }
                    if (!empty($comment_data[$i]['user_icq'])) {
                        $user_cache[$poster_id]['icq'] = 'http://www.icq.com/people/webmsg.php?to=' . $comment_data[$i]['user_icq'];
                        $user_cache[$poster_id]['icq_status_img'] = '<img src="http://web.icq.com/whitepages/online?icq=' . $comment_data[$i]['user_icq'] . '&amp;img=5" width="18" height="18" alt="" />';
                    } else {
                        $user_cache[$poster_id]['icq_status_img'] = '';
                        $user_cache[$poster_id]['icq'] = '';
                    }
                }
            }
        }
        // Generate online information for user
        if ($config['load_onlinetrack'] && sizeof($id_cache)) {
            $sql = 'SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline
				FROM ' . SESSIONS_TABLE . '
				WHERE ' . $db->sql_in_set('session_user_id', $id_cache) . '
				GROUP BY session_user_id';
            $result = $db->sql_query($sql);
            $update_time = $config['load_online_time'] * 60;
            while ($row = $db->sql_fetchrow($result)) {
                $user_cache[$row['session_user_id']]['online'] = time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline')) ? true : false;
            }
            $db->sql_freeresult($result);
        }
        unset($id_cache);
        /*
         * Second Loop Of Comments Is Just To Declare Contents To Template Engine
         */
        for ($i = 0, $count = sizeof($comment_data); $i < $count; $i++) {
            $poster_id = $comment_data[$i]['author_id'];
            $comment_data[$i]['user_id'] = empty($comment_data[$i]['user_id']) ? ANONYMOUS : $comment_data[$i]['user_id'];
            $username = $comment_data[$i]['username'];
            $temp_url = append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=viewprofile&amp;u=" . $comment_data[$i]['user_id']);
            $poster = '<a href="' . $temp_url . '">' . $comment_data[$i]['username'] . '</a>';
            $poster_id = $comment_data[$i]['author_id'];
            $poster_posts = $comment_data[$i]['user_id'] != ANONYMOUS ? $comment_data[$i]['user_posts'] : '';
            $poster_from = $comment_data[$i]['user_from'] && $comment_data[$i]['user_id'] != ANONYMOUS ? $user->lang['LOCATION'] . ': ' . $comment_data[$i]['user_from'] : '';
            $vehicle_id = $comment_data[$i]['vehicle_id'];
            $poster_car_year = $comment_data[$i]['made_year'] && $comment_data[$i]['user_id'] != ANONYMOUS ? ' ' . $comment_data[$i]['made_year'] : '';
            $poster_car_mark = $comment_data[$i]['make'] && $comment_data[$i]['user_id'] != ANONYMOUS ? ' ' . $comment_data[$i]['make'] : '';
            $poster_car_model = $comment_data[$i]['model'] && $comment_data[$i]['user_id'] != ANONYMOUS ? ' ' . $comment_data[$i]['model'] : '';
            $poster_joined = $comment_data[$i]['user_id'] != ANONYMOUS ? $user->lang['JOINED'] . ': ' . $user->format_date($comment_data[$i]['user_regdate']) : '';
            // Handle anon users posting with usernames
            //if ( $comment_data[$i]['user_id'] == ANONYMOUS && $comment_data[$i]['post_username'] != '' )
            //{
            //		$poster = $comment_data[$i]['post_username'];
            //	}
            $profile = '<a href="' . $temp_url . '">' . $user->lang['READ_PROFILE'] . '</a>';
            $temp_url = append_sid("{$phpbb_root_path}privmsg.{$phpEx}", "mode=post&amp;u=" . $comment_data[$i]['user_id']);
            $pm = '<a href="' . $temp_url . '">' . $user->lang['SEND_PRIVATE_MESSAGE'] . '</a>';
            if (!empty($comment_data[$i]['user_viewemail']) || $auth->acl_get('m_')) {
                $email_uri = $config['board_email_form'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=email&amp;u=" . $comment_data[$i]['user_id']) : 'mailto:' . $comment_data[$i]['user_email'];
                $email = '<a href="' . $email_uri . '">' . $user->lang['SEND_EMAIL'] . '</a>';
            } else {
                $email_img = '';
                $email = '';
            }
            //$www_img = ( $comment_data[$i]['user_website'] ) ? '<a href="' . $comment_data[$i]['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $user->lang['Visit_website'] . '" title="' . $user->lang['Visit_website'] . '" border="0" /></a>' : '';
            $www_img = '';
            //$www = ( $comment_data[$i]['user_website'] ) ? '<a href="' . $comment_data[$i]['user_website'] . '" target="_userwww">' . $user->lang['Visit_website'] . '</a>' : '';
//.........这里部分代码省略.........
开发者ID:poyntesm,项目名称:phpbbgarage,代码行数:101,代码来源:class_garage_guestbook.php

示例5: main


//.........这里部分代码省略.........
                $sql_array = array('SELECT' => 'u.*', 'FROM' => array($this->users_table => 'u'), 'ORDER_BY' => $order_by);
                if ($top) {
                    $total_users = $top;
                    $start = 0;
                    $page_title = $this->user->lang['REPUT_TOPLIST'];
                } else {
                    $top = $this->config['topics_per_page'];
                }
                if ($sortparam) {
                    $sql_array['FROM'] = array($this->thanks_table => 't');
                    $sql_array['SELECT'] .= ', count(t.' . $sortparam . '_id) as count_thanks';
                    $sql_array['LEFT_JOIN'][] = array('FROM' => array($this->users_table => 'u'), 'ON' => 't.' . $sortparam . '_id = u.user_id');
                    $sql_array['GROUP_BY'] = 't.' . $sortparam . '_id';
                }
                $where[] = $rows[0];
                for ($i = 1, $end = sizeof($rows); $i < $end; ++$i) {
                    $where[] = $rows[$i];
                }
                $sql_array['WHERE'] = $this->db->sql_in_set('u.user_id', $where);
                $sql = $this->db->sql_build_query('SELECT', $sql_array);
                $result = $this->db->sql_query_limit($sql, $top, $start);
                if (!($row = $this->db->sql_fetchrow($result))) {
                    trigger_error('NO_USER');
                } else {
                    $sql = 'SELECT session_user_id, MAX(session_time) AS session_time
						FROM ' . SESSIONS_TABLE . '
						WHERE session_time >= ' . (time() - $this->config['session_length']) . '
							AND ' . $this->db->sql_in_set('session_user_id', $where) . '
						GROUP BY session_user_id';
                    $result_sessions = $this->db->sql_query($sql);
                    $session_times = array();
                    while ($session = $this->db->sql_fetchrow($result_sessions)) {
                        $session_times[$session['session_user_id']] = $session['session_time'];
                    }
                    $this->db->sql_freeresult($result_sessions);
                    $user_list = array();
                    $id_cache = array();
                    do {
                        $row['session_time'] = !empty($session_times[$session['user_id']]) ? $session_times[$session['user_id']] : 0;
                        $row['last_visit'] = !empty($session['session_time']) ? $session['session_time'] : $session['user_lastvisit'];
                        $user_list[] = (int) $row['user_id'];
                        $id_cache[$row['user_id']] = $row;
                    } while ($row = $this->db->sql_fetchrow($result));
                    $this->db->sql_freeresult($result);
                    // Load custom profile fields
                    if ($this->config['load_cpf_memberlist']) {
                        $cp_row = $this->profilefields_manager->generate_profile_fields_template_headlines('field_show_on_ml');
                        foreach ($cp_row as $profile_field) {
                            $this->template->assign_block_vars('custom_fields', $profile_field);
                        }
                        // Grab all profile fields from users in id cache for later use - similar to the poster cache
                        $profile_fields_cache = $this->profilefields_manager->grab_profile_fields_data($user_list);
                        // Filter the fields we don't want to show
                        foreach ($profile_fields_cache as $user_id => $user_profile_fields) {
                            foreach ($user_profile_fields as $field_ident => $profile_field) {
                                if (!$profile_field['data']['field_show_on_ml']) {
                                    unset($profile_fields_cache[$user_id][$field_ident]);
                                }
                            }
                        }
                    }
                    //do
                    for ($i = 0, $end = sizeof($user_list); $i < $end; ++$i) {
                        $user_id = $user_list[$i];
                        $row = $id_cache[$user_id];
                        $last_visit = $row['user_lastvisit'];
                        $rank_title = $rank_img = $rank_img_src = '';
                        include_once $this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext;
                        get_user_rank($row['user_rank'], $user_id == ANONYMOUS ? false : $row['user_posts'], $rank_title, $rank_img, $rank_img_src);
                        $sthanks = true;
                        // Custom Profile Fields
                        $cp_row = array();
                        if ($this->config['load_cpf_memberlist']) {
                            $cp_row = isset($profile_fields_cache[$user_id]) ? $this->profilefields_manager->generate_profile_fields_template_data($profile_fields_cache[$user_id], false) : array();
                        }
                        $memberrow = array_merge(phpbb_show_profile($row), array('ROW_NUMBER' => $row_number + ($start + 1), 'RANK_TITLE' => $rank_title, 'RANK_IMG' => $rank_img, 'RANK_IMG_SRC' => $rank_img_src, 'GIVENS' => !isset($givens[$user_id]) ? 0 : $givens[$user_id], 'RECEIVED' => !isset($reseved[$user_id]) ? 0 : $reseved[$user_id], 'JOINED' => $this->user->format_date($row['user_regdate']), 'VISITED' => empty($last_visit) ? ' - ' : $this->user->format_date($last_visit), 'POSTS' => $row['user_posts'] ? $row['user_posts'] : 0, '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']), 'U_SEARCH_USER' => $this->auth->acl_get('u_search') ? append_sid("{$this->phpbb_root_path}search.{$this->php_ext}", "author_id={$user_id}&amp;sr=posts") : '', 'U_SEARCH_USER_GIVENS' => $this->auth->acl_get('u_search') ? $this->controller_helper->route('gfksx_ThanksForPosts_thankslist_controller_user', array('mode' => 'givens', 'author_id' => $user_id, 'give' => 'true', 'tslash' => '')) : '', 'U_SEARCH_USER_RECEIVED' => $this->auth->acl_get('u_search') ? $this->controller_helper->route('gfksx_ThanksForPosts_thankslist_controller_user', array('mode' => 'givens', 'author_id' => $user_id, 'give' => 'false', 'tslash' => '')) : '', 'L_VIEWING_PROFILE' => sprintf($this->user->lang['VIEWING_PROFILE'], $row['username']), 'VISITED' => empty($last_visit) ? ' - ' : $this->user->format_date($last_visit), 'S_CUSTOM_FIELDS' => isset($cp_row['row']) && sizeof($cp_row['row']) ? true : false));
                        if (isset($cp_row['row']) && sizeof($cp_row['row'])) {
                            $memberrow = array_merge($memberrow, $cp_row['row']);
                        }
                        $this->template->assign_block_vars('memberrow', $memberrow);
                        if (isset($cp_row['blockrow']) && sizeof($cp_row['blockrow'])) {
                            foreach ($cp_row['blockrow'] as $field_data) {
                                $this->template->assign_block_vars('memberrow.custom_fields', $field_data);
                            }
                        }
                        $row_number++;
                    }
                    $this->pagination->generate_template_pagination($pagination_url, 'pagination', 'start', $total_users, $this->config['topics_per_page'], $start);
                    $this->template->assign_vars(array('PAGE_NUMBER' => $this->pagination->on_page($total_users, $this->config['topics_per_page'], $start), 'U_SORT_POSTS' => $this->controller_helper->route('gfksx_ThanksForPosts_thankslist_controller', array('mode' => $mode, 'sk' => 'd', 'sd' => $sort_key == 'd' && $sort_dir == 'a' ? 'd' : 'a', 'tslash' => '')), 'U_SORT_USERNAME' => $this->controller_helper->route('gfksx_ThanksForPosts_thankslist_controller', array('mode' => $mode, 'sk' => 'a', 'sd' => $sort_key == 'a' && $sort_dir == 'a' ? 'd' : 'a', 'tslash' => '')), 'U_SORT_FROM' => $this->controller_helper->route('gfksx_ThanksForPosts_thankslist_controller', array('mode' => $mode, 'sk' => 'b', 'sd' => $sort_key == 'b' && $sort_dir == 'a' ? 'd' : 'a', 'tslash' => '')), 'U_SORT_JOINED' => $this->controller_helper->route('gfksx_ThanksForPosts_thankslist_controller', array('mode' => $mode, 'sk' => 'c', 'sd' => $sort_key == 'c' && $sort_dir == 'a' ? 'd' : 'a', 'tslash' => '')), 'U_SORT_THANKS_R' => $this->controller_helper->route('gfksx_ThanksForPosts_thankslist_controller', array('mode' => $mode, 'sk' => 'e', 'sd' => $sort_key == 'e' && $sort_dir == 'd' ? 'a' : 'd', 'tslash' => '')), 'U_SORT_THANKS_G' => $this->controller_helper->route('gfksx_ThanksForPosts_thankslist_controller', array('mode' => $mode, 'sk' => 'f', 'sd' => $sort_key == 'f' && $sort_dir == 'd' ? 'a' : 'd', 'tslash' => '')), 'U_SORT_ACTIVE' => $this->auth->acl_get('u_viewonline') ? $this->controller_helper->route('gfksx_ThanksForPosts_thankslist_controller', array('mode' => $mode, 'sk' => 'l', 'sd' => $sort_key == 'l' && $sort_dir == 'a' ? 'd' : 'a', 'tslash' => '')) : ''));
                }
                break;
        }
        // Output the page
        $this->template->assign_vars(array('TOTAL_USERS' => $this->user->lang('LIST_USERS', $total_users), 'U_THANKS' => $this->controller_helper->route('gfksx_ThanksForPosts_thankslist_controller', array('tslash' => '')), 'S_THANKS' => $sthanks));
        page_header($page_title);
        $this->template->set_filenames(array('body' => $template_html));
        make_jumpbox(append_sid("{$this->phpbb_root_path}viewforum.{$this->php_ext}"));
        page_footer();
        return new Response($this->template->return_display('body'), 200);
    }
开发者ID:Chklang,项目名称:thanks_for_posts,代码行数:101,代码来源:thankslist.php

示例6: array

 }
 // Cache various user specific data ... so we don't have to recompute
 // this each time the same user appears on this page
 if (!isset($user_cache[$poster_id])) {
     if ($poster_id == ANONYMOUS) {
         $user_cache[$poster_id] = array('joined' => '', 'posts' => '', 'from' => '', 'sig' => '', 'sig_bbcode_uid' => '', 'sig_bbcode_bitfield' => '', 'online' => false, 'avatar' => $user->optionget('viewavatars') ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']) : '', 'rank_title' => '', 'rank_image' => '', 'rank_image_src' => '', 'sig' => '', 'profile' => '', 'pm' => '', 'email' => '', 'www' => '', 'icq_status_img' => '', 'icq' => '', 'aim' => '', 'msn' => '', 'yim' => '', 'jabber' => '', 'search' => '', 'age' => '', 'username' => $row['username'], 'user_colour' => $row['user_colour'], 'warnings' => 0, 'allow_pm' => 0);
         get_user_rank($row['user_rank'], false, $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
     } else {
         $user_sig = '';
         // We add the signature to every posters entry because enable_sig is post dependant
         if ($row['user_sig'] && $config['allow_sig'] && $user->optionget('viewsigs')) {
             $user_sig = $row['user_sig'];
         }
         $id_cache[] = $poster_id;
         $user_cache[$poster_id] = array('joined' => $user->format_date($row['user_regdate']), 'posts' => $row['user_posts'], 'warnings' => isset($row['user_warnings']) ? $row['user_warnings'] : 0, 'from' => !empty($row['user_from']) ? $row['user_from'] : '', 'sig' => $user_sig, 'sig_bbcode_uid' => !empty($row['user_sig_bbcode_uid']) ? $row['user_sig_bbcode_uid'] : '', 'sig_bbcode_bitfield' => !empty($row['user_sig_bbcode_bitfield']) ? $row['user_sig_bbcode_bitfield'] : '', 'viewonline' => $row['user_allow_viewonline'], 'allow_pm' => $row['user_allow_pm'], 'avatar' => $user->optionget('viewavatars') ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']) : '', 'age' => '', 'rank_title' => '', 'rank_image' => '', 'rank_image_src' => '', 'username' => $row['username'], 'user_colour' => $row['user_colour'], 'online' => false, 'profile' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=viewprofile&amp;u={$poster_id}"), 'www' => $row['user_website'], 'aim' => $row['user_aim'] && $auth->acl_get('u_sendim') ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=contact&amp;action=aim&amp;u={$poster_id}") : '', 'msn' => $row['user_msnm'] && $auth->acl_get('u_sendim') ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=contact&amp;action=msnm&amp;u={$poster_id}") : '', 'yim' => $row['user_yim'] ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($row['user_yim']) . '&amp;.src=pg' : '', 'jabber' => $row['user_jabber'] && $auth->acl_get('u_sendim') ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=contact&amp;action=jabber&amp;u={$poster_id}") : '', 'search' => $auth->acl_get('u_search') ? append_sid("{$phpbb_root_path}search.{$phpEx}", "author_id={$poster_id}&amp;sr=posts") : '');
         get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
         if (!empty($row['user_allow_viewemail']) || $auth->acl_get('a_email')) {
             $user_cache[$poster_id]['email'] = $config['board_email_form'] && $config['email_enable'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=email&amp;u={$poster_id}") : ($config['board_hide_emails'] && !$auth->acl_get('a_email') ? '' : 'mailto:' . $row['user_email']);
         } else {
             $user_cache[$poster_id]['email'] = '';
         }
         if (!empty($row['user_icq'])) {
             $user_cache[$poster_id]['icq'] = 'http://www.icq.com/people/webmsg.php?to=' . $row['user_icq'];
             $user_cache[$poster_id]['icq_status_img'] = '<img src="http://web.icq.com/whitepages/online?icq=' . $row['user_icq'] . '&amp;img=5" width="18" height="18" alt="" />';
         } else {
             $user_cache[$poster_id]['icq_status_img'] = '';
             $user_cache[$poster_id]['icq'] = '';
         }
         if ($config['allow_birthdays'] && !empty($row['user_birthday'])) {
             list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $row['user_birthday']));
             if ($bday_year) {
开发者ID:Phatboy82,项目名称:phpbbgarage,代码行数:31,代码来源:viewtopic.php

示例7: show_profile

/**
* Prepare profile data
*/
function show_profile($data)
{
    global $config, $auth, $template, $user, $phpEx, $phpbb_root_path;
    $username = $data['username'];
    $user_id = $data['user_id'];
    $rank_title = $rank_img = $rank_img_src = '';
    get_user_rank($data['user_rank'], $user_id == ANONYMOUS ? false : $data['user_posts'], $rank_title, $rank_img, $rank_img_src);
    if (!empty($data['user_allow_viewemail']) || $auth->acl_get('a_user')) {
        $email = $config['board_email_form'] && $config['email_enable'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=email&amp;u=' . $user_id) : ($config['board_hide_emails'] && !$auth->acl_get('a_user') ? '' : 'mailto:' . $data['user_email']);
    } else {
        $email = '';
    }
    if ($config['load_onlinetrack']) {
        $update_time = $config['load_online_time'] * 60;
        $online = time() - $update_time < $data['session_time'] && (isset($data['session_viewonline']) && $data['session_viewonline'] || $auth->acl_get('u_viewonline')) ? true : false;
    } else {
        $online = false;
    }
    if ($data['user_allow_viewonline'] || $auth->acl_get('u_viewonline')) {
        $last_visit = !empty($data['session_time']) ? $data['session_time'] : $data['user_lastvisit'];
    } else {
        $last_visit = '';
    }
    $age = '';
    if ($config['allow_birthdays'] && $data['user_birthday']) {
        list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $data['user_birthday']));
        if ($bday_year) {
            $now = getdate(time() + $user->timezone + $user->dst - date('Z'));
            $diff = $now['mon'] - $bday_month;
            if ($diff == 0) {
                $diff = $now['mday'] - $bday_day < 0 ? 1 : 0;
            } else {
                $diff = $diff < 0 ? 1 : 0;
            }
            $age = (int) ($now['year'] - $bday_year - $diff);
        }
    }
    // Dump it out to the template
    return array('AGE' => $age, 'RANK_TITLE' => $rank_title, 'JOINED' => $user->format_date($data['user_regdate']), 'VISITED' => empty($last_visit) ? ' - ' : $user->format_date($last_visit), 'POSTS' => $data['user_posts'] ? $data['user_posts'] : 0, 'WARNINGS' => isset($data['user_warnings']) ? $data['user_warnings'] : 0, 'USERNAME_FULL' => get_username_string('full', $user_id, $username, $data['user_colour']), 'USERNAME' => get_username_string('username', $user_id, $username, $data['user_colour']), 'USER_COLOR' => get_username_string('colour', $user_id, $username, $data['user_colour']), 'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $data['user_colour']), 'A_USERNAME' => addslashes(get_username_string('username', $user_id, $username, $data['user_colour'])), 'AVATAR_IMG' => get_user_avatar($data['user_avatar'], $data['user_avatar_type'], $data['user_avatar_width'], $data['user_avatar_height']), 'ONLINE_IMG' => !$config['load_onlinetrack'] ? '' : ($online ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')), 'S_ONLINE' => $config['load_onlinetrack'] && $online ? true : false, 'RANK_IMG' => $rank_img, 'RANK_IMG_SRC' => $rank_img_src, 'ICQ_STATUS_IMG' => !empty($data['user_icq']) ? '<img src="http://web.icq.com/whitepages/online?icq=' . $data['user_icq'] . '&amp;img=5" width="18" height="18" />' : '', 'S_JABBER_ENABLED' => $config['jab_enable'] ? true : false, 'U_SEARCH_USER' => $auth->acl_get('u_search') ? append_sid("{$phpbb_root_path}search.{$phpEx}", "author_id={$user_id}&amp;sr=posts") : '', 'U_NOTES' => $auth->acl_getf_global('m_') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=notes&amp;mode=user_notes&amp;u=' . $user_id, true, $user->session_id) : '', 'U_WARN' => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=warn&amp;mode=warn_user&amp;u=' . $user_id, true, $user->session_id) : '', 'U_PM' => $config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($data['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}ucp.{$phpEx}", 'i=pm&amp;mode=compose&amp;u=' . $user_id) : '', 'U_EMAIL' => $email, 'U_WWW' => !empty($data['user_website']) ? $data['user_website'] : '', 'U_SHORT_WWW' => !empty($data['user_website']) ? strlen($data['user_website']) > 55 ? substr($data['user_website'], 0, 39) . ' ... ' . substr($data['user_website'], -10) : $data['user_website'] : '', 'U_ICQ' => $data['user_icq'] ? 'http://www.icq.com/people/webmsg.php?to=' . urlencode($data['user_icq']) : '', 'U_AIM' => $data['user_aim'] && $auth->acl_get('u_sendim') ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=contact&amp;action=aim&amp;u=' . $user_id) : '', 'U_YIM' => $data['user_yim'] ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($data['user_yim']) . '&amp;.src=pg' : '', 'U_MSN' => $data['user_msnm'] && $auth->acl_get('u_sendim') ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=contact&amp;action=msnm&amp;u=' . $user_id) : '', 'U_JABBER' => $data['user_jabber'] && $auth->acl_get('u_sendim') ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=contact&amp;action=jabber&amp;u=' . $user_id) : '', 'LOCATION' => $data['user_from'] ? $data['user_from'] : '', 'USER_ICQ' => $data['user_icq'], 'USER_AIM' => $data['user_aim'], 'USER_YIM' => $data['user_yim'], 'USER_MSN' => $data['user_msnm'], 'USER_JABBER' => $data['user_jabber'], 'USER_JABBER_IMG' => $data['user_jabber'] ? $user->img('icon_contact_jabber', $data['user_jabber']) : '', 'L_VIEWING_PROFILE' => sprintf($user->lang['VIEWING_PROFILE'], $username));
}
开发者ID:html,项目名称:PI,代码行数:43,代码来源:memberlist.php

示例8: get_user_data

    /**
     * Get user data
     *
     * grabs the data on the user and places it in the self::$user array
     *
     * @param int|bool $id The user_id (or multiple user_ids if given an array) of the user we want to grab the data for
     * @param bool $user_queue If user_queue is true then we just grab the user_ids from the user_queue, otherwise we select data from $id.
     */
    public function get_user_data($id, $user_queue = false, $username = false)
    {
        global $user, $db, $phpbb_root_path, $phpEx, $config, $auth, $cp;
        // if we are using the user_queue, set $user_id as that for consistency
        if ($user_queue) {
            $id = self::$user_queue;
        }
        blog_plugins::plugin_do('user_data_start');
        // this holds the user_id's we will query
        $users_to_query = array();
        // if the $user_id isn't an array, make it one for consistency
        if (!is_array($id)) {
            $id = array(intval($id));
        }
        if ($username) {
            $sql = 'SELECT user_id FROM ' . USERS_TABLE . ' WHERE username_clean = \'' . $db->sql_escape(utf8_clean_string($username)) . '\'';
            $result = $db->sql_query($sql);
            $id[] = $db->sql_fetchfield('user_id', $result);
            $db->sql_freeresult($result);
        }
        if (!sizeof($id)) {
            return;
        }
        $id[] = 1;
        foreach ($id as $i) {
            if ($i && !isset(self::$user[$i]) && !in_array($i, $users_to_query)) {
                $users_to_query[] = (int) $i;
            }
        }
        if (!sizeof($users_to_query)) {
            return;
        }
        // Grab all profile fields from users in id cache for later use - similar to the poster cache
        if ($config['user_blog_custom_profile_enable']) {
            if (!class_exists('custom_profile')) {
                include $phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx;
                $cp = new custom_profile();
            }
            $profile_fields_cache = $cp->generate_profile_fields_template('grab', $users_to_query);
        }
        // Grab user status information
        $status_data = array();
        $sql = 'SELECT session_user_id, MAX(session_time) AS online_time, MIN(session_viewonline) AS viewonline
			FROM ' . SESSIONS_TABLE . '
				WHERE ' . $db->sql_in_set('session_user_id', $users_to_query) . '
					GROUP BY session_user_id';
        $result = $db->sql_query($sql);
        while ($row = $db->sql_fetchrow($result)) {
            $status_data[$row['session_user_id']] = $row;
        }
        $db->sql_freeresult($result);
        $update_time = $config['load_online_time'] * 60;
        // Get the rest of the data on the users and parse everything we need
        $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $users_to_query);
        blog_plugins::plugin_do_ref('user_data_sql', $sql);
        $result = $db->sql_query($sql);
        while ($row = $db->sql_fetchrow($result)) {
            $user_id = $row['user_id'];
            blog_plugins::plugin_do_ref('user_data_while', $row);
            // view profile link
            $row['view_profile'] = append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=viewprofile&amp;u=" . $user_id);
            // Full username, with colour
            $row['username_full'] = get_username_string('full', $user_id, $row['username'], $row['user_colour']);
            // format the color correctly
            $row['user_colour'] = get_username_string('colour', $user_id, $row['username'], $row['user_colour']);
            // Avatar
            $row['avatar'] = get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']);
            // Rank
            get_user_rank($row['user_rank'], $row['user_posts'], $row['rank_title'], $row['rank_img'], $row['rank_img_src']);
            if ($row['user_type'] != USER_IGNORE && $row['user_id'] != ANONYMOUS) {
                // Online/Offline Status
                $row['status'] = isset($status_data[$user_id]) && time() - $update_time < $status_data[$user_id]['online_time'] && ($status_data[$user_id]['viewonline'] && $row['user_allow_viewonline'] || $auth->acl_get('u_viewonline')) ? true : false;
                // IM Links
                $row['aim_url'] = $row['user_aim'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=contact&amp;action=aim&amp;u={$user_id}") : '';
                $row['icq_url'] = $row['user_icq'] ? 'http://www.icq.com/people/webmsg.php?to=' . $row['user_icq'] : '';
                $row['jabber_url'] = $row['user_jabber'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=contact&amp;action=jabber&amp;u={$user_id}") : '';
                $row['msn_url'] = $row['user_msnm'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=contact&amp;action=msnm&amp;u={$user_id}") : '';
                $row['yim_url'] = $row['user_yim'] ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg' : '';
                // PM and email links
                $row['email_url'] = $config['board_email_form'] && $config['email_enable'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=email&amp;u={$user_id}") : ($config['board_hide_emails'] && !$auth->acl_get('a_email') ? '' : 'mailto:' . $row['user_email']);
                $row['pm_url'] = $row['user_id'] != ANONYMOUS && $config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}ucp.{$phpEx}", "i=pm&amp;mode=compose&amp;u={$user_id}") : '';
                // get the custom profile fields if the admin wants them
                if ($config['user_blog_custom_profile_enable']) {
                    $row['cp_row'] = isset($profile_fields_cache[$user_id]) ? $cp->generate_profile_fields_template('show', false, $profile_fields_cache[$user_id]) : array();
                }
            } else {
                $row = array_merge($row, array('status' => false, 'aim_url' => '', 'icq_url' => '', 'jabber_url' => '', 'msn_url' => '', 'yim_url' => '', 'email_url' => '', 'pm_url' => ''));
            }
            // now lets put everything in the user array
            self::$user[$user_id] = $row;
        }
        $db->sql_freeresult($result);
//.........这里部分代码省略.........
开发者ID:EXreaction,项目名称:User-Blog-Mod,代码行数:101,代码来源:blog_data.php

示例9: get_my_comments

function get_my_comments($goods_id, $type = 0, $page = 1)
{
    $res = $GLOBALS['db']->getAll("SELECT * FROM " . $GLOBALS['ecs']->table('goods_tag') . " WHERE goods_id = '{$goods_id}' AND state = 1");
    foreach ($res as $v) {
        $tags[$v['tag_id']] = $v['tag_name'];
    }
    if ($type != 4) {
        if ($type == 1) {
            $where .= " AND c.comment_rank in (5,4)";
        }
        if ($type == 2) {
            $where .= " AND c.comment_rank in (3,2)";
        }
        if ($type == 3) {
            $where .= " AND c.comment_rank = 1";
        }
        if ($type == 4) {
            $where .= " AND s.shaidan_id > 0";
        }
        $count = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('comment') . " AS c \n\t\t\t\t\t\t\t\t\t\t LEFT JOIN " . $GLOBALS['ecs']->table('shaidan') . " AS s ON c.rec_id=s.rec_id\n\t\t\t\t\t\t\t\t\t\t WHERE c.id_value = '{$goods_id}' AND c.status = 1 AND c.comment_rank > 0 {$where}");
        $size = 20;
        $page_count = $count > 0 ? intval(ceil($count / $size)) : 1;
        $sql = "SELECT c.*, s.shaidan_id, s.title, s.message as shaidan_message, s.status AS shaidan_status FROM " . $GLOBALS['ecs']->table('comment') . " AS c \n\t\t\t\tLEFT JOIN " . $GLOBALS['ecs']->table('users') . " AS u ON c.user_id=u.user_id\n\t\t\t\tLEFT JOIN " . $GLOBALS['ecs']->table('shaidan') . " AS s ON c.rec_id=s.rec_id\n\t\t\t\tWHERE c.id_value = '{$goods_id}' AND c.status = 1 AND c.comment_rank > 0 {$where} ORDER BY c.add_time DESC";
        $res = $GLOBALS['db']->selectLimit($sql, $size, ($page - 1) * $size);
        $points_list = array();
        while ($row = $GLOBALS['db']->fetchRow($res)) {
            $row['add_time_str'] = date("Y-m-d", $row['add_time']);
            $row['buy_time_str'] = date("Y-m-d", $row['buy_time']);
            $row['user_rank'] = get_user_rank($row['user_id']);
            if ($row['shaidan_id'] > 0 && $row['shaidan_status'] == 1) {
                $row['shaidan_imgs'] = $GLOBALS['db']->getAll("SELECT * FROM " . $GLOBALS['ecs']->table('shaidan_img') . " WHERE shaidan_id = '{$row['shaidan_id']}'");
                $row['shaidan_imgs_num'] = count($row['shaidan_imgs']);
            }
            if ($row['comment_tag']) {
                $comment_tag = explode(',', $row['comment_tag']);
                foreach ($comment_tag as $tag_id) {
                    $row['tags'][] = $tags[$tag_id];
                }
            }
            $parent_res = $GLOBALS['db']->getAll("SELECT * FROM " . $GLOBALS['ecs']->table('comment') . " WHERE parent_id = '" . $row['comment_id'] . "'");
            $row['comment_reps'] = $parent_res;
            $item_list[] = $row;
        }
        $arr = array();
        $arr['item_list'] = $item_list;
        $arr['page'] = $page;
        $arr['count'] = $count;
        $arr['size'] = $size;
        $arr['page_count'] = $page_count;
        $next = $page + 1;
        $prev = $page - 1;
        $arr['page_prev'] = "ShowMyComments({$goods_id},{$type},{$prev})";
        $arr['page_next'] = "ShowMyComments({$goods_id},{$type},{$next})";
        //		for ($i = 1 ; $i <= $page_count ; $i ++)
        //		{
        //			$arr['page_number'][$i] = "ShowMyComments($goods_id,$type,$i)";
        //		}
        //
        return $arr;
    } else {
        $count = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('shaidan') . " AS s \n\t\t\t\t\t\t\t\t\t\t WHERE s.goods_id = '{$goods_id}' AND s.status = 1");
        $size = 20;
        $page_count = $count > 0 ? intval(ceil($count / $size)) : 1;
        $sql = "SELECT s.*, u.user_name, c.comment_tag, c.comment_rank, c.comment_id FROM " . $GLOBALS['ecs']->table('shaidan') . " AS s \n\t\t\t\tLEFT JOIN " . $GLOBALS['ecs']->table('users') . " AS u ON s.user_id=u.user_id\n\t\t\t\tLEFT JOIN " . $GLOBALS['ecs']->table('comment') . " AS c ON c.rec_id=s.rec_id\n\t\t\t\tWHERE s.goods_id = '{$goods_id}' AND s.status = 1 ORDER BY s.add_time DESC";
        $res = $GLOBALS['db']->selectLimit($sql, $size, ($page - 1) * $size);
        $points_list = array();
        while ($row = $GLOBALS['db']->fetchRow($res)) {
            $row['buy_time'] = $GLOBALS['db']->getOne("SELECT o.add_time FROM " . $GLOBALS['ecs']->table('order_info') . " AS o\n\t\t\t\t\t\t\t\t\t\t\t\t\t   LEFT JOIN " . $GLOBALS['ecs']->table('order_goods') . " AS og ON o.order_id=og.order_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t   WHERE og.rec_id = '{$row['rec_id']}'");
            $row['add_time_str'] = date("Y-m-d", $row['add_time']);
            $row['buy_time_str'] = date("Y-m-d", $row['buy_time']);
            $row['user_rank'] = get_user_rank($row['user_id']);
            if ($row['shaidan_id'] > 0) {
                $row['shaidan_imgs'] = $GLOBALS['db']->getAll("SELECT * FROM " . $GLOBALS['ecs']->table('shaidan_img') . " WHERE shaidan_id = '{$row['shaidan_id']}'");
                $row['shaidan_imgs_num'] = count($row['shaidan_imgs']);
            }
            if ($row['comment_tag']) {
                $comment_tag = explode(',', $row['comment_tag']);
                foreach ($comment_tag as $tag_id) {
                    $row['tags'][] = $tags[$tag_id];
                }
            }
            $row['content'] = $row['message'];
            $row['hide_gnum'] = 1;
            if ($row['comment_id'] > 0) {
                $parent_res = $GLOBALS['db']->getAll("SELECT * FROM " . $GLOBALS['ecs']->table('comment') . " WHERE parent_id = '{$row['comment_id']}'");
                $row['comment_reps'] = $parent_res;
            }
            $item_list[] = $row;
        }
        $arr = array();
        $arr['item_list'] = $item_list;
        $arr['page'] = $page;
        $arr['count'] = $count;
        $arr['size'] = $size;
        $arr['page_count'] = $page_count;
        for ($i = 1; $i <= $page_count; $i++) {
            $arr['page_number'][$i] = "ShowMyComments({$goods_id},{$type},{$i})";
        }
        return $arr;
    }
//.........这里部分代码省略.........
开发者ID:moonlight-wang,项目名称:feilun,代码行数:101,代码来源:lib_comment.php

示例10: intval

    echo $json->encode($result);
    exit;
}
if ($_REQUEST['act'] == 'view') {
    $rec_id = intval($_REQUEST['id']);
    $cache_id = sprintf('%X', crc32($_REQUEST['id'] . 'goods_comment_view'));
    if (!$smarty->is_cached('goods_comment_view.dwt', $cache_id)) {
        $comment = $db->getRow("SELECT * FROM " . $ecs->table('comment') . " WHERE rec_id = '{$rec_id}'");
        $goods_id = $comment['id_value'];
        $res = $GLOBALS['db']->getAll("SELECT * FROM " . $GLOBALS['ecs']->table('goods_tag') . " WHERE goods_id = '{$goods_id}'");
        foreach ($res as $v) {
            $tags[$v['tag_id']] = $v['tag_name'];
        }
        $comment['add_time_str'] = date("Y-m-d", $comment['add_time']);
        $comment['buy_time_str'] = date("Y-m-d", $comment['buy_time']);
        $comment['user_rank'] = get_user_rank($comment['user_id']);
        if ($comment['shaidan_id'] > 0) {
            $comment['shaidan_imgs'] = $GLOBALS['db']->getAll("SELECT * FROM " . $GLOBALS['ecs']->table('shaidan_img') . " WHERE shaidan_id = '{$comment['shaidan_id']}'");
        }
        if ($comment['comment_tag']) {
            $comment_tag = explode(',', $comment['comment_tag']);
            foreach ($comment_tag as $tag_id) {
                $comment['tags'][] = $tags[$tag_id];
            }
        }
        $smarty->assign('comment', $comment);
        /* 获得商品的信息 */
        $goods = get_goods_info($goods_id);
        if ($goods === false) {
            /* 如果没有找到任何记录则跳回到首页 */
            ecs_header("Location: ./\n");
开发者ID:moonlight-wang,项目名称:feilun,代码行数:31,代码来源:goods_comment.php

示例11: mcp_warn_user_view


//.........这里部分代码省略.........
            $result = $db->sql_query($sql);
            $warning_row = $db->sql_fetchrow($result);
            $db->sql_freeresult($result);
            if (!$warning_row) {
                trigger_error('NO_WARNING');
            }
            if (!$warning_row['warning_status']) {
                trigger_error('WARNING_EXPIRED');
            }
            $warning_edit = unserialize($warning_row['log_data']);
        }
        if (strpos($this->u_action, "&amp;u={$user_id}") === false) {
            $this->p_master->adjust_url('&amp;u=' . $user_id);
            $this->u_action .= "&amp;u={$user_id}";
        }
        // Check if can send a notification
        if ($config['allow_privmsg']) {
            $auth2 = new \phpbb\auth\auth();
            $auth2->acl($user_row);
            $s_can_notify = $auth2->acl_get('u_readpm') ? true : false;
            unset($auth2);
        } else {
            $s_can_notify = false;
        }
        // Prevent against clever people
        if ($notify && !$s_can_notify) {
            $notify = false;
        }
        if (!$warning_id && !$user_row['user_ban_id'] && $user_row['user_warnings'] + 1 == $config['warnings_for_ban']) {
            $warn_type = WARNING_BAN;
            $warning = $user->lang('WARNING_BAN', (int) $user_row['user_warnings'] + 1, $warning);
        }
        if ($warning && $action == 'add_warning') {
            if (check_form_key('mcp_warn')) {
                if (!function_exists('user_ban')) {
                    include_once $phpbb_root_path . 'includes/functions_user.' . $phpEx;
                }
                if ($warning_id) {
                    $this->edit_warning($warning_row, $user_row, $warning, $warn_len, $warn_len_other, $warn_type);
                    $msg = $user->lang['USER_WARNING_EDITED'] . ($warn_type == BAN ? '<br /><br />' . $user->lang['BAN_UPDATE_SUCCESSFUL'] : '');
                    $email_template = 'warning_edited';
                } else {
                    $this->add_warning($user_row, $warning, $warn_len, $warn_len_other, $warn_type, $notify);
                    $msg = $user->lang['USER_WARNING_ADDED'];
                    $email_template = 'warning_user';
                    if ($warn_type == BAN) {
                        $ban = utf8_normalize_nfc($user_row['username']);
                        user_ban('user', $ban, $warn_len, $warn_len_other, 0, $warning, $warning);
                        $msg .= '<br /><br />' . $user->lang['BAN_UPDATE_SUCCESSFUL'];
                        $email_template = 'warning_user_ban';
                    } else {
                        if ($warn_type == WARNING_BAN) {
                            $ban = utf8_normalize_nfc($user_row['username']);
                            $user_ban_id = (int) user_ban('user', $ban, 0, 0, 0, $warning, $warning);
                            if ($user_ban_id) {
                                $sql = 'UPDATE ' . USERS_TABLE . "\tSET user_ban_id = {$user_ban_id}\n\t\t\t\t\t\t\t\tWHERE user_id = " . $user_row['user_id'];
                                $db->sql_query($sql);
                                $msg .= '<br /><br />' . $user->lang['BAN_UPDATE_SUCCESSFUL'];
                            }
                            $email_template = 'warning_ban_by_warning';
                        }
                    }
                }
                // Notify user about warning/ban
                if ($notify) {
                    $user->add_lang('acp/ban');
                    $length = $this->get_warning_end($warn_len, $warn_len_other);
                    $assign_vars_array = array('USERNAME' => htmlspecialchars_decode($user_row['username']), 'TO_USERNAME' => htmlspecialchars_decode($user_row['username']), 'FROM_USERNAME' => htmlspecialchars_decode($user->data['username']), 'WARNINGS_COUNT' => htmlspecialchars_decode($config['warnings_for_ban']), 'WARNING' => htmlspecialchars_decode($warning), 'WARNING_POSTER' => htmlspecialchars_decode($user->data['username']), 'WARNING_LENGTH' => $length ? htmlspecialchars_decode($user->format_date($length, $user_row['user_dateformat'])) : htmlspecialchars_decode($user->lang['PERMANENT']), 'WARNING_TYPE' => $warn_type == BAN ? htmlspecialchars_decode($user->lang['BAN']) : htmlspecialchars_decode($user->lang['WARNING']), 'WARNING_TYPE_OLD' => $warning_id ? $warning_row['warning_type'] == BAN ? htmlspecialchars_decode($user->lang['BAN']) : htmlspecialchars_decode($user->lang['WARNING']) : '', 'WARNING_LENGTH_OLD' => $warning_id ? $warning_row['warning_end'] ? htmlspecialchars_decode($user->format_date($warning_row['warning_end'], $user_row['user_dateformat'])) : htmlspecialchars_decode($user->lang['PERMANENT']) : '', 'WARNING_OLD' => isset($warning_edit[0]) ? $warning_edit[0] : '');
                    $this->user_notify($email_template, $user_row, $assign_vars_array, "{$phpbb_root_path}ext/rxu/AdvancedWarnings/language/{$user_row['user_lang']}/email");
                }
            } else {
                $msg = $user->lang['FORM_INVALID'];
            }
            $redirect = append_sid("{$phpbb_root_path}mcp.{$phpEx}", "i=notes&amp;mode=user_notes&amp;u={$user_id}");
            meta_refresh(2, $redirect);
            trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
        }
        // Generate the appropriate user information for the user we are looking at
        if (!function_exists('phpbb_get_user_avatar')) {
            include $phpbb_root_path . 'includes/functions.' . $phpEx;
        }
        if (!function_exists('get_user_rank')) {
            include $phpbb_root_path . 'includes/functions_display.' . $phpEx;
        }
        get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);
        $avatar_img = phpbb_get_user_avatar($user_row);
        if (isset($warning_row['warning_type'])) {
            $this->select_warn_type($warning_row['warning_type']);
        } else {
            $this->select_warn_type();
        }
        if (isset($warning_row['warning_end']) && $warning_row['warning_end']) {
            $this->display_warn_options('-1');
        } else {
            $this->display_warn_options();
        }
        // OK, they didn't submit a warning so lets build the page for them to do so
        $template->assign_vars(array('U_POST_ACTION' => $this->u_action, 'RANK_TITLE' => $rank_title, 'JOINED' => $user->format_date($user_row['user_regdate']), 'POSTS' => $user_row['user_posts'] ? $user_row['user_posts'] : 0, 'WARNINGS' => $user_row['user_warnings'] ? $user_row['user_warnings'] : 0, 'WARNING' => isset($warning_edit[0]) ? $warning_edit[0] : '', 'WARNING_ID' => isset($warning_row['warning_id']) ? $warning_row['warning_id'] : '', 'WARNING_END' => isset($warning_row['warning_end']) ? $warning_row['warning_end'] ? $user->format_date($warning_row['warning_end'], 'Y-m-d') : '' : '', 'USERNAME_FULL' => get_username_string('full', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), 'USERNAME_COLOUR' => get_username_string('colour', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), 'USERNAME' => get_username_string('username', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), 'U_PROFILE' => get_username_string('profile', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), 'AVATAR_IMG' => $avatar_img, 'RANK_IMG' => $rank_img, 'S_CAN_NOTIFY' => $s_can_notify));
        return $user_id;
    }
开发者ID:Galixte,项目名称:advanced_warnings,代码行数:101,代码来源:warnings_module.php

示例12: show_profile

/**
* Prepare profile data
*/
function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false)
{
	global $config, $auth, $template, $user, $phpEx, $phpbb_root_path;

	$username = $data['username'];
	$user_id = $data['user_id'];

	$rank_title = $rank_img = $rank_img_src = '';
	get_user_rank($data['user_rank'], (($user_id == ANONYMOUS) ? false : $data['user_posts']), $rank_title, $rank_img, $rank_img_src);
		// START needed for PBWoW
	$pbwow_config = obtain_pbwow_config();
	$cfg_blizz_ranks = array();
	$cfg_blizz_ranks = explode(',', $pbwow_config['pbwow_blizz_ranks']);
	$cfg_propass_ranks = array();
	$cfg_propass_ranks = explode(',', $pbwow_config['pbwow_propass_ranks']);

	if(isset($cfg_blizz_ranks) && strlen($cfg_blizz_ranks > 0) && ($pbwow_config['pbwow_blizz_enable']))
	{
		$rank_blizz = (in_array($data['user_rank'], $cfg_blizz_ranks)) ? true : false;
	}
	if(isset($cfg_propass_ranks) && strlen($cfg_propass_ranks > 0) && ($pbwow_config['pbwow_propass_enable']) && !($rank_blizz == true))
	{
		$rank_propass = (in_array($data['user_rank'], $cfg_propass_ranks)) ? true : false;
	}
	// Just gonna copy the current 'primary' rank into the special one, so the current one can be overwritten without losing the previous one.
	$special_rank_title = $special_rank_img = $special_rank_img_src = '';
	
	if(!empty($data['user_rank'])){
		$special_rank_title = $rank_title;
		$special_rank_img = $rank_img;
		$special_rank_img_src = $rank_img_src;
		$rank_title = $rank_img = $rank_img_src = '';
	}
	// Now we get all the 'secondary' ranks (based on post count etc.) and put them in the place of the user ranks. Switcharooh!
	get_user_additional_rank($data['user_rank'], $data['user_posts'], $rank_title, $rank_img, $rank_img_src);
	// END needed for PBWoW

	if (!empty($data['user_allow_viewemail']) || $auth->acl_get('a_user'))
	{
		$email = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&amp;u=' . $user_id) : (($config['board_hide_emails'] && !$auth->acl_get('a_user')) ? '' : 'mailto:' . $data['user_email']);
	}
	else
	{
		$email = '';
	}

	if ($config['load_onlinetrack'])
	{
		$update_time = $config['load_online_time'] * 60;
		$online = (time() - $update_time < $data['session_time'] && ((isset($data['session_viewonline']) && $data['session_viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false;
	}
	else
	{
		$online = false;
	}

	if ($data['user_allow_viewonline'] || $auth->acl_get('u_viewonline'))
	{
		$last_visit = (!empty($data['session_time'])) ? $data['session_time'] : $data['user_lastvisit'];
	}
	else
	{
		$last_visit = '';
	}

	$age = '';

	if ($config['allow_birthdays'] && $data['user_birthday'])
	{
		list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $data['user_birthday']));

		if ($bday_year)
		{
			$now = getdate(time() + $user->timezone + $user->dst - date('Z'));

			$diff = $now['mon'] - $bday_month;
			if ($diff == 0)
			{
				$diff = ($now['mday'] - $bday_day < 0) ? 1 : 0;
			}
			else
			{
				$diff = ($diff < 0) ? 1 : 0;
			}

			$age = (int) ($now['year'] - $bday_year - $diff);
		}
	}

	// Dump it out to the template
	return array(
		'AGE'			=> $age,
		'RANK_TITLE'	=> $rank_title,
		'JOINED'		=> $user->format_date($data['user_regdate']),
		'VISITED'		=> (empty($last_visit)) ? ' - ' : $user->format_date($last_visit),
		'POSTS'			=> ($data['user_posts']) ? $data['user_posts'] : 0,
		'WARNINGS'		=> isset($data['user_warnings']) ? $data['user_warnings'] : 0,
//.........这里部分代码省略.........
开发者ID:BACKUPLIB,项目名称:mwenhanced,代码行数:101,代码来源:memberlist.php

示例13: get_template_side

    /**
     * {@inheritdoc}
     */
    public function get_template_side($module_id)
    {
        switch ($this->db->get_sql_layer()) {
            case 'postgres':
                $sql = 'SELECT *
				FROM ' . USERS_TABLE . '
				WHERE user_type <> ' . USER_IGNORE . '
				AND user_type <> ' . USER_INACTIVE . '
				ORDER BY RANDOM()';
                break;
            case 'mssql':
            case 'mssql_odbc':
                $sql = 'SELECT *
				FROM ' . USERS_TABLE . '
				WHERE user_type <> ' . USER_IGNORE . '
				AND user_type <> ' . USER_INACTIVE . '
				ORDER BY NEWID()';
                break;
            default:
                $sql = 'SELECT *
				FROM ' . USERS_TABLE . '
				WHERE user_type <> ' . USER_IGNORE . '
				AND user_type <> ' . USER_INACTIVE . '
				ORDER BY RAND()';
                break;
        }
        $result = $this->db->sql_query_limit($sql, 1);
        $row = $this->db->sql_fetchrow($result);
        $avatar_img = phpbb_get_avatar(\phpbb\avatar\manager::clean_row($row, 'user'), 'USER_AVATAR');
        $rank_title = $rank_img = $rank_img_src = '';
        get_user_rank($row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src);
        $username = $row['username'];
        $user_id = (int) $row['user_id'];
        $colour = $row['user_colour'];
        $this->template->assign_block_vars('random_member', array('USERNAME_FULL' => get_username_string('full', $user_id, $username, $colour), 'USERNAME' => get_username_string('username', $user_id, $username, $colour), 'USER_COLOR' => get_username_string('colour', $user_id, $username, $colour), 'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $colour), 'RANK_TITLE' => $rank_title, 'RANK_IMG' => $rank_img, 'RANK_IMG_SRC' => $rank_img_src, 'USER_POSTS' => (int) $row['user_posts'], 'AVATAR_IMG' => $avatar_img, 'JOINED' => $this->user->format_date($row['user_regdate'])));
        $this->db->sql_freeresult($result);
        return 'random_member_side.html';
    }
开发者ID:sgtevmckay,项目名称:Board3-Portal,代码行数:41,代码来源:random_member.php

示例14: show_profile

/**
* Prepare profile data
*/
function show_profile($data)
{
    global $config, $auth, $template, $user, $phpEx, $phpbb_root_path;
    $username = $data['username'];
    $user_id = $data['user_id'];
    $rank_title = $rank_img = $rank_img_src = '';
    get_user_rank($data['user_rank'], $data['user_posts'], $rank_title, $rank_img, $rank_img_src);
    if (!empty($data['user_allow_viewemail']) || $auth->acl_get('a_email')) {
        $email = $config['board_email_form'] && $config['email_enable'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=email&amp;u=' . $user_id) : ($config['board_hide_emails'] && !$auth->acl_get('a_email') ? '' : 'mailto:' . $data['user_email']);
    } else {
        $email = '';
    }
    $last_visit = !empty($data['session_time']) ? $data['session_time'] : $data['user_lastvisit'];
    $update_time = $config['load_online_time'] * 60;
    $online = time() - $update_time < $data['session_time'] && (isset($data['session_viewonline']) && $data['user_allow_viewonline'] || $auth->acl_get('u_viewonline')) ? true : false;
    // Dump it out to the template
    return array('USERNAME' => $username, 'USER_COLOR' => !empty($data['user_colour']) ? $data['user_colour'] : '', 'RANK_TITLE' => $rank_title, 'JOINED' => $user->format_date($data['user_regdate']), 'VISITED' => empty($last_visit) ? ' - ' : $user->format_date($last_visit), 'POSTS' => $data['user_posts'] ? $data['user_posts'] : 0, 'WARNINGS' => isset($data['user_warnings']) ? $data['user_warnings'] : 0, 'ONLINE_IMG' => $online ? $user->img('btn_online', 'ONLINE') : $user->img('btn_offline', 'OFFLINE'), 'S_ONLINE' => $online ? true : false, 'RANK_IMG' => $rank_img, 'RANK_IMG_SRC' => $rank_img_src, 'ICQ_STATUS_IMG' => !empty($data['user_icq']) ? '<img src="http://web.icq.com/whitepages/online?icq=' . $data['user_icq'] . '&amp;img=5" width="18" height="18" />' : '', 'S_JABBER_ENABLED' => $config['jab_enable'] ? true : false, 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=viewprofile&amp;u=' . $user_id), 'U_SEARCH_USER' => $auth->acl_get('u_search') ? append_sid("{$phpbb_root_path}search.{$phpEx}", "author_id={$user_id}&amp;sr=posts") : '', 'U_NOTES' => $auth->acl_getf_global('m_') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=notes&amp;mode=user_notes&amp;u=' . $user_id, true, $user->session_id) : '', 'U_WARN' => $auth->acl_getf_global('m_warn') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=warn&amp;mode=warn_user&amp;u=' . $user_id, true, $user->session_id) : '', 'U_PM' => $auth->acl_get('u_sendpm') ? append_sid("{$phpbb_root_path}ucp.{$phpEx}", 'i=pm&amp;mode=compose&amp;u=' . $user_id) : '', 'U_EMAIL' => $email, 'U_WWW' => !empty($data['user_website']) ? $data['user_website'] : '', 'U_ICQ' => $data['user_icq'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=contact&amp;action=icq&amp;u=' . $user_id) : '', 'U_AIM' => $data['user_aim'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=contact&amp;action=aim&amp;u=' . $user_id) : '', 'U_YIM' => $data['user_yim'] ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . $data['user_yim'] . '&amp;.src=pg' : '', 'U_MSN' => $data['user_msnm'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=contact&amp;action=msnm&amp;u=' . $user_id) : '', 'U_JABBER' => $data['user_jabber'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=contact&amp;action=jabber&amp;u=' . $user_id) : '', 'LOCATION' => $data['user_from'] ? $data['user_from'] : '', 'L_VIEWING_PROFILE' => sprintf($user->lang['VIEWING_PROFILE'], $username), 'S_ONLINE' => $online ? true : false);
}
开发者ID:yunsite,项目名称:gloryroad,代码行数:21,代码来源:memberlist.php

示例15: foreach

* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
if (!defined('IN_PHPBB')) {
    exit;
}
global $k_config, $k_blocks, $template, $user;
$this->template = $template;
$this->user = $user;
$total_queries = $queries = $cached_queries = 0;
$rank_title = $rank_img = $rank_img_src = '';
if (!function_exists('get_user_rank')) {
    include $this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext;
}
foreach ($k_blocks as $blk) {
    if ($blk['html_file_name'] == 'block_user_information.html') {
        $block_cache_time = $blk['block_cache_time'];
        break;
    }
}
$block_cache_time = isset($block_cache_time) ? $block_cache_time : $k_config['k_block_cache_time_default'];
get_user_rank($this->user->data['user_rank'], $this->user->data['user_id'] == ANONYMOUS ? false : $this->user->data['user_posts'], $rank_title, $rank_img, $rank_img_src);
// Generate logged in/logged out status
if ($this->user->data['user_id'] != ANONYMOUS) {
    $u_login_logout = append_sid("{$this->phpbb_root_path}ucp.{$phpEx}", 'mode=logout', true, $this->user->session_id);
    $l_login_logout = sprintf($this->user->lang['LOGOUT_USER'], $this->user->data['username']);
} else {
    $u_login_logout = append_sid("{$this->phpbb_root_path}ucp.{$phpEx}", 'mode=login');
    $l_login_logout = $this->user->lang['LOGIN'];
}
$this->template->assign_vars(array('AVATAR' => phpbb_get_user_avatar($this->user->data, $user->lang['USER_AVATAR'], false), 'WELCOME_SITE' => sprintf($this->user->lang['WELCOME_SITE'], $this->config['sitename']), 'USR_RANK_TITLE' => $rank_title, 'USR_RANK_IMG' => $rank_img, 'U_LOGIN_LOGOUT' => $u_login_logout, 'L_LOGIN_LOGOUT' => $l_login_logout, 'S_LOGIN_ACTION' => append_sid("{$this->phpbb_root_path}ucp.{$phpEx}", 'mode=login')));
开发者ID:phpbbireland,项目名称:portal,代码行数:31,代码来源:block_user_information.php


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