Commit f1ac1258 authored by mose's avatar mose

[MOD] dates: more cleaning

parent ce48a7bf
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-edit_banner.php,v 1.24 2007-02-04 20:09:32 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-edit_banner.php,v 1.25 2007-02-12 11:47:58 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -94,9 +94,8 @@ if (isset($_REQUEST["bannerId"]) && $_REQUEST["bannerId"] > 0) {
} else {
$smarty->assign('client', '');
$smarty->assign('maxImpressions', 1000);
$now = date("U");
$smarty->assign('fromDate', $now);
$smarty->assign('toDate', $now + (365 * 24 * 3600));
$smarty->assign('fromDate', $tikilib->now);
$smarty->assign('toDate', $tikilib->now + (365 * 24 * 3600));
$smarty->assign('useDates', 'n');
$smarty->assign('fromTime', '00:00');
$smarty->assign('toTime', '23:59');
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-edit_programmed_content.php,v 1.19 2007-02-04 20:09:32 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-edit_programmed_content.php,v 1.20 2007-02-12 11:47:58 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -51,9 +51,8 @@ if (isset($_REQUEST["remove"])) {
}
}
$now = date("U");
$smarty->assign('data', '');
$smarty->assign('publishDate', $now);
$smarty->assign('publishDate', $tikilib->now);
$smarty->assign('actual', '');
if (isset($_REQUEST["save"])) {
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-edit_quiz.php,v 1.21 2007-02-04 20:09:32 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-edit_quiz.php,v 1.22 2007-02-12 11:47:58 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -22,7 +22,6 @@ if (!isset($_REQUEST["quizId"])) {
$_REQUEST["quizId"] = 0;
}
$dc = &$tikilib->get_date_converter($user);
$smarty->assign('quizId', $_REQUEST["quizId"]);
......@@ -62,9 +61,8 @@ $_REQUEST["questionsPerPage"] = 999;
$info = array();
$info["name"] = '';
$info["description"] = '';
$info["publishDate"] = date("U");
$cur_time = getdate();
$info["expireDate"] = mktime ($cur_time["hours"], $cur_time["minutes"], 0, $cur_time["mon"], $cur_time["mday"]+365, $cur_time["year"]);
$info["publishDate"] = $tikilib->now;
$info["expireDate"] = $tikilib->now + 365*24*60*60;
$info["canRepeat"] = 'n';
$info["storeResults"] = 'n';
$info["immediateFeedback"] = 'n';
......@@ -87,10 +85,8 @@ if (isset($_REQUEST["save"])) {
# convert from the displayed 'site' time to 'server' time
$publishDate = $dc->getServerDateFromDisplayDate(mktime($_REQUEST["publish_Hour"], $_REQUEST["publish_Minute"],
0, $_REQUEST["publish_Month"], $_REQUEST["publish_Day"], $_REQUEST["publish_Year"]));
$expireDate = $dc->getServerDateFromDisplayDate(mktime($_REQUEST["expire_Hour"], $_REQUEST["expire_Minute"],
0, $_REQUEST["expire_Month"], $_REQUEST["expire_Day"], $_REQUEST["expire_Year"]));
$publishDate = $tikilib->make_time($_REQUEST["publish_Hour"], $_REQUEST["publish_Minute"], 0, $_REQUEST["publish_Month"], $_REQUEST["publish_Day"], $_REQUEST["publish_Year"]));
$expireDate = $tikilib->make_time($_REQUEST["expire_Hour"], $_REQUEST["expire_Minute"], 0, $_REQUEST["expire_Month"], $_REQUEST["expire_Day"], $_REQUEST["expire_Year"]));
// print $publishDate."<br>";
// print $expireDate."<br>";
......@@ -161,11 +157,10 @@ if (isset($_REQUEST["save"])) {
$info = $quizlib->get_quiz($_REQUEST["quizId"]);
if (!isset($info["publishDate"])){
$info["publishDate"] = date("U");
$info["publishDate"] = $tikilib->now;
}
if (!isset($info["expireDate"])){
$cur_time = getdate();
$info["expireDate"] = mktime ($cur_time["hours"], $cur_time["minutes"], 0, $cur_time["mon"], $cur_time["mday"]+365, $cur_time["year"]);
$info["expireDate"] = $tikilib->now + 365*24*60*60;
}
}
......@@ -303,9 +298,9 @@ include_once ("categorize_list.php");
ask_ticket('edit-quiz');
$smarty->assign('publishDate', $info['publishDate']);
$smarty->assign('publishDateSite', $dc->getDisplayDateFromServerDate($info['publishDate']));
$smarty->assign('publishDateSite', $info['publishDate']);
$smarty->assign('expireDate', $info['expireDate']);
$smarty->assign('expireDateSite', $dc->getDisplayDateFromServerDate($info['expireDate']));
$smarty->assign('expireDateSite', $info['expireDate']);
// disallow robots to index page:
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-edit_submission.php,v 1.57 2007-02-06 09:31:08 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-edit_submission.php,v 1.58 2007-02-12 11:47:58 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -41,8 +41,8 @@ if (isset($_REQUEST["subId"])) {
$smarty->assign('subId', $subId);
$smarty->assign('articleId', $subId);
$smarty->assign('allowhtml', 'y');
$publishDate = date('U');
$expireDate = TikiLib::make_time(0,0,0,date("m"), date("d"), date("Y")+1);
$publishDate = $tikilib->now;
$expireDate = $tikilib->make_time(0,0,0,$tikilib->date_format("%m"), $tikilib->date_format("%d"), $tikilib->date_format("%Y")+1);
$smarty->assign('title', '');
$smarty->assign('topline', '');
$smarty->assign('subtitle', '');
......@@ -398,7 +398,7 @@ if (isset($_REQUEST["save"])) {
}
// Set date to today before it's too late
$_SESSION["thedate"] = date("U");
$_SESSION["thedate"] = $tikilib->now;
// Armar un select con los topics
$topics = $artlib->list_topics();
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-editpage.php,v 1.162 2007-02-05 22:32:48 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-editpage.php,v 1.163 2007-02-12 11:47:58 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -797,8 +797,7 @@ if (isset($_REQUEST["save"]) && (strtolower($_REQUEST['page']) != 'sandbox' || $
$cachedlinks = array_diff($links, $notcachedlinks);
$tikilib->cache_links($cachedlinks);
*/
$t = date("U");
$tikilib->create_page($_REQUEST["page"], 0, $edit, $t, $_REQUEST["comment"],$user,$_SERVER["REMOTE_ADDR"],$description, $pageLang, $is_html, $lock_it, isset($_REQUEST['contributions'])? $_REQUEST['contributions']:'');
$tikilib->create_page($_REQUEST["page"], 0, $edit, $tikilib->now, $_REQUEST["comment"],$user,$_SERVER["REMOTE_ADDR"],$description, $pageLang, $is_html, $lock_it, isset($_REQUEST['contributions'])? $_REQUEST['contributions']:'');
if ($wiki_watch_author == 'y') {
$tikilib->add_user_watch($user,"wiki_page_changed",$_REQUEST["page"],'wiki page',$page,"tiki-index.php?page=$page");
}
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-export_tracker.php,v 1.8 2007-02-04 20:09:32 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-export_tracker.php,v 1.9 2007-02-12 11:47:58 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -190,7 +190,7 @@ for ($i = 0; $i < $temp_max; $i++) {
$ins_fields["data"][$i]["value"] = mktime($_REQUEST["$ins_id" . "Hour"], $_REQUEST["$ins_id" . "Minute"],
0, $_REQUEST["$ins_id" . "Month"], $_REQUEST["$ins_id" . "Day"], $_REQUEST["$ins_id" . "Year"]);
} else {
$ins_fields["data"][$i]["value"] = date("U");
$ins_fields["data"][$i]["value"] = $tikilib->now;
}
} elseif ($fields["data"][$i]["type"] == 'e') { // category
include_once('lib/categories/categlib.php');
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-file_galleries_rss.php,v 1.29 2007-02-04 20:09:32 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-file_galleries_rss.php,v 1.30 2007-02-12 11:47:58 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -26,7 +26,6 @@ $output = $rsslib->get_from_cache($uniqueid);
if ($output["data"]=="EMPTY") {
$title = (!empty($title_rss_file_galleries)) ? $title_rss_file_galleries : tra("Tiki RSS feed for file galleries");
$desc = (!empty($desc_rss_file_galleries)) ? $desc_rss_file_galleries : tra("Last files uploaded to the file galleries.");
$now = date("U");
$id = "fileId";
$descId = "description";
$dateId = "lastModif";
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-file_gallery_rss.php,v 1.30 2007-02-04 20:09:32 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-file_gallery_rss.php,v 1.31 2007-02-12 11:47:58 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -32,7 +32,6 @@ if ($output["data"]=="EMPTY") {
$tmp = $tikilib->get_file_gallery($_REQUEST["galleryId"]);
$title = tra("Tiki RSS feed for the file gallery: ").$tmp["name"];
$desc = $tmp["description"];
$now = date("U");
$id = "fileId";
$descId = "description";
$dateId = "lastModif";
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-forum_rss.php,v 1.23 2007-02-04 20:09:32 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-forum_rss.php,v 1.24 2007-02-12 11:47:58 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -38,7 +38,6 @@ if ($output["data"]=="EMPTY") {
$tmp = $commentslib->get_forum($_REQUEST["forumId"]);
$title = tra("Tiki RSS feed for forum: ").$tmp["name"];
$desc = $tmp["description"];
$now = date("U");
$param = "threadId";
$descId = "data";
$dateId = "commentDate";
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-forums_rss.php,v 1.24 2007-02-04 20:09:32 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-forums_rss.php,v 1.25 2007-02-12 11:47:58 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -26,7 +26,6 @@ $output = $rsslib->get_from_cache($uniqueid);
if ($output["data"]=="EMPTY") {
$title = (!empty($title_rss_forums)) ? $title_rss_forums : tra("Tiki RSS feed for forums");
$desc = (!empty($desc_rss_forums)) ? $desc_rss_forums : tra("Last topics in forums.");
$now = date("U");
$id = "forumId";
$param = "threadId";
$descId = "data";
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-history_sheets.php,v 1.7 2007-02-04 20:09:32 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-history_sheets.php,v 1.8 2007-02-12 11:47:58 mose Exp $
// Based on tiki-galleries.php
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
......@@ -42,7 +42,7 @@ $smarty->assign('page_mode', 'view' );
$result = $tikilib->query( "SELECT DISTINCT `begin`, `user` FROM `tiki_sheet_values` WHERE `sheetId` = ? ORDER BY begin DESC", array( $_REQUEST['sheetId'] ) );
$data = array();
while( $row = $result->fetchRow() )
$data[] = array( "stamp" =>$row['begin'], "string" => date( "Y-m-d H:i:s", $row['begin'] ), "user" => $row['user'] );
$data[] = array( "stamp" =>$row['begin'], "string" => $tikilib->date_format( "%Y-%m-%d %H:%M:%S", $row['begin'] ), "user" => $row['user'] );
$smarty->assign_by_ref( 'history', $data );
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-image_galleries_rss.php,v 1.29 2007-02-04 20:09:32 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-image_galleries_rss.php,v 1.30 2007-02-12 11:47:58 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -28,7 +28,6 @@ if ($output["data"]=="EMPTY") {
$title = (!empty($title_rss_image_galleries)) ? $title_rss_image_galleries : tra("Tiki RSS feed for image galleries");
$desc = (!empty($desc_rss_image_galleries)) ? $desc_rss_image_galleries : tra("Last images uploaded to the image galleries.");
$now = date("U");
$id = "imageId";
$titleId = "name";
$descId = "description";
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-image_gallery_rss.php,v 1.28 2007-02-04 20:09:32 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-image_gallery_rss.php,v 1.29 2007-02-12 11:47:58 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -32,7 +32,6 @@ $output = $rsslib->get_from_cache($uniqueid);
if ($output["data"]=="EMPTY") {
$tmp = $imagegallib->get_gallery($_REQUEST["galleryId"]);
$title = tra("Tiki RSS feed for the image gallery: ").$tmp["name"];
$now = date("U");
$desc = $tmp["description"]; // TODO: make configurable
$id = "imageId";
$titleId = "name";
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-index.php,v 1.175 2007-02-04 20:09:32 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-index.php,v 1.176 2007-02-12 11:47:59 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -29,7 +29,7 @@ if($feature_wiki != 'y') {
}
if(!isset($_SESSION['thedate'])) {
$thedate = date('U');
$thedate = $tikilib->now;
} else {
$thedate = $_SESSION['thedate'];
}
......@@ -45,7 +45,7 @@ if ((!isset($_REQUEST['page']) || $_REQUEST['page'] == '') and !isset($_REQUEST[
$_REQUEST['page'] = $userHomePage = $userlib->get_user_default_homepage2($user);
// Create the HomePage if it doesn't exist
if(!$tikilib->page_exists($wikiHomePage)) {
$tikilib->create_page($wikiHomePage,0,'',date('U'),'Tiki initialization');
$tikilib->create_page($wikiHomePage,0,'',$tikilib->now,'Tiki initialization');
}
header('Location: tiki-index.php?page='.$userHomePage);
if ($feature_best_language == 'y') {
......@@ -377,7 +377,7 @@ if(isset($_REQUEST['undo'])) {
$wikilib->remove_last_version($page);
// If page was deleted then re-create
if(!$tikilib->page_exists($page)) {
$tikilib->create_page($page,0,'',date('U'),'Tiki initialization');
$tikilib->create_page($page,0,'',$tikilib->now,'Tiki initialization');
}
// Restore page information
$info = $tikilib->get_page_info($page);
......@@ -416,8 +416,7 @@ $smarty->assign('cached_page','n');
if(isset($info['wiki_cache'])) {$wiki_cache=$info['wiki_cache'];}
if($wiki_cache>0) {
$cache_info = $wikilib->get_cache_info($page);
$now = date('U');
if($cache_info['cache_timestamp']+$wiki_cache > $now) {
if($cache_info['cache_timestamp']+$wiki_cache > $tikilib->now) {
$pdata = $cache_info['cache'];
$smarty->assign('cached_page','y');
} else {
......@@ -450,7 +449,6 @@ $smarty->assign('first_page',1);
$smarty->assign('last_page',$pages);
$smarty->assign('pagenum',$_REQUEST['pagenum']);
//$smarty->assign_by_ref('lastModif',date("l d of F, Y [H:i:s]",$info["lastModif"]));
$smarty->assign_by_ref('lastVersion',$info["version"]);
$smarty->assign_by_ref('lastModif',$info["lastModif"]);
if(empty($info['user'])) {
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-index_p.php,v 1.24 2007-02-04 20:09:32 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-index_p.php,v 1.25 2007-02-12 11:47:59 mose Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -31,11 +31,11 @@ if ($feature_wiki != 'y') {
// Create the HomePage if it doesn't exist
if (!$tikilib->page_exists($wikiHomePage)) {
$tikilib->create_page($wikiHomePage, 0, '', date("U"), 'Tiki initialization');
$tikilib->create_page($wikiHomePage, 0, '', $tikilib->now, 'Tiki initialization');
}
if (!isset($_SESSION["thedate"])) {
$thedate = date("U");
$thedate = $tikilib->now;
} else {
$thedate = $_SESSION["thedate"];
}
......@@ -48,7 +48,7 @@ $page = $_REQUEST['page'];
$smarty->assign('page', $page);
if (!$tikilib->page_exists($wikiHomePage)) {
$tikilib->create_page($wikiHomePage, 0, '', date("U"), 'Tiki initialization');
$tikilib->create_page($wikiHomePage, 0, '', $tikilib->now, 'Tiki initialization');
}
require_once('tiki-pagesetup.php');
......@@ -198,9 +198,7 @@ $tikilib->parse_first( $info["data"], $preparsed, $noparsed );
if ($wiki_cache > 0) {
$cache_info = $wikilib->get_cache_info($page);
$now = date('U');
if ($cache_info['cache_timestamp'] + $wiki_cache > $now) {
if ($cache_info['cache_timestamp'] + $wiki_cache > $tikilib->now) {
$pdata = $cache_info['cache'];
$smarty->assign('cached_page', 'y');
......@@ -244,7 +242,6 @@ $tikilib->replace_preparse( $pdata, $preparsed, $noparsed );
$smarty->assign_by_ref('parsed', $pdata);
//$smarty->assign_by_ref('lastModif',date("l d of F, Y [H:i:s]",$info["lastModif"]));
$smarty->assign_by_ref('lastModif', $info["lastModif"]);
if (empty($info["user"])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment