From: <tr...@us...> - 2011-10-29 19:46:53
|
Revision: 7996 http://xoops.svn.sourceforge.net/xoops/?rev=7996&view=rev Author: trabis Date: 2011-10-29 19:46:46 +0000 (Sat, 29 Oct 2011) Log Message: ----------- formatTimestamp belongs in XoopsLocal Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/moduleadmin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php XoopsCore/branches/2.6.x/2.6.0/htdocs/banners.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/moduleadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/moduleadmin.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/moduleadmin.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -345,7 +345,6 @@ function renderAbout($paypal = '', $logo_xoops = true) { - $xoops = Xoops::getInstance(); $path = XOOPS_URL . "/Frameworks/moduleclasses/icons/32/"; $ret = "<table>\n<tr>\n"; @@ -353,9 +352,9 @@ $date = explode('/',$this->_obj->getInfo('release_date')); $author = explode(',',$this->_obj->getInfo('author')); $nickname = explode(',',$this->_obj->getInfo('nickname')); - $release_date = $xoops->formatTimestamp(mktime(0, 0, 0, $date[1], $date[2], $date[0]), 's'); + $release_date = XoopsLocal::formatTimestamp(mktime(0, 0, 0, $date[1], $date[2], $date[0]), 's'); $module_info = '<div id="about"><label>' . _AM_MODULEADMIN_ABOUT_DESCRIPTION . '</label><text>' . $this->_obj->getInfo("description") . '</text><br /> - <label>' . _AM_MODULEADMIN_ABOUT_UPDATEDATE . '</label><text class="bold">' . $xoops->formatTimestamp($this->_obj->getVar("last_update"),"m") . '</text><br /> + <label>' . _AM_MODULEADMIN_ABOUT_UPDATEDATE . '</label><text class="bold">' . XoopsLocal::formatTimestamp($this->_obj->getVar("last_update"),"m") . '</text><br /> <label>' . _AM_MODULEADMIN_ABOUT_MODULESTATUS . '</label><text>' . $this->_obj->getInfo("module_status") . '</text><br /> <label>' . _AM_MODULEADMIN_ABOUT_WEBSITE . '</label><text><a class="tooltip" href="http://' . $this->_obj->getInfo("module_website_url") . '" rel="external" title="'. $this->_obj->getInfo("module_website_name") . ' - ' . $this->_obj->getInfo("module_website_url") . '"> ' . $this->_obj->getInfo("module_website_name") . '</a></text></div>'; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -31,7 +31,7 @@ $tpl->assign('channel_title', XoopsLocal::convert_encoding(htmlspecialchars($xoops->config['sitename'], ENT_QUOTES))); $tpl->assign('channel_link', XOOPS_URL . '/'); $tpl->assign('channel_desc', XoopsLocal::convert_encoding(htmlspecialchars($xoops->config['slogan'], ENT_QUOTES))); - $tpl->assign('channel_lastbuild', $xoops->formatTimestamp(time(), 'rss')); + $tpl->assign('channel_lastbuild', XoopsLocal::formatTimestamp(time(), 'rss')); $tpl->assign('channel_webmaster', $xoops->checkEmail($xoops->config['adminmail'], true)); $tpl->assign('channel_editor', $xoops->checkEmail($xoops->config['adminmail'], true)); $tpl->assign('channel_category', 'News'); @@ -61,7 +61,7 @@ 'title' => XoopsLocal::convert_encoding(htmlspecialchars($story->title(), ENT_QUOTES)), 'link' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid(), 'guid' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid(), - 'pubdate' => $xoops->formatTimestamp($story->published(), 'rss'), + 'pubdate' => XoopsLocal::formatTimestamp($story->published(), 'rss'), 'description' => XoopsLocal::convert_encoding(htmlspecialchars($story->hometext(), ENT_QUOTES)) )); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/banners.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/banners.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/banners.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -218,8 +218,8 @@ <td>{$impressions}</td> <td>{$clicks}</td> <td>{$percent}%</td> - <td>" . $xoops->formatTimestamp($datestart) . "</td> - <td>" . $xoops->formatTimestamp($dateend) . "</td></tr></tbody>"; + <td>" . XoopsLocal::formatTimestamp($datestart) . "</td> + <td>" . XoopsLocal::formatTimestamp($dateend) . "</td></tr></tbody>"; } echo "</table></div>"; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -124,7 +124,6 @@ */ public function renderFlatView($admin_view = false) { - $xoops = Xoops::getInstance(); foreach ($this->_comments as $i => $comment) { /* @var $comment XoopsComment */ if (false != $this->_useIcons) { @@ -146,8 +145,8 @@ $this->_comments[$i] = $comment; $this->_tpl->append('comments', array( 'id' => $comment->getVar('com_id'), 'title' => $title, 'text' => $text, - 'date_posted' => $xoops->formatTimestamp($comment->getVar('com_created'), 'm'), - 'date_modified' => $xoops->formatTimestamp($comment->getVar('com_modified'), 'm'), + 'date_posted' => XoopsLocal::formatTimestamp($comment->getVar('com_created'), 'm'), + 'date_modified' => XoopsLocal::formatTimestamp($comment->getVar('com_modified'), 'm'), 'poster' => $poster )); } @@ -164,7 +163,6 @@ */ public function renderThreadView($comment_id = 0, $admin_view = false, $show_nav = true) { - $xoops = Xoops::getInstance(); // construct comment tree $xot = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid'); $tree = $xot->getTree(); @@ -206,8 +204,8 @@ 'id' => $tree[$comment_id]['obj']->getVar('com_id'), 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid'), 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, - 'date_posted' => $xoops->formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), - 'date_modified' => $xoops->formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'), + 'date_posted' => XoopsLocal::formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), + 'date_modified' => XoopsLocal::formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid')), 'replies' => $replies, 'show_replies' => $show_replies )); @@ -227,7 +225,6 @@ */ private function _renderThreadReplies($thread, $key, $replies, $prefix, $admin_view, $depth = 0, $current_prefix = '') { - $xoops = Xoops::getInstance(); if ($depth > 0) { if (false != $this->_useIcons) { $title = $this->_getTitleIcon($thread[$key]['obj']->getVar('com_icon')) . ' ' . $thread[$key]['obj']->getVar('com_title'); @@ -238,7 +235,7 @@ ? $title . ' ' . $this->_statusText[$thread[$key]['obj']->getVar('com_status')] : $title; $replies[] = array( 'id' => $key, 'prefix' => $current_prefix, - 'date_posted' => $xoops->formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'), 'title' => $title, + 'date_posted' => XoopsLocal::formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'), 'title' => $title, 'root_id' => $thread[$key]['obj']->getVar('com_rootid'), 'status' => $this->_statusText[$thread[$key]['obj']->getVar('com_status')], 'poster' => $this->_getPosterName($thread[$key]['obj']->getVar('com_uid')) @@ -272,7 +269,6 @@ */ public function renderNestView($comment_id = 0, $admin_view = false) { - $xoops = Xoops::getInstance(); $xot = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid'); $tree = $xot->getTree(); if (false != $this->_useIcons) { @@ -303,8 +299,8 @@ 'id' => $tree[$comment_id]['obj']->getVar('com_id'), 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid'), 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, - 'date_posted' => $xoops->formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), - 'date_modified' => $xoops->formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'), + 'date_posted' => XoopsLocal::formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), + 'date_modified' => XoopsLocal::formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid')), 'replies' => $replies )); } @@ -322,7 +318,6 @@ */ private function _renderNestReplies($thread, $key, $replies, $prefix, $admin_view, $depth = 0) { - $xoops = Xoops::getInstance(); if ($depth > 0) { if (false != $this->_useIcons) { $title = $this->_getTitleIcon($thread[$key]['obj']->getVar('com_icon')) . ' ' . $thread[$key]['obj']->getVar('com_title'); @@ -336,8 +331,8 @@ 'id' => $key, 'prefix' => $prefix, 'pid' => $thread[$key]['obj']->getVar('com_pid'), 'itemid' => $thread[$key]['obj']->getVar('com_itemid'), 'rootid' => $thread[$key]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, - 'date_posted' => $xoops->formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'), - 'date_modified' => $xoops->formatTimestamp($thread[$key]['obj']->getVar('com_modified'), 'm'), + 'date_posted' => XoopsLocal::formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'), + 'date_modified' => XoopsLocal::formatTimestamp($thread[$key]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($thread[$key]['obj']->getVar('com_uid')) ); @@ -400,7 +395,7 @@ $poster['rank_image'] = ($poster_rank['image'] != '') ? $poster_rank['image'] : 'blank.gif'; $poster['rank_title'] = $poster_rank['title']; $poster['avatar'] = $com_poster->getVar('user_avatar'); - $poster['regdate'] = $xoops->formatTimestamp($com_poster->getVar('user_regdate'), 's'); + $poster['regdate'] = XoopsLocal::formatTimestamp($com_poster->getVar('user_regdate'), 's'); $poster['from'] = $com_poster->getVar('user_from'); $poster['postnum'] = $com_poster->getVar('posts'); $poster['status'] = $com_poster->isOnline() ? _CM_ONLINE : ''; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -441,7 +441,6 @@ return $this->userIsAdmin; } - /** * @param mixed $name * @param mixed $optional @@ -975,19 +974,6 @@ } /** - * Function to display formatted times in user timezone - * - * @param int $time - * @param string $format - * @param string $timeoffset - * @return string - */ - public function formatTimestamp($time, $format = 'l', $timeoffset = '') - { - return XoopsLocal::formatTimestamp($time, $format, $timeoffset); - } - - /** * Function to calculate server timestamp from user entered time (timestamp) * * @param int $timestamp Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -209,7 +209,7 @@ { $xoops = Xoops::getInstance(); $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); - return $xoops->formatTimestamp($time, $format, $timeoffset); + return XoopsLocal::formatTimestamp($time, $format, $timeoffset); } /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -86,7 +86,7 @@ echo "</td><td><img src='images/subject/" .$iconName . "' alt='' /> " . _PM_SENTC . "" . $xoops->formatTimestamp($pm_arr[0]->getVar("msg_time")); } else { - echo "</td><td>" . _PM_SENTC . "" . $xoops->formatTimestamp($pm_arr[0]->getVar("msg_time")); + echo "</td><td>" . _PM_SENTC . "" . XoopsLocal::formatTimestamp($pm_arr[0]->getVar("msg_time")); } //------------- mamba Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -197,7 +197,7 @@ $uname = XoopsUser::getUnameFromId($results[$i]['uid']); echo " <a href='" . XOOPS_URL . "/userinfo.php?uid=" . $results[$i]['uid'] . "' title=''>" . $uname . "</a>\n"; } - echo !empty($results[$i]['time']) ? " (" . $xoops->formatTimestamp(intval($results[$i]['time'])) . ")" + echo !empty($results[$i]['time']) ? " (" . XoopsLocal::formatTimestamp(intval($results[$i]['time'])) . ")" : ""; echo "</span><br />\n"; } @@ -262,7 +262,7 @@ $uname = XoopsUser::getUnameFromId($results[$i]['uid']); echo " <a href='" . XOOPS_URL . "/userinfo.php?uid=" . $results[$i]['uid'] . "'>" . $uname . "</a>\n"; } - echo !empty($results[$i]['time']) ? " (" . $xoops->formatTimestamp(intval($results[$i]['time'])) . ")" : ""; + echo !empty($results[$i]['time']) ? " (" . XoopsLocal::formatTimestamp(intval($results[$i]['time'])) . ")" : ""; echo "</span><br />\n"; } echo '<table><tr>'; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -118,7 +118,7 @@ $xoops->tpl->assign('lang_statistics', _US_STATISTICS); $xoops->tpl->assign('lang_membersince', _US_MEMBERSINCE); $var = $thisUser->getVar('user_regdate'); -$xoops->tpl->assign('user_joindate', $xoops->formatTimestamp($var, 's')); +$xoops->tpl->assign('user_joindate', XoopsLocal::formatTimestamp($var, 's')); $xoops->tpl->assign('lang_rank', _US_RANK); $xoops->tpl->assign('lang_posts', _US_POSTS); $xoops->tpl->assign('lang_basicInfo', _US_BASICINFO); @@ -154,7 +154,7 @@ $xoops->tpl->assign('user_ranktitle', $userrank['title']); $date = $thisUser->getVar("last_login"); if (!empty($date)) { - $xoops->tpl->assign('user_lastlogin', $xoops->formatTimestamp($date, "m")); + $xoops->tpl->assign('user_lastlogin', XoopsLocal::formatTimestamp($date, "m")); } $module_handler = $xoops->getModuleHandler(); $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); @@ -179,7 +179,7 @@ } $results[$i]['title'] = $myts->htmlspecialchars($results[$i]['title']); - $results[$i]['time'] = $results[$i]['time'] ? $xoops->formatTimestamp($results[$i]['time']) : ''; + $results[$i]['time'] = $results[$i]['time'] ? XoopsLocal::formatTimestamp($results[$i]['time']) : ''; } if ($count == 5) { $showall_link = '<a href="search.php?action=showallbyuser&mid=' . $mid . '&uid=' . $thisUser->getVar('uid') . '">' . _US_SHOWALL . '</a>'; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -92,7 +92,7 @@ } echo "</td>\n"; echo "<td class='alignmiddle'><a href='readpmsg.php?start=" . ($total_messages - $i - 1), "&total_messages=$total_messages'>" . $pm_arr[$i]->getVar("subject") . "</a></td>"; - echo "<td class='alignmiddle txtcenter width20'>" . $xoops->formatTimestamp($pm_arr[$i]->getVar("msg_time")) . "</td></tr>"; + echo "<td class='alignmiddle txtcenter width20'>" . XoopsLocal::formatTimestamp($pm_arr[$i]->getVar("msg_time")) . "</td></tr>"; } if ($display == 1) { echo "<tr class='foot txtleft'><td colspan='6' align='left'><input type='button' class='formButton' onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . "/pmlite.php?send=1\",\"pmlite\",565,500);' value='" . _PM_SEND . "' /> <input type='submit' class='formButton' name='delete_messages' value='" . _PM_DELETE . "' />" . $xoops->security->getTokenHTML() . "</td></tr></table></form>"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |