您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程
ecshop文章信息添加时间的修改方法
李具匡2024-01-16 21:40:36ecshop商城教程已有人查阅
导读ecshop实现后台文章信息可以修改添加时间的方法。有时我们希望将过去发布的新闻改成今天发布的,或者是今天发布的文章,希望改成是过去发布的,ECSHOP教
ecshop实现后台文章信息可以修改添加时间的方法。有时我们希望将过去发布的新闻改成今天发布的,或者是今天发布的文章,希望改成是过去发布的,代码号今天就分享这个方法。
步骤一:
1,打开 /admin/templates/article_info.htm 文件,加一个修改时间
在第三行下面加入调用日历JS代码
找到
步骤一:
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']))
OK了!
本文标签:
很赞哦! ()
相关文章
随机图文
ecshop商品列表商品按商品货号排序
今天看到一网友问此类问题,稍微写了些,希望能帮到同样有此需求的朋友下面过程是在 BigSale 模板基础上实现的,其他模板方法原理是一样的ecshop商品评论30秒时间限制的删除方法
如果商品评论或留言 没有启用验证码的话,ECSHOP默认有30秒的限制,也就是两次评论之间需要间隔30秒。有的店长建站之初ecshop结构数据说明
一、 文件夹功能说明1 、根目录:前台程序文件2 、admin :后台程序文件夹- 根目录:后台程序文件 *.php 文件-help/zh_cn :各功能的帮助文件 *.xml 文件-images :后台页面用图ecshop广告链接地址去掉affiche.php改为直连的方法
相信很多用过ECSHOP的站长都知道,ECSHOP的广告链接地址形式为“affiche.php?ad_id=1&uri=http%3A%2F%2Fwww.ebingou.cn”
留言与评论 (共有 条评论) |