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


PHP fetch_trimmed_title函数代码示例

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


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

示例1: fetchTemplate

 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $messageinfo =& $this->content['visitormessage'][$activity['contentid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $userinfo2 =& $this->content['user'][$messageinfo['userid']];
     $messageinfo['preview'] = strip_quotes($messageinfo['pagetext']);
     $messageinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($messageinfo['preview'], false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     $userinfo = $this->fetchUser($activity['userid'], $messageinfo['postusername']);
     if ($fetchphrase) {
         if ($userinfo['userid']) {
             $phrase = construct_phrase($this->vbphrase['x_created_a_visitormessage_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('member', $userinfo2, $linkinfo), $messageinfo['vmid'], fetch_seo_url('member', $userinfo2), $userinfo2['username']);
         } else {
             $phrase = construct_phrase($this->vbphrase['guest_x_created_a_visitormessage_y_in_z'], $userinfo['username'], fetch_seo_url('member', $userinfo2, $linkinfo), $messageinfo['vmid'], fetch_seo_url('member', $userinfo2), $userinfo2['username']);
         }
         return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('userinfo2', $userinfo2);
         $templater->register('linkinfo', array('vmid' => $messageinfo['vmid']));
         $templater->register('linkinfo2', array('tab' => 'visitor_messaging'));
         $templater->register('activity', $activity);
         $templater->register('messageinfo', $messageinfo);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:27,代码来源:visitormessage.php

示例2: fetchTemplate

 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $postinfo =& $this->content['cms_post'][$activity['contentid']];
     $nodeinfo =& $this->content['cms_node'][$postinfo['nodeid']];
     $articleinfo =& $this->content['cms_article'][$nodeinfo['contentid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $preview = strip_quotes($postinfo['pagetext']);
     $articleinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     $articleinfo['fullurl'] = vB_Route::create('vBCms_Route_Content', $nodeinfo['nodeid'] . ($nodeinfo['url'] == '' ? '' : '-' . $nodeinfo['url']))->getCurrentURL();
     $nodeinfo['parenturl'] = $this->fetchParentUrl($nodeinfo['parentnode']);
     $nodeinfo['parenttitle'] = $this->fetchParentTitle($nodeinfo['parentnode']);
     $userinfo = $this->fetchUser($activity['userid'], $postinfo['username']);
     if ($fetchphrase) {
         if ($userinfo['userid']) {
             $phrase = construct_phrase($this->vbphrase['x_commented_on_an_article_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], $articleinfo['fullurl'], $nodeinfo['title'], $nodeinfo['parenturl'], $nodeinfo['parenttitle']);
         } else {
             $phrase = construct_phrase($this->vbphrase['guest_x_commented_on_an_article_y_in_z'], $userinfo['username'], $articleinfo['fullurl'], $nodeinfo['title'], $nodeinfo['parenturl'], $nodeinfo['parenttitle']);
         }
         return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('postinfo', $postinfo);
         $templater->register('activity', $activity);
         $templater->register('nodeinfo', $nodeinfo);
         $templater->register('articleinfo', $articleinfo);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:30,代码来源:comment.php

示例3: prepare_pictureinfo_thumb

/**
* Prepares a picture array for thumbnail display.
*
* @param	array	Array of picture info
*
* @return	array	Array of picture info modified
*/
function prepare_pictureinfo_thumb($pictureinfo)
{
    global $vbulletin;
    $pictureinfo['caption_preview'] = fetch_censored_text(fetch_trimmed_title($pictureinfo['caption'], $vbulletin->options['album_captionpreviewlen']));
    $pictureinfo['dimensions'] = $pictureinfo['thumbnail_width'] ? "width=\"{$pictureinfo['thumbnail_width']}\" height=\"{$pictureinfo['thumbnail_height']}\"" : '';
    $pictureinfo['date'] = vbdate($vbulletin->options['dateformat'], $pictureinfo['dateline'], true);
    $pictureinfo['time'] = vbdate($vbulletin->options['timeformat'], $pictureinfo['dateline']);
    return $pictureinfo;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:16,代码来源:functions_album.php

示例4: mobiquo_chop

function mobiquo_chop($string)
{
    global $stylevar, $vbulletin;
    $string = preg_replace('/<br \\/\\>/', '', $string);
    $string = preg_replace('/(^\\s+)|(\\s+$)/', '', $string);
    $string = preg_replace('/\\n/', '', $string);
    $string = preg_replace('/\\r/', '', $string);
    $string = strip_quotes($string);
    $string = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($string, false, true), 200)));
    return $string;
}
开发者ID:patrickrolanddg,项目名称:dragonfly-tapatalk,代码行数:11,代码来源:common.php

示例5: prepare_pictureinfo_thumb

/**
* Prepares a picture array for thumbnail display.
*
* @param	array	Array of picture info
* @param	array	Container info (either for a group or album); changes thumbnail URL
*
* @return	array	Array of picture info modified
*/
function prepare_pictureinfo_thumb($pictureinfo, $displaytypeinfo)
{
    global $vbulletin;
    $pictureinfo['caption_preview'] = fetch_censored_text(fetch_trimmed_title($pictureinfo['caption'], $vbulletin->options['album_captionpreviewlen']));
    $pictureinfo['thumburl'] = $pictureinfo['thumbnail_filesize'] ? fetch_picture_url($pictureinfo, $displaytypeinfo, true) : '';
    $pictureinfo['dimensions'] = $pictureinfo['thumbnail_width'] ? "width=\"{$pictureinfo['thumbnail_width']}\" height=\"{$pictureinfo['thumbnail_height']}\"" : '';
    $pictureinfo['date'] = vbdate($vbulletin->options['dateformat'], $pictureinfo['dateline'], true);
    $pictureinfo['time'] = vbdate($vbulletin->options['dateformat'], $pictureinfo['dateline']);
    ($hook = vBulletinHook::fetch_hook('album_prepare_thumb')) ? eval($hook) : false;
    return $pictureinfo;
}
开发者ID:holandacz,项目名称:nb4,代码行数:19,代码来源:functions_album.php

示例6: fetchTemplate

 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     $userinfo =& $this->content['user'][$activity['userid']];
     $bloginfo =& $this->content['blog'][$activity['contentid']];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $preview = strip_quotes($bloginfo['pagetext']);
     $bloginfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     if ($fetchphrase) {
         return array('phrase' => construct_phrase($this->vbphrase['x_created_a_blog_entry_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('entry', $bloginfo), $bloginfo['title'], fetch_seo_url('blog', $bloginfo), $bloginfo['blog_title']), 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('activity', $activity);
         $templater->register('bloginfo', $bloginfo);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:18,代码来源:entry.php

示例7: fetchTemplate

 public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
 {
     global $show;
     $postinfo =& $this->content['post'][$activity['contentid']];
     $threadinfo =& $this->content['thread'][$postinfo['threadid']];
     $foruminfo =& vB::$vbulletin->forumcache[$threadinfo['forumid']];
     $threadinfo['prefix_plain_html'] = htmlspecialchars_uni($this->vbphrase["prefix_{$threadinfo['prefixid']}_title_plain"]);
     $threadinfo['prefix_rich'] = $this->vbphrase["prefix_{$threadinfo['prefixid']}_title_rich"];
     $activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
     $activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
     $preview = strip_quotes($postinfo['pagetext']);
     $postinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
     $forumperms = fetch_permissions($threadinfo['forumid']);
     $show['threadcontent'] = $forumperms & vB::$vbulletin->bf_ugp_forumpermissions['canviewthreads'] ? true : false;
     $userinfo = $this->fetchUser($activity['userid'], $postinfo['username']);
     if ($fetchphrase) {
         if ($threadinfo['pollid']) {
             if ($userinfo['userid']) {
                 $phrase = construct_phrase($this->vbphrase['x_replied_to_a_poll_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
             } else {
                 $phrase = construct_phrase($this->vbphrase['guest_x_replied_to_a_poll_y_in_z'], $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
             }
         } else {
             if ($userinfo['userid']) {
                 $phrase = construct_phrase($this->vbphrase['x_replied_to_a_thread_y_in_z'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
             } else {
                 $phrase = construct_phrase($this->vbphrase['guest_x_replied_to_a_thread_y_in_z'], $userinfo['username'], fetch_seo_url('thread', $threadinfo), $threadinfo['prefix_rich'], $threadinfo['title'], fetch_seo_url('forum', $foruminfo), $foruminfo['title']);
             }
         }
         return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
     } else {
         $templater = vB_Template::create($templatename);
         $templater->register('userinfo', $userinfo);
         $templater->register('activity', $activity);
         $templater->register('threadinfo', $threadinfo);
         $templater->register('postinfo', $postinfo);
         $templater->register('pageinfo', array('p' => $postinfo['postid']));
         $templater->register('foruminfo', $foruminfo);
         return $templater->render();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:41,代码来源:post.php

示例8: convert_ids_to_titles

function convert_ids_to_titles()
{
    global $vbulletin;
    global $albumids, $attachmentids, $calendarids, $eventids, $forumids, $infractionids, $pmids, $postids, $searchids, $socialgroupids, $threadids, $userids;
    global $wol_album, $wol_attachment, $wol_calendar, $wol_event, $wol_inf, $wol_pm, $wol_post, $wol_search, $wol_socialgroup, $wol_thread, $wol_user;
    if ($attachmentids) {
        $postidquery = $vbulletin->db->query_read_slave("\n\t\t\tSELECT postid, attachmentid\n\t\t\tFROM " . TABLE_PREFIX . "attachment\n\t\t\tWHERE attachmentid IN (0{$attachmentids})\n\t\t");
        while ($postidqueryr = $vbulletin->db->fetch_array($postidquery)) {
            $postids .= ',' . $postidqueryr['postid'];
            $wol_attachment["{$postidqueryr['attachmentid']}"] = $postidqueryr['postid'];
        }
    }
    if ($postids) {
        $postidquery = $vbulletin->db->query_read_slave("\n\t\t\tSELECT threadid, postid\n\t\t\tFROM " . TABLE_PREFIX . "post\n\t\t\tWHERE postid IN (0{$postids})\n\t\t");
        while ($postidqueryr = $vbulletin->db->fetch_array($postidquery)) {
            $threadids .= ',' . $postidqueryr['threadid'];
            $wol_post["{$postidqueryr['postid']}"] = $postidqueryr['threadid'];
        }
    }
    if ($socialgroupids) {
        $socialgroups = $vbulletin->db->query_read_slave("\n\t\t\tSELECT name, groupid\n\t\t\tFROM " . TABLE_PREFIX . "socialgroup\n\t\t\tWHERE groupid IN (0{$socialgroupids})\n\t\t");
        while ($socialgroup = $vbulletin->db->fetch_array($socialgroups)) {
            $wol_socialgroup["{$socialgroup['groupid']}"]['name'] = $socialgroup['name'];
        }
    }
    if ($albumids) {
        $albums = $vbulletin->db->query_read_slave("\n\t\t\tSELECT title, albumid, state, userid\n\t\t\tFROM " . TABLE_PREFIX . "album\n\t\t\tWHERE albumid IN (0{$albumids})\n\t\t");
        while ($album = $vbulletin->db->fetch_array($albums)) {
            $wol_album["{$album['albumid']}"] = $album;
        }
    }
    if ($threadids) {
        $threadresults = $vbulletin->db->query_read_slave("\n\t\t\tSELECT thread.title, thread.prefixid, thread.threadid, thread.forumid, thread.postuserid, thread.visible\n\t\t\t" . iif($vbulletin->options['threadpreview'] > 0, ",post.pagetext AS preview") . "\n\t\t\t" . iif($vbulletin->options['threadsubscribed'] and $vbulletin->userinfo['userid'], ", NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed") . "\n\t\t\tFROM " . TABLE_PREFIX . "thread AS thread\n\t\t\t" . iif($vbulletin->options['threadpreview'] > 0, "LEFT JOIN " . TABLE_PREFIX . "post AS post ON(post.postid = thread.firstpostid)") . "\n\t\t\t" . iif($vbulletin->options['threadsubscribed'] and $vbulletin->userinfo['userid'], " LEFT JOIN " . TABLE_PREFIX . "subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = " . $vbulletin->userinfo['userid'] . " AND canview = 1)") . "\n\t\t\tWHERE thread.threadid IN (0{$threadids})\n\t\t");
        while ($threadresult = $vbulletin->db->fetch_array($threadresults)) {
            $wol_thread["{$threadresult['threadid']}"]['title'] = $threadresult['title'];
            $wol_thread["{$threadresult['threadid']}"]['prefixid'] = $threadresult['prefixid'];
            $wol_thread["{$threadresult['threadid']}"]['forumid'] = $threadresult['forumid'];
            $wol_thread["{$threadresult['threadid']}"]['postuserid'] = $threadresult['postuserid'];
            $wol_thread["{$threadresult['threadid']}"]['isdeleted'] = $threadresult['visible'] == 2 ? true : false;
            $wol_thread["{$threadresult['threadid']}"]['visible'] = $threadresult['visible'] == 1 ? true : false;
            $wol_thread["{$threadresult['threadid']}"]['issubscribed'] = $threadresult['issubscribed'];
            // format thread preview if there is one
            $userperms = fetch_permissions($threadresult['forumid']);
            if (!empty($threadresult['preview']) and $vbulletin->options['threadpreview'] > 0 and $userperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) {
                // 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)));
                if (!$ignore["{$threadresult['postuserid']}"]) {
                    $threadresult['preview'] = strip_quotes($threadresult['preview']);
                    $threadresult['preview'] = htmlspecialchars_uni(strip_bbcode(fetch_trimmed_title($threadresult['preview'], $vbulletin->options['threadpreview']), false, true));
                    $wol_thread["{$threadresult['threadid']}"]['preview'] = $threadresult['preview'];
                }
            }
        }
    }
    if ($calendarids) {
        $calendarresults = $vbulletin->db->query_read_slave("\n\t\t\tSELECT calendarid, title\n\t\t\tFROM " . TABLE_PREFIX . "calendar\n\t\t\tWHERE calendarid IN (0{$calendarids})\n\t\t");
        while ($calendarresult = $vbulletin->db->fetch_array($calendarresults)) {
            $wol_calendar["{$calendarresult['calendarid']}"] = $calendarresult['title'];
        }
    }
    if ($infractionids) {
        $infractions = $vbulletin->db->query_read_slave("\n\t\t\tSELECT infractionid, userid\n\t\t\tFROM " . TABLE_PREFIX . "infraction\n\t\t\tWHERE infractionid IN (0{$infractionids})\n\t\t");
        while ($infraction = $vbulletin->db->fetch_array($infractions)) {
            $wol_inf["{$infraction['infractionid']}"]['userid'] = $infraction['userid'];
            $userids .= ',' . $infraction['userid'];
        }
    }
    if ($eventids) {
        $eventresults = $vbulletin->db->query_read_slave("\n\t\t\tSELECT eventid, title, userid, calendarid\n\t\t\tFROM " . TABLE_PREFIX . "event\n\t\t\tWHERE eventid IN (0{$eventids})\n\t\t");
        while ($eventresult = $vbulletin->db->fetch_array($eventresults)) {
            $wol_event["{$eventresult['eventid']}"]['title'] = $eventresult['title'];
            $wol_event["{$eventresult['eventid']}"]['calendarid'] = $eventresult['calendarid'];
            $wol_event["{$eventresult['eventid']}"]['postuserid'] = $eventresult['userid'];
        }
    }
    if ($pmids and $vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull']) {
        $pmresults = $vbulletin->db->query_read_slave("\n\t\t\tSELECT pmtext.fromuserid, pm.pmid\n\t\t\tFROM " . TABLE_PREFIX . "pm AS pm\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "pmtext AS pmtext ON (pm.pmtextid = pmtext.pmtextid)\n\t\t\tWHERE pmid IN (0{$pmids})\n\t\t\t");
        while ($pmresult = $vbulletin->db->fetch_array($pmresults)) {
            $wol_pm["{$pmresult['pmid']}"] = $pmresult['fromuserid'];
            $userids .= ',' . intval($pmresult['fromuserid']);
        }
    }
//.........这里部分代码省略.........
开发者ID:holandacz,项目名称:nb4,代码行数:101,代码来源:functions_online.php

示例9: fetch_permissions

         $forum_active_cache["{$current_forum['forumid']}"] = true;
         $current_forum = $vbulletin->forumcache["{$current_forum['parentid']}"];
     }
 }
 if (!$forum_active_cache["{$simthread['forumid']}"]) {
     continue;
 }
 $fperms = fetch_permissions($simthread['forumid']);
 if ($fperms & $vbulletin->bf_ugp_forumpermissions['canview'] and ($fperms & $vbulletin->bf_ugp_forumpermissions['canviewothers'] or $vbulletin->userinfo['userid'] != 0 and $simthread['postuserid'] == $vbulletin->userinfo['userid'])) {
     // format thread preview if there is one
     if (isset($ignore["{$simthread['postuserid']}"])) {
         $simthread['preview'] = '';
     } else {
         if (isset($simthread['preview']) and $vbulletin->options['threadpreview'] > 0) {
             $simthread['preview'] = strip_quotes($simthread['preview']);
             $simthread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode($simthread['preview'], false, true), $vbulletin->options['threadpreview']));
         }
     }
     $simthread['lastreplydate'] = vbdate($vbulletin->options['dateformat'], $simthread['lastpost'], true);
     $simthread['lastreplytime'] = vbdate($vbulletin->options['timeformat'], $simthread['lastpost']);
     if ($simthread['prefixid']) {
         $simthread['prefix_plain_html'] = htmlspecialchars_uni($vbphrase["prefix_{$simthread['prefixid']}_title_plain"]);
         $simthread['prefix_rich'] = $vbphrase["prefix_{$simthread['prefixid']}_title_rich"];
     } else {
         $simthread['prefix_plain_html'] = '';
         $simthread['prefix_rich'] = '';
     }
     $simthread['title'] = fetch_censored_text($simthread['title']);
     ($hook = vBulletinHook::fetch_hook('showthread_similarthreadbit')) ? eval($hook) : false;
     $templater = vB_Template::create('showthread_similarthreadbit');
     $templater->register('simthread', $simthread);
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:showthread.php

示例10: while

 $first = $itemcount + 1;
 if ($db->num_rows($getevents)) {
     $show['haveevents'] = true;
     while ($event = $db->fetch_array($getevents)) {
         if (empty($reminders["{$event['reminder']}"])) {
             $event['reminder'] = 3600;
         }
         $event['reminder'] = $vbphrase[$reminders[$event['reminder']]];
         $offset = $event['dst'] ? $vbulletin->userinfo['timezoneoffset'] : $vbulletin->userinfo['tzoffset'];
         $event = array_merge($event, convert_bits_to_array($event['options'], $vbulletin->bf_misc_useroptions));
         $event = array_merge($event, convert_bits_to_array($event['adminoptions'], $vbulletin->bf_misc_adminoptions));
         cache_permissions($event, false);
         fetch_avatar_from_userinfo($event, true);
         $event['dateline_from_user'] = $event['dateline_from'] + $offset * 3600;
         $event['dateline_to_user'] = $event['dateline_to'] + $offset * 3600;
         $event['preview'] = htmlspecialchars_uni(strip_bbcode(fetch_trimmed_title(strip_quotes($event['event']), 300), false, true));
         $event = fetch_event_date_time($event);
         $event['calendar'] = $calendarcache["{$event['calendarid']}"];
         $show['singleday'] = !empty($event['singleday']) ? true : false;
         ($hook = vBulletinHook::fetch_hook('calendar_viewreminder_event')) ? eval($hook) : false;
         $oppositesort = $sortorder == 'asc' ? 'desc' : 'asc';
         $templater = vB_Template::create('calendar_reminder_eventbit');
         $templater->register('date1', $date1);
         $templater->register('date2', $date2);
         $templater->register('daterange', $daterange);
         $templater->register('event', $event);
         $templater->register('eventdate', $eventdate);
         $templater->register('recurcriteria', $recurcriteria);
         $templater->register('time1', $time1);
         $templater->register('time2', $time2);
         $eventbits .= $templater->render();
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:calendar.php

示例11: prepare_socialgroup

/**
 * Takes information regardign a group, and prepares the information within it
 * for display
 *
 * @param	array	Group Array
 * @param	bool	Whether to fetch group members and avatars
 *
 * @return	array	Group Array with prepared information
 *
 */
function prepare_socialgroup($group, $fetchmembers = false)
{
    global $vbulletin;
    if (!is_array($group)) {
        return array();
    }
    if ($fetchmembers) {
        $membersinfo = cache_group_members();
        $group['membersinfo'] = $membersinfo[$group['groupid']];
    }
    $group['joindate'] = !empty($group['joindate']) ? vbdate($vbulletin->options['dateformat'], $group['joindate'], true) : '';
    $group['createtime'] = !empty($group['createdate']) ? vbdate($vbulletin->options['timeformat'], $group['createdate'], true) : '';
    $group['createdate'] = !empty($group['createdate']) ? vbdate($vbulletin->options['dateformat'], $group['createdate'], true) : '';
    $group['lastupdatetime'] = !empty($group['lastupdate']) ? vbdate($vbulletin->options['timeformat'], $group['lastupdate'], true) : '';
    $group['lastupdatedate'] = !empty($group['lastupdate']) ? vbdate($vbulletin->options['dateformat'], $group['lastupdate'], true) : '';
    $group['visible'] = vb_number_format($group['visible']);
    $group['moderation'] = vb_number_format($group['moderation']);
    $group['members'] = vb_number_format($group['members']);
    $group['moderatedmembers'] = vb_number_format($group['moderatedmembers']);
    $group['categoryname'] = htmlspecialchars_uni($group['categoryname']);
    $group['discussions'] = vb_number_format($group['discussions']);
    $group['lastdiscussion'] = fetch_word_wrapped_string(fetch_censored_text($group['lastdiscussion']));
    $group['trimdiscussion'] = fetch_trimmed_title($group['lastdiscussion']);
    if (!($group['options'] & $vbulletin->bf_misc_socialgroupoptions['enable_group_albums'])) {
        // albums disabled in this group - force 0 pictures
        $group['picturecount'] = 0;
    }
    $group['rawpicturecount'] = $group['picturecount'];
    $group['picturecount'] = vb_number_format($group['picturecount']);
    $group['rawname'] = $group['name'];
    $group['rawdescription'] = $group['description'];
    $group['name'] = fetch_word_wrapped_string(fetch_censored_text($group['name']));
    if ($group['description']) {
        $group['shortdescription'] = fetch_word_wrapped_string(fetch_censored_text(fetch_trimmed_title($group['description'], 185)));
    } else {
        $group['shortdescription'] = $group['name'];
    }
    $group['mediumdescription'] = fetch_word_wrapped_string(fetch_censored_text(fetch_trimmed_title($group['description'], 1000)));
    $group['description'] = nl2br(fetch_word_wrapped_string(fetch_censored_text($group['description'])));
    $group['is_owner'] = $group['creatoruserid'] == $vbulletin->userinfo['userid'];
    $group['is_automoderated'] = ($group['options'] & $vbulletin->bf_misc_socialgroupoptions['owner_mod_queue'] and $vbulletin->options['sg_allow_owner_mod_queue'] and !$vbulletin->options['social_moderation']);
    $group['canviewcontent'] = (!($group['options'] & $vbulletin->bf_misc_socialgroupoptions['join_to_view']) or !$vbulletin->options['sg_allow_join_to_view'] or $group['membertype'] == 'member' or can_moderate(0, 'canmoderategroupmessages') or can_moderate(0, 'canremovegroupmessages') or can_moderate(0, 'candeletegroupmessages') or fetch_socialgroup_perm('canalwayspostmessage') or fetch_socialgroup_perm('canalwascreatediscussion'));
    $group['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $group['lastpost'], true);
    $group['lastposttime'] = vbdate($vbulletin->options['timeformat'], $group['lastpost']);
    $group['lastposterid'] = $group['canviewcontent'] ? $group['lastposterid'] : 0;
    $group['lastposter'] = $group['canviewcontent'] ? $group['lastposter'] : '';
    // check read marking
    //remove notice and make readtime determination a bit more clear
    if (!empty($group['readtime'])) {
        $readtime = $group['readtime'];
    } else {
        $readtime = fetch_bbarray_cookie('group_marking', $group['groupid']);
        if (!$readtime) {
            $readtime = $vbulletin->userinfo['lastvisit'];
        }
    }
    // get thumb url
    $group['iconurl'] = fetch_socialgroupicon_url($group, true);
    // check if social group is moderated to join
    $group['membermoderated'] = 'moderated' == $group['type'];
    // posts older than markinglimit days won't be highlighted as new
    $oldtime = TIMENOW - $vbulletin->options['markinglimit'] * 24 * 60 * 60;
    $readtime = max((int) $readtime, $oldtime);
    $group['readtime'] = $readtime;
    $group['is_read'] = $readtime >= $group['lastpost'];
    // Legacy Hook 'group_prepareinfo' Removed //
    return $group;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:78,代码来源:functions_socialgroup.php

示例12: construct_forum_bit

function construct_forum_bit($parentid, $depth = 0, $subsonly = 0)
{
    global $vbulletin, $vbphrase, $show;
    global $imodcache, $lastpostarray, $counters, $inforum;
    // this function takes the constant MAXFORUMDEPTH as its guide for how
    // deep to recurse down forum lists. if MAXFORUMDEPTH is not defined,
    // it will assume a depth of 2.
    // call fetch_last_post_array() first to get last post info for forums
    if (!is_array($lastpostarray)) {
        fetch_last_post_array($parentid);
    }
    if (empty($vbulletin->iforumcache["{$parentid}"])) {
        return;
    }
    if (!defined('MAXFORUMDEPTH')) {
        define('MAXFORUMDEPTH', 2);
    }
    $forumbits = '';
    $depth++;
    if ($parentid == -1) {
        $parent_is_category = false;
    } else {
        $parentforum = $vbulletin->forumcache[$parentid];
        $parent_is_category = !(bool) ($parentforum['options'] & $vbulletin->bf_misc_forumoptions['cancontainthreads']);
    }
    foreach ($vbulletin->iforumcache["{$parentid}"] as $forumid) {
        // grab the appropriate forum from the $vbulletin->forumcache
        $forum = $vbulletin->forumcache["{$forumid}"];
        //$lastpostforum = $vbulletin->forumcache["$lastpostarray[$forumid]"];
        $lastpostforum = empty($lastpostarray[$forumid]) ? array() : $vbulletin->forumcache["{$lastpostarray[$forumid]}"];
        if (!$forum['displayorder'] or !($forum['options'] & $vbulletin->bf_misc_forumoptions['active'])) {
            continue;
        }
        $forumperms = $vbulletin->userinfo['forumpermissions']["{$forumid}"];
        $lastpostforumperms = empty($lastpostarray[$forumid]) ? 0 : $vbulletin->userinfo['forumpermissions']["{$lastpostarray[$forumid]}"];
        if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) and ($vbulletin->forumcache["{$forumid}"]['showprivate'] == 1 or !$vbulletin->forumcache["{$forumid}"]['showprivate'] and !$vbulletin->options['showprivateforums'])) {
            // no permission to view current forum
            continue;
        }
        if ($subsonly) {
            $childforumbits = construct_forum_bit($forum['forumid'], 1, $subsonly);
        } else {
            if ($depth < MAXFORUMDEPTH) {
                $childforumbits = construct_forum_bit($forum['forumid'], $depth, $subsonly);
            } else {
                $childforumbits = '';
            }
        }
        // do stuff if we are not doing subscriptions only, or if we ARE doing subscriptions,
        // and the forum has a subscribedforumid
        if (!$subsonly or $subsonly and !empty($forum['subscribeforumid'])) {
            $GLOBALS['forumshown'] = true;
            // say that we have shown at least one forum
            if ($forum['options'] & $vbulletin->bf_misc_forumoptions['cancontainthreads']) {
                // get appropriate suffix for template name
                $tempext = '_post';
            } else {
                $tempext = '_nopost';
            }
            if (!$vbulletin->options['showforumdescription']) {
                // blank forum description if set to not show
                $forum['description'] = '';
            }
            // dates & thread title
            $lastpostinfo = empty($lastpostarray["{$forumid}"]) ? array() : $vbulletin->forumcache["{$lastpostarray[$forumid]}"];
            // compare last post time for this forum with the last post time specified by
            // the $lastpostarray, and if it's less, use the last post info from the forum
            // specified by $lastpostarray
            if (!empty($lastpostinfo) and $vbulletin->forumcache["{$lastpostarray[$forumid]}"]['lastpost'] > 0) {
                if (!($lastpostforumperms & $vbulletin->bf_ugp_forumpermissions['canview']) or !($lastpostforumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) and $lastpostinfo['lastposter'] != $vbulletin->userinfo['username']) {
                    $forum['lastpostinfo'] = $vbphrase['private'];
                } else {
                    $lastpostinfo['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $lastpostinfo['lastpost'], 1);
                    $lastpostinfo['lastposttime'] = vbdate($vbulletin->options['timeformat'], $lastpostinfo['lastpost']);
                    $lastpostinfo['trimthread'] = fetch_trimmed_title(fetch_censored_text($lastpostinfo['lastthread']));
                    if ($lastpostinfo['lastprefixid'] and $vbulletin->options['showprefixlastpost']) {
                        $lastpostinfo['prefix'] = $vbulletin->options['showprefixlastpost'] == 2 ? $vbphrase["prefix_{$lastpostinfo['lastprefixid']}_title_rich"] : htmlspecialchars_uni($vbphrase["prefix_{$lastpostinfo['lastprefixid']}_title_plain"]);
                    } else {
                        $lastpostinfo['prefix'] = '';
                    }
                    if ($vbulletin->forumcache["{$lastpostforum['forumid']}"]['options'] & $vbulletin->bf_misc_forumoptions['allowicons'] and $icon = fetch_iconinfo($lastpostinfo['lasticonid'])) {
                        $show['icon'] = true;
                    } else {
                        $show['icon'] = false;
                    }
                    $show['lastpostinfo'] = (!$lastpostforum['password'] or verify_forum_password($lastpostforum['forumid'], $lastpostforum['password'], false));
                    $pageinfo_lastpost = array('p' => $lastpostinfo['lastpostid']);
                    $pageinfo_newpost = array('goto' => 'newpost');
                    $threadinfo = array('title' => $lastpostinfo['lastthread'], 'threadid' => $lastpostinfo['lastthreadid']);
                    // prepare the member action drop-down menu
                    $memberaction_dropdown = construct_memberaction_dropdown(fetch_lastposter_userinfo($lastpostinfo));
                    $templater = vB_Template::create('forumhome_lastpostby');
                    $templater->register('icon', $icon);
                    $templater->register('memberaction_dropdown', $memberaction_dropdown);
                    $templater->register('lastpostinfo', $lastpostinfo);
                    $templater->register('pageinfo_lastpost', $pageinfo_lastpost);
                    $templater->register('pageinfo_newpost', $pageinfo_newpost);
                    $templater->register('threadinfo', $threadinfo);
                    $forum['lastpostinfo'] = $templater->render();
                }
//.........这里部分代码省略.........
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:functions_forumlist.php

示例13: do_get_thread

function do_get_thread()
{
    global $vbulletin, $db, $foruminfo, $threadinfo, $postid, $vault, $vbphrase;
    $vbulletin->input->clean_array_gpc('r', array('pagenumber' => TYPE_UINT, 'perpage' => TYPE_UINT, 'password' => TYPE_STR, 'signature' => TYPE_BOOL));
    if (empty($threadinfo['threadid'])) {
        json_error(ERR_INVALID_THREAD);
    }
    $threadedmode = 0;
    $threadid = $vbulletin->GPC['threadid'];
    // Goto first unread post?
    if ($vbulletin->GPC['pagenumber'] == FR_LAST_POST) {
        $threadinfo = verify_id('thread', $threadid, 1, 1);
        if ($vbulletin->options['threadmarking'] and $vbulletin->userinfo['userid']) {
            $vbulletin->userinfo['lastvisit'] = max($threadinfo['threadread'], $threadinfo['forumread'], TIMENOW - $vbulletin->options['markinglimit'] * 86400);
        } else {
            if (($tview = intval(fetch_bbarray_cookie('thread_lastview', $threadid))) > $vbulletin->userinfo['lastvisit']) {
                $vbulletin->userinfo['lastvisit'] = $tview;
            }
        }
        $coventry = fetch_coventry('string');
        $posts = $db->query_first("\n\t    SELECT MIN(postid) AS postid\n\t    FROM " . TABLE_PREFIX . "post\n\t    WHERE threadid = {$threadinfo['threadid']}\n\t    AND visible = 1\n\t    AND dateline > " . intval($vbulletin->userinfo['lastvisit']) . "\n\t    " . ($coventry ? "AND userid NOT IN ({$coventry})" : "") . "\n\t    LIMIT 1\n\t");
        if ($posts['postid']) {
            $postid = $posts['postid'];
        } else {
            $postid = $threadinfo['lastpostid'];
        }
    }
    // *********************************************************************************
    // workaround for header redirect issue from forms with enctype in IE
    // (use a scrollIntoView javascript call in the <body> onload event)
    $onload = '';
    // *********************************************************************************
    // set $perpage
    $perpage = max(FR_MIN_PERPAGE, min($vbulletin->GPC['perpage'], FR_MAX_PERPAGE));
    // FRNR
    //$perpage = sanitize_maxposts($vbulletin->GPC['perpage']);
    // *********************************************************************************
    // set post order
    if ($vbulletin->userinfo['postorder'] == 0) {
        $postorder = '';
    } else {
        $postorder = 'DESC';
    }
    // *********************************************************************************
    // get thread info
    $thread = verify_id('thread', $threadid, 1, 1);
    $threadinfo =& $thread;
    ($hook = vBulletinHook::fetch_hook('showthread_getinfo')) ? eval($hook) : false;
    // *********************************************************************************
    // check for visible / deleted thread
    if (!$thread['visible'] and !can_moderate($thread['forumid'], 'canmoderateposts') or $thread['isdeleted'] and !can_moderate($thread['forumid'])) {
        json_error(ERR_INVALID_THREAD);
    }
    // *********************************************************************************
    // Tachy goes to coventry
    if (in_coventry($thread['postuserid']) and !can_moderate($thread['forumid'])) {
        json_error(ERR_INVALID_THREAD);
    }
    // FRNR Start
    // Check the forum password (set necessary cookies)
    if ($vbulletin->GPC['password'] && $foruminfo['password'] == $vbulletin->GPC['password']) {
        // set a temp cookie for guests
        if (!$vbulletin->userinfo['userid']) {
            set_bbarray_cookie('forumpwd', $foruminfo['forumid'], md5($vbulletin->userinfo['userid'] . $vbulletin->GPC['password']));
        } else {
            set_bbarray_cookie('forumpwd', $foruminfo['forumid'], md5($vbulletin->userinfo['userid'] . $vbulletin->GPC['password']), 1);
        }
    }
    // FRNR End
    // *********************************************************************************
    // do word wrapping for the thread title
    if ($vbulletin->options['wordwrap'] != 0) {
        $thread['title'] = fetch_word_wrapped_string($thread['title']);
    }
    $thread['title'] = fetch_censored_text($thread['title']);
    $thread['meta_description'] = strip_bbcode(strip_quotes($thread['description']), false, true);
    $thread['meta_description'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title($thread['meta_description'], 500, false)));
    // *********************************************************************************
    // words to highlight from the search engine
    if (!empty($vbulletin->GPC['highlight'])) {
        $highlight = preg_replace('#\\*+#s', '*', $vbulletin->GPC['highlight']);
        if ($highlight != '*') {
            $regexfind = array('\\*', '\\<', '\\>');
            $regexreplace = array('[\\w.:@*/?=]*?', '<', '>');
            $highlight = preg_quote(strtolower($highlight), '#');
            $highlight = explode(' ', $highlight);
            $highlight = str_replace($regexfind, $regexreplace, $highlight);
            foreach ($highlight as $val) {
                if ($val = trim($val)) {
                    $replacewords[] = htmlspecialchars_uni($val);
                }
            }
        }
    }
    // *********************************************************************************
    // make the forum jump in order to fill the forum caches
    $navpopup = array('id' => 'showthread_navpopup', 'title' => $foruminfo['title_clean'], 'link' => fetch_seo_url('thread', $threadinfo));
    construct_quick_nav($navpopup);
    // *********************************************************************************
    // get forum info
//.........这里部分代码省略.........
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:get_thread.php

示例14: prepare_socialgroup

/**
 * Takes information regardign a group, and prepares the information within it
 * for display
 *
 * @param	array	Group Array
 *
 * @return	array	Group Array with prepared information
 *
 */
function prepare_socialgroup($group)
{
    global $vbulletin;
    if (!is_array($group)) {
        return array();
    }
    $group['joindate'] = $group['joindate'] ? vbdate($vbulletin->options['dateformat'], $group['joindate'], true) : '';
    $group['createdate'] = $group['createdate'] ? vbdate($vbulletin->options['dateformat'], $group['createdate'], true) : '';
    $group['members'] = vb_number_format($group['members']);
    $group['moderatedmembers'] = vb_number_format($group['moderatedmembers']);
    if (!($group['options'] & $vbulletin->bf_misc_socialgroupoptions['enable_group_albums'])) {
        // albums disabled in this group - force 0 pictures
        $group['picturecount'] = 0;
    }
    $group['rawpicturecount'] = $group['picturecount'];
    $group['picturecount'] = vb_number_format($group['picturecount']);
    $group['rawname'] = $group['name'];
    $group['rawdescription'] = $group['description'];
    $group['name'] = fetch_word_wrapped_string(fetch_censored_text($group['name']));
    $group['shortdescription'] = fetch_word_wrapped_string(fetch_censored_text(fetch_trimmed_title($group['description'], 200)));
    $group['description'] = nl2br(fetch_word_wrapped_string(fetch_censored_text($group['description'])));
    $group['is_owner'] = $group['creatoruserid'] == $vbulletin->userinfo['userid'];
    $group['is_automoderated'] = ($group['options'] & $vbulletin->bf_misc_socialgroupoptions['owner_mod_queue'] and $vbulletin->options['sg_allow_owner_mod_queue'] and !$vbulletin->options['social_moderation']);
    $group['canviewcontent'] = (!($group['options'] & $vbulletin->bf_misc_socialgroupoptions['join_to_view']) or !$vbulletin->options['sg_allow_join_to_view'] or $group['membertype'] == 'member' or can_moderate(0, 'canmoderategroupmessages') or can_moderate(0, 'canremovegroupmessages') or can_moderate(0, 'candeletegroupmessages') or can_moderate(0, 'candeletegroupmessages'));
    $group['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $group['lastpost'], true);
    $group['lastposttime'] = vbdate($vbulletin->options['timeformat'], $group['lastpost']);
    $group['lastposterid'] = $group['canviewcontent'] ? $group['lastposterid'] : 0;
    $group['lastposter'] = $group['canviewcontent'] ? $group['lastposter'] : '';
    ($hook = vBulletinHook::fetch_hook('group_prepareinfo')) ? eval($hook) : false;
    return $group;
}
开发者ID:holandacz,项目名称:nb4,代码行数:40,代码来源:functions_socialgroup.php

示例15: convert_ids_to_titles


//.........这里部分代码省略.........
			// format thread preview if there is one
			$userperms = fetch_permissions($threadresult['forumid']);
			if (!empty($threadresult['preview']) AND $vbulletin->options['threadpreview'] > 0 AND ($userperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
			{
				// 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)));

				if (!$ignore["$threadresult[postuserid]"])
				{
					$threadresult['preview'] = strip_quotes($threadresult['preview']);
					$threadresult['preview'] = htmlspecialchars_uni(strip_bbcode(fetch_trimmed_title($threadresult['preview'], $vbulletin->options['threadpreview']), false, true));
					$wol_thread["$threadresult[threadid]"]['preview'] = $threadresult['preview'];
				}
			}
		}
	}

	if ($calendarids)
	{
		$calendarresults = $vbulletin->db->query_read_slave("
			SELECT calendarid, title
			FROM " . TABLE_PREFIX . "calendar
			WHERE calendarid IN (0$calendarids)
		");
		while ($calendarresult = $vbulletin->db->fetch_array($calendarresults))
		{
			$wol_calendar["$calendarresult[calendarid]"] = $calendarresult['title'];
		}
	}

	if ($infractionids)
	{
		$infractions = $vbulletin->db->query_read_slave("
			SELECT infractionid, userid
			FROM " . TABLE_PREFIX . "infraction
			WHERE infractionid IN (0$infractionids)
		");
		while ($infraction = $vbulletin->db->fetch_array($infractions))
		{
			$wol_inf["$infraction[infractionid]"]['userid'] = $infraction['userid'];
			$userids .= ',' . $infraction['userid'];
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:67,代码来源:functions_online.php


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