您好!欢迎来到大秦朝旭拼单网官方站

大秦朝旭拼单网官方站

热门搜索: 友价    店铺转让    智企    知识产权    新媒   

ecshop后台文章加上日期时间的方法_拼单网

  • 二开教程
  • 来源:转载
  • 编辑:拼单网
  • 时间:2023-11-22 06:36
  • 阅读:503

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 (&#3广告买卖9;$_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']))

全部评论(0)
资讯详情页最新发布上方横幅
推荐阅读
  • 织梦安装教程(视频版)_拼单网
  • 织梦安装教程(视频版)_拼单网
  • 这个视频是专门录制给对于织梦系统还不太熟悉的朋友,直接发布的是的图文版的,这次是视频版也录制的非常详细。拼单网模板网用了视频录制的工具,录制好以后的是.lxe扩展名,传到优酷上发现无法转码。所以大家就下载下来看吧。如果看不清楚,可以下载原视频进行观看,视频下载地址:链接:https://pan.baidu.com/s/1dGoUDup密码:ze9x大家
  • 二开教程
  • 来源:转载
  • 编辑:拼单网
  • 时间:2024-03-13 21:58
  • 阅读:878
  • 织梦网站如何修改中英文模板的当前位置_拼单网
  • 织梦网站如何修改中英文模板的当前位置_拼单网
  • 织梦网站如何修改中英文模板的当前位置中文模版的当前位置:{dede:fieldname=position/}英文模版的当前位置:{dede:fieldname=positionrunphp=yes}&大秦朝旭nbsp;$b=array(”主页”);$c=array(”HOME”);@me=str_replac
  • 二开教程
  • 来源:转载
  • 编辑:拼单网
  • 时间:2024-03-13 21:44
  • 阅读:526
  • 织梦dedecms单独增加手机版搜索功能 不跳转到电脑版_拼单网
  • 织梦dedecms单独增加手机版搜索功能 不跳转到电脑版_拼单网
  • 1、找到plus下面的search.php复制该文件(注意,是复制一份不是修改名字),取名search_m.php打开search_m.php这个文件,找到require_once(DEDEINC.”/arc.searchview.class.php”);大概在13行拼单网%99%E9%95%BFv_j37v.html”>站长培训改成requi
  • 二开教程
  • 来源:转载
  • 编辑:拼单网
  • 时间:2024-03-13 21:40
  • 阅读:719
联系我们
Q Q:1005618718
电话:17792038992
邮箱:1005618718@qq.com
时间:09:00 - 19:00
平台客服