首页建站经验 ECSHOP后台给文章加上日期时间修改

ECSHOP后台给文章加上日期时间修改

ECSHOP后台给文章加上日期时间修改,添加好的文章怎么才能改时间,比如说我是几年前添加的文章但是百度收录了我又不想去删除,想改到近期的时间,下面就由A5源码帮你解决首先打开文…

ECSHOP后台给文章加上日期时间修改,添加好的文章怎么才能改时间,比如说我是几年前添加的文章但是百度收录了我又不想去删除,想改到近期的时间,下面就由A5源码帮你解决

首先打开文件夹admin/templates/article_info.htm

加一个修改时间

在第三行下面加入调用日历 JS

-------------------------------------------

修改代码:

找到代码:

{$lang.author}

在下面加入以下代码:

{$lang.add_time}

-------------------------------------------

然后去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);

修改为:

/*插入数据*/

$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);

----------------------------------

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']))

本文来自网络,不代表1号站长-站长学院|资讯交流平台立场。转载请注明出处: https://www.1cn.cc/jianzhan/jingyan/16091.html
上一篇修改商品详情页评论时email必填
下一篇 DISCUZ! X 多国语言实现方法
admin

作者: admin

这里可以再内容模板定义一些文字和说明,也可以调用对应作者的简介!或者做一些网站的描述之类的文字或者HTML!

为您推荐

评论列表()

    联系我们

    联系我们

    0898-88888888

    在线咨询: QQ交谈

    邮箱: email@wangzhan.com

    工作时间:周一至周五,9:00-17:30,节假日休息

    关注微信
    微信扫一扫关注我们

    微信扫一扫关注我们

    关注微博
    返回顶部