本文整理汇总了PHP中convert::convert_date方法的典型用法代码示例。如果您正苦于以下问题:PHP convert::convert_date方法的具体用法?PHP convert::convert_date怎么用?PHP convert::convert_date使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类convert
的用法示例。
在下文中一共展示了convert::convert_date方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showList
function showList()
{
$mes = e107::getMessage();
$sql = e107::getDb();
$ns = e107::getRender();
$tp = e107::getParser();
$frm = e107::getForm();
$gen = new convert();
$count = $sql->select("gsitemap", "*", "gsitemap_id !=0 ORDER BY gsitemap_order ASC");
if (!$count) {
$text = "\n\t\t\t<form action='" . e_SELF . "?import' id='import' method='post'>\n\t\t\t" . GSLAN_39 . "<br /><br />" . $frm->admin_button('import', LAN_YES, 'submit') . "\n\t\t\t</form>";
$mes->addInfo($text);
$ns->tablerender(GSLAN_24, $mes->render());
return;
} else {
$text = "\n\t\t\t<form action='" . e_SELF . "' id='display' method='post'>\n\t\t\t<table class='table adminlist'>\n \t<colgroup span='2'>\n\t\t\t\t\t<col style='width:5%' />\n\t\t\t\t\t<col style='width:10%' />\n\t\t\t\t\t<col style='width:35%' />\n\t\t\t\t\t<col style='width:20%' />\n\t\t\t\t\t<col style='width:10%' />\n\t\t\t\t\t<col style='width:10%' />\n\t\t\t\t\t<col style='width:10%' />\n\t\t\t\t</colgroup>\n <thead>\n\t\t\t\t<tr class='first last' >\n\t\t\t\t<th style='text-align: center;'>Id</th>\n\t\t\t\t<th>" . LAN_NAME . "</th>\n\t\t\t\t<th>" . LAN_URL . "</th>\n\t\t\t\t<th style='text-align: center'>" . GSLAN_27 . "</th>\n\t\t\t\t<th style='text-align: center' >" . GSLAN_28 . "</th>\n\t\t\t\t<th style='text-align: center' >" . GSLAN_9 . "</th>\n\t\t\t\t<th style='text-align: center'>" . LAN_OPTIONS . "</th>\n\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t";
$glArray = $sql->db_getList();
foreach ($glArray as $row2) {
$datestamp = $gen->convert_date($row2['gsitemap_lastmod'], "short");
$rowStyle = vartrue($rowStyle) == "odd" ? "even" : "odd";
$text .= "<tr class='{$rowStyle}'>\n\t\t\t\t<td style='; text-align: center;'>" . $row2['gsitemap_id'] . "</td>\n\t\t\t\t<td>" . $tp->toHTML($row2['gsitemap_name'], "", "defs") . "</td>\n\t\t\t\t<td>" . $row2['gsitemap_url'] . "</td>\n\t\t\t\t<td style='; text-align: center;'>" . $datestamp . "</td>\n\t\t\t\t<td style='; text-align: center;'>" . $this->freq_list[$row2['gsitemap_freq']] . "</td>\n\t\t\t\t<td style='; text-align: center;'>" . $row2['gsitemap_priority'] . "</td>\n\n\t\t\t\t<td class='center' style='white-space:nowrap'>\n\t\t\t\t<div>\n\t\t\t\t<button class='btn btn-default' type='submit' name='edit[{$row2['gsitemap_id']}]' value='edit' alt='" . LAN_EDIT . "' title='" . LAN_EDIT . "' style='border:0px' >" . ADMIN_EDIT_ICON . "</button>\n\t\t\t\t<button class='btn btn-default action delete' type='submit' name='delete[{$row2['gsitemap_id']}]' value='del' data-confirm='" . $tp->toJS(LAN_CONFIRMDEL . " [" . $row2['gsitemap_name'] . "]") . "' title='" . LAN_DELETE . "' >" . ADMIN_DELETE_ICON . "</button>\n\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t";
}
}
$text .= "</tbody></table>\n</form>";
$ns->tablerender(GSLAN_24, $mes->render() . $text);
}
示例2: email_item
function email_item($thread_id)
{
global $tp;
$gen = new convert();
include_once e_PLUGIN . 'forum/forum_class.php';
$forum = new e107forum();
$thread_info = $forum->thread_get($thread_id, 0, 999);
$thread_name = $tp->toHTML($thread_info[0]['thread_name'], TRUE);
$text = "<b>" . $thread_name . "</b><br />\n\t" . $thread_info[0]['user_name'] . ", " . $gen->convert_date($thread_info[0]['thread_datestamp'], "forum") . "<br /><br />\n\t" . $tp->toHTML($thread_info[0]['thread_thread'], TRUE);
$count = 1;
unset($thread_info[0], $thread_info['head']);
foreach ($thread_info as $reply) {
$text .= "<br /><br />Re: <b>" . $thread_name . "</b><br />\n\t\t" . $reply['user_name'] . ", " . $gen->convert_date($reply['thread_datestamp'], "forum") . "<br /><br />\n\t\t" . $tp->toHTML($reply['thread_thread'], TRUE);
}
return $text;
}
示例3: sc_pm_blocked_date
public function sc_pm_blocked_date($parm = '')
{
require_once e_HANDLER . 'date_handler.php';
return convert::convert_date($this->pmBlocked['pm_block_datestamp'], $parm);
}
示例4: show_newsarchive
function show_newsarchive($newsAr, $i = 1)
{
global $ns, $gen, $pref, $tp, $news_archive_shortcodes, $NEWSARCHIVE, $news2;
// do not show the news archive on the news.php?item.X page (but only on the news mainpage)
require_once e_CORE . 'shortcodes/batch/news_archives.php';
$textnewsarchive = '';
ob_start();
$i++;
// First entry to show
while (isset($newsAr[$i])) {
$news2 = $newsAr[$i];
// Code from Lisa
// copied from the rss creation, but added here to make sure the url for the newsitem is to the news.php?item.X
// instead of the actual hyperlink that may have been added to a newstitle on creation
$search = array();
$replace = array();
$search[0] = "/\\<a href=\"(.*?)\">(.*?)<\\/a>/si";
$replace[0] = '\\2';
$search[1] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si";
$replace[1] = '\\2';
$search[2] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si";
$replace[2] = '\\2';
$search[3] = "/\\<a href="(.*?)">(.*?)<\\/a>/si";
$replace[3] = '\\2';
$search[4] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si";
$replace[4] = '\\2';
$news2['news_title'] = preg_replace($search, $replace, $news2['news_title']);
// End of code from Lisa
$gen = new convert();
$news2['news_datestamp'] = $gen->convert_date($news2['news_datestamp'], "short");
if (!$NEWSARCHIVE) {
$NEWSARCHIVE = "<div>\n\t\t\t\t\t<table style='width:98%;'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t<div>{ARCHIVE_BULLET} <b>{ARCHIVE_LINK}</b> <span class='smalltext'><i>{ARCHIVE_AUTHOR} @ ({ARCHIVE_DATESTAMP}) ({ARCHIVE_CATEGORY})</i></span></div>\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t</div>";
}
$textnewsarchive .= $tp->parseTemplate($NEWSARCHIVE, FALSE, $news_archive_shortcodes);
$i++;
}
$ns->tablerender($pref['newsposts_archive_title'], $textnewsarchive, 'news_archive');
$newsarchive = ob_get_contents();
ob_end_flush();
// dump collected data
setNewsCache('newsarchive', $newsarchive);
}
示例5: varsettrue
if (strstr($online_location, "admin")) {
$class_check = FALSE;
$online_location_page = ADMINAREA;
}
$ONLINE_TABLE_ICON = varsettrue($pref['plug_installed']['pm']) && $oid != USERID ? $tp->parseTemplate("{SENDPM={$oid}}", 'sendpm.sc') : "<img src='" . e_PLUGIN . "online_extended_menu/images/user.png' alt='' style='vertical-align:middle' />";
$ONLINE_TABLE_USERNAME = "<a href='" . e_BASE . "user.php?id.{$oid}'>{$oname}</a>";
$ONLINE_TABLE_LOCATION = $class_check ? "<a href='{$online_location}'>{$online_location_page}</a>" : $online_location_page;
$textstring .= preg_replace("/\\{(.*?)\\}/e", '$\\1', $ONLINE_TABLE);
}
$ONLINE_TABLE_MEMBERS_ONLINE = ONLINE_EL1 . GUESTS_ONLINE;
$ONLINE_TABLE_GUESTS_ONLINE = ONLINE_EL2 . MEMBERS_ONLINE;
if (!isset($gen) || !is_object($gen)) {
$gen = new convert();
}
$siteHistory = e107::getConfig('history')->getPref('');
$datestamp = $gen->convert_date($siteHistory['most_online_datestamp'], "short");
$ONLINE_TABLE_MOST_EVER_ONLINE = ONLINE_EL8 . ($siteHistory['most_members_online'] + $siteHistory['most_guests_online']);
$ONLINE_TABLE_MOST_MEMBERS_ONLINE = ONLINE_EL2 . $siteHistory['most_members_online'];
$ONLINE_TABLE_MOST_GUESTS_ONLINE = ONLINE_EL1 . $siteHistory['most_guests_online'];
$ONLINE_TABLE_DATESTAMP = $datestamp;
$total_members = $sql->db_Count("user", "(*)", "where user_ban = 0");
if ($total_members > 1) {
$newest_member = $sql->db_Select("user", "user_id, user_name", "user_ban=0 ORDER BY user_join DESC LIMIT 0,1");
$row = $sql->db_Fetch();
$ONLINE_TABLE_MEMBERS_TOTAL = "<br />" . ONLINE_EL5 . ": " . $total_members;
$ONLINE_TABLE_MEMBERS_NEWEST = "<br />" . ONLINE_EL6 . ": " . (USER ? "<a href='" . e_BASE . "user.php?id." . $row['user_id'] . "'>" . $row['user_name'] . "</a>" : $row['user_name']);
}
$text = '';
if (count($listuserson)) {
$textstart = preg_replace("/\\{(.*?)\\}/e", '$\\1', $ONLINE_TABLE_START);
$textend = preg_replace("/\\{(.*?)\\}/e", '$\\1', $ONLINE_TABLE_END);
示例6: convert
if ($source == 'news') {
$con = new convert();
$sql->db_Select('news', '*', 'news_id=' . intval($parms));
$row = $sql->db_Fetch();
$news_body = $tp->toHTML($row['news_body'], TRUE);
$news_extended = $tp->toHTML($row['news_extended'], TRUE);
if ($row['news_author'] == 0) {
$a_name = 'e107';
$category_name = 'e107 welcome message';
} else {
$sql->db_Select('news_category', 'category_id, category_name', 'category_id=' . intval($row['news_category']));
list($category_id, $category_name) = $sql->db_Fetch();
$sql->db_Select('user', 'user_id, user_name', 'user_id=' . intval($row['news_author']));
list($a_id, $a_name) = $sql->db_Fetch(MYSQL_NUM);
}
$row['news_datestamp'] = $con->convert_date($row['news_datestamp'], "long");
$row['news_title'] = $tp->toHTML($row['news_title'], TRUE, 'parse_sc');
//remove existing links from news title
$search = array();
$replace = array();
$search[0] = "/\\<a href=\"(.*?)\">(.*?)<\\/a>/si";
$replace[0] = '\\2';
$search[1] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si";
$replace[1] = '\\2';
$search[2] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si";
$replace[2] = '\\2';
$search[3] = "/\\<a href="(.*?)">(.*?)<\\/a>/si";
$replace[3] = '\\2';
$search[4] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si";
$replace[4] = '\\2';
$row['news_title'] = preg_replace($search, $replace, $row['news_title']);
示例7: define
define("CB_MOD", check_class($pref['cb_mod']));
$qry = "\n\tSELECT c.*, u.user_name FROM #chatbox AS c\n\tLEFT JOIN #user AS u ON SUBSTRING_INDEX(c.cb_nick,'.',1) = u.user_id\n\tORDER BY c.cb_datestamp DESC LIMIT 0, " . intval($chatbox_posts);
if ($sql->db_Select_gen($qry)) {
$obj2 = new convert();
$cbpost = $sql->db_getList();
$text .= "<div id='chatbox-posts-block'>\n";
foreach ($cbpost as $cb) {
// get available vars
list($cb_uid, $cb_nick) = explode(".", $cb['cb_nick'], 2);
if ($cb['user_name']) {
$cb_nick = "<a href='" . e_HTTP . "user.php?id.{$cb_uid}'>{$cb['user_name']}</a>";
} else {
$cb_nick = $tp->toHTML($cb_nick, FALSE, 'USER_TITLE, emotes_off, no_make_clickable');
$cb_nick = str_replace("Anonymous", LAN_ANONYMOUS, $cb_nick);
}
$datestamp = $obj2->convert_date($cb['cb_datestamp'], "short");
$emotes_active = $pref['cb_emote'] ? 'USER_BODY, emotes_on' : 'USER_BODY, emotes_off';
$cb_message = $tp->toHTML($cb['cb_message'], FALSE, $emotes_active, $cb_uid, $pref['menu_wordwrap']);
$replace[0] = "[";
$replace[1] = "]";
$search[0] = "[";
$search[1] = "]";
$cb_message = str_replace($search, $replace, $cb_message);
global $CHATBOXSTYLE;
if (!$CHATBOXSTYLE) {
$bullet = '';
if (defined('BULLET')) {
$bullet = '<img src="' . THEME_ABS . 'images/' . BULLET . '" alt="" class="icon" />';
} elseif (file_exists(THEME . 'images/bullet2.gif')) {
$bullet = '<img src="' . THEME_ABS . 'images/bullet2.gif" alt="" class="icon" />';
}
示例8: print_item_pdf
function print_item_pdf($id)
{
global $tp, $pref, $content_shortcodes;
global $CONTENT_PRINT_IMAGES, $row, $content_image_path, $content_pref, $mainparent;
//in this section you decide what to needs to be output to the pdf file
$con = new convert();
require_once e_PLUGIN . "content/content_shortcodes.php";
require_once e_PLUGIN . "content/handlers/content_class.php";
$aa = new content();
if (!is_object($sql)) {
$sql = new db();
}
$sql->db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_image, content_author, content_parent, content_datestamp, content_class, content_pref", "content_id='" . intval($id) . "' ");
$row = $sql->db_Fetch();
if (!check_class($row['content_class'])) {
header("location:" . e_PLUGIN . "content/content.php");
exit;
}
$authordetails = $aa->getAuthor($row['content_author']);
$row['content_datestamp'] = $con->convert_date($row['content_datestamp'], "long");
$img = $tp->parseTemplate('{CONTENT_PRINT_IMAGES}', FALSE, $content_shortcodes);
$mainparent = $aa->getMainParent(intval($id));
$content_pref = $aa->getContentPref($mainparent);
$content_icon_path = $tp->replaceConstants($content_pref["content_icon_path"]);
$content_image_path = $tp->replaceConstants($content_pref["content_image_path"]);
$img = $tp->parseTemplate('{CONTENT_PDF_IMAGES}', FALSE, $content_shortcodes);
//add custom and preset tags if present
$custom = e107::unserialize($row['content_pref']);
//$custom = $eArrayStorage->ReadxxxArray($row['content_pref']);
$months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11);
$CONTENT_CONTENT_TABLE_CUSTOM_TAGS = "";
if (!empty($custom)) {
foreach ($custom as $k => $v) {
if ($k == "content_custom_presettags") {
if (isset($content_pref["content_content_presettags"]) && $content_pref["content_content_presettags"]) {
foreach ($v as $ck => $cv) {
if (is_array($cv)) {
//date
if (!($cv['day'] == "" && $cv['month'] == "" && $cv['year'] == "")) {
$vv = $cv['day'] . " " . $months[$cv['month'] - 1] . " " . $cv['year'];
}
} else {
$vv = $cv;
}
if (isset($ck) && $ck != "" && isset($vv) && $vv != "") {
$CUSTOM_TAGS = TRUE;
$CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($ck, true);
$CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($vv, true);
$CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY . " : " . $CONTENT_CONTENT_TABLE_CUSTOM_VALUE . "<br />";
}
}
}
} else {
if (isset($content_pref["content_content_customtags"]) && $content_pref["content_content_customtags"]) {
$key = substr($k, 15);
if (isset($key) && $key != "" && isset($v) && $v != "") {
$CUSTOM_TAGS = TRUE;
$CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($key, true);
$CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($v, true);
$CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY . " : " . $CONTENT_CONTENT_TABLE_CUSTOM_VALUE . "<br />";
}
}
}
}
}
$text = "\n\t<b>" . $row['content_heading'] . "</b><br />\n\t" . $row['content_subheading'] . "<br />\n\t" . $authordetails[1] . ", " . $row['content_datestamp'] . "<br />\n\t<br />\n\t" . $row['content_text'] . "<br />\n\t" . ($CONTENT_CONTENT_TABLE_CUSTOM_TAGS ? $CONTENT_CONTENT_TABLE_CUSTOM_TAGS : "") . "\n\t<div style='float:left; padding-left:10px;'>" . $img . "</div>\n\t";
//the following defines are processed in the document properties of the pdf file
//Do NOT add parser function to the variables, leave them as raw data !
//as the pdf methods will handle this !
$text = $text;
//define text
$creator = SITENAME;
//define creator
$author = $authordetails[1];
//define author
$title = $row['content_heading'];
//define title
$subject = $row['content_subheading'];
//define subject
$keywords = "";
//define keywords
//define url to use in the header of the pdf file
$url = SITEURLBASE . e_PLUGIN_ABS . "content/content.php?content." . $row['content_id'];
//always return an array with the following data:
return array($text, $creator, $author, $title, $subject, $keywords, $url);
}
示例9: elseif
function user_info($ipd)
{
global $ns, $sql, $e107;
if (isset($ipd)) {
$bullet = '';
if (defined('BULLET')) {
$bullet = '<img src="' . THEME . 'images/' . BULLET . '" alt="" class="icon" />';
} elseif (file_exists(THEME . 'images/bullet2.gif')) {
$bullet = '<img src="' . THEME . 'images/bullet2.gif" alt="" class="icon" />';
}
// TODO - move to e_userinfo.php
$obj = new convert();
$sql->db_Select("chatbox", "*", "cb_ip='{$ipd}' LIMIT 0,20");
$host = $e107->get_host_name($ipd);
$text = USFLAN_3 . " <b>" . $ipd . "</b> [ " . USFLAN_4 . ": {$host} ]<br />\r\n\t\t\t\t<i><a href=\"banlist.php?" . $ipd . "\">" . USFLAN_5 . "</a></i>\r\n\r\n\t\t\t\t<br /><br />";
while (list($cb_id, $cb_nick, $cb_message, $cb_datestamp, $cb_blocked, $cb_ip) = $sql->fetch()) {
$datestamp = $obj->convert_date($cb_datestamp, "short");
$post_author_id = substr($cb_nick, 0, strpos($cb_nick, "."));
$post_author_name = substr($cb_nick, strpos($cb_nick, ".") + 1);
$text .= $bullet . "\r\n\t\t\t\t\t<span class=\"defaulttext\"><i>" . $post_author_name . " (" . USFLAN_6 . ": " . $post_author_id . ")</i></span>\r\n\t\t\t\t\t<div class=\"mediumtext\">\r\n\t\t\t\t\t" . $datestamp . "\r\n\t\t\t\t\t<br />\r\n\t\t\t\t\t" . $cb_message . "\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<br />";
}
$text .= "<hr />";
$sql->db_Select("comments", "*", "comment_ip='{$ipd}' LIMIT 0,20");
while (list($comment_id, $comment_item_id, $comment_author, $comment_author_email, $comment_datestamp, $comment_comment, $comment_blocked, $comment_ip) = $sql->fetch()) {
$datestamp = $obj->convert_date($comment_datestamp, "short");
$post_author_id = substr($comment_author, 0, strpos($comment_author, "."));
$post_author_name = substr($comment_author, strpos($comment_author, ".") + 1);
$text .= $bullet . "\r\n\t\t\t\t\t<span class=\"defaulttext\"><i>" . $post_author_name . " (" . USFLAN_6 . ": " . $post_author_id . ")</i></span>\r\n\t\t\t\t\t<div class=\"mediumtext\">\r\n\t\t\t\t\t" . $datestamp . "\r\n\t\t\t\t\t<br />" . $comment_comment . "\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<br />";
}
}
$ns->tablerender(USFLAN_7, $text);
}
示例10: intval
$from = $page_count;
break;
}
$row_count++;
if ($row_count == 30) {
$row_count = 0;
$page_count += 30;
}
}
}
// end search
$sql->db_Select("chatbox", "*", "{$qry_where} ORDER BY cb_datestamp DESC LIMIT " . intval($from) . ", 30");
$obj2 = new convert();
$chatList = $sql->db_getList();
foreach ($chatList as $row) {
$CHAT_TABLE_DATESTAMP = $obj2->convert_date($row['cb_datestamp'], "long");
$CHAT_TABLE_NICK = preg_replace("/[0-9]+\\./", "", $row['cb_nick']);
$cb_message = $tp->toHTML($row['cb_message'], TRUE, 'USER_BODY');
if ($row['cb_blocked']) {
$cb_message .= "<br />" . CHATBOX_L25;
}
if (CB_MOD) {
$cb_message .= "<br /><input type='checkbox' name='delete[{$row['cb_id']}]' value='1' />" . CHATBOX_L10;
if ($row['cb_blocked']) {
$cb_message .= " <input type='checkbox' name='unblock[{$row['cb_id']}]' value='1' />" . CHATBOX_L7;
} else {
$cb_message .= " <input type='checkbox' name='block[{$row['cb_id']}]' value='1' />" . CHATBOX_L9;
}
}
$CHAT_TABLE_MESSAGE = $cb_message;
$CHAT_TABLE_FLAG = $flag ? "forumheader3" : "forumheader4";
示例11: sum
$barr = file_exists(THEME . 'images/barr.png') ? THEME . 'images/barr.png' : e_PLUGIN . 'poll/images/barr.png';
$bar = file_exists(THEME . 'images/bar.png') ? THEME . 'images/bar.png' : e_PLUGIN . 'poll/images/bar.png';
require_once HEADERF;
$total_posts = $sql->db_Count('forum_post');
$total_topics = $sql->db_Count('forum_thread');
$total_replies = $total_posts - $total_topics;
$total_views = 0;
$query = 'SELECT sum(thread_views) AS total FROM `#forum_thread` ';
if ($sql->db_Select_gen($query)) {
$row = $sql->db_Fetch();
$total_views = $row['total'];
}
$firstpost = $sql->db_Select('forum_post', 'post_datestamp', 'post_datestamp > 0 ORDER BY post_datestamp ASC LIMIT 0,1', 'default');
$fp = $sql->db_Fetch();
$open_ds = $fp['post_datestamp'];
$open_date = $gen->convert_date($open_ds, 'long');
$open_since = $gen->computeLapse($open_ds);
$open_days = floor((time() - $open_ds) / 86400);
$postsperday = $open_days < 1 ? $total_posts : round($total_posts / $open_days);
$query = "SHOW TABLE STATUS FROM `{$mySQLdefaultdb}`";
$sql->db_Select_gen($query);
$array = $sql->db_getList();
foreach ($array as $table) {
if ($table['Name'] == MPREFIX . 'forum_post') {
$db_size = $e107->parseMemorySize($table['Data_length']);
$avg_row_len = $e107->parseMemorySize($table['Avg_row_length']);
break;
}
}
$query = "\nSELECT ft.thread_id, ft.thread_user, ft.thread_name, ft.thread_total_replies, ft.thread_datestamp, f.forum_class, u.user_name, u.user_id FROM #forum_thread as ft\nLEFT JOIN #user AS u ON ft.thread_user = u.user_id\nLEFT JOIN #forum AS f ON f.forum_id = ft.thread_forum_id\nWHERE ft.thread_active > 0\nAND f.forum_class IN (" . USERCLASS_LIST . ")\nORDER BY ft.thread_total_replies DESC LIMIT 0,10";
$sql->db_Select_gen($query);
示例12: get_history
function get_history($page)
{
global $sql;
$r = "<script>\n\tfunction urldecode( str ) {\n\t var ret = str;\n\t ret = ret.replace(/\\+/g, '%20');\n\t ret = decodeURIComponent(ret);\n\t ret = ret.toString();\n\t return ret;\n\t}\n\t</script><ul>";
$sql->db_Select("wiki", "*", "ORDER BY page_datestamp DESC", false);
$gen = new convert();
while ($row = $sql->db_Fetch()) {
$r .= "<li><a href='#' onclick=\"document.getElementById('wiki_content').value=urldecode('" . urlencode(stripslashes($row['page_content'])) . "');\" >" . $gen->convert_date($row['page_datestamp']) . " by " . get_username($row['page_author']) . "</a></li>";
}
return $r . "</ul>";
}
示例13: vartrue
include_once e_PLUGIN . 'forum/forum_class.php';
$max_age = vartrue($menu_pref['newforumposts_maxage'], 0);
$max_age = $max_age == 0 ? '' : '(t.post_datestamp > ' . (time() - (int) $max_age * 86400) . ') AND ';
$forum = new e107forum();
$forumList = implode(',', $forum->getForumPermList('view'));
//TODO: Use query from forum class to get thread list
$qry = "\nSELECT\n\tp.post_user, p.post_id, p.post_datestamp, p.post_user_anon, p.post_entry,\n\tt.thread_id, t.thread_datestamp, t.thread_name, u.user_name\nFROM `#forum_post` as p\nLEFT JOIN `#forum_thread` AS t ON t.thread_id = p.post_thread\nLEFT JOIN `#user` AS u ON u.user_id = p.post_user\nWHERE {$maxage} p.post_forum IN ({$forumList})\nORDER BY p.post_datestamp DESC LIMIT 0, " . $menu_pref['newforumposts_display'];
// Get forum plugin preferences.
$plugForumPrefs = e107::getPlugConfig('forum')->getPref();
// New MySQL class instantiation to avoid overrides.
$db = new e_db_mysql();
// TODO: cache menu.
if ($results = $sql->gen($qry)) {
$text = "<ul>";
while ($row = $sql->fetch(MYSQL_ASSOC)) {
$datestamp = $gen->convert_date($row['post_datestamp'], 'relative');
$id = $row['thread_id'];
$topic = $row['thread_datestamp'] == $row['post_datestamp'] ? '' : 'Re:';
$topic .= strip_tags($tp->toHTML($row['thread_name'], true, 'emotes_off, no_make_clickable, parse_bb', '', $pref['menu_wordwrap']));
if ($row['post_user_anon']) {
$poster = $row['post_user_anon'];
} else {
if ($row['user_name']) {
$poster = "<a href='" . e107::getUrl()->create('user/profile/view', array('name' => $row['user_name'], 'id' => $row['post_user'])) . "'>{$row['user_name']}</a>";
} else {
$poster = '[deleted]';
}
}
$post = strip_tags($tp->toHTML($row['post_entry'], true, 'emotes_off, no_make_clickable', '', $pref['menu_wordwrap']));
$post = $tp->text_truncate($post, $menu_pref['newforumposts_characters'], $menu_pref['newforumposts_postfix']);
// Count previous posts for calculating proper (topic) page number for the current post.
示例14: extract
$sql->db_Select("news", "*", "news_id='{$parms}'");
$row = $sql->db_Fetch();
extract($row);
define("e_PAGETITLE", $news_title);
$news_body = $tp->toHTML($news_body, TRUE, 'BODY');
$news_extended = $tp->toHTML($news_extended, TRUE, 'BODY');
if ($news_author == 0) {
$a_name = "e107";
$category_name = "e107 welcome message";
} else {
$sql->db_Select("news_category", "category_id, category_name", "category_id='{$news_category}'");
list($category_id, $category_name) = $sql->db_Fetch(MYSQL_NUM);
$sql->db_Select("user", "user_id, user_name", "user_id='{$news_author}'");
list($a_id, $a_name) = $sql->db_Fetch(MYSQL_NUM);
}
$news_datestamp = $con->convert_date($news_datestamp, "long");
$print_text = "<span style=\"font-size: 13px; color: black; font-family: tahoma, verdana, arial, helvetica; text-decoration: none\">\n\t<b>" . LAN_PRINT_135 . $news_title . "</b>\n\t<br />\n\t(" . LAN_PRINT_86 . " " . $tp->toHTML($category_name, FALSE, "defs") . ")\n\t<br />\n\t" . LAN_PRINT_94 . " " . $a_name . "<br />\n\t" . $news_datestamp . "\n\t<br /><br />" . $news_body;
if ($news_extended != "") {
$print_text .= "<br /><br />" . $news_extended;
}
if ($news_source != "") {
$print_text .= "<br /><br />" . $news_source;
}
if ($news_url != "") {
$print_text .= "<br />" . $news_url;
}
$print_text .= "<br /><br /></span><hr />" . LAN_PRINT_303 . SITENAME . "\n\t<br />\n\t( http://" . $_SERVER['HTTP_HOST'] . e_HTTP . "news.php?extend." . $news_id . " )\n\t";
}
if (defined("TEXTDIRECTION") && TEXTDIRECTION == "rtl") {
$align = 'right';
} else {
示例15: convert
function sc_cm_datestamp()
{
$gen = new convert();
return $gen->convert_date($this->var['comment_datestamp'], "relative");
}