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


PHP formatTime函数代码示例

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


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

示例1: GZ_assign_comment

/**
 * 查询评论内容
 *
 * @access  public
 * @params  integer     $id
 * @params  integer     $type
 * @params  integer     $page
 * @return  array
 */
function GZ_assign_comment($id, $type, $page = 1, $page_size = 10)
{
    /* 取得评论列表 */
    $count = $GLOBALS['db']->getOne('SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$id}' AND comment_type = '{$type}' AND status = 1 AND parent_id = 0");
    $page_count = $count > 0 ? intval(ceil($count / $page_size)) : 1;
    $sql = 'SELECT * FROM ' . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$id}' AND comment_type = '{$type}' AND status = 1 AND parent_id = 0" . ' ORDER BY comment_id DESC';
    $res = $GLOBALS['db']->selectLimit($sql, $page_size, ($page - 1) * $page_size);
    $arr = array();
    $ids = '';
    while ($row = $GLOBALS['db']->fetchRow($res)) {
        $ids .= $ids ? ",{$row['comment_id']}" : $row['comment_id'];
        $arr[$row['comment_id']]['id'] = $row['comment_id'];
        // $arr[$row['comment_id']]['email']    = $row['email'];
        $arr[$row['comment_id']]['author'] = empty($row['user_name']) ? '匿名用户' : $row['user_name'];
        $arr[$row['comment_id']]['content'] = str_replace('\\r\\n', '<br />', htmlspecialchars($row['content']));
        $arr[$row['comment_id']]['content'] = nl2br(str_replace('\\n', '<br />', $arr[$row['comment_id']]['content']));
        // $arr[$row['comment_id']]['rank']     = $row['comment_rank'];
        $arr[$row['comment_id']]['create'] = formatTime($row['add_time']);
        $arr[$row['comment_id']]['re_content'] = '';
    }
    /* 取得已有回复的评论 */
    if ($ids) {
        $sql = 'SELECT * FROM ' . $GLOBALS['ecs']->table('comment') . " WHERE parent_id IN( {$ids} )";
        $res = $GLOBALS['db']->query($sql);
        while ($row = $GLOBALS['db']->fetch_array($res)) {
            $arr[$row['parent_id']]['re_content'] = nl2br(str_replace('\\n', '<br />', htmlspecialchars($row['content'])));
            // $arr[$row['parent_id']]['re_add_time'] = local_date($GLOBALS['_CFG']['time_format'], $row['add_time']);
            // $arr[$row['parent_id']]['re_email']    = $row['email'];
            // $arr[$row['parent_id']]['re_username'] = $row['user_name'];
        }
    }
    $pager = array("total" => $count, "count" => count($arr), "more" => $page < $page_count ? 1 : 0);
    $cmt = array('comments' => array_values($arr), 'pager' => $pager);
    return $cmt;
}
开发者ID:blowfishJ,项目名称:galaxyCode,代码行数:44,代码来源:comments.php

示例2: source

function source($path, $action, $title, $content)
{
    $Head = '<meta name="robots" content="noindex, nofollow" />';
    $content['PageNav']->Active("Page History");
    if (is_numeric($action[1])) {
        $PageQuery = mysql_query("SELECT `AccountID`,`EditTime`,`Name`,`Description`,`Title`,`Content` FROM `Wiki_Edits` WHERE `ID`='{$action['1']}' and `Archived` = 0");
        list($AccountID, $PageEditTime, $PageName, $PageDescription, $PageTitle, $PageContent) = mysql_fetch_array($PageQuery);
        $Form['_Options'] = "action:;";
        $Form['Name']['Text'] = "Name:";
        $Form['Name']['Form'] = "id:Name; name:Name; value:{" . $PageName . "}; maxlength:32;";
        $Form['Title']['Text'] = "Title:";
        $Form['Title']['Form'] = "name:Title; value:x{" . $PageTitle . "}x; maxlength:255;";
        $Form['Content']['Text'] = "Content:";
        $Form['Content']['Form'] = "name:Content; value:x{" . $PageContent . "}x; type:textarea; cols:80; rows:12;";
        $Form['Description']['Text'] = "Description:";
        $Form['Description']['Form'] = "name:Description; value:x{" . $PageDescription . "}x; size: 80; maxlength:255;";
        $content['Title'] = "Viewing Source of: {$PageTitle}";
        $content['Body'] .= Format($Form, Form);
        date_default_timezone_set('America/New_York');
        //			$PageEditTime = date("F j\, Y G:i:s", $PageEditTime)." EST";
        $PageEditTime = formatTime($PageEditTime);
        $content['Footer'] = "This page is an old revision made by <b><a href='/names?id={$AccountID}'>{$PageName}</a></b> on {$PageEditTime}.";
    }
    return array($title, $content);
}
开发者ID:kelsh,项目名称:classic,代码行数:25,代码来源:source.php

示例3: countDown

function countDown($dateStarted, $duration)
{
    date_default_timezone_set("UTC");
    $startedAt = strtotime($dateStarted);
    $currtime = time();
    $timeElapsed = $currtime - $startedAt;
    $remaining = $duration * 60 - $timeElapsed;
    $seconds = $remaining;
    $minutes = floor($remaining / 60);
    $hours = floor($remaining / 3600);
    //$days    = floor($diffInSeconds/86400);
    $minutes %= 60;
    $hours %= 24;
    $seconds %= 60;
    if ($remaining <= 0) {
        $mins = '00';
        $hrs = '00';
        $secs = '00';
    } else {
        $mins = formatTime($minutes);
        $hrs = formatTime($hours);
        $secs = formatTime($seconds);
    }
    return array($remaining, $hrs . ":" . $mins . ":" . $secs);
}
开发者ID:brightantwiboasiako,项目名称:tratech2016,代码行数:25,代码来源:general.php

示例4: display

 /**
 * Context is not used.
 */
 function display($context)
 {
     mpLog("notebook-view:User visited Lab Notebook page");
     $labbook = openLabbook();
     echo $this->pageHeader("Lab notebook", "notebook");
     // Set time zone form
     echo makeEventForm("onSetTimezone");
     echo "<table border='0' width='100%'><tr>\n";
     echo "<td>Current time: " . formatTime(time()) . "</td>\n";
     echo "<td>" . timeZonePicker('timezone', $_SESSION['timeZone']);
     echo "<input type='submit' name='cmd' value='Set time zone'></td>\n";
     echo "</tr></table></form>\n";
     echo "</div>\n<br>\n<div class='pagecontent'>\n";
     // Notebook table of contents
     echo "<h3><a name='top'</a>Table of contents:</h3>\n";
     echo "<div class='indent'>\n";
     $this->printTOC($labbook);
     //onNotebookEdit removed for security reasons (probably nobody was using it)
     //echo makeEventForm("onNotebookEdit");
     //echo "<input type='submit' name='cmd' value='Create new entry'>\n</form>\n";
     echo "</div>\n";
     // Actual notebook entries
     foreach ($labbook as $num => $entry) {
         $this->printEntry($num, $entry);
     }
     echo $this->pageFooter();
 }
开发者ID:smlewis,项目名称:MolProbity,代码行数:30,代码来源:notebook_main.php

示例5: widget

 function widget($args, $instance)
 {
     $daysOfWeek = array("0" => array("Monday", "Mon"), "1" => array("Tuesday", "Tue"), "2" => array("Wednesday", "Wed"), "3" => array("Thursday", "Thu"), "4" => array("Friday", "Fri"), "5" => array("Saturday", "Sat"), "6" => array("Sunday", "Sun"));
     // Widget output
     $title = apply_filters('widget_title', $instance['title']);
     // before and after widget arguments are defined by themes
     echo $args['before_widget'];
     // This is where you run the code and display the output
     $widgetOutput = "";
     $widgetOutput .= "<div class='container openhours-widget'>";
     $widgetOutput .= "<h4 class='title'>" . $title . "</h4>";
     $hoursObj = json_decode($instance['hours'], true);
     $lz = $instance['leadingzero'] == '1';
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[0][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["monday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["monday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[1][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["tuesday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["tuesday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[2][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["wednesday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["wednesday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[3][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["thursday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["thursday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[4][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["friday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["friday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[5][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["saturday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["saturday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "<div><span class='day'>" . $daysOfWeek[6][0] . ":</span> <span class='hours'>" . formatTime($hoursObj["sunday"]["from"], $instance['displayformat'], $lz) . " - " . formatTime($hoursObj["sunday"]["to"], $instance['displayformat'], $lz) . "</span></div>";
     $widgetOutput .= "</div>";
     //div.container
     echo __($widgetOutput, 'austeve_openhours_widget_domain');
     echo $args['after_widget'];
 }
开发者ID:australiansteve,项目名称:wp-theme-hamburger-cat,代码行数:25,代码来源:widgets.php

示例6: formatDayTimeBrief

function formatDayTimeBrief($time)
{
    $day = formatDayAdaptive($time);
    if ($day == 'Today') {
        return formatTime($time);
    } else {
        return $day;
    }
}
开发者ID:smlewis,项目名称:MolProbity,代码行数:9,代码来源:strings.php

示例7: diff

function diff($path, $action, $title, $content)
{
    $Head = '<meta name="robots" content="noindex, nofollow" />';
    $content['PageNav']->Active("Page History");
    if (is_numeric($action[1])) {
        $pageQuery = mysql_query("SELECT `PageID`,`AccountID`,`EditTime`,`Name`,`Description`,`Title`,`Content` FROM `Wiki_Edits` WHERE `ID`='{$action['1']}' and `Archived` = 0");
        list($PageID, $AccountID, $PageEditTime, $PageName, $PageDescription, $PageTitle, $pageContent) = mysql_fetch_array($pageQuery);
        $previousQuery = mysql_query("Select `ID`, `Content` from `Wiki_Edits` where `ID` < '{$action['1']}' and `PageID`='{$PageID}' and `Archived` = 0 order by `ID` desc limit 1");
        list($previousID, $previousContent) = mysql_fetch_array($previousQuery);
        $nextQuery = mysql_query("Select `ID` from `Wiki_Edits` where `ID` > '{$action['1']}' and `PageID`='{$PageID}' and `Archived` = 0 order by `ID` limit 1");
        list($nextID) = mysql_fetch_array($nextQuery);
        if (!empty($previousID)) {
            $previousPath = FormatPath("/{$path}/?diff/{$previousID}");
            $content['Title'] = "<a href='{$previousPath}' title='Previous Revision'>⟨</a> ";
        }
        $content['Title'] .= FishFormat($PageTitle);
        if (!empty($nextID)) {
            $nextPath = FormatPath("/{$path}/?diff/{$nextID}");
            $content['Title'] .= " <a href='{$nextPath}' title='Next Revision'>⟩</a>";
        }
        $content['Body'] .= <<<JavaScript
        
        <script>
            \$(document).ready(function ()
            {
                \$('body').on('keydown', function(event)
                {
                    event.stopImmediatePropagation()
                    
                    if(event.keyCode == 37) // Previous
                        location.href = '{$previousPath}';
                    else if(event.keyCode == 39) // Next
                        location.href = '{$nextPath}';
                });
            });
        </script>
JavaScript;
        $old = explode("\n", html_entity_decode($previousContent, ENT_QUOTES));
        $new = explode("\n", html_entity_decode($pageContent, ENT_QUOTES));
        // Initialize the diff class
        $diff = new Diff($old, $new);
        require_once dirname(__FILE__) . '/../libraries/Diff/Renderer/Html/SideBySide.php';
        $renderer = new Diff_Renderer_Html_SideBySide();
        $content['Body'] .= $diff->Render($renderer);
        date_default_timezone_set('America/New_York');
        $PageEditTime = formatTime($PageEditTime);
        $content['Footer'] = "This page is an old revision made by <b><a href='/names?id={$AccountID}'>{$PageName}</a></b> on {$PageEditTime}.";
        if ($PageDescription) {
            $content['Footer'] .= "<br />'{$PageDescription}'";
        }
    }
    return array($title, $content);
}
开发者ID:kelsh,项目名称:classic,代码行数:53,代码来源:diff.php

示例8: export

 /**
  * 导出名单
  */
 public function export()
 {
     $activeid = intval($_GET['activeid']);
     $data[0] = array('姓名', '手机', '邮箱', '报名时间');
     $members = $this->t('activedata')->where(array('activeid' => $activeid))->select();
     foreach ($members as $k => $member) {
         $data[] = array($member['username'], $member['mobile'], $member['email'], formatTime($member['dateline'], 'Y-m-d H:i:s'));
     }
     //printr($data);exit();
     include ROOT_PATH . '/core/library/class.php_excel.php';
     $xls = new Excel_XML();
     $xls->addArray($data);
     $xls->generateXML(random(10));
 }
开发者ID:xy113,项目名称:XiangBaLaoServer,代码行数:17,代码来源:class.ActiveController.php

示例9: view

function view($path, $action, $title, $content)
{
    $content['PageNav']->Active("View Page");
    $PageQuery = mysql_query("SELECT `ID`,`Title`,`Content`,`Edits`,`Views`,`EditTime` FROM `Wiki_Pages` WHERE `Path`='{$path}'");
    list($PageID, $PageTitle, $PageContent, $PageEdits, $pageViews, $PageEditTime) = mysql_fetch_array($PageQuery);
    $tagQuery = mysql_query("Select tags.`tag`, stats.`count`\n                                from `Wiki_Tags` as tags,\n                                     `Wiki_Tag_Statistics` as stats\n                                     \n                                where tags.`pageID` = '{$PageID}'\n                                    and stats.`tag` = tags.`tag`");
    while (list($tagName, $tagCount) = mysql_fetch_array($tagQuery)) {
        $plural = 's';
        if ($tagCount == 1) {
            $plural = '';
        }
        $tagLink = urlencode($tagName);
        $tagTitle = str_replace('-', ' ', $tagName);
        $tagLinks[] = "<a href='/?tag/{$tagLink}' title='{$tagCount} tagged page{$plural}'>{$tagTitle}</a>";
    }
    if ($tagLinks) {
        $tagLinks = implode(" | ", $tagLinks);
        $tagLinks = "<hr />Tags: {$tagLinks}";
    }
    $PageTitle = PageTitler($PageTitle);
    if (empty($PageContent)) {
        $PageContent = array("Hello friend. b{Wetfish regrets to inform you this page does not exist.}", "", "Confused? This is the {{wiki|Wetfish Wiki}}, a place anyone can edit!", "It appears you've stumbled upon a place none have yet traveled.", "Would you like to be the first? {{{$path}/?edit|All it takes is a click.}}", "", "i{But please, don't wallow.}", "i{A new page surely follows.}", "i{You have the power.}");
        $PageContent = implode("<br />", $PageContent);
    } else {
        mysql_query("Update `Wiki_Pages` set `Views` = `Views` + 1 where `ID`='{$PageID}'");
    }
    if ($_SESSION['admin']) {
        $content['ExtraNav'] = new Navigation();
        $content['ExtraNav']->Add("Archive This Page", FormatPath("/{$path}/") . "?archive");
        $content['ExtraNav']->Add("Rename This Page", FormatPath("/{$path}/") . "?rename");
    }
    $title[] = FishFormat($PageTitle, "strip");
    $content['Title'] .= FishFormat($PageTitle);
    $content['Body'] .= FishFormat($PageContent);
    if ($PageEdits) {
        $EditCount = count(explode(",", $PageEdits));
        date_default_timezone_set('America/New_York');
        $PageEditTime = formatTime($PageEditTime);
        if ($pageViews != 1) {
            $viewPlural = 's';
        }
        if ($EditCount != 1) {
            $Plural = "s";
        }
        $content['Tags'] = $tagLinks;
        $content['Footer'] = "<b>" . number_format($pageViews) . "</b> page view{$viewPlural}. <b>{$EditCount}</b> edit{$Plural} &ensp;&mdash;&ensp; Last modified <b>{$PageEditTime}</b>.";
    }
    return array($title, $content);
}
开发者ID:kelsh,项目名称:classic,代码行数:49,代码来源:view.php

示例10: formatTime

function formatTime($t,$type)
{
	if ($t=="") return "";
	if ($t=="DNF" || $t=="DNS") return $t;
	switch($type)
	{
	case 1:
		while(strlen($t)>4 && ((($ch=substr($t,0,1))=="0") || $ch==":")) $t = substr($t,1);
		return $t;
		break;
	case 2:
		if(strlen($t)>1 && substr($t,0,1)=="0") $t = substr($t,1);
		return $t;
		break;
	default:
		return formatTime(substr($t,0,2),2)."/".formatTime(substr($t,2,2),2)." ".formatTime(substr($t,4,9),1);
	}
}
开发者ID:pedrosino,项目名称:cubecomps.com,代码行数:18,代码来源:extrarep.php

示例11: querySQL

			_ticket_price.": ".number_format($row->price,2).
			"</cite></p>";
			if( key($row) != count($events_advertise)-1 ) {
				echo"<br/>";
			} 
		}
	echo "</div>";
}

// Special event of the day and outlet
$special_events = querySQL('event_data_day');
if ($special_events && $_SESSION['page'] == 2 ) {
	echo "<div class='alert_info'>";
		// special events
		foreach($special_events as $row) {
			echo "
			<img src='../web/images/icon_cutlery.png' alt='special' class='middle'/>
			<span class='bold'>
			<a href='".$_SERVER['SCRIPT_NAME']."?outletID=".$row->outlet_id."&selectedDate=".$row->event_date."'>".
			_today.": ".$row->subject."</a></span>
			<p class='margin-bottom-10'>".$row->description."</p><p><cite>
			".date($general['dateformat'],strtotime($row->event_date)).
			" ".formatTime($row->start_time,$general['timeformat']).
			" - ".formatTime($row->end_time,$general['timeformat'])." | ".
			_ticket_price.": ".number_format($row->price,2).
			"</cite></p>";
		}
	echo "</div>";
}

?>
开发者ID:hellovic,项目名称:myseat,代码行数:31,代码来源:messagebox.inc.php

示例12: formatTime

      <div class='<?php 
        echo $class;
        ?>
 comment-id'><?php 
        echo $message->id;
        ?>
</div>
      <table class='table table-borderless w-p100'>
        <tr>
        <th class='th-from'>
          <?php 
        echo $message->from;
        ?>
<br>
          <span class='time'> <?php 
        echo formatTime($message->date, 'Y/m/d');
        ?>
 </span>
        </th>
        <td class='td-content'>
          <div class='content-detail'><?php 
        echo nl2br($message->content);
        ?>
</div>
        </td>
        <td class='td-action'> <?php 
        echo html::a($this->createLink('message', 'reply', "messageID={$message->id}"), $lang->message->reply, "data-toggle='modal' data-type='iframe' data-icon='reply' data-title='{$lang->message->reply}'");
        ?>
 </td>
        </tr>
        <?php 
开发者ID:hansen1416,项目名称:eastsoft,代码行数:31,代码来源:index.html.php

示例13: formatTime

     echo "<img src='images/icons/clock-bolt.png' class='help tipsyold middle smicon' title='" . _sentence_11 . "' />";
 } else {
     // daylight coloring
     if ($row->reservation_time > $daylight_evening) {
         echo "<img src='images/icons/clock-moon.png' class='middle smicon'/>";
     } else {
         if ($row->reservation_time > $daylight_noon) {
             echo "<img src='images/icons/clock-sun.png' class='middle smicon'/>";
         } else {
             if ($row->reservation_time < $daylight_noon) {
                 echo "<img src='images/icons/clock-grey.png' class='middle smicon'/>";
             }
         }
     }
 }
 echo "<strong>" . formatTime($row->reservation_time, $general['timeformat']) . "</strong></td>";
 echo "<td>\n\t\t\t\t<strong class='big'>" . $row->reservation_pax . "</strong>&nbsp;&nbsp;" . $row->reservation_hotelguest_yn . "</td>";
 //<img src='images/icons/user-silhouette.png' class='middle'/>
 echo "<td style='width:20%'>" . printTitle($row->reservation_title) . "<strong> <a id='detlbuttontrigger' href='ajax/guest_detail.php?id=" . $id . "'";
 // color guest name if tautologous
 if ($tautologous > 1) {
     echo " class='tautologous tipsy' title='" . _tautologous_booking . "'";
 }
 echo ">" . $row->reservation_guest_name . "</a></strong>";
 if ($row->repeat_id != 0) {
     //print out recurring symbol
     echo "&nbsp;<img src='images/icons/loop-alt.png' alt='" . _recurring . "' title='" . _recurring . "' class='tipsy' border='0' >";
 }
 echo "</td><td style='width:20%'>";
 if ($_SESSION['page'] == 1) {
     echo $row->outlet_name;
开发者ID:namaris,项目名称:Can_Pages,代码行数:31,代码来源:reservations_grid_short_icon.inc.php

示例14: formatTime

     </div>
     <div class='item-content'>
       
       <div class='text small text-muted'>
         <div class='media pull-left'>
         <?php 
       if (!empty($article->image)) {
           $title = $article->image->primary->title ? $article->image->primary->title : $article->title;
           echo html::a($url, html::image($article->image->primary->smallURL, "title='{$title}' class='thumbnail'"));
       }
       ?>
         </div>
         <strong class='text-important'>
           <?php 
       if (isset($content->time)) {
           echo "<i class='icon-time'></i> " . formatTime($article->addedDate, DT_DATE4);
       }
       ?>
         </strong> 
         &nbsp;<?php 
       echo $article->summary;
       ?>
       </div>
     </div>
   </div>
   <?php 
   }
   ?>
   </div>
 </div>
 <?php 
开发者ID:wenyinos,项目名称:chanzhieps,代码行数:31,代码来源:latestarticle.html.php

示例15: recent

function recent($path, $action, $title, $content)
{
    //		$Head = '<meta name="robots" content="noindex, nofollow" />';
    $content['UserNav']->Active("Recent Activity");
    if (empty($_SESSION['Recent'])) {
        $_SESSION['Recent']['Active'][0] = "All Edits";
        $_SESSION['Recent']['Active'][3] = "Descending";
        $_SESSION['Recent']['Order'] = "DESC";
    }
    $content['ExtraNav'] = new Navigation();
    $content['ExtraNav']->Add("All Edits", "?recent/all");
    $content['ExtraNav']->Add("Most Recent Edit", "?recent/unique");
    $content['ExtraNav']->Add("Ascending", "?recent/asc");
    $content['ExtraNav']->Add("Descending", "?recent/desc");
    $content['ExtraNav']->Active($_SESSION['Recent']['Active']);
    $Template['Title'] = "View:";
    $content['ExtraNav']->Template($Template);
    if (empty($action[1])) {
        $content['Title'] = "Recent Activity";
        $ActivityQuery = "SELECT {$Unique} `ID`,`PageID`,`AccountID`,`EditTime`,`Size`,`Tags`,`Name`,`Description`,`Title` FROM `Wiki_Edits` where `Archived` = 0 ORDER BY `ID` {$_SESSION['Recent']['Order']}";
        list($QueryData, $Links) = Paginate($ActivityQuery, 50, $_GET['page'], $_SERVER['QUERY_STRING']);
        $content['Body'] .= "<center class='page-navigation'>{$Links}</center>";
        $content['Body'] .= "<table width='100%' class='history'>";
        $content['Body'] .= "<tr><td><b>Revision</b></td><td><b>Size</b></td><td><b>Tags</b></td><td><b>Editor</b></td><td style='min-width:200px;'><b>Title</b></td><td><b>Description</b></td></tr>";
        if ($QueryData) {
            foreach ($QueryData as $Result) {
                list($EditID, $PageID, $AccountID, $PageTime, $PageSize, $pageTags, $PageName, $PageDescription, $PageTitle) = $Result;
                if (empty($Data[$PageID])) {
                    $PageQuery = mysql_query("SELECT `Path` FROM `Wiki_Pages` WHERE `ID`='{$PageID}'");
                    list($PagePath) = mysql_fetch_array($PageQuery);
                    $Data[$PageID] = $PagePath;
                } else {
                    $PagePath = $Data[$PageID];
                }
                $Toggle++;
                date_default_timezone_set('America/New_York');
                $minWidth = recentTime($PageTime) ? 85 : 175;
                $PageTime = formatTime($PageTime);
                if ($Toggle % 2 == 1) {
                    $Class = "class='toggle'";
                } else {
                    $Class = '';
                }
                $PageName = FishFormat($PageName, "format");
                $PageDescription = FishFormat($PageDescription, "format");
                $PageTitle = FishFormat($PageTitle, "format");
                $DiffURL = str_replace("//", "/", "/{$PagePath}/?diff/{$EditID}");
                $content['Body'] .= "<tr {$Class}><td style='min-width:{$minWidth}px;'>{$PageTime}</td><td>{$PageSize}</td><td>{$pageTags}</td><td><b><a href='/edits?name={$PageName}'>{$PageName}</a></b></td><td style='max-width:400px'><span style='float:right;'><a href='{$DiffURL}' rel='nofollow'>d</a></span><b><a href='/{$PagePath}'>{$PageTitle}</a></b></td><td class='multi-line'>{$PageDescription}</td></tr>";
            }
        }
        $content['Body'] .= "</table>";
        $content['Body'] .= "<center class='page-navigation bottom'>{$Links}</center>";
    } elseif ($action[1] == "page") {
    } else {
        switch ($action[1]) {
            case "all":
                $_SESSION['Recent']['Active'][0] = "All Edits";
                $_SESSION['Recent']['Active'][1] = "";
                $_SESSION['Recent']['View'] = "";
                break;
            case "unique":
                $_SESSION['Recent']['Active'][0] = "";
                $_SESSION['Recent']['Active'][1] = "Most Recent Edit";
                $_SESSION['Recent']['View'] = "DISTINCT";
                break;
            case "asc":
                $_SESSION['Recent']['Active'][2] = "Ascending";
                $_SESSION['Recent']['Active'][3] = "";
                $_SESSION['Recent']['Order'] = "";
                break;
            case "desc":
                $_SESSION['Recent']['Active'][2] = "";
                $_SESSION['Recent']['Active'][3] = "Descending";
                $_SESSION['Recent']['Order'] = "DESC";
                break;
        }
        $content['Body'] = "<b>Settings changed...</b> <meta http-equiv='refresh' content='2;url=" . FormatPath("/{$path}/?recent") . "'>";
    }
    return array($title, $content);
}
开发者ID:kelsh,项目名称:classic,代码行数:80,代码来源:recent.php


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