- 资源介绍
- 更新记录
- 安装教程
ecshop后台文章加上日期时间的方法
- 1、打开 /admin/templates/article_info.htm 文件,加一个修改时间
在第三行下面加入调用日历JS代码
<script type=”text/javascript” src=”../js/calendar.php?lang={$cfg_lang}”></script>
<link href=”../js/calendar/calendar.css” rel=”stylesheet” type=”text/css” />找到
<tr>
<td class=”narrow-label”>{$lang.author}</td>
<td><input type=”text” name=”author” maxlength=”60″ value=”{$article.author|escape}” /></td>
</tr>
在其下面添加以下代码
<!–新加日期修改 开始–>
<tr>
<td class=”narrow-label”>{$lang.add_time}</td>
<td><input name=”add_time” type=”text” id=”add_time” size=”20″ value='{$article.add_time}’ readonly=”readonly” /><input name=”selbtn1″ type=”button” id=”selbtn1″ onclick=”return showCalendar(‘add_time’, ‘%Y-%m-%d %H:%M’, ’24’, false, ‘selbtn1’);” value=”{$lang.btn_sel ect}” class=”button”/></td>
</tr>
<!–新加日期修改 结束–>2、打开 /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, description) “.
“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]’, ‘$_POST[description]’)”;
$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, description) “.
“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]’, ‘$_POST[description]’)”;
$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]’, description = ‘$_POST[description]'”, $_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]’, description = ‘$_POST[description]'”, $_POST[‘id’]))
猜你喜欢
-
如何实现ecshop批量添加商品到购物车
2021-02-04 -
ecshop无法删除分类的解决方法
2021-02-04 -
ecshop商品相册图片文件夹按年月日生成的方法
2021-02-04 -
ecshop教程:显示某商品销售累计效果的实现代码
2021-02-04 -
ecshop商品详情页添加任意字段的方法
2021-02-04 -
ecshop教程:添加前台切换颜色功能
2021-02-04 -
让ecshop首页中新品上市的商品下面出现购买和收藏两个按钮
2021-02-04 -
将ecshop网站模板邮箱地址替换为手机号码
2021-02-04 -
到底是否该购买ecshop授权
2021-02-04 -
ecshop商品详情页增加自定义title的方法
2021-02-04
-
修ecshop品牌筛选以LOGO图片形式显示
2021-02-04 -
Ecshop上传商品图片模糊缩略图不清晰的解决方法
2021-02-04 -
ecshop教程:编辑器kindeditor图片上传添加水印功能
2021-02-04 -
ecshop商店显示当前会员登陆价格
2021-02-04 -
ecshop商品列表页显示每个商品的品牌
2021-02-04 -
ECSHOP后台销售明细中增加收货人和收货地址的方法
2021-02-04 -
ecshop是如何控制产品的价格显示的
2021-02-04 -
ecshop教程:文章分类或ID自动取内容第一张图做为缩略图展示
2021-02-04 -
ecshop简化免登录用户的购物收货流量
2021-02-04 -
ecshop调用文章内图的方法总结
2021-02-04
猜你在找
常见问题FAQ
- 免费下载或者VIP会员专享资源能否直接商用?
- 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
- 提示下载完但解压或打开不了?
- 找不到素材资源介绍文章里的示例图片?
- 大资源网
- 2021-02-04Hi,初次和大家见面了,请多关照!
最后编辑:2021-02-04



