function content_55924c9073acb9_13404666($_smarty_tpl) { echo $_smarty_tpl->getSubTemplate("header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0); ?> <div class="page"> <div class="fixed-bar"> <div class="item-title"> <h3>积分产品</h3> <ul class="tab-base"> <li><a href="JavaScript:void(0);" class="current"><span>管理</span></a></li> <li><a href="<?php echo $_smarty_tpl->tpl_vars['COM']->value['ADMIN_URL']; ?> caifu/points/points_add/?loghash=<?php echo $_smarty_tpl->tpl_vars['COM']->value['LOGHASH']; ?> " ><span>新增</span></a></li> </ul> </div> </div> <div class="fixed-empty"></div> <table class="table tb-type2" id="prompt"> <tbody> <tr class="space odd"> <th colspan="12"><div class="title"> <h5>操作提示</h5> <span class="arrow"></span></div></th> </tr> <tr> <td><ul> <li>通过积分产品管理,你可以编辑、查看、删除积分产品信息</li> </ul></td> </tr> </tbody> </table> <form method="get" name="serachfrom" id="listfrom"> <input type="hidden" name="dosubmit" value="ok" /> <table class="table tb-type2 nobdb"> <thead> <tr class="thead"> <th> </th> <th>排序</th> <th colspan="2">商品名称</th> <th>参考市场价</th> <th>所需积分</th> <th>发布时间</th> <th class="align-center">操作</th> </tr> </thead> <tbody> <?php if ($_smarty_tpl->tpl_vars['infolist']->value) { ?> <?php $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['v']->_loop = false; $_from = $_smarty_tpl->tpl_vars['infolist']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) { $_smarty_tpl->tpl_vars['v']->_loop = true; ?> <tr class="hover edit"> <td class="w24"><input type="checkbox" name="del_id[]" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['id']; ?> " class="checkitem"></td> <td class="w48 sort"><input type="hidden" name="hdnid[]" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['id']; ?> " /><input type="text" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['listorder']; ?> " name="listorder[]" id="listorder[]" class="txt-short"></td> <td class="w60 picture"><div class="size-56x56"><span class="thumb size-56x56"><i></i><img src="<?php echo $_smarty_tpl->tpl_vars['COM']->value['BASE_URL']; echo remain_image_path($_smarty_tpl->tpl_vars['v']->value['points_image'], 'w'); ?> " onerror="this.src='<?php echo $_smarty_tpl->tpl_vars['COM']->value['BASE_URL']; ?> uploadfile/common/default_goods_image.gif_tiny.gif'" onload="javascript:DrawImage(this,56,56);"/></span></div></td> <td class="goods-name w270"><p><span class="editable-tarea tooltip" required="1" ajax_branch_textarea="name" fieldid="84" fieldname="name" nc_type="inline_edit_textarea"><?php echo $_smarty_tpl->tpl_vars['v']->value['name']; ?> </span></p></td> <td><?php echo $_smarty_tpl->tpl_vars['v']->value['market_price']; ?> </td> <td><?php echo $_smarty_tpl->tpl_vars['v']->value['points']; ?> </td> <td><?php echo date('Y-m-d H:i:s', $_smarty_tpl->tpl_vars['v']->value['post_time']); ?> </td> <td class="w96 align-center"><a href="<?php echo $_smarty_tpl->tpl_vars['COM']->value['ADMIN_URL']; ?> caifu/points/points_edit/?loghash=<?php echo $_smarty_tpl->tpl_vars['COM']->value['LOGHASH']; ?> &id=<?php echo $_smarty_tpl->tpl_vars['v']->value['id']; ?> ">编辑</a> | <a href="javascript:del('<?php echo $_smarty_tpl->tpl_vars['COM']->value['ADMIN_URL']; ?> caifu/points/points_del/?loghash=<?php echo $_smarty_tpl->tpl_vars['COM']->value['LOGHASH']; ?> ','del_id[]',<?php echo $_smarty_tpl->tpl_vars['v']->value['id']; ?> );">删除</a></td> </tr> <?php } ?> </tbody> <tfoot> <tr class="tfoot" id="dataFuncs"> <td><input type="checkbox" class="checkall" id="checkallBottom"></td> <td colspan="16" id="batchAction"><label for="checkallBottom">全选</label> <a class="btn" onclick="dodel('<?php echo $_smarty_tpl->tpl_vars['COM']->value['ADMIN_URL']; ?> caifu/points/points_del/?loghash=<?php echo $_smarty_tpl->tpl_vars['COM']->value['LOGHASH']; ?> ','del_id[]');" href="JavaScript:void(0);"><span>删除</span></a> <a href="JavaScript:void(0);" class="btn" onclick="doOrder('<?php echo $_smarty_tpl->tpl_vars['COM']->value['ADMIN_URL']; ?> caifu/points/points_order/?loghash=<?php echo $_smarty_tpl->tpl_vars['COM']->value['LOGHASH']; ?> ');"><span>排序</span></a> <?php echo $_smarty_tpl->tpl_vars['infopage']->value; ?> </tr> </tfoot> <?php } else { ?> <tfoot> <tr class="no_data"> <td colspan="10">没有符合条件的记录</td> </tr> </tbody> <?php } ?> </table> </form> </div> <?php echo $_smarty_tpl->getSubTemplate("footer.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0); }
/** * @webid 站点 * @return bool * @tid 摊位符号 */ function setcache_flash($webid, $tid) { if (!isset($CI)) { $CI =& get_instance(); } $CI->load->helper('global'); $CI->load->model('user'); $CI->load->model('market_booth'); $CI->load->model('goods'); $CI->load->model('shop'); $CI->load->model('market_regional'); $baseURL = base_url(); //获取用户id关联摊位 if (empty($tid)) { return 0; } $booth_info = $CI->market_booth->get_one(array('id' => $tid, 'sts' => 0, 'webid' => $webid), 'market_booth'); if (empty($booth_info)) { return 0; } $userid = $booth_info['userid']; $shop_info = $CI->shop->get_one(array('shop_id' => $userid)); $shop_name = substr($shop_info['shop_name'], 0, 44); $shop_id = $shop_info['shop_id']; //组装缓存数组 bcache $bcache['id'] = $tid; $bcache['siteid'] = $booth_info['siteid']; $bcache['number'] = $booth_info['boothnum']; $bcache['userid'] = $booth_info['userid']; $bcache['username'] = $booth_info['username']; $bcache['name'] = $shop_name; $bcache['detailPage'] = 'index.php?c=shop&shop_id=' . $shop_id; //$bcache['detailPage']=$shopdata['shop_domain'];//2级域名 //$bcache['uin']=$memberinfo['uin'];//用户IM后期扩展 //读取店铺产品 $bcache['products']['detailPage'] = 'index.php?c=shop&a=goods_list&shop_id=' . $userid; /****获取产品列表:首先取推荐并且带图片的商品,推荐没有到达六张,取最近发布的商品****/ $where_1 = 'shop_id =' . $userid . ' and goods_commend = 1 '; $where_2 = 'and goods_show = 1 and goods_starttime <= ' . time() . ' and goods_endtime >= ' . time() . ' and sts = 0 and goods_state = 0 and length(goods_image) > 2 order by goods_id desc limit 6'; $pro_commend_list = $CI->goods->get_query($where_1 . $where_2, 'goods'); $pro_commend_count = count($pro_commend_list); $product_arr = array(); foreach ($pro_commend_list as $k => $v) { $imgurl = empty($v['goods_image']) ? "" : $v['goods_image']; $imgurl = remain_image_path($imgurl, 's'); //获取缩略图路径 $url = 'index.php?c=shop&a=goods&goods_id=' . $v['goods_id'] . '&shop_id=' . $shop_info['shop_id']; $product_arr[$k] = array('url' => $url, 'image' => $imgurl, 'ishttp' => 1); //$keyword.=$pro_info['keywords'].','; } //小于6商机推荐的商品没有达到6个,取最近发布的商品 if ($pro_commend_count < 6) { $where_3 = 'shop_id =' . $userid . ' and goods_commend = 0 '; $pro_news_list = $CI->goods->get_query($where_3 . $where_2, 'goods'); $i = $pro_commend_count; foreach ($pro_news_list as $v) { if ($i < 6) { $imgurl = empty($v['goods_image']) ? "" : $v['goods_image']; $imgurl = remain_image_path($imgurl, 's'); //获取缩略图路径 $url = 'index.php?c=shop&a=goods&goods_id=' . $v['goods_id'] . '&shop_id=' . $shop_info['shop_id']; $product_arr[$i] = array('url' => $url, 'image' => $imgurl, 'ishttp' => 1); } $i++; } } $bcache['products']['product'] = $product_arr; $return = setcache('booth_' . $webid . '_' . $tid, $bcache, 'booth', 'file', '0', 'array'); if ($return) { return '1'; } else { return '0'; } }
function content_555070772f9334_96582517($_smarty_tpl) { echo $_smarty_tpl->getSubTemplate("header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0); ?> <script type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['JS_PATH']->value; ?> admin.tools.js"></script> <div class="page"> <div class="fixed-bar"> <div class="item-title"> <h3>文章管理</h3> <ul class="tab-base"> <li><a href="<?php echo $_smarty_tpl->tpl_vars['COM']->value['ADMIN_URL']; ?> content/article/lists?loghash=<?php echo $_smarty_tpl->tpl_vars['COM']->value['LOGHASH']; ?> "><span>管理</span></a></li> <li><a href="JavaScript:void(0);" class="current"><span>新增</span></a></li> </ul> </div> </div> <div class="fixed-empty"></div> <form id="article_form" method="post" name="articleForm" enctype="multipart/form-data" > <input type="hidden" name="dosubmit" value="ok" /> <input type="hidden" name="codetype" value="<?php echo $_smarty_tpl->tpl_vars['codetype']->value; ?> " /> <table class="table tb-type2 nobdb"> <tbody> <tr class="noborder"> <td colspan="2" class="required"><label class="validation">标题:</label></td> </tr> <tr class="noborder"> <td class="vatop rowform"><input type="text" value="" name="article_title" id="article_title" class="txt"></td> <td class="vatop tips"></td> </tr> <tr> <td colspan="2" class="required"><label class="validation" for="cate_id">所属分类:</label></td> </tr> <tr class="noborder"> <td class="vatop rowform"><select name="ac_id" id="ac_id"> <option value="">请选择...</option> <?php $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['v']->_loop = false; $_from = $_smarty_tpl->tpl_vars['ac_list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) { $_smarty_tpl->tpl_vars['v']->_loop = true; ?> <option value="<?php echo $_smarty_tpl->tpl_vars['v']->value['ac_id']; ?> " ><?php if ($_smarty_tpl->tpl_vars['v']->value['floor'] == 1) { ?> <?php } echo $_smarty_tpl->tpl_vars['v']->value['ac_name']; ?> </option> <?php } ?> </select></td> <td class="vatop tips"></td> </tr> <tr> <td colspan="2" class="required"><label for="article_focus">首页焦点图:</label></td> </tr> <tr class="noborder"> <td class="vatop rowform"><span class="type-file-show"><img class="show_image" src="<?php echo $_smarty_tpl->tpl_vars['IMG_PATH']->value; ?> preview.png"> <div class="type-file-preview"><img src="" ></div> </span><span class="type-file-box"> <input name="article_focus" type="file" class="type-file-file" id="article_focus" size="30" hidefocus="true" > </span></td> <td class="vatop tips">108px * 144px</td> </tr> <tr> <td colspan="2" class="required"><label for="acticle_logo">缩略图:</label></td> </tr> <tr class="noborder"> <td class="vatop rowform"><span class="type-file-show"><img class="show_image" src="<?php echo $_smarty_tpl->tpl_vars['IMG_PATH']->value; ?> preview.png"> <div class="type-file-preview"><img src="" ></div> </span><span class="type-file-box"> <input name="acticle_logo" type="file" class="type-file-file" id="acticle_logo" size="30" hidefocus="true" > </span></td> <td class="vatop tips">164px * 123px</td> </tr> <tr> <td colspan="2" class="required"><label for="articleForm">链接:</label></td> </tr> <tr class="noborder"> <td class="vatop rowform"><input type="text" value="" name="article_url" id="article_url" class="txt"></td> <td class="vatop tips">当填写"链接"后点击文章标题将直接跳转至链接地址,不显示文章内容。链接格式请以http://开头</td> </tr> <tr> <td colspan="2" class="required"><label>首页推荐:</label></td> </tr> <tr class="noborder"> <td class="vatop rowform onoff"><label for="isrecommend1" class="cb-enable" ><span>是</span></label> <label for="isrecommend0" class="cb-disable selected" ><span>否</span></label> <input id="isrecommend1" name="isrecommend" value="1" type="radio"> <input id="isrecommend0" name="isrecommend" checked="checked" value="0" type="radio"></td> <td class="vatop tips"></td> </tr> <tr> <td colspan="2" class="required"><label>是否显示:</label></td> </tr> <tr class="noborder"> <td class="vatop rowform onoff"><label for="article_show1" class="cb-enable selected" ><span>是</span></label> <label for="article_show0" class="cb-disable" ><span>否</span></label> <input id="article_show1" name="article_show" checked="checked" value="1" type="radio"> <input id="article_show0" name="article_show" value="0" type="radio"></td> <td class="vatop tips"></td> </tr> <tr> <td colspan="2" class="required">排序: </tr> <tr class="noborder"> <td class="vatop rowform"><input type="text" value="255" name="article_sort" id="article_sort" class="txt"></td> <td class="vatop tips"></td> </tr> <tr> <td colspan="2" class="required"><label class="validation">文章内容:</label></td> </tr> <tr class="noborder"> <td colspan="2" class="vatop rowform"><textarea id="article_content" name="article_content" style="width:700px;height:300px;visibility:hidden;"></textarea> <script src="<?php echo $_smarty_tpl->tpl_vars['IMG_PATH']->value; ?> kindeditor/kindeditor-min.js" charset="utf-8"></script> <script src="<?php echo $_smarty_tpl->tpl_vars['IMG_PATH']->value; ?> kindeditor/lang/zh_CN.js" charset="utf-8"></script> <script> var KE; KindEditor.ready(function(K) { KE = K.create("textarea[name='article_content']", { items : ['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste', 'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript', '|', 'selectall', 'clearhtml','quickformat','|', 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|'/*, 'image'*/, 'table', 'hr', 'emoticons', 'link', 'unlink', '|', 'about'], cssPath : "<?php echo $_smarty_tpl->tpl_vars['JS_PATH']->value; ?> kindeditor/themes/default/default.css", allowImageUpload : true, allowFlashUpload : false, allowMediaUpload : false, allowFileManager : false, syncType:"form", afterCreate : function() { var self = this; self.sync(); }, afterChange : function() { var self = this; self.sync(); }, afterBlur : function() { var self = this; self.sync(); } }); KE.appendHtml = function(id,val) { this.html(this.html() + val); if (this.isCreated) { var cmd = this.cmd; cmd.range.selectNodeContents(cmd.doc.body).collapse(false); cmd.select(); } return this; } }); </script> </td> </tr> <tr> <td colspan="2" class="required">图片上传:</td> </tr> <tr class="noborder"> <td class="y-bg" > <iframe src="<?php echo $_smarty_tpl->tpl_vars['COM']->value['ADMIN_URL']; ?> com/comupload/public_upload_one?btnname=上传图片&instance=article_content&filedir=article" style="width:90px;height:30px;" scrolling="no" frameborder="0" ></iframe> </td> </tr> <tr> <td colspan="2" class="required">已传图片:</td> </tr> <tr class="noborder"> <td colspan="2"> <ul id="thumbnails" class="thumblists"> <?php if (isset($_smarty_tpl->tpl_vars['upload']->value)) { $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['v']->_loop = false; $_from = $_smarty_tpl->tpl_vars['upload']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) { $_smarty_tpl->tpl_vars['v']->_loop = true; ?> <li id="<?php echo $_smarty_tpl->tpl_vars['v']->value['file_id']; ?> " class="picture" > <input type="hidden" name="file_id[]" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['file_id']; ?> " /> <div class="size-64x64"><span class="thumb size-64x64"><i></i><img src="<?php echo $_smarty_tpl->tpl_vars['COM']->value['BASE_URL']; echo remain_image_path($_smarty_tpl->tpl_vars['v']->value['filepath'], 'w'); ?> " alt="<?php echo $_smarty_tpl->tpl_vars['v']->value['realname']; ?> " onload="javascript:DrawImage(this,64,64);"/></span></div> <p><span><a href="javascript:insert_editor('<?php echo $_smarty_tpl->tpl_vars['COM']->value['BASE_URL']; echo $_smarty_tpl->tpl_vars['v']->value['filepath']; ?> ');">插入</a></span><span><a href="javascript:del_file_upload('<?php echo $_smarty_tpl->tpl_vars['v']->value['file_id']; ?> ');">删除</a></span></p> </li> <?php } } ?> </ul> </td> </tr> <script type="text/javascript"> // 模拟网站LOGO上传input type='file'样式 $(function(){ var textButton="<input type='text' name='textfield' id='textfield1' class='type-file-text' /><input type='button' name='button' id='button1' value='' class='type-file-button' />" $(textButton).insertBefore("#acticle_logo"); $("#acticle_logo").change(function(){ $("#textfield1").val($("#acticle_logo").val()); }); var textButton2="<input type='text' name='textfield2' id='textfield2' class='type-file-text' /><input type='button' name='button2' id='button2' value='' class='type-file-button' />" $(textButton2).insertBefore("#article_focus"); $("#article_focus").change(function(){ $("#textfield2").val($("#article_focus").val()); }); // 上传图片类型 $('input[class="type-file-file"]').change(function(){ var filepatd=$(this).val(); var extStart=filepatd.lastIndexOf("."); var ext=filepatd.substring(extStart,filepatd.lengtd).toUpperCase(); if(ext!=".PNG"&&ext!=".GIF"&&ext!=".JPG"&&ext!=".JPEG"){ alert("图片限于png,gif,jpeg,jpg格式"); $(this).attr('value',''); return false; } }); }); </script> <script type="text/javascript"> var SITE_URL = "<?php echo $_smarty_tpl->tpl_vars['COM']->value['ADMIN_URL']; ?> "; var WEB_URL = "<?php echo $_smarty_tpl->tpl_vars['COM']->value['BASE_URL']; ?> "; var LOGHASH = "<?php echo $_smarty_tpl->tpl_vars['COM']->value['LOGHASH']; ?> "; function do_uploadedfile(file_data){ file_data = jQuery.parseJSON(file_data); if(file_data.state == 'true') { var fid=file_data.instance; var newImg = '<li id="' + file_data.file_id + '" class="picture"><input type="hidden" name="file_id[]" value="' + file_data.file_id + '" /><div class="size-64x64"><span class="thumb size-64x64"><i></i><img src="' + WEB_URL+'/'+file_data.filepath + '" alt="' + file_data.filename + '" width="64px" height="64px"/></span></div><p><span><a href="javascript:insert_editor(\'' + WEB_URL+'/'+file_data.filepath + '\');">插入</a></span><span><a href="javascript:del_file_upload(' + file_data.file_id + ');">删除</a></span></p></li>'; $('#thumbnails').prepend(newImg); } } function insert_editor(file_path){ KE.appendHtml('article_content', '<img src="'+ file_path + '" alt="'+ file_path + '">'); } function del_file_upload(file_id) { if(!window.confirm('您确定要删除吗?')){ return; } $.getJSON('<?php echo $_smarty_tpl->tpl_vars['COM']->value['ADMIN_URL']; ?> market/booth/ajax_market_file_del?file_id=' + file_id+'&loghash=<?php echo $_smarty_tpl->tpl_vars['COM']->value['LOGHASH']; ?> ', function(result){ if(result){ $('#' + file_id).remove(); }else{ alert('删除失败'); } }); } </script> </tbody> <tfoot> <tr class="tfoot"> <td colspan="15" ><a href="JavaScript:void(0);" class="btn" id="submitBtn"><span>提交</span></a></td> </tr> </tfoot> </table> </form> </div> <script> //按钮先执行验证再提交表单 $(function(){$("#submitBtn").click(function(){ if($("#article_form").valid()){ $("#article_form").submit(); } }); }); // $(document).ready(function(){ $('#article_form').validate({ errorPlacement: function(error, element){ error.appendTo(element.parent().parent().prev().find('td:first')); }, success: function(label){ label.addClass('valid'); }, onfocusout : false, onkeyup : false, rules : { article_title : { required : true }, ac_id : { required : true }, article_url : { url : true }, article_content : { required : true }, article_sort : { number : true } }, messages : { article_title : { required : '文章标题不能为空' }, ac_id : { required : '文章分类不能为空' }, article_url : { url : '链接格式不正确' }, article_content : { required : '文章内容不能为空' }, article_sort : { number : '文章排序仅能为数字' } } }); }); </script> <?php echo $_smarty_tpl->getSubTemplate("footer.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0); }
function content_5493e4461b3b38_76161191($_smarty_tpl) { echo $_smarty_tpl->getSubTemplate("header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0); ?> <div class="page"> <div class="fixed-bar"> <div class="item-title"> <h3>系统文章</h3> <ul class="tab-base"> <li><a href="<?php echo $_smarty_tpl->tpl_vars['COM']->value['ADMIN_URL']; ?> content/document/lists?loghash=<?php echo $_smarty_tpl->tpl_vars['COM']->value['LOGHASH']; ?> "><span>管理</span></a></li> </ul> </div> </div> <div class="fixed-empty"></div> <form id="doc_form" method="post"> <input type="hidden" name="dosubmit" value="ok" /> <input type="hidden" name="doc_id" value="<?php echo $_smarty_tpl->tpl_vars['doc']->value['doc_id']; ?> " /> <table class="table tb-type2 nobdb"> <tbody> <tr> <td colspan="2" class="required"><label class="validation">标题: </label></td> </tr> <tr class="noborder"> <td class="vatop rowform"><input type="text" value="<?php echo $_smarty_tpl->tpl_vars['doc']->value['doc_title']; ?> " name="doc_title" id="doc_title" class="infoTableInput"></td> <td class="vatop tips"></td> </tr> <tr> <td colspan="2" class="required"><label class="validation">文章内容: </label></td> </tr> <tr class="noborder"> <td class="vatop rowform"><textarea id="doc_content" name="doc_content" style="width:700px;height:300px;visibility:hidden;"><?php echo $_smarty_tpl->tpl_vars['doc']->value['doc_content']; ?> </textarea> <script src="<?php echo $_smarty_tpl->tpl_vars['IMG_PATH']->value; ?> kindeditor/kindeditor-min.js" charset="utf-8"></script> <script src="<?php echo $_smarty_tpl->tpl_vars['IMG_PATH']->value; ?> kindeditor/lang/zh_CN.js" charset="utf-8"></script> <script> var KE; KindEditor.ready(function(K) { KE = K.create("textarea[name='doc_content']", { items : ['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste', 'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript', '|', 'selectall', 'clearhtml','quickformat','|', 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|'/*, 'image'*/, 'table', 'hr', 'emoticons', 'link', 'unlink', '|', 'about'], cssPath : "<?php echo $_smarty_tpl->tpl_vars['JS_PATH']->value; ?> kindeditor/themes/default/default.css", allowImageUpload : true, allowFlashUpload : false, allowMediaUpload : false, allowFileManager : false, syncType:"form", afterCreate : function() { var self = this; self.sync(); }, afterChange : function() { var self = this; self.sync(); }, afterBlur : function() { var self = this; self.sync(); } }); KE.appendHtml = function(id,val) { this.html(this.html() + val); if (this.isCreated) { var cmd = this.cmd; cmd.range.selectNodeContents(cmd.doc.body).collapse(false); cmd.select(); } return this; } }); </script> </td> <td class="vatop tips"></td> </tr> <tr> <td colspan="2" class="required">图片上传:</td> </tr> <tr class="noborder"> <td class="y-bg" > <iframe src="<?php echo $_smarty_tpl->tpl_vars['COM']->value['ADMIN_URL']; ?> com/comupload/public_upload_one?btnname=上传图片&instance=document_content&filedir=document" style="width:90px;height:30px;" scrolling="no" frameborder="0" ></iframe> </td> </tr> <tr> <td colspan="2" class="required">已传图片:</td> </tr> <tr class="noborder"> <td colspan="2"> <ul id="thumbnails" class="thumblists"> <?php if (isset($_smarty_tpl->tpl_vars['file_list']->value)) { $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['v']->_loop = false; $_from = $_smarty_tpl->tpl_vars['file_list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) { $_smarty_tpl->tpl_vars['v']->_loop = true; ?> <li id="<?php echo $_smarty_tpl->tpl_vars['v']->value['file_id']; ?> " class="picture" > <input type="hidden" name="file_id[]" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['file_id']; ?> " /> <div class="size-64x64"><span class="thumb size-64x64"><i></i><img src="<?php echo $_smarty_tpl->tpl_vars['COM']->value['BASE_URL']; echo remain_image_path($_smarty_tpl->tpl_vars['v']->value['filepath'], 'w'); ?> " alt="<?php echo $_smarty_tpl->tpl_vars['v']->value['realname']; ?> " onload="javascript:DrawImage(this,64,64);"/></span></div> <p><span><a href="javascript:insert_editor('<?php echo $_smarty_tpl->tpl_vars['COM']->value['BASE_URL']; echo $_smarty_tpl->tpl_vars['v']->value['filepath']; ?> ');">插入</a></span><span><a href="javascript:del_file_upload('<?php echo $_smarty_tpl->tpl_vars['v']->value['file_id']; ?> ');">删除</a></span></p> </li> <?php } } ?> </ul> </td> </tr> <script type="text/javascript"> var SITE_URL = "<?php echo $_smarty_tpl->tpl_vars['COM']->value['ADMIN_URL']; ?> "; var WEB_URL = "<?php echo $_smarty_tpl->tpl_vars['COM']->value['BASE_URL']; ?> "; var LOGHASH = "<?php echo $_smarty_tpl->tpl_vars['COM']->value['LOGHASH']; ?> "; function do_uploadedfile(file_data){ file_data = jQuery.parseJSON(file_data); if(file_data.state == 'true') { var fid=file_data.instance; var newImg = '<li id="' + file_data.file_id + '" class="picture"><input type="hidden" name="file_id[]" value="' + file_data.file_id + '" /><div class="size-64x64"><span class="thumb size-64x64"><i></i><img src="' + WEB_URL+'/'+file_data.filepath + '" alt="' + file_data.filename + '" width="64px" height="64px"/></span></div><p><span><a href="javascript:insert_editor(\'' + WEB_URL+'/'+file_data.filepath + '\');">插入</a></span><span><a href="javascript:del_file_upload(' + file_data.file_id + ');">删除</a></span></p></li>'; $('#thumbnails').prepend(newImg); } } function insert_editor(file_path){ KE.appendHtml('article_content', '<img src="'+ file_path + '" alt="'+ file_path + '">'); } function del_file_upload(file_id) { if(!window.confirm('您确定要删除吗?')){ return; } $.getJSON('<?php echo $_smarty_tpl->tpl_vars['COM']->value['ADMIN_URL']; ?> market/booth/ajax_market_file_del?file_id=' + file_id+'&loghash=<?php echo $_smarty_tpl->tpl_vars['COM']->value['LOGHASH']; ?> ', function(result){ if(result){ $('#' + file_id).remove(); }else{ alert('删除失败'); } }); } </script> </tbody> <tfoot> <tr class="tfoot"> <td colspan="15" ><a href="JavaScript:void(0);" class="btn" id="submitBtn"><span>提交</span></a></td> </tr> </tfoot> </table> </form> </div> <script> //按钮先执行验证再提交表单 $(function(){$("#submitBtn").click(function(){ if($("#doc_form").valid()){ $("#doc_form").submit(); } }); }); // $(document).ready(function(){ $('#doc_form').validate({ errorPlacement: function(error, element){ error.appendTo(element.parent().parent().prev().find('td:first')); }, success: function(label){ label.addClass('valid'); }, onfocusout : false, onkeyup : false, rules : { doc_title : { required : true }, doc_content : { required : true } }, messages : { doc_title : { required : '文章标题不能为空' }, doc_content : { required : '文章内容不能为空' } } }); }); </script> <?php echo $_smarty_tpl->getSubTemplate("footer.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0); ?> <?php }