本文整理汇总了PHP中vbdate函数的典型用法代码示例。如果您正苦于以下问题:PHP vbdate函数的具体用法?PHP vbdate怎么用?PHP vbdate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vbdate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: time
public static function time($timestamp)
{
if (empty($timestamp)) {
$timestamp = 0;
}
return vbdate(vB::getDatastore()->getOption('timeformat'), $timestamp);
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:7,代码来源:runtime.php
示例2: 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
示例3: create_array
public static function create_array($ids)
{
global $vbulletin;
$set = $vbulletin->db->query_read_slave("
SELECT announcementid, startdate, title, announcement.views, forumid,
user.username, user.userid, user.usertitle, user.customtitle, user.usergroupid,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
FROM " . TABLE_PREFIX . "announcement AS announcement
LEFT JOIN " . TABLE_PREFIX . "user AS user USING (userid)
WHERE announcementid IN (" . implode(',', array_map('intval', $ids)) . ")
");
$items = array();
while ($record = $vbulletin->db->fetch_array($set))
{
fetch_musername($record);
$record['title'] = fetch_censored_text($record['title']);
$record['postdate'] = vbdate($vbulletin->options['dateformat'], $record['startdate']);
$record['statusicon'] = 'new';
$record['views'] = vb_number_format($record['views']);
$record['forumtitle'] = $vbulletin->forumcache["$record[forumid]"]['title'];
$show['forumtitle'] = ($record['forumid'] == -1) ? false : true;
$announcement = new vBForum_Search_Result_Announcement();
$announcement->record = $record;
$items[$record['announcementid']] = $announcement;
}
return $items;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:announcement.php
示例4: fetchTemplate
public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
{
$commentinfo =& $this->content['album_picturecomment'][$activity['contentid']];
$albuminfo =& $this->content['album'][$commentinfo['albumid']];
$activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
$activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
$preview = strip_quotes($commentinfo['pagetext']);
$commentinfo['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($preview, false, true, true, true), vb::$vbulletin->options['as_snippet'])));
$userinfo = $this->fetchUser($activity['userid'], $commentinfo['postusername']);
$userinfo2 = $this->fetchUser($albuminfo['userid']);
if ($fetchphrase) {
if ($userinfo['userid']) {
$phrase = construct_phrase($this->vbphrase['x_commented_on_a_photo_in_album_y'], fetch_seo_url('member', $userinfo), $userinfo['username'], fetch_seo_url('member', $userinfo2), $userinfo2['username'], vB::$vbulletin->session->vars['sessionurl'], $albuminfo['albumid'], $albuminfo['title']);
} else {
$phrase = construct_phrase($this->vbphrase['guest_x_commented_on_a_photo_in_album_y'], $userinfo['username'], fetch_seo_url('member', $userinfo2), $userinfo2['username'], vB::$vbulletin->session->vars['sessionurl'], $albuminfo['albumid'], $albuminfo['title']);
}
return array('phrase' => $phrase, 'userinfo' => $userinfo, 'activity' => $activity);
} else {
$templater = vB_Template::create($templatename);
$templater->register('userinfo', $userinfo);
$templater->register('userinfo2', $userinfo2);
$templater->register('activity', $activity);
$templater->register('commentinfo', $commentinfo);
$templater->register('albuminfo', $albuminfo);
return $templater->render();
}
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:27,代码来源:comment.php
示例5: addContentInfo
protected function addContentInfo($results)
{
$results = parent::addContentInfo($results);
$checkvoted = array();
try {
$checkvoted = $this->checkVotedMultiple(array_keys($results));
} catch (vB_Exception_Api $e) {
// Ignore for guest user
}
//the key of for each node is the nodeid, fortunately
foreach ($results as $key => &$record) {
if (!empty($record['options']) and !is_array($record['options'])) {
$record['options'] = @unserialize($record['options']);
}
// Check if the poll is timeout
if (isset($record['timeout'])) {
$record['istimeout'] = ($record['timeout'] and $record['timeout'] < vB::getRequest()->getTimeNow());
// For timeout input
if ($record['timeout']) {
$record['timeoutstr'] = vbdate("m/d/Y H:i", $record['timeout']);
} else {
$record['timeoutstr'] = '';
}
} else {
$record['timeoutstr'] = '';
$record['istimeout'] = false;
}
// Check if it's voted already
// TODO: we need to improve this to consider voting permissions for guests.
$record['voted'] = !empty($checkvoted[$key]) ? $checkvoted[$key] : false;
}
return $results;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:33,代码来源:poll.php
示例6: fetch_event_date_time
function fetch_event_date_time($info)
{
global $timerange, $vbulletin, $vbphrase, $months, $days, $day, $month, $year, $holiday, $eventdate;
global $titlecolor, $date1, $date2, $time1, $time2, $recurcriteria, $allday, $show;
require_once DIR . '/includes/functions_misc.php';
$daterange = '';
$recurcriteria = '';
$show['recuroption'] = false;
$titlecolor = 'alt1';
$info['title'] = htmlspecialchars_uni($info['title']);
if ($wordwrap != 0) {
$info['title'] = fetch_word_wrapped_string($info['title']);
}
$info['event'] = iif(empty($info['event']), ' ', parse_calendar_bbcode($info['event'], $info['allowsmilies']));
if (!$info['recurring'] and !$info['singleday']) {
$daystamp = gmmktime(0, 0, 0, $month, $day, $year);
$eventfirstday = gmmktime(0, 0, 0, gmdate('n', $info['dateline_from_user']), gmdate('j', $info['dateline_from_user']), gmdate('Y', $info['dateline_from_user']));
$eventlastday = gmmktime(0, 0, 0, gmdate('n', $info['dateline_to_user']), gmdate('j', $info['dateline_to_user']), gmdate('Y', $info['dateline_to_user']));
if ($info['dateline_from'] == $daystamp) {
if ($eventfirstday == $daystamp) {
if ($eventfirstday != $eventlastday) {
if (vbdate('g:ia', $info['dateline_from_user'], false, false) == '12:00am') {
$allday = true;
} else {
$time2 = vbgmdate($vbulletin->options['timeformat'], gmmktime(0, 0, 0, $month, $day, $year));
}
}
}
} else {
if ($eventlastday == $daystamp) {
$time1 = gmdate($vbulletin->options['timeformat'], gmmktime(0, 0, 0, $month, $day, $year));
$time1 = vbgmdate($vbulletin->options['timeformat'], gmmktime(0, 0, 0, $month, $day, $year));
} else {
$allday = true;
// Used in conditional
}
}
}
if ($info['holidayid']) {
$eventdate = vbgmdate($vbulletin->options['dateformat'], gmmktime(0, 0, 0, $month, $day, $year));
} else {
if ($info['singleday']) {
$eventdate = vbgmdate($vbulletin->options['dateformat'], $info['dateline_from']);
} else {
$date1 = vbgmdate($vbulletin->options['dateformat'], $info['dateline_from_user']);
$date2 = vbgmdate($vbulletin->options['dateformat'], $info['dateline_to_user']);
$time1 = vbgmdate($vbulletin->options['timeformat'], $info['dateline_from_user']);
$time2 = vbgmdate($vbulletin->options['timeformat'], $info['dateline_to_user']);
if ($info['recurring']) {
$recurcriteria = fetch_event_criteria($info);
$show['recuroption'] = true;
} else {
$show['daterange'] = iif($date1 != $date2, true, false);
$eventdate = vbgmdate($vbulletin->options['dateformat'], $info['dateline_from_user']);
}
}
}
return $info;
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:59,代码来源:functions_calendar.php
示例7: 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
示例8: construct_threaded_post_link
function construct_threaded_post_link($post, $imageString, $depth, $haschildren, $highlightpost = false)
{
global $vbulletin, $bgclass, $curpostid, $parent_postids, $morereplies, $threadedmode, $vbphrase, $postattach;
global $threadinfo;
// ugly
static $lasttitle;
//print_array($post);
if ($threadedmode == 2 and $highlightpost) {
$highlightpost = 1;
} else {
$highlightpost = 0;
}
$pageinfo = array('p' => $post['postid']);
if ($vbulletin->GPC['highlight']) {
$pageinfo['highlight'] = urlencode($vbulletin->GPC['highlight']);
}
// write 'more replies below' link
if ($vbulletin->options['threaded_listdepth'] != 0 and $depth == $vbulletin->options['threaded_listdepth'] and $post['postid'] != $curpostid and $haschildren and ($vbulletin->options['threaded_listdepth'] != 0 and $depth == $vbulletin->options['threaded_listdepth'] and !strpos(' ,' . $curpostid . $parent_postids . ',', ',' . $post['postid'] . ','))) {
$morereplies[$post['postid']] = 1;
return "writeLink({$post['postid']}, " . fetch_statusicon_from_child_posts($post['postid']) . ", 0, 0, \"{$imageString}\", \"\", \"more\", \"\", {$highlightpost}, \"" . addslashes_js(fetch_seo_url('thread|js', $threadinfo, $pageinfo) . "#post{$post['postid']}") . "\");\n";
}
// get time fields
$post['date'] = vbdate($vbulletin->options['dateformat'], $post['dateline'], 1);
$post['time'] = vbdate($vbulletin->options['timeformat'], $post['dateline']);
// get status icon and paperclip
$post['statusicon'] = iif($post['dateline'] > $threadinfo['threadview'], 1, 0);
// get paperclip
$post['paperclip'] = 0;
if (is_array($postattach["{$post['postid']}"])) {
foreach ($postattach["{$post['postid']}"] as $attachment) {
if ($attachment['visible']) {
$post['paperclip'] = 1;
break;
}
}
}
// echo some text from the post if no title
if ($post['isdeleted']) {
$post['title'] = $vbphrase['post_deleted'];
} else {
if (empty($post['title'])) {
$pagetext = htmlspecialchars_uni($post['pagetext']);
$pagetext = strip_bbcode($pagetext, 1);
if (trim($pagetext) == '') {
$post['title'] = $vbphrase['reply_prefix'] . ' ' . fetch_trimmed_title($lasttitle, $vbulletin->options['threaded_trimtitle']);
} else {
$post['title'] = '<i>' . fetch_trimmed_title($pagetext, $vbulletin->options['threaded_trimtitle']) . '</i>';
}
} else {
$lasttitle = $post['title'];
$post['title'] = fetch_trimmed_title($post['title'], $vbulletin->options['threaded_trimtitle']);
}
}
($hook = vBulletinHook::fetch_hook('showthread_threaded_construct_link')) ? eval($hook) : false;
return "writeLink({$post['postid']}, {$post['statusicon']}, {$post['paperclip']}, " . intval($post['userid']) . ", \"{$imageString}\", \"" . addslashes_js($post['title'], '"') . "\", \"" . addslashes_js($post['date'], '"') . "\", \"" . addslashes_js($post['time'], '"') . "\", {$highlightpost}, \"" . addslashes_js(fetch_seo_url('thread|js', $threadinfo, $pageinfo) . "#post{$post['postid']}") . "\");\n";
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:56,代码来源:functions_threadedmode.php
示例9: 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
示例10: build_history_bit
/**
* Builds the history bit for a selected history point
*
* @param array Array of information for this histoy point
* @param object BB code parser
*
* @return string History bit HTML
*/
function build_history_bit($history, &$bbcode)
{
global $vbulletin, $vbphrase, $show, $stylevar;
$history['editdate'] = vbdate($vbulletin->options['dateformat'], $history['dateline'], true);
$history['edittime'] = vbdate($vbulletin->options['timeformat'], $history['dateline']);
$history['message'] = $bbcode->parse($history['pagetext'], 'pt');
if ($history['reason'] === '') {
$history['reason'] = $vbphrase['n_a'];
}
($hook = vBulletinHook::fetch_hook('project_historybit')) ? eval($hook) : false;
eval('$edit_history = "' . fetch_template('pt_historybit') . '";');
return $edit_history;
}
开发者ID:holandacz,项目名称:nb4,代码行数:21,代码来源:functions_pt_notehistory.php
示例11: prepare_milestone_stats
/**
* Creates the milestone stats array (target date, total issues, progress).
* Array contains formatted data.
*
* @param array Array of milestone info
* @param array Array of raw count info
*
* @return array Formatted stats data
*/
function prepare_milestone_stats($milestone, $raw_counts)
{
global $vbulletin;
$stats = array('total_issues' => vb_number_format($raw_counts['total_issues']), 'total_completed' => vb_number_format($raw_counts['total_completed']), 'total_active' => vb_number_format($raw_counts['total_active']), 'percent_completed' => vb_number_format($raw_counts['percent_completed']));
if ($milestone['completeddate']) {
$stats['completed_date'] = vbdate($vbulletin->options['dateformat'], $milestone['completeddate']);
$stats['milestone_overdue'] = false;
} else {
$stats['target_date'] = vbdate($vbulletin->options['dateformat'], $milestone['targetdate']);
$stats['milestone_overdue'] = ($milestone['targetdate'] and $milestone['targetdate'] < TIMENOW);
}
return $stats;
}
开发者ID:holandacz,项目名称:nb4,代码行数:22,代码来源:functions_pt_milestone.php
示例12: IF
/**
* Contructs a Post Tree
*
* @param string The template Name to use
* @param integer The Thread ID
* @param integer The "Root" post for which to work from
* @param integer The current "Depth" within the tree
*
* @return string The Generated Tree
*
*/
function &construct_post_tree($templatename, $threadid, $parentid = 0, $depth = 1)
{
global $vbulletin, $stylevar, $parentassoc, $show, $vbphrase, $threadedmode;
static $postcache;
if (!$threadedmode and $vbulletin->userinfo['postorder']) {
$postorder = 'DESC';
}
$depthnext = $depth + 2;
if (!$postcache) {
$posts = $vbulletin->db->query_read_slave("\n\t\t\tSELECT post.parentid, post.postid, post.userid, post.pagetext, post.dateline, IF(visible = 2, 1, 0) AS isdeleted,\n\t\t\t\tIF(user.username <> '', user.username, post.username) AS username\n\t\t\tFROM " . TABLE_PREFIX . "post AS post\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON user.userid = post.userid\n\t\t\tWHERE post.threadid = {$threadid}\n\t\t\tORDER BY dateline {$postorder}\n\t\t");
while ($post = $vbulletin->db->fetch_array($posts)) {
if (!$threadedmode) {
$post['parentid'] = 0;
}
$postcache[$post['parentid']][$post['postid']] = $post;
}
ksort($postcache);
}
$counter = 0;
$postbits = '';
if (is_array($postcache["{$parentid}"])) {
foreach ($postcache["{$parentid}"] as $post) {
$parentassoc[$post['postid']] = $post['parentid'];
if (($depth + 1) % 4 == 0) {
// alternate colors when switching depths; depth gets incremented by 2 each time
$post['backcolor'] = '{firstaltcolor}';
$post['bgclass'] = 'alt1';
} else {
$post['backcolor'] = '{secondaltcolor}';
$post['bgclass'] = 'alt2';
}
$post['postdate'] = vbdate($vbulletin->options['dateformat'], $post['dateline'], true);
$post['posttime'] = vbdate($vbulletin->options['timeformat'], $post['dateline']);
// cut page text short if too long
if (vbstrlen($post['pagetext']) > 100) {
$spacepos = strpos($post['pagetext'], ' ', 100);
if ($spacepos != 0) {
$post['pagetext'] = substr($post['pagetext'], 0, $spacepos) . '...';
}
}
$post['pagetext'] = nl2br(htmlspecialchars_uni($post['pagetext']));
($hook = vBulletinHook::fetch_hook('threadmanage_construct_post_tree')) ? eval($hook) : false;
eval('$postbits .= "' . fetch_template($templatename) . '";');
$ret =& construct_post_tree($templatename, $threadid, $post['postid'], $depthnext);
$postbits .= $ret;
}
}
return $postbits;
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:60,代码来源:functions_threadmanage.php
示例13: process_showgroups_userinfo
function process_showgroups_userinfo($user)
{
global $vbulletin, $permissions, $stylevar, $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, true);
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);
return $user;
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:15,代码来源:showgroups.php
示例14: process_showgroups_userinfo
function process_showgroups_userinfo($user)
{
global $vbulletin, $permissions, $stylevar, $show;
$post =& $user;
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
require_once DIR . '/includes/functions_bigthree.php';
fetch_online_status($user, true);
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);
return $user;
}
开发者ID:holandacz,项目名称:nb4,代码行数:15,代码来源:showgroups.php
示例15: fetchTemplate
public function fetchTemplate($templatename, $activity, $skipgroup = false, $fetchphrase = false)
{
$groupinfo =& $this->content['socialgroup'][$activity['contentid']];
$userinfo =& $this->content['user'][$activity['userid']];
$activity['postdate'] = vbdate(vB::$vbulletin->options['dateformat'], $activity['dateline'], true);
$activity['posttime'] = vbdate(vB::$vbulletin->options['timeformat'], $activity['dateline']);
if ($fetchphrase) {
return array('phrase' => construct_phrase($this->vbphrase['x_created_a_group_y'], fetch_seo_url('member', $userinfo), $userinfo['username'], vB::$vbulletin->session->vars['sessionurl'], $groupinfo['groupid'], $groupinfo['name']), 'userinfo' => $userinfo, 'activity' => $activity);
} else {
$templater = vB_Template::create($templatename);
$templater->register('userinfo', $userinfo);
$templater->register('activity', $activity);
$templater->register('groupinfo', $groupinfo);
return $templater->render();
}
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:16,代码来源:group.php
示例16: fetch_log_file_array
function fetch_log_file_array($type = 'database')
{
global $vbulletin, $vbphrase;
$filelist = array();
switch ($type) {
case 'database':
$option = 'errorlogdatabase';
$title = $vbphrase['vbulletin_database_errors'];
break;
case 'security':
$option = 'errorlogsecurity';
$title = $vbphrase['admin_control_panel_failed_logins'];
break;
default:
return $filelist;
}
if ($filebase = trim($vbulletin->options["{$option}"])) {
$slashpos = strrpos($filebase, '/');
if ($slashpos === false) {
$basedir = '.';
} else {
$basedir = substr($filebase, 0, $slashpos);
}
if ($handle = @opendir($basedir)) {
$filebase = substr($filebase, $slashpos + 1);
$namelength = strlen($filebase);
while ($file = readdir($handle)) {
if (strpos($file, $filebase) === 0) {
if ($unixdate = intval(substr($file, $namelength, -4))) {
$date = vbdate($vbulletin->options['dateformat'] . ' ' . $vbulletin->options['timeformat'], $unixdate);
} else {
$date = '(Current Version)';
}
$key = $type . '_' . $unixdate;
$filelist["{$key}"] = "{$title} {$date}";
}
}
@closedir($handle);
return $filelist;
} else {
echo '<p>' . $vbphrase['invalid_directory_specified'] . '</p>';
}
} else {
return false;
}
}
开发者ID:holandacz,项目名称:nb4,代码行数:46,代码来源:adminlog.php
示例17: 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
示例18: latestvids
function latestvids()
{
global $vbulletin, $stylevar;
$latestvids = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "anymedia ORDER BY " . TABLE_PREFIX . "anymedia.date DESC LIMIT 0,10");
while ($lv = $vbulletin->db->fetch_array($latestvids)) {
$wtf = $lv;
$lv['date'] = vbdate($vbulletin->options['dateformat'], $lv['date']);
$lv['time'] = vbdate($vbulletin->options['timeformat'], $lv['date']);
//$lv['body'] = cutOffString($lv['body'],500, '', DO_CLOSE_BBCODE);
//require_once(DIR . '/includes/class_bbcode.php');
//$lv['body'] = strip_tags($lv['body']);
//$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
//$lv['body'] = $parser->do_parse($lv['body'], false, true, true, false, true, false);\
//$vids .= "$lv[media_url]";
//$vid .= fetch_template('anymedia_vids')
echo eval('$vid .= "' . fetch_template('anymedia_vids') . '";');
return $lv;
}
return $please;
}
开发者ID:holandacz,项目名称:nb4,代码行数:20,代码来源:functions_anymedia.php
示例19: 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
示例20: IF
}
if ($limitlower <= 0) {
$limitlower = 1;
}
// Get attachment info
$attachments = $db->query_read_slave("\n\t\t\tSELECT thread.forumid, post.postid, post.threadid AS p_threadid, post.title AS p_title, post.dateline AS p_dateline, attachment.attachmentid,\n\t\t\t\tthread.title AS t_title, attachment.filename, attachment.counter, attachment.filesize AS size, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail,\n\t\t\t\tthumbnail_filesize, user.username, thread.open, attachment.userid " . iif($userid == $vbulletin->userinfo['userid'], ", IF(attachment.postid = 0, 1, 0) AS inprogress") . ",\n\t\t\t\tattachment.dateline, attachment.thumbnail_dateline\n\t\t\tFROM " . TABLE_PREFIX . "attachment AS attachment\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = attachment.postid)\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (post.threadid = thread.threadid)\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (attachment.userid = user.userid)\n\t\t\tWHERE attachment.userid = {$userid}\n\t\t\t\tAND ((forumid IN (0{$forumids}) AND thread.visible = 1 AND post.visible = 1) " . iif($userid == $vbulletin->userinfo['userid'], "OR attachment.postid = 0") . ")\n\t\t\tORDER BY attachment.attachmentid DESC\n\t\t\tLIMIT " . ($limitlower - 1) . ", {$perpage}\n\t\t");
$template['attachmentlistbits'] = '';
while ($post = $db->fetch_array($attachments)) {
$post['filename'] = htmlspecialchars_uni($post['filename']);
if (!$post['p_title']) {
$post['p_title'] = '«' . $vbphrase['n_a'] . '»';
}
$post['counter'] = vb_number_format($post['counter']);
$post['size'] = vb_number_format($post['size'], 1, true);
$post['postdate'] = vbdate($vbulletin->options['dateformat'], $post['p_dateline'], true);
$post['posttime'] = vbdate($vbulletin->options['timeformat'], $post['p_dateline']);
$post['attachmentextension'] = strtolower(file_extension($post['filename']));
$show['thumbnail'] = iif($post['hasthumbnail'] == 1 and $vbulletin->options['attachthumbs'] and $showthumbs, 1, 0);
$show['inprogress'] = iif(!$post['postid'], true, false);
$show['deletebox'] = false;
if ($post['inprogress']) {
$show['deletebox'] = true;
} else {
if ($post['open'] or $vbulletin->options['allowclosedattachdel'] or can_moderate($post['forumid'], 'canopenclose')) {
if (can_moderate($post['forumid'], 'caneditposts')) {
$show['deletebox'] = true;
} else {
$forumperms = fetch_permissions($post['forumid']);
if ($forumperms & $vbulletin->bf_ugp_forumpermissions['caneditpost'] and $vbulletin->userinfo['userid'] == $post['userid']) {
if ($vbulletin->options['allowattachdel'] or !$vbulletin->options['edittimelimit'] or $post['p_dateline'] >= TIMENOW - $vbulletin->options['edittimelimit'] * 60) {
$show['deletebox'] = true;
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:profile.php
注:本文中的vbdate函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论