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


PHP fetch_avatar_from_userinfo函数代码示例

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


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

示例1: process_showgroups_userinfo

function process_showgroups_userinfo($user)
{
    global $vbulletin, $permissions, $show;
    $user = array_merge($user, convert_bits_to_array($user['options'], $vbulletin->bf_misc_useroptions));
    $user = array_merge($user, convert_bits_to_array($user['adminoptions'], $vbulletin->bf_misc_adminoptions));
    cache_permissions($user, false);
    fetch_online_status($user);
    if (!$user['invisible'] or $permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseehidden']) {
        $user['lastonline'] = vbdate($vbulletin->options['dateformat'], $user['lastactivity'], 1);
    } else {
        $user['lastonline'] = ' ';
    }
    fetch_musername($user);
    fetch_avatar_from_userinfo($user, true);
    return $user;
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:16,代码来源:showgroups.php

示例2: array

    $templatename = 'socialgroups_group';
}
// #######################################################################
if ($_REQUEST['do'] == 'viewmembers') {
    $vbulletin->input->clean_array_gpc('r', array('perpage' => TYPE_UINT, 'pagenumber' => TYPE_UINT));
    $perpage = $vbulletin->GPC['perpage'];
    $pagenumber = $vbulletin->GPC['pagenumber'];
    $totalmembers = $group['members'];
    sanitize_pageresults($totalmembers, $pagenumber, $perpage);
    $groupmembers = $vbulletin->db->query_read("\n\t\tSELECT userfield.*, usertextfield.*, user.*, UNIX_TIMESTAMP(passworddate) AS passworddate,\n\t\t\tIF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, (user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible,\n\t\t\t" . ($vbulletin->options['avatarenabled'] ? 'avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline, customavatar.width AS avwidth, customavatar.height AS avheight,' : '') . "\n\t\t\tcustomprofilepic.userid AS profilepic, customprofilepic.dateline AS profilepicdateline, customprofilepic.width AS ppwidth, customprofilepic.height AS ppheight,\n\t\t\tuser.icq AS icq, user.aim AS aim, user.yahoo AS yahoo, user.msn AS msn, user.skype AS skype\n\t\tFROM " . TABLE_PREFIX . "socialgroupmember AS socialgroupmember\n\t\tINNER JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = socialgroupmember.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON (user.userid = userfield.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON (usertextfield.userid = user.userid)\n\t\t" . ($vbulletin->options['avatarenabled'] ? "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON (avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON (customavatar.userid = user.userid) " : '') . "\n\t\tLEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid)\n\t\tWHERE socialgroupmember.groupid = " . $vbulletin->GPC['groupid'] . " AND socialgroupmember.type = 'member'\n\t\tORDER BY user.username\n\t\tLIMIT " . ($pagenumber - 1) * $perpage . ", {$perpage}\n\t");
    require_once DIR . '/includes/functions_bigthree.php';
    while ($groupmember = $vbulletin->db->fetch_array($groupmembers)) {
        $width = 0;
        $height = 0;
        $alt = exec_switch_bg();
        fetch_avatar_from_userinfo($groupmember, true);
        fetch_musername($groupmember);
        $user =& $groupmember;
        fetch_online_status($user, true);
        construct_im_icons($user, true);
        ($hook = vBulletinHook::fetch_hook('group_memberbit')) ? eval($hook) : false;
        eval('$member_list .= "' . fetch_template('memberinfo_small') . '";');
    }
    $navbits = array('group.php' . $vbulletin->session->vars['sessionurl_q'] => $vbphrase['social_groups'], 'group.php?' . $vbulletin->session->vars['sessionurl'] . 'groupid=' . $group['groupid'] => $group['name'], '' => $vbphrase['member_list']);
    $custompagetitle = $group['name'] . ' - ' . $vbphrase['member_list'];
    $pagenav = construct_page_nav($pagenumber, $perpage, $totalmembers, 'group.php?' . $vbulletin->session->vars['sessionurl'] . 'do=viewmembers&groupid=' . $group['groupid'] . ($perpage ? "&pp={$perpage}" : ''));
    eval('$memberinfo_css = "' . fetch_template('memberinfo_css') . '";');
    $templatename = 'socialgroups_memberlist';
}
// #######################################################################
if ($_REQUEST['do'] == 'search') {
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:group.php

示例3: construct

 /**
  * Template method that does all the work to display an issue note, including processing the template
  *
  * @return	string	Templated note output
  */
 function construct()
 {
     ($hook = vBulletinHook::fetch_hook('group_messagebit_display_start')) ? eval($hook) : false;
     // preparation for display...
     $this->prepare_start();
     if ($this->message['userid']) {
         $this->process_registered_user();
     } else {
         $this->process_unregistered_user();
     }
     fetch_avatar_from_userinfo($this->message, true);
     $this->process_date_status();
     $this->process_display();
     $this->process_text();
     $this->prepare_end();
     // actual display...
     $group =& $this->group;
     $message =& $this->message;
     global $show, $vbphrase, $stylevar;
     global $spacer_open, $spacer_close;
     global $bgclass, $altbgclass;
     exec_switch_bg();
     ($hook = vBulletinHook::fetch_hook('group_messagebit_display_complete')) ? eval($hook) : false;
     eval('$output = "' . fetch_template($this->template) . '";');
     return $output;
 }
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:class_groupmessage.php

示例4: prepare_output

 /**
  * Prepare any data needed for the output
  *
  * @param	string	The id of the block
  * @param	array	Options specific to the block
  */
 function prepare_output($id = '', $options = array())
 {
     global $show, $vbphrase;
     if ($this->profile->userinfo['friendcount'] != 0) {
         require_once DIR . '/includes/functions_bigthree.php';
         $this->block_data = array();
         if (is_array($options)) {
             $options = array_merge($this->option_defaults, $options);
         } else {
             $options = $this->option_defaults;
         }
         switch ($options['fetchorder']) {
             case 'asc':
                 $friendorder = 'user.username ASC';
                 break;
             case 'desc':
                 $friendorder = 'user.username DESC';
                 break;
             case 'rand':
             default:
                 $friendorder = 'RAND()';
         }
         $pagenumber = $options['pagenumber'];
         if (isset($options['perpage'])) {
             $perpage = $options['perpage'];
         } else {
             $perpage = $options['fetchamount'];
         }
         if (!$pagenumber or $options['tab'] != $id or empty($options['tab'])) {
             $pagenumber = 1;
         } else {
             if ($pagenumber > ceil($this->profile->userinfo['friendcount'] / $perpage)) {
                 $pagenumber = ceil($this->profile->userinfo['friendcount'] / $perpage);
             }
         }
         $limitstart = ($pagenumber - 1) * $perpage;
         $limitamount = max(1, min($perpage, $this->profile->userinfo['friendcount'] - $limitstart));
         $hook_query_fields = $hook_query_joins = $hook_query_where = '';
         ($hook = vBulletinHook::fetch_hook('member_profileblock_friends_query')) ? eval($hook) : false;
         $friends_sql = $this->registry->db->query_read_slave("\n\t\t\t\tSELECT user.*, (user.options & " . $this->registry->bf_misc_useroptions['invisible'] . ") AS invisible " . ($this->registry->options['avatarenabled'] ? ", avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustom, customavatar.dateline AS avatardateline, customavatar.filedata_thumb, customavatar.height AS avheight, customavatar.width AS avwidth, customavatar.width_thumb AS avwidth_thumb, customavatar.height_thumb AS avheight_thumb" : "") . "\n\t\t\t\t\t{$hook_query_fields}\n\t\t\t\tFROM " . TABLE_PREFIX . "userlist AS userlist\n\t\t\t\tINNER JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = userlist.relationid)" . ($this->registry->options['avatarenabled'] ? "\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON (avatar.avatarid = user.avatarid)\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON (customavatar.userid = user.userid) " : '') . "\n\t\t\t\t{$hook_query_joins}\n\t\t\t\tWHERE userlist.userid = " . $this->profile->userinfo['userid'] . "\n\t\t\t\t\tAND userlist.type = 'buddy'\n\t\t\t\t\tAND userlist.friend = 'yes'\n\t\t\t\t\t{$hook_query_where}\n\t\t\t\tORDER BY {$friendorder}\n\t\t\t\tLIMIT {$limitstart}, {$limitamount}\n\t\t\t");
         $friendbits = '';
         $alt = 'alt2';
         while ($user = $this->registry->db->fetch_array($friends_sql)) {
             fetch_avatar_from_userinfo($user, true);
             fetch_musername($user);
             $alt = $alt == 'alt1' ? 'alt2' : 'alt1';
             fetch_online_status($user, true);
             construct_im_icons($user, true);
             if ($user['userid'] == $this->registry->userinfo['userid'] or $this->profile->userinfo['userid'] == $this->registry->userinfo['userid']) {
                 if ($user['userid'] == $this->registry->userinfo['userid']) {
                     $show['return'] = true;
                     $remove = array('userid' => $this->profile->userinfo['userid'], 'return' => 1);
                 } else {
                     $remove = array('userid' => $user['userid']);
                 }
                 $show['breakfriendship'] = true;
             } else {
                 $show['breakfriendship'] = false;
             }
             ($hook = vBulletinHook::fetch_hook('member_profileblock_friendbit')) ? eval($hook) : false;
             $templater = vB_Template::create($options['membertemplate']);
             $templater->register('remove', $remove);
             $templater->register('user', $user);
             $friendbits .= $templater->render();
         }
         $pageinfo = array('tab' => $id);
         if ($perpage != $this->registry->options['friends_perpage']) {
             $paginfo['pp'] = $perpage;
         }
         $this->block_data['start_friends'] = $limitstart + 1;
         $this->block_data['friendbits'] = $friendbits;
         $this->block_data['showtotal'] = vb_number_format($this->registry->db->num_rows($friends_sql));
         $this->block_data['end_friends'] = $limitstart + $this->block_data['showtotal'];
         sanitize_pageresults($this->profile->userinfo['friendcount'], $pagenumber, $perpage, 100, 5);
         $this->block_data['pagenav'] = construct_page_nav($pagenumber, $perpage, $this->profile->userinfo['friendcount'], '', '', $id, 'member', $this->profile->userinfo, $pageinfo);
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:83,代码来源:class_profileblock.php

示例5: render

 public function render($current_user, $criteria, $template = '')
 {
     //ensure that the phrases used by events are in the phrase list.
     $phrase = new vB_Legacy_Phrase();
     $phrase->add_phrase_groups(array('calendar', 'holiday', 'timezone', 'posting', 'user'));
     global $show, $bgclass;
     //a bunch of crap set by fetch_event_date_time that we send to the template
     global $date1, $date2, $time1, $time2, $recurcriteria, $eventdate;
     //a bunch of crap set by fetch_event_date_time that I can't find any use of.
     //leaving it in for now in case I missed some use of globals.
     global $titlecolor, $allday, $calendarinfo;
     $eventinfo = $this->event->get_record();
     $calendarinfo = $this->event->get_calendar()->get_record();
     //event['dst'] means "don't adjust event time for dst"
     $offset = $current_user->getTimezoneOffset(!$eventinfo['dst']);
     $eventinfo['dateline_from_user'] = $eventinfo['dateline_from'] + $offset * 3600;
     $eventinfo['dateline_to_user'] = $eventinfo['dateline_to'] + $offset * 3600;
     $eventinfo = fetch_event_date_time($eventinfo);
     fetch_musername($eventinfo);
     if (!$eventinfo['holidayid']) {
         $bgclass = 'alt2';
         //Custom fields are a little weird.  By default we don't show a blank value, but
         //the conditional is in the template so its possible that the user by change that.
         //We don't show the text block unless we have at least one set field, but again
         //the user can change that.  I'm not sure why somebody would want to do these
         //things but its not worth altering the behavior.  It does mean that we can't
         //rely on either field_text being blank when there are no set fields
         $custom_fields = $this->event->get_custom_fields();
         $custom_field_text = $this->render_custom_fields($custom_fields);
         $show['customfields'] = $this->have_set_customfield($custom_fields);
         $show['holiday'] = false;
         $show['caneditevent'] = $this->event->can_edit($current_user);
         $show['subscribed'] = !empty($eventinfo['subscribed']) ? true : false;
         $show['subscribelink'] = ($eventinfo['subscribed'] or $this->event->can_subscribe($current_user));
     } else {
         $custom_field_text = '';
         $show['holiday'] = true;
         $show['caneditevent'] = false;
         $show['subscribed'] = false;
         $show['subscribelink'] = false;
     }
     exec_switch_bg();
     if (!$eventinfo['singleday'] and gmdate('w', $eventinfo['dateline_from_user']) != gmdate('w', $eventinfo['dateline_from'] + $eventinfo['utc'] * 3600)) {
         $show['adjustedday'] = true;
         $eventinfo['timezone'] = str_replace(' ', ' ', $vbphrase[fetch_timezone($eventinfo['utc'])]);
     } else {
         $show['adjustedday'] = false;
     }
     $show['ignoredst'] = ($eventinfo['dst'] and !$eventinfo['singleday']) ? true : false;
     $show['postedby'] = !empty($eventinfo['userid']) ? true : false;
     $show['singleday'] = !empty($eventinfo['singleday']) ? true : false;
     if (($show['candeleteevent'] or $show['canmoveevent'] or $show['caneditevent']) and !$show['holiday']) {
         $show['eventoptions'] = true;
     }
     $eventinfo = array_merge($eventinfo, convert_bits_to_array($eventinfo['options'], vB::$vbulletin->bf_misc_useroptions));
     $eventinfo = array_merge($eventinfo, convert_bits_to_array($eventinfo['adminoptions'], vB::$vbulletin->bf_misc_adminoptions));
     cache_permissions($eventinfo, false);
     //we already have the avatar info, no need to refetch.
     fetch_avatar_from_userinfo($eventinfo);
     // prepare the member action drop-down menu
     $memberaction_dropdown = construct_memberaction_dropdown($eventinfo);
     ($hook = vBulletinHook::fetch_hook('calendar_getday_event')) ? eval($hook) : false;
     //some globals registered for the template's sake
     global $gobutton, $spacer_open, $spacer_close;
     $templater = vB_Template::create('calendar_showeventsbit');
     $templater->register('calendarinfo', $calendarinfo);
     $templater->register('customfields', $custom_field_text);
     $templater->register('date1', $date1);
     $templater->register('date2', $date2);
     $templater->register('time1', $time1);
     $templater->register('time2', $time2);
     $templater->register('eventdate', $eventdate);
     $templater->register('eventinfo', $eventinfo);
     $templater->register('gobutton', $gobutton);
     $templater->register('memberaction_dropdown', $memberaction_dropdown);
     $templater->register('recurcriteria', $recurcriteria);
     $templater->register('spacer_close', $spacer_close);
     $templater->register('spacer_open', $spacer_open);
     return $templater->render();
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:80,代码来源:event.php

示例6: do_get_subscriptions


//.........这里部分代码省略.........
        }
        $hasthreads = true;
        $threadbits = '';
        $pagenav = '';
        $counter = 0;
        $toread = 0;
        $vbulletin->options['showvotes'] = intval($vbulletin->options['showvotes']);
        if ($vbulletin->userinfo['userid'] and in_coventry($vbulletin->userinfo['userid'], true)) {
            $lastpost_info = "IF(tachythreadpost.userid IS NULL, thread.lastpost, tachythreadpost.lastpost) AS lastpost, " . "IF(tachythreadpost.userid IS NULL, thread.lastposter, tachythreadpost.lastposter) AS lastposter, " . "IF(tachythreadpost.userid IS NULL, thread.lastposterid, tachythreadpost.lastposterid) AS lastposterid, " . "IF(tachythreadpost.userid IS NULL, thread.lastpostid, tachythreadpost.lastpostid) AS lastpostid";
            $tachyjoin = "LEFT JOIN " . TABLE_PREFIX . "tachythreadpost AS tachythreadpost ON " . "(tachythreadpost.threadid = thread.threadid AND tachythreadpost.userid = " . $vbulletin->userinfo['userid'] . ')';
        } else {
            $lastpost_info = 'thread.lastpost, thread.lastposter, thread.lastposterid, thread.lastpostid';
            $tachyjoin = '';
        }
        $hook_query_fields = $hook_query_joins = $hook_query_where = '';
        $threads = $db->query_read_slave("\n\t\t\tSELECT\n\t\t\t\tIF(thread.votenum >= " . $vbulletin->options['showvotes'] . ", thread.votenum, 0) AS votenum,\n\t\t\t\tIF(thread.votenum >= " . $vbulletin->options['showvotes'] . " AND thread.votenum > 0, thread.votetotal / thread.votenum, 0) AS voteavg,\n\t\t\t\tthread.votetotal,\n\t\t\t\t{$previewfield} thread.threadid, thread.title AS threadtitle, thread.forumid, thread.pollid,\n\t\t\t\tthread.open, thread.replycount, thread.postusername, thread.prefixid,\n\t\t\t\t{$lastpost_info}, thread.postuserid, thread.dateline, thread.views, thread.iconid AS threadiconid,\n\t\t\t\tthread.notes, thread.visible, thread.attach, thread.taglist\n\t\t\t\t" . ($vbulletin->options['threadmarking'] ? ", threadread.readtime AS threadread" : '') . "\n\t\t\t\t{$hook_query_fields}\n\t\t\tFROM " . TABLE_PREFIX . "thread AS thread\n\t\t\t{$previewjoin}\n\t\t\t" . ($vbulletin->options['threadmarking'] ? " LEFT JOIN " . TABLE_PREFIX . "threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = " . $vbulletin->userinfo['userid'] . ")" : '') . "\n\t\t\t{$tachyjoin}\n\t\t\t{$hook_query_joins}\n\t\t\tWHERE thread.threadid IN ({$threadids})\n\t\t\tORDER BY {$sqlsortfield} {$sqlsortorder}\n\t\t");
        unset($sqlsortfield, $sqlsortorder);
        require_once DIR . '/includes/functions_forumdisplay.php';
        // Get Dot Threads
        $dotthreads = fetch_dot_threads_array($threadids);
        if ($vbulletin->options['showdots'] and $vbulletin->userinfo['userid']) {
            $show['dotthreads'] = true;
        } else {
            $show['dotthreads'] = false;
        }
        if ($vbulletin->options['threadpreview'] and $vbulletin->userinfo['ignorelist']) {
            // Get Buddy List
            $buddy = array();
            if (trim($vbulletin->userinfo['buddylist'])) {
                $buddylist = preg_split('/( )+/', trim($vbulletin->userinfo['buddylist']), -1, PREG_SPLIT_NO_EMPTY);
                foreach ($buddylist as $buddyuserid) {
                    $buddy["{$buddyuserid}"] = 1;
                }
            }
            DEVDEBUG('buddies: ' . implode(', ', array_keys($buddy)));
            // Get Ignore Users
            $ignore = array();
            if (trim($vbulletin->userinfo['ignorelist'])) {
                $ignorelist = preg_split('/( )+/', trim($vbulletin->userinfo['ignorelist']), -1, PREG_SPLIT_NO_EMPTY);
                foreach ($ignorelist as $ignoreuserid) {
                    if (!$buddy["{$ignoreuserid}"]) {
                        $ignore["{$ignoreuserid}"] = 1;
                    }
                }
            }
            DEVDEBUG('ignored users: ' . implode(', ', array_keys($ignore)));
        }
        $foruminfo['allowratings'] = true;
        $show['notificationtype'] = true;
        $show['threadratings'] = true;
        $show['threadrating'] = true;
        while ($thread = $db->fetch_array($threads)) {
            $threadid = $thread['threadid'];
            // build thread data
            $thread = process_thread_array($thread, $lastread["{$thread['forumid']}"]);
            switch ($emailupdate["{$thread['threadid']}"]) {
                case 0:
                    $thread['notification'] = $vbphrase['none'];
                    break;
                case 1:
                    $thread['notification'] = $vbphrase['instant'];
                    break;
                case 2:
                    $thread['notification'] = $vbphrase['daily'];
                    break;
                case 3:
                    $thread['notification'] = $vbphrase['weekly'];
                    break;
                default:
                    $thread['notification'] = $vbphrase['n_a'];
            }
            $avatarurl = '';
            if ($thread['lastpost_userid'] > 0) {
                $userinfoavatar = fetch_userinfo($thread['lastpost_userid'], FETCH_USERINFO_AVATAR);
                fetch_avatar_from_userinfo($userinfoavatar, true, false);
                if ($userinfoavatar['avatarurl'] != '') {
                    $avatarurl = process_avatarurl($userinfoavatar['avatarurl']);
                }
                unset($userinfoavatar);
            }
            $tmp = array('thread_id' => $thread['threadid'], 'new_posts' => $show['gotonewpost'] ? true : false, 'forum_id' => $thread['forumid'], 'total_posts' => $thread['totalposts'] ? $thread['totalposts'] : 0, 'forum_title' => prepare_utf8_string($thread['forumtitle']), 'thread_title' => prepare_utf8_string($thread['threadtitle']), 'thread_preview' => prepare_utf8_string(preview_chop(html_entity_decode($thread['preview']), FR_PREVIEW_LEN)), 'post_userid' => $thread['lastpost_userid'], 'post_lastposttime' => prepare_utf8_string(date_trunc($thread['lastpostdate']) . ' ' . $thread['lastposttime']), 'post_username' => prepare_utf8_string(strip_tags($thread['lastpost_username'])));
            if ($avatarurl != '') {
                $tmp['avatarurl'] = $avatarurl;
            }
            if ($thread['attach']) {
                $tmp['attach'] = true;
            }
            if ($thread['pollid']) {
                $tmp['poll'] = true;
            }
            $thread_data[] = $tmp;
        }
        $db->free_result($threads);
        unset($threadids);
    } else {
        $totalallthreads = 0;
    }
    $out = array('threads' => $thread_data, 'total_threads' => $totalallthreads);
    return $out;
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:subscriptions.php

示例7: prepare_avatar

 /**
  * Prepares the User's Avatar
  *
  */
 function prepare_avatar()
 {
     fetch_avatar_from_userinfo($this->userinfo, true, false);
     if ($this->userinfo['avatarurl'] == '' or !$this->registry->options['avatarenabled'] or $this->userinfo['hascustomavatar'] and !($this->userinfo['permissions']['genericpermissions'] & $this->registry->bf_ugp_genericpermissions['canuseavatar']) and !$this->userinfo['adminavatar']) {
         $this->prepared['avatarurl'] = '';
         $this->prepared['avatarsize'] = '';
     } else {
         $this->prepared['avatarsize'] = ($this->userinfo['avatarwidth'] ? ' width="' . $this->userinfo['avatarwidth'] . '"' : '') . ($this->userinfo['avatarheight'] ? ' height="' . $this->userinfo['avatarheight'] . '"' : '');
         $this->prepared['avatarurl'] = $this->userinfo['avatarurl'];
     }
 }
开发者ID:holandacz,项目名称:nb4,代码行数:15,代码来源:class_userprofile.php

示例8: do_online

function do_online()
{
    global $vbulletin, $db;
    $showmembers = true;
    $showguests = true;
    $showspiders = true;
    $datecut = TIMENOW - $vbulletin->options['cookietimeout'];
    $wol_event = array();
    $wol_pm = array();
    $wol_calendar = array();
    $wol_user = array();
    $wol_forum = array();
    $wol_link = array();
    $wol_thread = array();
    $wol_post = array();
    $sqlsort = 'user.username';
    $sortfield = 'username';
    $hook_query_fields = $hook_query_joins = $hook_query_where = '';
    ($hook = vBulletinHook::fetch_hook('online_query')) ? eval($hook) : false;
    $allusers = $db->query_read_slave("\n\tSELECT\n\t    user.username, session.useragent, session.location, session.lastactivity, user.userid, user.options, session.host, session.badlocation, session.incalendar, user.aim, user.icq, user.msn, user.yahoo, user.skype,\n\t    IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid\n\t{$hook_query_fields}\n\tFROM " . TABLE_PREFIX . "session AS session\n\t" . iif($vbulletin->options['WOLguests'], " LEFT JOIN " . TABLE_PREFIX . "user AS user USING (userid) ", ", " . TABLE_PREFIX . "user AS user") . "\n\t{$hook_query_joins}\n\tWHERE session.lastactivity > {$datecut}\n\t" . iif(!$vbulletin->options['WOLguests'], " AND session.userid = user.userid", "") . "\n\t{$hook_query_where}\n\tORDER BY {$sqlsort} {$sortorder}\n    ");
    require_once DIR . '/includes/class_postbit.php';
    while ($users = $db->fetch_array($allusers)) {
        if ($users['userid']) {
            // Reg'd Member
            if (!$showmembers) {
                continue;
            }
            $users = array_merge($users, convert_bits_to_array($users['options'], $vbulletin->bf_misc_useroptions));
            $key = $users['userid'];
            if ($key == $vbulletin->userinfo['userid']) {
                // in case this is the first view for the user, fake it that show up to themself
                $foundviewer = true;
            }
            if (empty($userinfo["{$key}"]['lastactivity']) or $userinfo["{$key}"]['lastactivity'] < $users['lastactivity']) {
                unset($userinfo["{$key}"]);
                // need this to sort by lastactivity
                $userinfo["{$key}"] = $users;
                fetch_musername($users);
                $userinfo["{$key}"]['musername'] = $users['musername'];
                $userinfo["{$key}"]['useragent'] = htmlspecialchars_uni($users['useragent']);
                $userinfoavatar = fetch_userinfo($key, FETCH_USERINFO_AVATAR);
                fetch_avatar_from_userinfo($userinfoavatar, true, false);
                if ($userinfoavatar['avatarurl'] != '') {
                    $userinfo["{$key}"]['avatarurl'] = process_avatarurl($userinfoavatar['avatarurl']);
                }
                unset($userinfoavatar);
                if ($users['invisible']) {
                    if ($permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseehidden'] or $key == $vbulletin->userinfo['userid']) {
                        $userinfo["{$key}"]['hidden'] = '*';
                        $userinfo["{$key}"]['invisible'] = 0;
                    }
                }
                if ($vbulletin->options['WOLresolve'] and $permissions['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlineip']) {
                    $userinfo["{$key}"]['host'] = @gethostbyaddr($users['host']);
                }
                $userinfo["{$key}"]['buddy'] = $buddy["{$key}"];
            }
        } else {
            // Guest or Spider..
            $spider = '';
            if ($vbulletin->options['enablespiders'] and !empty($vbulletin->wol_spiders)) {
                if (preg_match('#(' . $vbulletin->wol_spiders['spiderstring'] . ')#si', $users['useragent'], $agent)) {
                    $agent = strtolower($agent[1]);
                    // Check ip address
                    if (!empty($vbulletin->wol_spiders['agents']["{$agent}"]['lookup'])) {
                        $ourip = ip2long($users['host']);
                        foreach ($vbulletin->wol_spiders['agents']["{$agent}"]['lookup'] as $key => $ip) {
                            if ($ip['startip'] and $ip['endip']) {
                                if ($ourip >= $ip['startip'] and $ourip <= $ip['endip']) {
                                    $spider = $vbulletin->wol_spiders['agents']["{$agent}"];
                                    break;
                                }
                            } else {
                                if ($ip['startip'] == $ourip) {
                                    $spider = $vbulletin->wol_spiders['agents']["{$agent}"];
                                    break;
                                }
                            }
                        }
                    } else {
                        $spider = $vbulletin->wol_spiders['agents']["{$agent}"];
                    }
                }
            }
            if ($spider) {
                if (!$showspiders) {
                    continue;
                }
                $guests["{$count}"] = $users;
                $guests["{$count}"]['spider'] = $spider['name'];
                $guests["{$count}"]['spidertype'] = $spider['type'];
            } else {
                if (!$showguests) {
                    continue;
                }
                $guests["{$count}"] = $users;
            }
            $guests["{$count}"]['username'] = $vbphrase['guest'];
            $guests["{$count}"]['invisible'] = 0;
            $guests["{$count}"]['displaygroupid'] = 1;
//.........这里部分代码省略.........
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:online.php

示例9: construct

 /**
  * Template method that does all the work to render the item, including processing the template
  *
  * @access public
  *
  * @return	string	Templated note output
  */
 function construct()
 {
     if ($this->hook_display_start) {
         ($hook = vBulletinHook::fetch_hook($this->hook_display_start)) ? eval($hook) : false;
     }
     // preparation for display...
     $this->prepare_start();
     if ($this->process_user) {
         if ($this->item['userid']) {
             $this->process_registered_user();
         } else {
             $this->process_unregistered_user();
         }
     }
     if ($this->use_avatar) {
         fetch_avatar_from_userinfo($this->item, true);
     }
     $this->process_date_status();
     $this->process_display();
     $this->process_text();
     $this->prepare_end();
     // actual display...
     if ($this->template_item_var) {
         ${$this->template_item_var} = $this->item;
     }
     global $show, $vbphrase, $stylevar;
     global $spacer_open, $spacer_close;
     global $perpage, $pagenumber;
     global $bgclass, $altbgclass;
     exec_switch_bg();
     if ($this->hook_display_complete) {
         ($hook = vBulletinHook::fetch_hook($this->hook_display_complete)) ? eval($hook) : false;
     }
     eval('$output = "' . fetch_template($this->template) . '";');
     return $output;
 }
开发者ID:benyamin20,项目名称:vbregistration,代码行数:43,代码来源:class_groupmessage.php

示例10: construct

 /**
  * Template method that does all the work to render the item, including processing the template
  *
  * @access public
  *
  * @return	string	Templated note output
  */
 function construct()
 {
     if ($this->hook_display_start) {
         ($hook = vBulletinHook::fetch_hook($this->hook_display_start)) ? eval($hook) : false;
     }
     // preparation for display...
     $this->prepare_start();
     if ($this->use_avatar) {
         fetch_avatar_from_userinfo($this->item, true);
     }
     if ($this->process_user) {
         if ($this->item['userid']) {
             $this->process_registered_user();
         } else {
             $this->process_unregistered_user();
         }
     }
     $this->process_date_status();
     $this->process_display();
     $this->process_text();
     $this->prepare_end();
     // actual display...
     foreach ($this->template_data_vars as $varname) {
         ${$varname} = $this->{$varname};
     }
     global $show, $vbphrase;
     global $spacer_open, $spacer_close;
     global $perpage, $pagenumber;
     global $bgclass, $altbgclass;
     exec_switch_bg();
     if ($this->hook_display_complete) {
         ($hook = vBulletinHook::fetch_hook($this->hook_display_complete)) ? eval($hook) : false;
     }
     $templater = vB_Template::create($this->template);
     if ($this->template_item_var) {
         $templater->register($this->template_item_var, $this->item);
     }
     $templater->register('pagenumber', $pagenumber);
     $templater->register('perpage', $perpage);
     $templater->register('template_hook', $template_hook);
     return $templater->render();
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:49,代码来源:class_groupmessage.php

示例11: cache_events

function cache_events($range)
{
    global $vbulletin, $calendarinfo, $vbphrase, $serveroffset;
    $numdays = date('j', mktime(0, 0, 0, $range['nextmonth'] + 1, 1, $range['nextyear']) - 1);
    $beginday = gmmktime(0, 0, 0, $range['frommonth'], 1, $range['fromyear']) + -12 * 3600;
    $endday = gmmktime(24, 0, 0, $range['nextmonth'], $numdays, $range['nextyear']) + 12 * 3600;
    $event = array();
    $eventids = array();
    if ($calendarinfo['showholidays']) {
        // Holidays show across all calendars that a user has access to.
        $holidays = $vbulletin->db->query_read_slave("\n\t\t\tSELECT *\n\t\t\tFROM " . TABLE_PREFIX . "holiday\n\t\t");
        if ($vbulletin->db->num_rows($holidays)) {
            while ($ev = $vbulletin->db->fetch_array($holidays)) {
                $ev['visible'] = 1;
                $ev['title'] =& $vbphrase['holiday' . $ev['holidayid'] . '_title'];
                $ev['event'] =& $vbphrase['holiday' . $ev['holidayid'] . '_desc'];
                $ev['preview'] = strip_quotes($ev['event']);
                $ev['preview'] = htmlspecialchars_uni(strip_bbcode(fetch_trimmed_title($ev['preview'], 300), false, true));
                if ($ev['recurring'] == 6) {
                    $event['holiday1']["{$ev['recuroption']}"][] = $ev;
                } else {
                    $ev['dateline_from'] = $beginday;
                    $ev['dateline_to'] = $endday;
                    $offset = $vbulletin->userinfo['timezoneoffset'] ? $vbulletin->userinfo['tzoffset'] : $vbulletin->userinfo['timezoneoffset'];
                    $ev['dateline_from_user'] = $ev['dateline_from'] + $offset * 3600;
                    $ev['dateline_to_user'] = $ev['dateline_to'] + $offset * 3600;
                    $recuroption = substr($ev['recuroption'], 2);
                    $event['holiday2']["{$recuroption}"][] = $ev;
                }
            }
        }
    }
    require_once DIR . '/includes/functions_user.php';
    $events = $vbulletin->db->query_read_slave("\n\t\tSELECT event.*,\n\t\tuser.username, IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid,\n\t\tuser.adminoptions, user.usergroupid, user.usertitle, user.membergroupids, user.infractiongroupids, IF(options & " . $vbulletin->bf_misc_useroptions['hasaccessmask'] . ", 1, 0) AS hasaccessmask,\n\t\tIF(dateline_to = 0, 1, 0) AS singleday\n\t\t" . iif($vbulletin->userinfo['userid'], ", subscribeevent.eventid AS subscribed") . "\n\t\t" . ($vbulletin->options['avatarenabled'] ? ",avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,\n\t\t\t\tcustomavatar.width AS avwidth,customavatar.height AS avheight, customavatar.width_thumb AS avwidth_thumb, user.avatarrevision,\n\t\t\t\tcustomavatar.height_thumb AS avheight_thumb, customavatar.filedata_thumb, NOT ISNULL(customavatar.userid) AS hascustom" : "") . "\n\t\tFROM " . TABLE_PREFIX . "event AS event\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = event.userid)\n\t\t" . iif($vbulletin->userinfo['userid'], "LEFT JOIN " . TABLE_PREFIX . "subscribeevent AS subscribeevent ON (subscribeevent.eventid = event.eventid AND subscribeevent.userid = " . $vbulletin->userinfo['userid'] . ")") . "\n\t\t" . ($vbulletin->options['avatarenabled'] ? "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)" : "") . "\n\t\tWHERE calendarid = {$calendarinfo['calendarid']} AND\n\t\t\t((dateline_to >= {$beginday} AND dateline_from < {$endday}) OR (dateline_to = 0 AND dateline_from >= {$beginday} AND dateline_from <= {$endday} ))\tAND\n\t\t\tevent.visible = 1\n\t\tORDER BY dateline_from\n\t");
    // Cache Events
    if ($vbulletin->db->num_rows($events)) {
        while ($ev = $vbulletin->db->fetch_array($events)) {
            if ($ev['userid'] != $vbulletin->userinfo['userid'] and !($vbulletin->userinfo['calendarpermissions']["{$calendarinfo['calendarid']}"] & $vbulletin->bf_ugp_calendarpermissions['canviewothersevent'])) {
                continue;
            }
            $ev = array_merge($ev, convert_bits_to_array($ev['options'], $vbulletin->bf_misc_useroptions));
            $ev = array_merge($ev, convert_bits_to_array($ev['adminoptions'], $vbulletin->bf_misc_adminoptions));
            cache_permissions($ev, false);
            fetch_avatar_from_userinfo($ev, true);
            $ev['preview'] = strip_quotes($ev['event']);
            $ev['preview'] = htmlspecialchars_uni(strip_bbcode(fetch_trimmed_title($ev['preview'], 300), false, true));
            $offset = $ev['dst'] ? $vbulletin->userinfo['timezoneoffset'] : $vbulletin->userinfo['tzoffset'];
            $ev['dateline_from_user'] = $ev['dateline_from'] + $offset * 3600;
            $ev['dateline_to_user'] = $ev['dateline_to'] + $offset * 3600;
            fetch_musername($ev);
            if (!$ev['recurring']) {
                if ($ev['singleday']) {
                    $event['singleday']["{$ev['dateline_from']}"][] = $ev;
                } else {
                    $found = false;
                    $date = explode('-', gmdate('n-j-Y', $ev['dateline_from_user']));
                    $beginday = gmmktime(0, 0, 0, $date[0], $date[1], $date[2]);
                    while ($beginday <= $ev['dateline_to_user']) {
                        if (!$found) {
                            $event['ranged']["{$beginday}"][] = $ev;
                            $count = count($event['ranged']["{$beginday}"]) - 1;
                            $tempevent =& $event['ranged']["{$beginday}"]["{$count}"];
                            $found = true;
                        } else {
                            // if event ends at the start of the day, don't display it for that day
                            if ($ev['dateline_to_user'] != $beginday) {
                                $event['ranged']["{$beginday}"][] =& $tempevent;
                            }
                        }
                        $beginday += 86400;
                    }
                }
            } else {
                $event['recurring'][] = $ev;
            }
        }
    }
    return $event;
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:79,代码来源:functions_calendar.php

示例12: processUsers

 protected function processUsers()
 {
     if (!$this->content['userid']) {
         return;
     }
     /* This bit handles processUsers() being executed multiple times .. remove any users that we already know about
      * and only query if we have any unknown users left
      */
     if ($this->content['user']) {
         foreach ($this->content['user'] as $userid => $foo) {
             unset($this->content['userid'][$userid]);
         }
         if (!$this->content['userid']) {
             return;
         }
     }
     require_once DIR . '/includes/functions_user.php';
     $users = vB::$db->query_read("\n\t\t\tSELECT u.*\n\t\t\t\t" . (vB::$vbulletin->options['avatarenabled'] ? ", av.avatarpath, NOT ISNULL(cu.userid) AS hascustomavatar,\n\t\t\t\t\tcu.dateline AS avatardateline, cu.width AS avwidth, cu.height AS avheight, cu.height_thumb AS avheight_thumb,\n\t\t\t\t\tcu.width_thumb AS avwidth_thumb, NOT ISNULL(cu.filedata_thumb) AS filedata_thumb" : "") . "\n\t\t\t\t\t" . (vB::$vbulletin->userinfo['userid'] ? ",IF(userlist.userid IS NOT NULL, 1, 0) AS bbuser_iscontact_of_user" : "") . "\n\t\t\tFROM " . TABLE_PREFIX . "user AS u\n\t\t\t" . (vB::$vbulletin->options['avatarenabled'] ? "\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "avatar AS av ON(av.avatarid = u.avatarid)\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "customavatar AS cu ON(cu.userid = u.userid)" : "") . "\n\t\t\t\t" . (vB::$vbulletin->userinfo['userid'] ? "LEFT JOIN " . TABLE_PREFIX . "userlist AS userlist ON (userlist.userid = u.userid AND userlist.type = 'buddy' AND userlist.relationid = " . vB::$vbulletin->userinfo['userid'] . ")" : "") . "\n\t\t\tWHERE u.userid IN (" . implode(",", array_keys($this->content['userid'])) . ")\n\t\t");
     while ($user = vB::$db->fetch_array($users)) {
         $user = array_merge($user, convert_bits_to_array($user['options'], vB::$vbulletin->bf_misc_useroptions));
         fetch_avatar_from_userinfo($user, true);
         cache_permissions($user, false);
         if (empty($user['avatarurl']) or !$user['avatarid'] and !($user['permissions']['genericpermissions'] & vB::$vbulletin->bf_ugp_genericpermissions['canuseavatar']) and !$user['adminavatar']) {
             $user['avatarurl'] = vB_Template_Runtime::fetchStyleVar('imgdir_misc') . '/unknown.gif';
             $user['showavatar'] = true;
             $user['avatarclass'] = 'hasavatar';
         } else {
             if (vB::$vbulletin->userinfo['userid'] and !vB::$vbulletin->userinfo['showavatars']) {
                 $user['showavatar'] = false;
                 $user['avatarclass'] = 'noavatar';
             } else {
                 $user['showavatar'] = true;
                 $user['avatarclass'] = 'hasavatar';
             }
         }
         $this->content['user'][$user['userid']] = $user;
     }
     if (!$this->content['user']) {
         $this->content['user'] = array();
     }
     /*
      * Reset the array so that if processUsers() is executed again we won't query anything
      * unless new ids have been added to the array
      */
     $this->content['userid'] = array();
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:46,代码来源:base.php

示例13: do_get_pms


//.........这里部分代码省略.........
                        $tousers = array();
                        if (!empty($users)) {
                            foreach ($users as $key => $item) {
                                if (is_array($item)) {
                                    foreach ($item as $subkey => $subitem) {
                                        $touser["{$subkey}"] = $subitem;
                                    }
                                } else {
                                    $touser["{$key}"] = $item;
                                }
                            }
                            uasort($touser, 'strnatcasecmp');
                        }
                        foreach ($touser as $userid => $username) {
                            //eval('$tousers[] = "' . fetch_template('pm_messagelistbit_user') . '";');
                        }
                        $userbit = implode(', ', $tousers);
                    } else {
                        $userid =& $pm['fromuserid'];
                        $username =& $pm['fromusername'];
                        //eval('$userbit = "' . fetch_template('pm_messagelistbit_user') . '";');
                    }
                    $show['pmicon'] = iif($pm['iconpath'], true, false);
                    $show['unread'] = iif(!$pm['messageread'], true, false);
                    //($hook = vBulletinHook::fetch_hook('private_messagelist_messagebit')) ? eval($hook) : false;
                    //eval('$messagelistbits .= "' . fetch_template('pm_messagelistbit') . '";');
                }
                $to_users = unserialize($pm['touserarray']);
                $users = array();
                if ($to_users !== false) {
                    if ($to_users['cc']) {
                        $users = $to_users['cc'];
                    }
                }
                if (!is_array($users)) {
                    $users = array();
                }
                $pm_new = 0;
                switch ($pm['messageread']) {
                    case 0:
                        $pm_new = 1;
                        break;
                    case 1:
                        $pm_new = 0;
                        break;
                    case 2:
                        $pm_new = 2;
                        break;
                }
                $avatarurl = '';
                $userinfoavatar = fetch_userinfo($pm['fromuserid'], FETCH_USERINFO_AVATAR);
                fetch_avatar_from_userinfo($userinfoavatar, true, false);
                if ($userinfoavatar['avatarurl'] != '') {
                    $avatarurl = process_avatarurl($userinfoavatar['avatarurl']);
                }
                unset($userinfoavatar);
                $tmp = array('id' => $pm['pmid'], 'new_pm' => $pm_new, 'username' => prepare_utf8_string(strip_tags($pm['fromusername'])), 'to_usernames' => prepare_utf8_string(implode('; ', $users)), 'title' => prepare_utf8_string($pm['title']), 'message' => prepare_utf8_string(htmlspecialchars_uni(fetch_censored_text(strip_bbcode(strip_quotes($pm['message']), false, true)))), 'pm_timestamp' => prepare_utf8_string(date_trunc($pm['senddate'] . ' ' . $pm['sendtime'])));
                if ($avatarurl != '') {
                    $tmp['avatarurl'] = $avatarurl;
                }
                $pm_out[] = $tmp;
            }
            // free up memory not required any more
            unset($pm_period_groups["{$groupid}"]);
            //($hook = vBulletinHook::fetch_hook('private_messagelist_period')) ? eval($hook) : false;
            // build group template
            //eval('$messagelist_periodgroups .= "' . fetch_template('pm_messagelist_periodgroup') . '";');
        }
        if ($desc) {
            unset($search['order']);
        }
        $sorturl = urlimplode($search);
        // build pagenav
        if ($need_sql_calc_rows) {
            list($totalmessages) = $vbulletin->db->query_first_slave("SELECT FOUND_ROWS()", DBARRAY_NUM);
        }
        $pagenav = construct_page_nav($pagenumber, $perpage, $totalmessages, 'private.php?' . $vbulletin->session->vars['sessionurl'] . 'folderid=' . $vbulletin->GPC['folderid'] . '&amp;pp=' . $vbulletin->GPC['perpage'] . '&amp;' . $sorturl);
        $sortfield = $search['sort'];
        unset($search['sort']);
        $sorturl = 'private.php?' . $vbulletin->session->vars['sessionurl'] . 'folderid=' . $vbulletin->GPC['folderid'] . ($searchurl = urlimplode($search) ? '&amp;' . $searchurl : '');
        $oppositesort = $desc ? 'asc' : 'desc';
        $orderlinks = array('date' => $sorturl . '&amp;sort=date' . ($sortfield == 'date' ? '&amp;order=' . $oppositesort : ''), 'title' => $sorturl . '&amp;sort=title' . ($sortfield == 'title' ? '&amp;order=' . $oppositesort : '&amp;order=asc'), 'sender' => $sorturl . '&amp;sort=sender' . ($sortfield == 'sender' ? '&amp;order=' . $oppositesort : '&amp;order=asc'));
        //eval('$sortarrow["$sortfield"] = "' . fetch_template('forumdisplay_sortarrow') . '";');
        // values for filters
        $startdate = fetch_datearray_from_timestamp($search['startdate'] ? $search['startdate'] : strtotime('last month', TIMENOW));
        $enddate = fetch_datearray_from_timestamp($search['enddate'] ? $search['enddate'] : TIMENOW);
        $startmonth[$startdate[month]] = 'selected="selected"';
        $endmonth[$enddate[month]] = 'selected="selected"';
        $readselection[$search['read']] = 'selected="selected"';
        //eval('$sortfilter = "' . fetch_template('pm_filter') . '";');
    }
    if ($vbulletin->GPC['folderid'] == -1) {
        $show['sentto'] = true;
        $show['movetofolder'] = false;
    } else {
        $show['sentto'] = false;
        $show['movetofolder'] = true;
    }
    return array('pms' => $pm_out, 'total_pms' => $totalmessages, 'unread_pms' => $unread);
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:pms.php

示例14: fetch_censored_text

             $post['del_phrase'] = 'message_deleted_by_x';
             $show['deleted'] = true;
         } else {
             if ($post['tdel_userid']) {
                 $post['del_username'] =& $post['tdel_username'];
                 $post['del_userid'] =& $post['tdel_userid'];
                 $post['del_reason'] = fetch_censored_text($post['tdel_reason']);
                 $post['del_phrase'] = 'thread_deleted_by_x';
                 $show['deleted'] = true;
             } else {
                 $show['deleted'] = false;
             }
         }
         exec_switch_bg();
         ($hook = vBulletinHook::fetch_hook('postbit_lite')) ? eval($hook) : false;
         fetch_avatar_from_userinfo($post, true);
         $pageinfo_post = array('p' => $post['postid']);
         $templater = vB_Template::create('postbit_lite');
         $templater->register('pageinfo_post', $pageinfo_post);
         $templater->register('pageinfo_thread', $pageinfo_thread);
         $templater->register('post', $post);
         $templater->register('threadinfo', $threadinfo);
         $postbits .= $templater->render();
     }
     $db->free_result($posts);
     unset($postids);
     $sorturl = 'moderation.php?' . $vbulletin->session->vars['sessionurl'] . "do=viewposts&amp;type=" . $type . "&amp;pp={$perpage}&amp;daysprune={$daysprune}";
     $pagenav = construct_page_nav($pagenumber, $perpage, $totalposts, $sorturl . "&amp;sort={$sortfield}" . iif(!empty($vbulletin->GPC['sortorder']), "&amp;order=" . $vbulletin->GPC['sortorder']));
     $show['haveposts'] = true;
 } else {
     $totalposts = 0;
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:moderation.php

示例15: do_get_forum


//.........这里部分代码省略.........
        } else {
            $threadadmin_imod_thread_menu = '';
        }
        // get announcements
        $announcebits = '';
        if ($show['threadicons'] and $show['inlinemod']) {
            $announcecolspan = 6;
        } else {
            if (!$show['threadicons'] and !$show['inlinemod']) {
                $announcecolspan = 4;
            } else {
                $announcecolspan = 5;
            }
        }
        $mindate = TIMENOW - 2592000;
        // 30 days
        $hook_query_fields = $hook_query_joins = $hook_query_where = '';
        $announcements = $db->query_read_slave("\n    \t\tSELECT\n    \t\t\tannouncement.announcementid, startdate, title, announcement.views,\n    \t\t\tuser.username, user.userid, user.usertitle, user.customtitle, user.usergroupid,\n    \t\t\tIF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid\n    \t\t\t" . ($vbulletin->userinfo['userid'] ? ", NOT ISNULL(announcementread.announcementid) AS readannounce" : "") . "\n    \t\t\t{$hook_query_fields}\n    \t\tFROM " . TABLE_PREFIX . "announcement AS announcement\n    \t\t" . ($vbulletin->userinfo['userid'] ? "LEFT JOIN " . TABLE_PREFIX . "announcementread AS announcementread ON (announcementread.announcementid = announcement.announcementid AND announcementread.userid = " . $vbulletin->userinfo['userid'] . ")" : "") . "\n    \t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = announcement.userid)\n    \t\t{$hook_query_joins}\n    \t\tWHERE startdate <= " . TIMENOW . "\n    \t\t\tAND enddate >= " . TIMENOW . "\n    \t\t\tAND " . fetch_forum_clause_sql($foruminfo['forumid'], 'forumid') . "\n    \t\t\t{$hook_query_where}\n    \t\tORDER BY startdate DESC, announcement.announcementid DESC\n    \t\t" . iif($vbulletin->options['oneannounce'], "LIMIT 1"));
        while ($announcement = $db->fetch_array($announcements)) {
            fetch_musername($announcement);
            $announcement['title'] = fetch_censored_text($announcement['title']);
            $announcement['postdate'] = vbdate($vbulletin->options['dateformat'], $announcement['startdate']);
            if ($announcement['readannounce'] or $announcement['startdate'] <= $mindate) {
                $announcement['statusicon'] = 'old';
            } else {
                $announcement['statusicon'] = 'new';
            }
            $announcement['views'] = vb_number_format($announcement['views']);
            $announcementidlink = iif(!$vbulletin->options['oneannounce'], "&amp;a={$announcement['announcementid']}");
            // FRNR START
            if ($pagenumber == 1) {
                $avatarurl = '';
                $userinfoavatar = fetch_userinfo($announcement['userid'], FETCH_USERINFO_AVATAR);
                fetch_avatar_from_userinfo($userinfoavatar, true, false);
                if ($userinfoavatar['avatarurl'] != '') {
                    $avatarurl = process_avatarurl($userinfoavatar['avatarurl']);
                }
                unset($userinfoavatar);
                $tmp = array('thread_id' => $foruminfo['forumid'], 'announcement' => 1, 'new_posts' => $announcement['readannounce'] ? 0 : 1, 'thread_title' => prepare_utf8_string(strip_tags($announcement['title'])), 'thread_preview' => prepare_utf8_string(preview_chop(html_entity_decode($announcement['pagetext']), FR_PREVIEW_LEN)), 'post_userid' => $announcement['userid'], 'post_lastposttime' => prepare_utf8_string(date_trunc($announcement['postdate'])), 'post_username' => prepare_utf8_string(strip_tags($announcement['username'])));
                if ($avatarurl != '') {
                    $tmp['avatarurl'] = $avatarurl;
                }
                $announcements_out[] = $tmp;
            }
            // FRNR END
        }
        // display threads
        if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers'])) {
            $limitothers = "AND postuserid = " . $vbulletin->userinfo['userid'] . " AND " . $vbulletin->userinfo['userid'] . " <> 0";
        } else {
            $limitothers = '';
        }
        if (can_moderate($foruminfo['forumid'])) {
            $redirectjoin = "LEFT JOIN " . TABLE_PREFIX . "threadredirect AS threadredirect ON(thread.open = 10 AND thread.threadid = threadredirect.threadid)";
        } else {
            $redirectjoin = '';
        }
        // filter out deletion notices if can't be seen
        if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canseedelnotice'] or can_moderate($foruminfo['forumid'])) {
            $canseedelnotice = true;
            $deljoin = "LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND deletionlog.type = 'thread')";
        } else {
            $canseedelnotice = false;
            $deljoin = '';
        }
        // remove threads from users on the global ignore list if user is not a moderator
开发者ID:0hyeah,项目名称:yurivn,代码行数:67,代码来源:get_forum.php


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