

ECSHOP网站如何修改文章的发布时间,相信很多使用ECSHOP网站商城的朋友时间长了都会发现,ECSHOP有很多僵硬的BUG。本来很基本的需求,ECSHOP系统有时却忽略了,比如后台修改文章时间。其实这个在auction_info.htm 拍卖活动信息页面的头部就有这个。找到下面的代码:
<tr>
<td>{$lang.author}</td>
<td><input maxlength=”60″ value=”{$article.author|escape}” /></td>
</tr>
在下面加入以下代码:
<!–新加日期修改–>
<tr>
<td>{$lang.add_time}</td>
<td><input size=”20″ value=’{$article.add_time}’ readonly=”readonly” /><input value=”{$lang.btn_select}”/></td>
</tr>
<!–新加日期修改 结束–>
ECSHOP网站修改文章的发布时间,在admin/article.php修改如下信息:
找到 (添加文章)
/*初始化*/
$article = array();
$article['is_open'] = 1;
在下面加上以下代码:
$article['add_time'] = local_date(‘Y-m-d H:i’);
找到文章 (编辑文章) 代码:
/* 取文章数据 */
$sql = “SELECT * FROM ” .$ecs->table(‘article’). ” WHERE article_id=’$_REQUEST[id]‘”;
$article = $db->GetRow($sql);
在下面加上以下代码:
$article['add_time'] = local_date(‘Y-m-d H:i’,$article['add_time']);
/*插入数据*/
$add_time = gmtime();
if (empty($_POST['cat_id']))
{
$_POST['cat_id'] = 0;
}
$sql = “INSERT INTO “.$ecs->table(‘article’).”(title, cat_id, article_type, is_open, author, “.
“author_email, keywords, content, add_time, file_url, open_type, link) “.
”VALUES (‘$_POST[title]‘, ‘$_POST[article_cat]‘, ‘$_POST[article_type]‘, ‘$_POST[is_open]‘, “.
“‘$_POST[author]‘, ‘$_POST[author_email]‘, ‘$_POST[keywords]‘, ‘$_POST[FCKeditor1]‘, “.
“‘$add_time’, ‘$file_url’, ‘$open_type’, ‘$_POST[link_url]‘)”;
$db->query($sql);
ECSHOP网站修改文章的发布时间,修改为:
/*插入数据*/
$add_time = gmtime();
if (empty($_POST['cat_id']))
{
$_POST['cat_id'] = 0;
}
$add_time = local_strtotime($_POST['add_time']);
$sql = “INSERT INTO “.$ecs->table(‘article’).”(title, cat_id, article_type, is_open, author, “.
“author_email, keywords, content, add_time, file_url, open_type, link) “.
”VALUES (‘$_POST[title]‘, ‘$_POST[article_cat]‘, ‘$_POST[article_type]‘, ‘$_POST[is_open]‘, “.
“‘$_POST[author]‘, ‘$_POST[author_email]‘, ‘$_POST[keywords]‘, ‘$_POST[FCKeditor1]‘, “.
“‘$add_time’, ‘$file_url’, ‘$open_type’, ‘$_POST[link_url]‘)”;
$db->query($sql);
ECSHOP网站修改文章的发布时间,找到下面这段代码:
if($exc->edit(“title=’$_POST[title]‘,cat_id=’$_POST[article_cat]‘, article_type=’$_POST[article_type]‘, is_open=’$_POST[is_open]‘, author=’$_POST[author]‘, author_email=’$_POST[author_email]‘, keywords =’$_POST[keywords]‘, file_url =’$file_url’, open_type=’$open_type’, content=’$_POST[FCKeditor1]‘, link=’$_POST[link_url]‘ “, $_POST['id']))
修改为:
$add_time = local_strtotime($_POST['add_time']);
if ($exc->edit(“title=’$_POST[title]‘, cat_id=’$_POST[article_cat]‘, article_type=’$_POST[article_type]‘, is_open=’$_POST[is_open]‘, author=’$_POST[author]‘, add_time=’$add_time’,author_email=’$_POST[author_email]‘, keywords =’$_POST[keywords]‘, file_url =’$file_url’, open_type=’$open_type’, content=’$_POST[FCKeditor1]‘, link=’$_POST[link_url]‘ “, $_POST['id']))
ECSHOP网站如何修改文章的发布时间介绍如上,深圳网站建设公司提示文章的时间修改功能添加后,我们可以很方便的控制文章的显示,不用担心时间的BUG了,方便对文章的提前编纂和部署。
![]() | [2011-11-14] | 简析微博对网站产品营销的帮助 |
![]() | [2011-10-27] | 网站设计与视觉优化的原则 |
![]() | [2011-10-18] | 网站建设时如何设计更友好的网站url |
![]() | [2011-10-09] | 网站建设CSS样式block和inline属性介绍 |
![]() | [2011-09-19] | 网站建设中indexof和substring函数用法区别 |
