欢迎您光临10元资源网,本站秉承服务宗旨 履行“站长”责任,销售只是起点 服务永无止境!

ecshop后台文章加上日期时间的方法

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后台文章加上日期时间的方法

发表评论

售后服务:

  • 售后服务范围 1、商业模板使用范围内问题免费咨询
    2、源码安装、模板安装(一般 ¥200-1000)服务答疑仅限SVIP用户
    3、单价超过1000元的模板免费一次安装,需提供服务器信息。
    付费增值服务 1、提供dedecms模板、WordPress主题、discuz模板优化等服务请详询在线客服
    2、承接 WordPress、DedeCMS、Discuz 等系统建站、仿站、开发、定制等服务
    3、服务器环境配置(一般 ¥50-300)
    4、网站中毒处理(需额外付费,500元/次/质保三个月)
    售后服务时间 周一至周日(法定节假日除外) 9:00-23:00
    免责声明 本站所提供的模板(主题/插件)等资源仅供学习交流,若使用商业用途,请购买正版授权,否则产生的一切后果将由下载用户自行承担,有部分资源为网上收集或仿制而来,若模板侵犯了您的合法权益,请来信通知我们(Email: 263795763@qq.com),我们会及时删除,给您带来的不便,我们深表歉意!

Hi, 如果你对这款模板有疑问,可以跟我联系哦!

联系作者
';