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

大秦朝旭拼单网官方站

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

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

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

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)
资讯详情页最新发布上方横幅
推荐阅读
  • 友价源码分词搜索技术如何实现
  • 友价源码分词搜索技术如何实现
  • 联系客服安装分词插件后,再申请一个APIKEY(目前该接口是免费的)https://www.showapi.com/apiGateway/view/2691、将客服提供的插件文件,放在你的后台目录下2、进入后台,点击广告互动,有个其他广告点下,找到插件入口,添加3、路径写chajian_fenci.php名称随便写(如分词)4、再点击上面的插件专区,将你的APIKEY填入即可
  • 友价教程
  • 来源:转载
  • 编辑:拼单网
  • 时间:2025-06-30 03:06
  • 阅读:420
  • 友价源码如何集成阿里云OSS功能
  • 友价源码如何集成阿里云OSS功能
  • 前言:阿里云OSS是指把数据存在阿里云上面的一个空间体系,举个例子,开通这个OSS功能后,你可以把商品的一些数据包放在这上面,而不是存在自己的空间或服务器,这样用户在下载时,就不会占用你服务器的带宽。【附:PHP版本必须为5.3或以上,如果你的平台能用阿里通信发短信了,就说明已经是5.3或以上】1、登录阿里云,www.aliyun.com,进入控制台,点击左侧的对象存储OSS,如果没有,请看第二步2、如果能看到第一步红框里的链接,请跳过
  • 友价教程
  • 来源:转载
  • 编辑:拼单网
  • 时间:2025-06-30 02:54
  • 阅读:507
  • 友价源码使用腾讯云OSS时,报错解决方法
  • 友价源码使用腾讯云OSS时,报错解决方法
  • 请先下载腾讯云的PHPSDK包,然后在你的config目录下,新建一个文件夹,名称为tencentoss,再把下载的压缩包解压进去。(联系客服获取腾讯OSS压缩包)报错1:“Fatalerror:Composerdetectedissuesinyourplatform:YourComposerdependenciesrequireaPHPversion">=7.2.5".
  • 环境配置
  • 来源:转载
  • 编辑:拼单网
  • 时间:2025-06-30 02:50
  • 阅读:470
  • 之前已经申请了H5支付宝接口的,如何添加支付宝的新版电脑接口
  • 之前已经申请了H5支付宝接口的,如何添加支付宝的新版电脑接口
  • 本文是针对已经申请过支付宝H5接口的,并且已经在友价系统的后台填写好支付宝参数的用户,如果你没有申请过支付宝H5接口并配置的话,【点击查看友价源码如何申请支付宝新接口】。如果之前申请过支付宝H5接口,现在只需要开通电脑端的新支付接口的话,继续往下看就行:1、进支付宝开放平台,https://open.alipay.com/2、登录进去,找到之前H5接口的那个应用,如下图。点击对应的应用。3、点击添加能力,确保手机支付和网站支付都已经勾选
  • 友价教程
  • 来源:转载
  • 编辑:拼单网
  • 时间:2025-06-30 02:49
  • 阅读:509
联系我们
Q Q:1005618718
电话:17792038992
邮箱:1005618718@qq.com
时间:09:00 - 19:00
平台客服