• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP formatTimestamp函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: plzxoo_block_answers_show

function plzxoo_block_answers_show($options)
{
    $max_rows = empty($options[1]) ? 5 : intval($options[1]);
    // 表示件数
    $longest_subject = empty($options[2]) ? 50 : intval($options[2]);
    // 質問名の最大長
    $single_answer_per_question = empty($options[3]) ? false : true;
    // 締め切った質問も表示するか
    $category_limit = preg_match('/^[0-9, ]+$/', @$options[4]) ? $options[4] : 0;
    // category limit
    $order_by_modified = empty($options[5]) ? false : true;
    // order by input_date(0) or modified_date(1)
    $db =& Database::getInstance();
    if ($single_answer_per_question) {
        $grp_single = 'GROUP BY a.qid';
        $select_input_date = 'MAX(a.input_date) AS max_input_date';
        $select_modified_date = 'MAX(a.modified_date) AS max_modified_date';
        $odr_1st = $order_by_modified ? 'max_modified_date DESC' : 'max_input_date DESC';
    } else {
        $grp_single = '';
        $select_input_date = 'a.input_date';
        $select_modified_date = 'a.modified_date';
        $odr_1st = $order_by_modified ? 'a.modified_date DESC' : 'a.input_date DESC';
    }
    $whr_category = $category_limit ? 'q.cid IN (' . $category_limit . ')' : '1';
    $result = $db->query("SELECT q.subject,q.qid,q.cid,c.name,q.uid,u.uname,q.size,a.uid,{$select_input_date},{$select_modified_date},a.body FROM " . $db->prefix("plzxoo_answer") . " a LEFT JOIN " . $db->prefix("plzxoo_question") . " q ON q.qid=a.qid LEFT JOIN " . $db->prefix("plzxoo_category") . " c ON q.cid=c.cid LEFT JOIN " . $db->prefix("users") . " u ON a.uid=u.uid WHERE ({$whr_category}) AND q.status IN (1,2) {$grp_single} ORDER BY {$odr_1st} LIMIT {$max_rows}");
    $ret = array('dummy' => true);
    while (list($question_subject, $qid, $cid, $category_name, $question_uid, $answer_uname, $answer_num, $answer_uid, $input_date, $modified_date, $answer_body) = $db->fetchRow($result)) {
        $ret['answers'][] = array('question_subject' => htmlspecialchars(xoops_substr($question_subject, 0, $longest_subject), ENT_QUOTES), 'qid' => intval($qid), 'cid' => intval($cid), 'input_date' => intval($input_date), 'input_date_formatted' => formatTimestamp($input_date, 'm'), 'input_date_utime' => xoops_getUserTimestamp($input_date), 'modified_date' => intval($modified_date), 'modified_date_formatted' => formatTimestamp($modified_date, 'm'), 'modified_date_utime' => xoops_getUserTimestamp($modified_date), 'category_name' => htmlspecialchars($category_name, ENT_QUOTES), 'question_uid' => intval($question_uid), 'answer_uname' => htmlspecialchars($answer_uname, ENT_QUOTES), 'answer_num' => intval($answer_num), 'answer_uid' => intval($answer_uid), 'answer_body' => intval($answer_body));
    }
    return $ret;
}
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:32,代码来源:plzxoo_block_answers.php


示例2: cache_view_files

function cache_view_files()
{
    global $xoopsSecurity;
    RMTemplate::get()->set_help('http://redmexico.com.mx/docs/xoops-booster/archivos-del-cache');
    RMTemplate::get()->assign('xoops_pagetitle', __('Booster Zone', 'booster'));
    RMTemplate::get()->add_style('cache.css', 'rmcommon', 'plugins/booster');
    RMFunctions::create_toolbar();
    xoops_cp_header();
    $plugin = RMFunctions::get()->load_plugin('booster');
    // Get files
    $items = XoopsLists::getFileListAsArray(XOOPS_CACHE_PATH . '/booster/files');
    $files = array();
    $count_expired = 0;
    foreach ($items as $file) {
        $tmp = explode('.', $file);
        if ($tmp[1] != 'meta') {
            continue;
        }
        $content = json_decode(file_get_contents(XOOPS_CACHE_PATH . '/booster/files/' . $file), true);
        $files[] = array('id' => $tmp[0], 'url' => $content['uri'], 'date' => formatTimestamp($content['created'], 'l'), 'time' => $content['created'], 'lang' => $content['language'], 'size' => filesize(XOOPS_CACHE_PATH . '/booster/files/' . $tmp[0] . '.html'));
        $count_expired = time() - $content['created'] >= $plugin->get_config('time') ? $count_expired + 1 : $count_expired;
    }
    include RMTemplate::get()->get_template('cache_files.php', 'plugin', 'rmcommon', 'booster');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:25,代码来源:main.php


示例3: getLastRunTimeForDisplay

	/**
	 * Get the last time a task was run and format it for display
	 * @return	string
	 */
	public function getLastRunTimeForDisplay() {
		if ($this->getVar('sat_lastruntime') < 1) {
			return _CO_ICMS_AUTOTASKS_NOTYETRUNNED;
		} else {
			return formatTimestamp($this->getVar('sat_lastruntime'));
		}
	}
开发者ID:nao-pon,项目名称:impresscms,代码行数:11,代码来源:autotasks.php


示例4: __construct

 /**
  * Constructor
  */
 function __construct()
 {
     parent::__construct($this);
     $this->setTemplate(XMF_ROOT_PATH . '/templates/xmf_feed.html');
     $this->disableLogger();
     global $xoopsConfig;
     $this->title = $xoopsConfig['sitename'];
     $this->url = XOOPS_URL;
     $this->description = $xoopsConfig['slogan'];
     $this->language = _LANGCODE;
     $this->charset = _CHARSET;
     $this->pubdate = date(_DATESTRING, time());
     $this->lastbuild = formatTimestamp(time(), 'D, d M Y H:i:s');
     $this->webmaster = $xoopsConfig['adminmail'];
     $this->editor = $xoopsConfig['adminmail'];
     $this->generator = XOOPS_VERSION;
     $this->copyright = 'Copyright ' . formatTimestamp(time(), 'Y') . ' ' . $xoopsConfig['sitename'];
     $this->ttl = 60;
     $this->image_title = $this->title;
     $this->image_url = XOOPS_URL . '/images/logo.gif';
     $this->image_link = $this->url;
     $this->image_width = 200;
     $this->image_height = 50;
     //title link description pubdate guid category author
     $this->items = array();
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:29,代码来源:Feed.php


示例5: eventStartOutputInit

	/**
	 * Function to be triggered at the end of the core boot process
	 *
	 * @return	void
	 */
	function eventStartOutputInit() {
		global $xoopsTpl;
		if (is_object(icms::$user)) {
			foreach (icms::$user->vars as $key => $value) {
				$user[$key] = $value;
			}
			foreach ($user as $key => $value) {
				foreach ($user [$key] as $key1 => $value1) {
					if ($key1 == 'value') {
						if ($key == 'last_login') {
							$value1 = formatTimestamp(
								isset($_SESSION['xoopsUserLastLogin'])
										? $_SESSION['xoopsUserLastLogin']
										: time(),
								_DATESTRING
							);
						}
						$user [$key] = $value1;
					}
				}
			}
			$pm_handler = icms::handler('icms_data_privmessage');
			$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('read_msg', 0));
			$criteria->add(new icms_db_criteria_Item('to_userid', icms::$user->getVar('uid')));
			$user['new_messages'] = $pm_handler->getCount($criteria);

			$xoopsTpl->assign('user', $user);
		}
	}
开发者ID:nao-pon,项目名称:impresscms,代码行数:34,代码来源:userinfo.php


示例6: showPlayers

function showPlayers()
{
    global $xoopsModule, $mc, $adminTemplate, $tpl, $db;
    $gteam = TCFunctions::get('team');
    $team = new TCTeam($gteam);
    // Equipos
    $tpl->assign('team', $team->isNew() ? 0 : $team->id());
    $result = $db->query("SELECT * FROM " . $db->prefix("coach_teams") . " ORDER BY name");
    $teams = array();
    while ($row = $db->fetchArray($result)) {
        $ct = new TCTeam();
        $ct->assignVars($row);
        $cat =& $ct->category(true);
        $teams[] = array('id' => $ct->id(), 'name' => $ct->name() . " (" . $cat->name() . ")");
    }
    // Entrenadores
    $coachs = array();
    if (!$team->isNew()) {
        foreach ($team->coachs(true) as $coach) {
            $coachs[] = array('id' => $coach->id(), 'name' => $coach->name(), 'image' => $coach->image());
        }
    }
    // Jugadores
    $result = $db->query("SELECT * FROM " . $db->prefix("coach_players") . " WHERE team='" . $team->id() . "'");
    $players = array();
    while ($row = $db->fetchArray($result)) {
        $player = new TCPlayer();
        $player->assignVars($row);
        $players[] = array('id' => $player->id(), 'name' => $player->name(), 'image' => $player->image(), 'number' => $player->number(), 'age' => $player->age(), 'date' => formatTimestamp($player->date(), 'c'));
    }
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . __('Jugadores', 'admin_team'));
    xoops_cp_header();
    include RMTemplate::get()->get_template("admin/coach_players.php", 'module', 'team');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:35,代码来源:players.php


示例7: listAction

 function listAction()
 {
     echo '<h3>' . _AD_OPENID_LANG_ASSOC . '</h3>';
     echo '<p>' . _AD_OPENID_LANG_ASSOC_DESC . '</p>';
     echo '<table border=1>';
     echo '<tr><th>' . _AD_OPENID_LANG_PATTERN . '</th><th>' . _AD_OPENID_LANG_ISSUED;
     echo '</th><th colspan="2"></th></tr>';
     $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
     if ($records =& $this->_handler->getObjects(30, $start)) {
         foreach ($records as $r) {
             $server_url = $r->get4Show('server_url');
             $expire = $r->get('issued') + $r->get('life') < time();
             $issued = formatTimestamp($r->get('issued'), 'm/d H:i');
             echo '<tr><td>';
             echo $server_url;
             echo '</td><td>';
             echo $expire ? '<font color="#808080">' . $issued . '</font>' : $issued;
             echo '</td><td>';
             echo '<a href="' . XOOPS_URL . '/modules/openid/admin/index.php?controller=filter&op=new&auth=1&pattern=' . $server_url . '">' . _AD_OPENID_LANG_ALLOW . '</a>';
             echo '</td><td>';
             echo '<a href="' . XOOPS_URL . '/modules/openid/admin/index.php?controller=filter&op=new&auth=0&pattern=' . $server_url . '">' . _AD_OPENID_LANG_DENY . '</a>';
             echo '</td></tr>';
         }
         echo '</table>';
         require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
         $pageNav = new XoopsPageNav($this->_handler->getCount(), 30, $start, 'start', 'controller=' . $this->_control);
         echo $pageNav->renderNav();
         echo '<p><a href="' . $this->_url . '&op=garbage">' . _AD_OPENID_LANG_CLEANUP . '</a></p>';
     } else {
         echo '</table>';
         echo '<p>' . $this->_handler->getError() . '</p>';
     }
 }
开发者ID:nouphet,项目名称:rata,代码行数:33,代码来源:assoc.php


示例8: b_mysearch_last_search_show

function b_mysearch_last_search_show()
{
    include_once XOOPS_ROOT_PATH . '/modules/mysearch/include/functions.php';
    $mysearch_handler =& xoops_getmodulehandler('searches', 'mysearch');
    $visiblekeywords = 0;
    $block = array();
    $visiblekeywords = mysearch_getmoduleoption('showindex');
    if ($visiblekeywords > 0) {
        $block['visiblekeywords'] = $visiblekeywords;
        $totalcount = $mysearch_handler->getCount();
        $start = 0;
        $critere = new Criteria('mysearchid', 0, '<>');
        $critere->setSort('datesearch');
        $critere->setLimit($visiblekeywords);
        $critere->setStart($start);
        $critere->setOrder('DESC');
        $tmpmysearch = new searches();
        $elements = $mysearch_handler->getObjects($critere);
        foreach ($elements as $oneelement) {
            $search = array();
            $search['keyword'] = $oneelement->getVar('keyword');
            $search['date'] = formatTimestamp(strtotime($oneelement->getVar('datesearch')));
            $search['uid'] = $oneelement->getVar('keyword');
            $search['uname'] = $tmpmysearch->uname($oneelement->getVar('uid'));
            $search['link'] = "<a href='" . XOOPS_URL . '/search.php?query=' . $oneelement->getVar('keyword') . "&action=results' target='_blank'>";
            $block['searches'][] = $search;
            unset($search);
        }
    }
    return $block;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:mysearch_last_search.php


示例9: b_wfs_new_show

function b_wfs_new_show($options)
{
    global $xoopsDB;
    $myts =& MyTextSanitizer::getInstance();
    $block = array();
    $sql = "SELECT articleid, title, published, expired, counter, groupid FROM " . $xoopsDB->prefix("wfs_article") . " WHERE published < " . time() . " AND published > 0 AND (expired = 0 OR expired > " . time() . ") AND noshowart = 0 AND offline = 0 ORDER BY " . $options[0] . " DESC";
    $result = $xoopsDB->query($sql, $options[1], 0);
    while ($myrow = $xoopsDB->fetchArray($result)) {
        if (checkAccess($myrow["groupid"])) {
            $wfs = array();
            $title = $myts->makeTboxData4Show($myrow["title"]);
            if (!XOOPS_USE_MULTIBYTES) {
                if (strlen($myrow['title']) >= $options[2]) {
                    $title = $myts->makeTboxData4Show(substr($myrow['title'], 0, $options[2] - 1)) . "...";
                }
            }
            $wfs['title'] = $title;
            $wfs['id'] = $myrow['articleid'];
            if ($options[0] == "published") {
                $wfs['new'] = formatTimestamp($myrow['published'], "s");
            } elseif ($options[0] == "counter") {
                $wfs['new'] = $myrow['counter'];
            }
            $block['new'][] = $wfs;
        }
    }
    return $block;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:28,代码来源:wfs_new.php


示例10: b_mylinks_top_show

function b_mylinks_top_show($options)
{
    global $xoopsDB;
    $block = array();
    $myts =& MyTextSanitizer::getInstance();
    $result = $xoopsDB->query("SELECT lid, cid, title, date, hits FROM " . $xoopsDB->prefix("mylinks_links") . " WHERE status>0 ORDER BY " . $options[0] . " DESC", $options[1], 0);
    while ($myrow = $xoopsDB->fetchArray($result)) {
        $link = array();
        $title = $myts->makeTboxData4Show($myrow["title"]);
        if (!XOOPS_USE_MULTIBYTES) {
            if (strlen($myrow['title']) >= $options[2]) {
                $title = $myts->makeTboxData4Show(substr($myrow['title'], 0, $options[2] - 1)) . "...";
            }
        }
        $link['id'] = $myrow['lid'];
        $link['cid'] = $myrow['cid'];
        $link['title'] = $title;
        if ($options[0] == "date") {
            $link['date'] = formatTimestamp($myrow['date'], 's');
        } elseif ($options[0] == "hits") {
            $link['hits'] = $myrow['hits'];
        }
        $block['links'][] = $link;
    }
    return $block;
}
开发者ID:amjadtbssm,项目名称:website,代码行数:26,代码来源:mylinks_top.php


示例11: b_mylinks_top_show

function b_mylinks_top_show($options)
{
    global $xoopsDB;
    $block = array();
    //ver2.5
    $modulename = basename(dirname(dirname(__FILE__)));
    $myts =& MyTextSanitizer::getInstance();
    $result = $xoopsDB->query("SELECT lid, cid, title, date, hits FROM " . $xoopsDB->prefix("mylinks_links") . " WHERE status>0 ORDER BY " . $options[0] . " DESC", $options[1], 0);
    while ($myrow = $xoopsDB->fetchArray($result)) {
        $link = array();
        $title = $myts->htmlSpecialChars($myrow['title']);
        //        if ( !XOOPS_USE_MULTIBYTES ) {
        if (mb_strlen($myrow['title']) >= $options[2]) {
            $title = $myts->htmlSpecialChars(mb_substr($myrow['title'], 0, $options[2] - 1)) . "...";
        }
        //        }
        $link['id'] = $myrow['lid'];
        $link['cid'] = $myrow['cid'];
        $link['title'] = $title;
        if ($options[0] == "date") {
            $link['date'] = formatTimestamp($myrow['date'], 's');
        } elseif ($options[0] == "hits") {
            $link['hits'] = $myrow['hits'];
        }
        $block['links'][] = $link;
    }
    if (!empty($block)) {
        // only show block if there's data to display
        $block['mylinks_weburl'] = XOOPS_URL . "/modules/{$modulename}";
    }
    return $block;
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:32,代码来源:mylinks_top.php


示例12: tinyd_block_nav_base

 function tinyd_block_nav_base($mydirname, $mydirnumber)
 {
     // get my config
     $module_handler =& xoops_gethandler('module');
     $config_handler =& xoops_gethandler('config');
     $module =& $module_handler->getByDirname($mydirname);
     $config =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
     $navblock_target = empty($config['tc_navblock_target']) ? 1 : intval($config['tc_navblock_target']);
     if (empty($config['tc_modulesless_dir'])) {
         $block["mod_url"] = XOOPS_URL . "/modules/{$mydirname}";
         $tc_rewrite_dir = TC_REWRITE_DIR;
     } else {
         $block["mod_url"] = XOOPS_URL . '/' . $config['tc_modulesless_dir'];
         $tc_rewrite_dir = "";
     }
     $myts =& MyTextSanitizer::getInstance();
     $db =& Database::getInstance();
     $whr_submenu = $navblock_target == 2 ? "submenu=1" : "1";
     $result = $db->query("SELECT storyid,title,link,UNIX_TIMESTAMP(last_modified) FROM " . $db->prefix("tinycontent{$mydirnumber}") . " WHERE visible=1 AND {$whr_submenu} ORDER BY blockid");
     while (list($id, $title, $link, $last_modified) = $db->fetchRow($result)) {
         if (!empty($config['tc_force_mod_rewrite']) || $link == TC_WRAPTYPE_USEREWRITE) {
             $href = $tc_rewrite_dir . sprintf(TC_REWRITE_FILENAME_FMT, $id);
         } else {
             if ($link == TC_WRAPTYPE_CONTENTBASE) {
                 $href = "content/index.php?id={$id}";
             } else {
                 $href = "index.php?id={$id}";
             }
         }
         $block["links"][] = array("href" => $href, "id" => $id, "title" => $myts->makeTboxData4Show($title), "date" => formatTimestamp($last_modified), "last_modified" => $last_modified);
     }
     return $block;
 }
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:33,代码来源:tinycontent_navigation.php


示例13: PrintPage

function PrintPage($articleid)
{
    global $xoopsConfig, $xoopsDB, $xoopsModule, $wfsConfig;
    $story = new WfsArticle($articleid);
    $datetime = formatTimestamp($story->created(), $wfsConfig['timestamp']);
    echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n";
    echo "<html>\n<head>\n";
    echo "<title>" . $xoopsConfig['sitename'] . "</title>\n";
    echo "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "' />\n";
    echo "<meta name='AUTHOR' content='" . $xoopsConfig['sitename'] . "' />\n";
    echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by " . $xoopsConfig['sitename'] . "' />\n";
    echo "<meta name='DESCRIPTION' content='" . $xoopsConfig['slogan'] . "' />\n";
    echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "' />\n\n\n";
    echo "<body bgcolor='#ffffff' text='#000000'>\n            <table border='0'><tr><td align='center'>\n            <table border='0' width='650' cellpadding='0' cellspacing='1' bgcolor='#000000'><tr><td>\n            <table border='0' width='650' cellpadding='20' cellspacing='1' bgcolor='#ffffff'><tr><td align='center'>\n            <img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/logo.gif' border='0' alt='' /><br />\n            <h2>" . $story->title() . "</h2><hr />";
    if ($story->htmlpage) {
        $includepage = XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->dirname() . "/html/" . $story->htmlpage();
        $maintext = '';
        $maintext = (include $includepage);
        $maintext = $maintext;
    } else {
        $maintext = $story->maintext();
        //if (!empty($maintext)) $maintext .= "<hr />";
        $maintext = preg_replace("/\\[pagebreak\\]/", "<hr width='75%' />", $maintext);
    }
    echo "<tr><td>" . $maintext . "<br /><br /><br /><hr /><br />";
    echo "<small><b>" . _WFS_DATE . "</b>&nbsp;" . $datetime . "<br /><b>" . _WFS_TOPICC . "</b>&nbsp;" . $story->categoryTitle() . "<br /><b>" . _WFS_URLFORSTORY . "</b>&nbsp;" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/article.php?articleid=" . $story->articleid() . "</small><br /></td></tr>";
    echo "</td></tr></table></td></tr></table>\n\n            </td></tr></table>\n            </body>\n            </html>\n            ";
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:28,代码来源:print.php


示例14: b_ccenter_receipt_show

function b_ccenter_receipt_show($options)
{
    global $xoopsDB, $xoopsUser, $msg_status;
    if (!is_object($xoopsUser)) {
        return null;
    }
    $uid = $xoopsUser->getVar('uid');
    $max = array_shift($options);
    $order = array_shift($options);
    foreach ($options as $v) {
        $s[] = "'{$v}'";
    }
    $cond = " AND status IN (" . join(',', $s) . ")";
    $order = $order == 'asc' ? 'asc' : 'desc';
    $res = $xoopsDB->query("SELECT msgid, m.mtime, uid, status, title\n  FROM " . $xoopsDB->prefix('ccenter_message') . " m,\n    " . $xoopsDB->prefix('ccenter_form') . " WHERE (priuid={$uid} OR priuid=0) {$cond}\n   AND fidref=formid ORDER BY status,m.mtime {$order}", $max);
    if (!$res || $xoopsDB->getRowsNum($res) == 0) {
        return null;
    }
    $list = array();
    while ($data = $xoopsDB->fetchArray($res)) {
        $data['mdate'] = formatTimestamp($data['mtime'], _BL_CCENTER_DATE_FMT);
        $data['uname'] = $xoopsUser->getUnameFromId($data['uid']);
        $data['statstr'] = $msg_status[$data['status']];
        $list[] = $data;
    }
    $mydir = basename(dirname(dirname(__FILE__)));
    return array('list' => $list, 'dirname' => $mydir);
}
开发者ID:nbuy,项目名称:xoops-modules-ccenter,代码行数:28,代码来源:ccenter_receipt.php


示例15: foreach

function &gs_rssshow($limit)
{
    global $util, $mc;
    $db =& Database::getInstance();
    include_once XOOPS_ROOT_PATH . '/modules/galleries/class/gsimage.class.php';
    include_once XOOPS_ROOT_PATH . '/modules/galleries/class/gsset.class.php';
    include_once XOOPS_ROOT_PATH . '/modules/galleries/class/gsuser.class.php';
    foreach ($_GET as $k => $v) {
        ${$k} = $v;
    }
    $feed = array();
    // Información General
    $items = array();
    $mc =& $util->moduleConfig('galleries');
    if ($show == 'imgs') {
        $feed['title'] = htmlspecialchars(_MI_GS_RSSNAME);
        $feed['link'] = htmlspecialchars(XOOPS_URL . '/modules/galleries/' . ($mc['urlmode'] ? 'explore/photos/' : 'explore.php?by=explore/photos'));
        $feed['description'] = htmlspecialchars(_MI_GS_RSSIMGS_DESC);
        $sql = "SELECT * FROM " . $db->prefix("gs_images") . " WHERE public='2' ORDER BY created DESC LIMIT 0,15";
        $result = $db->query($sql);
        $users = array();
        while ($row = $db->fetchArray($result)) {
            $pic = new GSImage();
            $pic->assignVars($row);
            if (!isset($users[$pic->owner()])) {
                $users[$pic->owner()] = new GSUser($pic->owner(), 1);
            }
            $user =& $users[$pic->owner()];
            $rtn = array();
            $rtn['title'] = htmlspecialchars($pic->title());
            $rtn['link'] = $user->userURL() . 'img/' . $pic->id() . '/';
            $rtn['description'] = htmlspecialchars('<img src="' . $user->filesURL() . '/ths/' . $pic->image() . '" alt="" /><br />' . sprintf(_MI_GS_RSSIMGDESC, $pic->desc(), formatTimestamp($pic->created(), 'string'), $user->uname(), $pic->views()));
            $rtn['date'] = formatTimestamp($pic->created());
            $items[] = $rtn;
        }
    } elseif ($show == 'sets') {
        $feed['title'] = htmlspecialchars(_MI_GS_RSSSETS);
        $feed['link'] = htmlspecialchars(XOOPS_URL . '/modules/galleries/' . ($mc['urlmode'] ? 'explore/sets/' : 'explore.php?by=explore/sets'));
        $feed['description'] = htmlspecialchars(_MI_GS_RSSSETS_DESC);
        $sql = "SELECT * FROM " . $db->prefix("gs_sets") . " WHERE public='2' ORDER BY date DESC LIMIT 0,15";
        $result = $db->query($sql);
        $users = array();
        while ($row = $db->fetchArray($result)) {
            $set = new GSSet();
            $set->assignVars($row);
            if (!isset($users[$set->owner()])) {
                $users[$set->owner()] = new GSUser($set->owner(), 1);
            }
            $user =& $users[$set->owner()];
            $rtn = array();
            $rtn['title'] = htmlspecialchars($set->title());
            $rtn['link'] = $user->userURL() . 'set/' . $set->id() . '/';
            $rtn['description'] = htmlspecialchars(sprintf(_MI_GS_RSSSETDESC, $user->uname(), formatTimestamp($set->date(), 'string'), $set->pics()));
            $rtn['date'] = formatTimestamp($set->date());
            $items[] = $rtn;
        }
    }
    $ret = array('feed' => $feed, 'items' => $items);
    return $ret;
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:60,代码来源:rss.php


示例16: toArray

 /**
  * Overridding IcmsPersistable::toArray() method to add a few info
  *
  * @return array of tribetopic info
  */
 public function toArray()
 {
     $ret = parent::toArray();
     $ret['last_post_time'] = formatTimestamp($this->getVar('last_post_time', 'e'), 'm');
     $ret['poster_uname'] = icms_member_user_Handler::getUserLink($this->getVar('poster_uid'));
     $ret['userCanEditAndDelete'] = $this->userCanEditAndDelete();
     $ret['itemLink'] = str_replace($this->handler->_itemname . '.php?', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&', $ret['itemLink']);
     $ret['itemUrl'] = str_replace($this->handler->_itemname . '.php?', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&', $ret['itemUrl']);
     $ret['editItemLink'] = str_replace($this->handler->_itemname . '.php?op=mod', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&amp;op=modtribetopic', $this->getEditItemLink(false, true, true));
     $ret['deleteItemLink'] = str_replace($this->handler->_itemname . '.php?op=del', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&amp;op=deltribetopic', $this->getDeleteItemLink(false, true, true));
     // build last post link
     $module = icms::handler("icms_module")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);
     $start = '';
     if ($this->getVar('replies') + 1 > $module->config['tribepostsperpage']) {
         $start = '&start=' . ($this->getVar('replies') + 1 - ($this->getVar('replies') + 1) % $module->config['tribepostsperpage']);
     }
     $ret['lastItemLink'] = '<a href="' . $ret['itemUrl'] . $start . '#post' . $this->getVar('last_post_id') . '"><img src="' . $this->handler->_moduleUrl . 'images/comments.gif" title="' . _MD_PROFILE_TRIBETOPIC_SHOW_LAST_POST . '" style="vertical-align:middle;" /></a>';
     // build toggle close item link
     if ($this->getVar('closed')) {
         // link to reopen the topic
         $ret['closedIcon'] = '<img src="' . $this->handler->_moduleUrl . 'images/lock.gif" title="' . _MD_PROFILE_TRIBETOPIC_CLOSE . '" style="vertical-align:middle;" />';
         $ret['toggleCloseLink'] = '<a href="' . $ret['itemUrl'] . '&amp;op=toggleclose"><img src="' . $this->handler->_moduleUrl . 'images/unlock.gif" title="' . _MD_PROFILE_TRIBETOPIC_REOPEN . '" style="vertical-align:middle;" /></a>';
     } else {
         // link to close the topic
         $ret['toggleCloseLink'] = '<a href="' . $ret['itemUrl'] . '&amp;op=toggleclose"><img src="' . $this->handler->_moduleUrl . 'images/lock.gif" title="' . _MD_PROFILE_TRIBETOPIC_CLOSE . '" style="vertical-align:middle;" /></a>';
     }
     return $ret;
 }
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:33,代码来源:Tribetopic.php


示例17: b_news_top_show

function b_news_top_show($options)
{
    global $xoopsDB;
    $myts =& MyTextSanitizer::getInstance();
    $block = array();
    $sql = "SELECT storyid, title, published, expired, counter FROM " . $xoopsDB->prefix("stories") . " WHERE published < " . time() . " AND published > 0 AND (expired = 0 OR expired > " . time() . ") ORDER BY " . $options[0] . " DESC";
    $result = $xoopsDB->query($sql, $options[1], 0);
    while ($myrow = $xoopsDB->fetchArray($result)) {
        $news = array();
        $title = $myts->makeTboxData4Show($myrow["title"]);
        if (!XOOPS_USE_MULTIBYTES) {
            if (strlen($myrow['title']) >= $options[2]) {
                $title = $myts->makeTboxData4Show(substr($myrow['title'], 0, $options[2] - 1)) . "...";
            }
        }
        $news['title'] = $title;
        $news['id'] = $myrow['storyid'];
        if ($options[0] == "published") {
            $news['date'] = formatTimestamp($myrow['published'], "s");
        } elseif ($options[0] == "counter") {
            $news['hits'] = $myrow['counter'];
        }
        $block['stories'][] = $news;
    }
    return $block;
}
开发者ID:amjadtbssm,项目名称:website,代码行数:26,代码来源:news_top.php


示例18: showTeams

/**
* @desc Muestra todos los equipos registrados
*/
function showTeams()
{
    global $db, $tpl, $xoopsModule, $xoopsConfig, $adminTemplate;
    $tpl->assign('lang_existing', _AS_TC_EXISTING);
    $tpl->assign('lang_id', _AS_TC_ID);
    $tpl->assign('lang_image', _AS_TC_IMAGE);
    $tpl->assign('lang_name', _AS_TC_NAME);
    $tpl->assign('lang_catego', _AS_TC_CATEGO);
    $tpl->assign('lang_coachs', _AS_TC_COACHS);
    $tpl->assign('lang_options', _OPTIONS);
    $tpl->assign('lang_edit', _EDIT);
    $tpl->assign('lang_delete', _DELETE);
    $tpl->assign('lang_confirmm', _AS_TC_CONFM);
    $tpl->assign('lang_confirm', _AS_TC_CONFDEL);
    $tpl->assign('lang_date', _AS_TC_DATE);
    $tpl->assign('lang_players', _AS_TC_PLAYERS);
    $result = $db->query("SELECT * FROM " . $db->prefix("coach_teams") . " ORDER BY name");
    $teams = array();
    while ($row = $db->fetchArray($result)) {
        $team = new TCTeam();
        $team->assignVars($row);
        $cat = new TCCategory($team->category());
        $coachs = '';
        foreach ($team->coachs(true) as $coach) {
            $coachs .= $coachs == '' ? $coach->name() : '<br />' . $coach->name();
        }
        $teams[] = array('id' => $team->id(), 'name' => $team->name(), 'image' => $team->image(), 'catego' => $cat->name(), 'coachs' => $coachs, 'date' => formatTimestamp($team->created(), 'c'));
    }
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . _AS_TC_TEAMSLOC);
    xoops_cp_header();
    include RMTemplate::get()->get_template("admin/coach_teams.php", 'module', 'team');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:36,代码来源:teams.php


示例19: showcaseComponentsShow

function showcaseComponentsShow($options)
{
    include XOOPS_ROOT_PATH . "/modules/spotlight/components/showcase/config.php";
    $sp_handler =& xoops_getmodulehandler('spotlight', 'spotlight');
    $page_handler =& xoops_getmodulehandler('page', 'spotlight');
    // spotlight object
    $sp_obj = $sp_handler->get($options[0]);
    if (!is_object($sp_obj) || empty($options[0])) {
        trigger_error("spotlight is not object ", E_USER_WARNING);
    } else {
        //spotlight name
        $block['sp_name'] = $sp_obj->getVar('sp_name');
        // page list
        $criteria = new CriteriaCompo();
        $criteria->add(new Criteria('sp_id', $options[0]));
        $criteria->setLimit($config['limit']);
        $criteria->setSort($config['sort']);
        $criteria->setOrder('ASC');
        $pages = $page_handler->getAll($criteria, array('page_id', 'page_title', 'page_link', 'page_image', 'page_desc', 'published'), false);
        $myts = MyTextSanitizer::getInstance();
        foreach ($pages as $k => $v) {
            $block['news'][$k] = $v;
            $block['news'][$k]['images'] = XOOPS_UPLOAD_URL . '/spotlight/image_' . $v['page_image'];
            $block['news'][$k]['thumbs'] = XOOPS_UPLOAD_URL . '/spotlight/thumb_' . $v['page_image'];
            $page_desc = strip_tags($myts->undoHtmlSpecialChars(strip_tags($v['page_desc'])));
            $block['news'][$k]['page_desc'] = xoops_substr($page_desc, '', $config['page_desc_substr']);
            $block['news'][$k]['page_title'] = xoops_substr($v['page_title'], '', $config['page_title_substr']);
            $block['news'][$k]['published'] = formatTimestamp($v['published'], $config['timeformat']);
        }
        // component name
        $block['component'] = $sp_obj->getVar('component_name');
        return $block;
    }
}
开发者ID:yunsite,项目名称:xoopsdc,代码行数:34,代码来源:show.php


示例20: b_marquee_xfsection

function b_marquee_xfsection($limit, $dateformat, $itemssize)
{
    $block = array();
    global $xoopsDB;
    if (!function_exists('xfblock_checkAccess')) {
        include_once XOOPS_ROOT_PATH . "/modules/xfsection/include/xfblock_groupaccess.php";
    }
    $myts =& MyTextSanitizer::getInstance();
    $sql = "SELECT articleid, title, published, expired, counter, groupid, uid FROM " . $xoopsDB->prefix("xfs_article") . " WHERE published < " . time() . " AND published > 0 AND (expired = 0 OR expired > " . time() . ") AND noshowart = 0 AND offline = 0 ORDER BY published DESC";
    $result = $xoopsDB->query($sql, $limit, 0);
    while ($myrow = $xoopsDB->fetchArray($result)) {
        if (xfblock_checkAccess($myrow["groupid"])) {
            $wfs = array();
            $title = $myts->htmlSpecialChars($myrow["title"]);
            if (!XOOPS_USE_MULTIBYTES) {
                if ($itemssize > 0) {
                    $title = $myts->htmlSpecialChars(substr($myrow['title'], 0, $itemssize - 1));
                } else {
                    $title = $myts->htmlSpecialChars($myrow['title']);
                }
            }
            $block[] = array('date' => formatTimestamp($myrow['published'], $dateformat), 'category' => '', 'author' => XoopsUser::getUnameFromId($myrow['uid']), 'title' => $title, 'link' => "<a href='" . XOOPS_URL . '/modules/xfsection/article.php?articleid=' . $myrow['articleid'] . "'>" . $title . '</a>');
        }
    }
    return $block;
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:26,代码来源:xfsection.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP formatURL函数代码示例发布时间:2022-05-15
下一篇:
PHP formatTimeStamp函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap