This commit is contained in:
joyqi 2017-10-29 15:45:47 +08:00
parent 7a2b374526
commit 9884a2fc76
28 changed files with 112 additions and 64 deletions

View File

@ -108,7 +108,7 @@ $isAllPosts = ('on' == $request->get('__typecho_all_posts') || 'on' == Typecho_C
<?php while($posts->next()): ?>
<tr id="<?php $posts->theId(); ?>">
<td><input type="checkbox" value="<?php $posts->cid(); ?>" name="cid[]"/></td>
<td><a href="<?php $options->adminUrl('manage-comments.php?cid=' . $posts->cid); ?>" class="balloon-button size-<?php echo Typecho_Common::splitByCount($posts->commentsNum, 1, 10, 20, 50, 100); ?>" title="<?php $posts->commentsNum(); ?> <?php _e('评论'); ?>"><?php $posts->commentsNum(); ?></a></td>
<td><a href="<?php $options->adminUrl('manage-comments.php?cid=' . ($posts->parentId ? $posts->parentId : $posts->cid)); ?>" class="balloon-button size-<?php echo Typecho_Common::splitByCount($posts->commentsNum, 1, 10, 20, 50, 100); ?>" title="<?php $posts->commentsNum(); ?> <?php _e('评论'); ?>"><?php $posts->commentsNum(); ?></a></td>
<td>
<a href="<?php $options->adminUrl('write-post.php?cid=' . $posts->cid); ?>"><?php $posts->title(); ?></a>
<?php

View File

@ -5,9 +5,10 @@
</nav>
<div class="operate">
<?php Typecho_Plugin::factory('admin/menu.php')->navBar(); ?>
<a title="<?php
<a title="<?php
if ($user->logged > 0) {
_e('最后登录: %s', Typecho_I18n::dateWord($user->logged + $options->timezone, $options->gmtTime + $options->timezone));
$logged = new Typecho_Date($user->logged);
_e('最后登录: %s', $logged->word());
}
?>" href="<?php $options->adminUrl('profile.php'); ?>" class="author"><?php $user->screenName(); ?></a><a class="exit" href="<?php $options->logoutUrl(); ?>"><?php _e('登出'); ?></a><a href="<?php $options->siteUrl(); ?>"><?php _e('网站'); ?></a>
</div>

View File

@ -18,7 +18,8 @@ $stat = Typecho_Widget::widget('Widget_Stat');
$stat->myPublishedPostsNum, $stat->myPublishedCommentsNum, $stat->categoriesNum); ?></p>
<p><?php
if ($user->logged > 0) {
_e('最后登录: %s', Typecho_I18n::dateWord($user->logged + $options->timezone, $options->gmtTime + $options->timezone));
$logged = new Typecho_Date($user->logged);
_e('最后登录: %s', $logged->word());
}
?></p>
</div>

View File

@ -382,16 +382,16 @@ Typecho_Cookie::set('__typecho_lang', $lang);
$installDb->query($installDb->insert('table.relationships')->rows(array('cid' => 1, 'mid' => 1)));
/** 初始内容 */
$installDb->query($installDb->insert('table.contents')->rows(array('title' => _t('欢迎使用 Typecho'), 'slug' => 'start', 'created' => Typecho_Date::gmtTime(), 'modified' => Typecho_Date::gmtTime(),
$installDb->query($installDb->insert('table.contents')->rows(array('title' => _t('欢迎使用 Typecho'), 'slug' => 'start', 'created' => Typecho_Date::time(), 'modified' => Typecho_Date::time(),
'text' => '<!--markdown-->' . _t('如果您看到这篇文章,表示您的 blog 已经安装成功.'), 'authorId' => 1, 'type' => 'post', 'status' => 'publish', 'commentsNum' => 1, 'allowComment' => 1,
'allowPing' => 1, 'allowFeed' => 1, 'parent' => 0)));
$installDb->query($installDb->insert('table.contents')->rows(array('title' => _t('关于'), 'slug' => 'start-page', 'created' => Typecho_Date::gmtTime(), 'modified' => Typecho_Date::gmtTime(),
$installDb->query($installDb->insert('table.contents')->rows(array('title' => _t('关于'), 'slug' => 'start-page', 'created' => Typecho_Date::time(), 'modified' => Typecho_Date::time(),
'text' => '<!--markdown-->' . _t('本页面由 Typecho 创建, 这只是个测试页面.'), 'authorId' => 1, 'order' => 0, 'type' => 'page', 'status' => 'publish', 'commentsNum' => 0, 'allowComment' => 1,
'allowPing' => 1, 'allowFeed' => 1, 'parent' => 0)));
/** 初始评论 */
$installDb->query($installDb->insert('table.comments')->rows(array('cid' => 1, 'created' => Typecho_Date::gmtTime(), 'author' => 'Typecho', 'ownerId' => 1, 'url' => 'http://typecho.org',
$installDb->query($installDb->insert('table.comments')->rows(array('cid' => 1, 'created' => Typecho_Date::time(), 'author' => 'Typecho', 'ownerId' => 1, 'url' => 'http://typecho.org',
'ip' => '127.0.0.1', 'agent' => $options->generator, 'text' => '欢迎加入 Typecho 大家族', 'type' => 'comment', 'status' => 'approved', 'parent' => 0)));
/** 初始用户 */
@ -399,7 +399,7 @@ Typecho_Cookie::set('__typecho_lang', $lang);
$hasher = new PasswordHash(8, true);
$installDb->query($installDb->insert('table.users')->rows(array('name' => $config['userName'], 'password' => $hasher->HashPassword($password), 'mail' => $config['userMail'],
'url' => 'http://www.typecho.org', 'screenName' => $config['userName'], 'group' => 'administrator', 'created' => Typecho_Date::gmtTime())));
'url' => 'http://www.typecho.org', 'screenName' => $config['userName'], 'group' => 'administrator', 'created' => Typecho_Date::time())));
unset($_SESSION['typecho']);
header('Location: ./install.php?finish&user=' . urlencode($config['userName'])

View File

@ -26,12 +26,12 @@ class Typecho_Date
public static $serverTimezoneOffset = 0;
/**
* 当前的GMT时间戳
* 当前的服务器时间戳
*
* @access public
* @var integer
*/
public static $gmtTimeStamp;
public static $serverTimeStamp;
/**
* 可以被直接转换的时间戳
@ -45,11 +45,11 @@ class Typecho_Date
* 初始化参数
*
* @access public
* @param integer $gmtTime GMT时间戳
* @param integer $time 时间戳
*/
public function __construct($gmtTime)
public function __construct($time = NULL)
{
$this->timeStamp = $gmtTime + (self::$timezoneOffset - self::$serverTimezoneOffset);
$this->timeStamp = (NULL === $time ? self::time() : $time) + (self::$timezoneOffset - self::$serverTimezoneOffset);
}
/**
@ -85,7 +85,7 @@ class Typecho_Date
*/
public function word()
{
return Typecho_I18n::dateWord($this->timeStamp, self::gmtTime() + (self::$timezoneOffset - self::$serverTimezoneOffset));
return Typecho_I18n::dateWord($this->timeStamp, self::time() + (self::$timezoneOffset - self::$serverTimezoneOffset));
}
/**
@ -112,11 +112,21 @@ class Typecho_Date
/**
* 获取GMT时间
*
* @access public
* @return integer
* @deprecated
* @return int
*/
public static function gmtTime()
{
return self::$gmtTimeStamp ? self::$gmtTimeStamp : (self::$gmtTimeStamp = @gmmktime());
return self::time();
}
/**
* 获取服务器时间
*
* @return int
*/
public static function time()
{
return self::$serverTimeStamp ? self::$serverTimeStamp : (self::$serverTimeStamp = time() - idate('Z'));
}
}

View File

@ -167,7 +167,7 @@ class Widget_Abstract_Comments extends Widget_Abstract
/** 构建插入结构 */
$insertStruct = array(
'cid' => $comment['cid'],
'created' => empty($comment['created']) ? $this->options->gmtTime : $comment['created'],
'created' => empty($comment['created']) ? $this->options->time : $comment['created'],
'author' => empty($comment['author']) ? NULL : $comment['author'],
'authorId' => empty($comment['authorId']) ? 0 : $comment['authorId'],
'ownerId' => empty($comment['ownerId']) ? 0 : $comment['ownerId'],

View File

@ -272,8 +272,8 @@ class Widget_Abstract_Contents extends Widget_Abstract
/** 构建插入结构 */
$insertStruct = array(
'title' => empty($content['title']) ? NULL : htmlspecialchars($content['title']),
'created' => empty($content['created']) ? $this->options->gmtTime : $content['created'],
'modified' => $this->options->gmtTime,
'created' => empty($content['created']) ? $this->options->time : $content['created'],
'modified' => $this->options->time,
'text' => empty($content['text']) ? NULL : $content['text'],
'order' => empty($content['order']) ? 0 : intval($content['order']),
'authorId' => isset($content['authorId']) ? $content['authorId'] : $this->user->uid,
@ -345,7 +345,7 @@ class Widget_Abstract_Contents extends Widget_Abstract
$updateStruct['created'] = $content['created'];
}
$updateStruct['modified'] = $this->options->gmtTime;
$updateStruct['modified'] = $this->options->time;
/** 首先插入部分数据 */
$updateCondition = clone $condition;
@ -850,7 +850,7 @@ class Widget_Abstract_Contents extends Widget_Abstract
/** 对自动关闭反馈功能的支持 */
if (('ping' == $permission || 'comment' == $permission) && $this->options->commentsPostTimeout > 0 &&
$this->options->commentsAutoClose) {
if ($this->options->gmtTime - $this->created > $this->options->commentsPostTimeout) {
if ($this->options->time - $this->created > $this->options->commentsPostTimeout) {
return false;
}
}

View File

@ -1350,7 +1350,7 @@ class Widget_Archive extends Widget_Abstract_Contents
$select = $this->select()->where('table.contents.status = ?', 'publish');
}
}
$select->where('table.contents.created < ?', $this->options->gmtTime);
$select->where('table.contents.created < ?', $this->options->time);
}
/** handle初始化 */
@ -1541,7 +1541,7 @@ class Widget_Archive extends Widget_Abstract_Contents
public function theNext($format = '%s', $default = NULL, $custom = array())
{
$content = $this->db->fetchRow($this->select()->where('table.contents.created > ? AND table.contents.created < ?',
$this->created, $this->options->gmtTime)
$this->created, $this->options->time)
->where('table.contents.status = ?', 'publish')
->where('table.contents.type = ?', $this->type)
->where('table.contents.password IS NULL')

View File

@ -185,7 +185,7 @@ class Widget_Backup extends Widget_Abstract_Options implements Widget_Interface_
bin2hex(openssl_random_pseudo_bytes(16)) : sha1(Typecho_Common::randString(20));
}
$user['activated'] = $this->options->gmtTime;
$user['activated'] = $this->options->time;
$user['logged'] = $user['activated'];
Typecho_Cookie::set('__typecho_uid', $user['uid']);

View File

@ -309,7 +309,7 @@ class Widget_Comments_Edit extends Widget_Abstract_Comments implements Widget_In
$comment = array(
'cid' => $commentSelect['cid'],
'created' => $this->options->gmtTime,
'created' => $this->options->time,
'agent' => $this->request->getAgent(),
'ip' => $this->request->getIp(),
'ownerId' => $commentSelect['ownerId'],

View File

@ -109,7 +109,7 @@ class Widget_Contents_Page_Edit extends Widget_Contents_Post_Edit implements Wid
$this->pluginHandle()->finishSave($contents, $this);
if ($this->request->isAjax()) {
$created = new Typecho_Date($this->options->gmtTime);
$created = new Typecho_Date($this->options->time);
$this->response->throwJson(array(
'success' => 1,
'time' => $created->format('H:i:s A'),

View File

@ -31,7 +31,7 @@ class Widget_Contents_Page_List extends Widget_Abstract_Contents
{
$select = $this->select()->where('table.contents.type = ?', 'page')
->where('table.contents.status = ?', 'publish')
->where('table.contents.created < ?', $this->options->gmtTime)
->where('table.contents.created < ?', $this->options->time)
->order('table.contents.order', Typecho_Db::SORT_ASC);
//去掉自定义首页

View File

@ -52,6 +52,10 @@ class Widget_Contents_Post_Admin extends Widget_Abstract_Contents
*/
protected function ___hasSaved()
{
if (in_array($this->type, array('post_draft', 'page_draft'))) {
return true;
}
$savedPost = $this->db->fetchRow($this->db->select('cid', 'modified')
->from('table.contents')
->where('table.contents.parent = ? AND (table.contents.type = ? OR table.contents.type = ?)',
@ -82,6 +86,27 @@ class Widget_Contents_Post_Admin extends Widget_Abstract_Contents
throw new Typecho_Widget_Exception(_t('用户不存在'), 404);
}
/**
* 重载过滤函数
*
* @param array $value
* @return array
*/
public function filter(array $value)
{
$value = parent::filter($value);
if (!empty($value['parent'])) {
$parent = $this->db->fetchObject($this->select()->where('cid = ?', $value['parent']));
if (!empty($parent)) {
$value['commentsNum'] = $parent->commentsNum;
}
}
return $value;
}
/**
* 执行函数
*

View File

@ -43,7 +43,6 @@ class Widget_Contents_Post_Date extends Typecho_Widget
* @param mixed $request request对象
* @param mixed $response response对象
* @param mixed $params 参数列表
* @return void
*/
public function __construct($request, $response, $params = NULL)
{
@ -70,7 +69,7 @@ class Widget_Contents_Post_Date extends Typecho_Widget
$resource = $this->db->query($this->db->select('created')->from('table.contents')
->where('type = ?', 'post')
->where('table.contents.status = ?', 'publish')
->where('table.contents.created < ?', $this->options->gmtTime)
->where('table.contents.created < ?', $this->options->time)
->order('table.contents.created', Typecho_Db::SORT_DESC));
$offset = $this->options->timezone - $this->options->serverTimezone;

View File

@ -56,7 +56,7 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg
*/
protected function ___date()
{
return new Typecho_Date($this->options->gmtTime);
return new Typecho_Date();
}
/**
@ -85,7 +85,7 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg
* getFields
*
* @access protected
* @return void
* @return array
*/
protected function getFields()
{
@ -123,12 +123,13 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg
*/
protected function getCreated()
{
$created = $this->options->gmtTime;
$created = $this->options->time;
if (!empty($this->request->created)) {
$created = $this->request->created;
} else if (!empty($this->request->date)) {
$dstOffset = !empty($this->request->dst) ? $this->request->dst : 0;
$created = strtotime($this->request->date) - $this->options->timezone + $this->options->serverTimezone - $dstOffset;
$timezoneOffset = isset($this->request->timezone) ? intval($this->request->timezone) : $this->options->timezone;
$created = strtotime($this->request->date) - $timezoneOffset + $this->options->serverTimezone - $dstOffset;
} else if (!empty($this->request->year) && !empty($this->request->month) && !empty($this->request->day)) {
$second = intval($this->request->get('sec', date('s')));
$min = intval($this->request->get('min', date('i')));
@ -363,8 +364,7 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg
/**
* 执行函数
*
* @access public
* @return void
* @throws Typecho_Widget_Exception
*/
public function execute()
{
@ -437,16 +437,14 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg
if (isset($this->created)) {
parent::date($format);
} else {
echo date($format, $this->options->gmtTime + $this->options->timezone - $this->options->serverTimezone);
echo date($format, $this->options->time + $this->options->timezone - $this->options->serverTimezone);
}
}
/**
* 获取文章权限
*
* @access public
* @param string $permission 权限
* @return unknown
* @return bool
*/
public function allow()
{
@ -584,7 +582,8 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg
* @access public
* @param integer $cid
* @param string $tags
* @param boolean $count 是否参与计数
* @param boolean $beforeCount 是否参与计数
* @param boolean $afterCount 是否参与计数
* @return string
*/
public function setTags($cid, $tags, $beforeCount = true, $afterCount = true)
@ -651,7 +650,8 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg
* @access public
* @param integer $cid 内容id
* @param array $categories 分类id的集合数组
* @param boolean $count 是否参与计数
* @param boolean $beforeCount 是否参与计数
* @param boolean $afterCount 是否参与计数
* @return integer
*/
public function setCategories($cid, array $categories, $beforeCount = true, $afterCount = true)
@ -762,7 +762,7 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg
$this->pluginHandle()->finishSave($contents, $this);
if ($this->request->isAjax()) {
$created = new Typecho_Date($this->options->gmtTime);
$created = new Typecho_Date();
$this->response->throwJson(array(
'success' => 1,
'time' => $created->format('H:i:s A'),

View File

@ -32,7 +32,7 @@ class Widget_Contents_Post_Recent extends Widget_Abstract_Contents
$this->db->fetchAll($this->select()
->where('table.contents.status = ?', 'publish')
->where('table.contents.created < ?', $this->options->gmtTime)
->where('table.contents.created < ?', $this->options->time)
->where('table.contents.type = ?', 'post')
->order('table.contents.created', Typecho_Db::SORT_DESC)
->limit($this->parameter->pageSize), array($this, 'push'));

View File

@ -53,7 +53,7 @@ class Widget_Contents_Related extends Widget_Abstract_Contents
->where('table.contents.cid <> ?', $this->parameter->cid)
->where('table.contents.status = ?', 'publish')
->where('table.contents.password IS NULL')
->where('table.contents.created < ?', $this->options->gmtTime)
->where('table.contents.created < ?', $this->options->time)
->where('table.contents.type = ?', $this->parameter->type)
->order('table.contents.created', Typecho_Db::SORT_DESC)
->limit($this->parameter->limit), array($this, 'push'));

View File

@ -37,7 +37,7 @@ class Widget_Contents_Related_Author extends Widget_Abstract_Contents
->where('table.contents.cid <> ?', $this->parameter->cid)
->where('table.contents.status = ?', 'publish')
->where('table.contents.password IS NULL')
->where('table.contents.created < ?', $this->options->gmtTime)
->where('table.contents.created < ?', $this->options->time)
->where('table.contents.type = ?', $this->parameter->type)
->order('table.contents.created', Typecho_Db::SORT_DESC)
->limit($this->parameter->limit), array($this, 'push'));

View File

@ -43,7 +43,7 @@ class Widget_Feedback extends Widget_Abstract_Comments implements Widget_Interfa
$comment = array(
'cid' => $this->_content->cid,
'created' => $this->options->gmtTime,
'created' => $this->options->time,
'agent' => $this->request->getAgent(),
'ip' => $this->request->getIp(),
'ownerId' => $this->_content->author->uid,
@ -100,7 +100,7 @@ class Widget_Feedback extends Widget_Abstract_Comments implements Widget_Interfa
}
}
$expire = $this->options->gmtTime + $this->options->timezone + 30*24*3600;
$expire = $this->options->time + $this->options->timezone + 30*24*3600;
Typecho_Cookie::set('__typecho_remember_author', $comment['author'], $expire);
Typecho_Cookie::set('__typecho_remember_mail', $comment['mail'], $expire);
Typecho_Cookie::set('__typecho_remember_url', $comment['url'], $expire);
@ -170,7 +170,7 @@ class Widget_Feedback extends Widget_Abstract_Comments implements Widget_Interfa
$trackback = array(
'cid' => $this->_content->cid,
'created' => $this->options->gmtTime,
'created' => $this->options->time,
'agent' => $this->request->getAgent(),
'ip' => $this->request->getIp(),
'ownerId' => $this->_content->author->uid,
@ -320,8 +320,8 @@ class Widget_Feedback extends Widget_Abstract_Comments implements Widget_Interfa
->order('created', Typecho_Db::SORT_DESC)
->limit(1));
if ($latestComment && ($this->options->gmtTime - $latestComment['created'] > 0 &&
$this->options->gmtTime - $latestComment['created'] < $this->options->commentsPostInterval)) {
if ($latestComment && ($this->options->time - $latestComment['created'] > 0 &&
$this->options->time - $latestComment['created'] < $this->options->commentsPostInterval)) {
throw new Typecho_Widget_Exception(_t('对不起, 您的发言过于频繁, 请稍侯再次发布.'), 403);
}
}

View File

@ -53,7 +53,7 @@ class Widget_Login extends Widget_Abstract_Users implements Widget_Interface_Do
/** 开始验证用户 **/
$valid = $this->user->login($this->request->name, $this->request->password,
false, 1 == $this->request->remember ? $this->options->gmtTime + $this->options->timezone + 30*24*3600 : 0);
false, 1 == $this->request->remember ? $this->options->time + $this->options->timezone + 30*24*3600 : 0);
/** 比对密码 */
if (!$valid) {

View File

@ -34,7 +34,7 @@ class Widget_Notice extends Typecho_Widget
{
$this->highlight = $theId;
Typecho_Cookie::set('__typecho_notice_highlight', $theId,
$this->widget('Widget_Options')->gmtTime + $this->widget('Widget_Options')->timezone + 86400);
$this->widget('Widget_Options')->time + $this->widget('Widget_Options')->timezone + 86400);
}
/**
@ -64,8 +64,8 @@ class Widget_Notice extends Typecho_Widget
}
Typecho_Cookie::set('__typecho_notice', Json::encode($notice),
$this->widget('Widget_Options')->gmtTime + $this->widget('Widget_Options')->timezone + 86400);
$this->widget('Widget_Options')->time + $this->widget('Widget_Options')->timezone + 86400);
Typecho_Cookie::set('__typecho_notice_type', $type,
$this->widget('Widget_Options')->gmtTime + $this->widget('Widget_Options')->timezone + 86400);
$this->widget('Widget_Options')->time + $this->widget('Widget_Options')->timezone + 86400);
}
}

View File

@ -266,8 +266,9 @@ class Widget_Options extends Typecho_Widget
}
/**
* 获取格林尼治标准时间
* 获取GMT标准时间
*
* @deprecated
* @access protected
* @return integer
*/
@ -276,6 +277,18 @@ class Widget_Options extends Typecho_Widget
return Typecho_Date::gmtTime();
}
/**
* 获取时间
*
* @deprecated
* @access protected
* @return integer
*/
protected function ___time()
{
return Typecho_Date::time();
}
/**
* 获取格式
*

View File

@ -61,7 +61,7 @@ class Widget_Options_Reading extends Widget_Options_Permalink
// 页面列表
$pages = $this->db->fetchAll($this->db->select('cid', 'title')
->from('table.contents')->where('type = ?', 'page')
->where('status = ?', 'publish')->where('created < ?', $this->options->gmtTime));
->where('status = ?', 'publish')->where('created < ?', $this->options->time));
if (!empty($pages)) {
$pagesSelect = '<select name="frontPagePage" id="frontPage-frontPagePage">';
@ -163,7 +163,7 @@ class Widget_Options_Reading extends Widget_Options_Permalink
if ('page' == $settings['frontPage'] && isset($this->request->frontPagePage) &&
$this->db->fetchRow($this->db->select('cid')
->from('table.contents')->where('type = ?', 'page')
->where('status = ?', 'publish')->where('created < ?', $this->options->gmtTime)
->where('status = ?', 'publish')->where('created < ?', $this->options->time)
->where('cid = ?', $pageId = intval($this->request->frontPagePage)))) {
$settings['frontPage'] = 'page:' . $pageId;

View File

@ -64,7 +64,7 @@ class Widget_Register extends Widget_Abstract_Users implements Widget_Interface_
'mail' => $this->request->mail,
'screenName'=> $this->request->name,
'password' => $hasher->HashPassword($generatedPassword),
'created' => $this->options->gmtTime,
'created' => $this->options->time,
'group' => 'subscriber'
);

View File

@ -98,8 +98,7 @@ class Widget_Upload extends Widget_Abstract_Contents implements Widget_Interface
return false;
}
$options = Typecho_Widget::widget('Widget_Options');
$date = new Typecho_Date($options->gmtTime);
$date = new Typecho_Date();
$path = Typecho_Common::url(defined('__TYPECHO_UPLOAD_DIR__') ? __TYPECHO_UPLOAD_DIR__ : self::UPLOAD_DIR,
defined('__TYPECHO_UPLOAD_ROOT_DIR__') ? __TYPECHO_UPLOAD_ROOT_DIR__ : __TYPECHO_ROOT_DIR__)
. '/' . $date->year . '/' . $date->month;

View File

@ -95,7 +95,7 @@ class Widget_User extends Typecho_Widget
//更新最后活动时间
$this->db->query($this->db
->update('table.users')
->rows(array('activated' => $this->options->gmtTime))
->rows(array('activated' => $this->options->time))
->where('uid = ?', $this->_user['uid']));
}
}

View File

@ -212,7 +212,7 @@ class Widget_Users_Edit extends Widget_Abstract_Users implements Widget_Interfac
$user = $this->request->from('name', 'mail', 'screenName', 'password', 'url', 'group');
$user['screenName'] = empty($user['screenName']) ? $user['name'] : $user['screenName'];
$user['password'] = $hasher->HashPassword($user['password']);
$user['created'] = $this->options->gmtTime;
$user['created'] = $this->options->time;
/** 插入数据 */
$user['uid'] = $this->insert($user);

View File

@ -2144,7 +2144,7 @@ class Widget_XmlRpc extends Widget_Abstract_Contents implements Widget_Interface
$pingback = array(
'cid' => $post->cid,
'created' => $this->options->gmtTime,
'created' => $this->options->time,
'agent' => $this->request->getAgent(),
'ip' => $this->request->getIp(),
'author' => $finalTitle,