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


PHP formatTimestamp函数代码示例

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


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


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