人人商城

article.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. {template 'common/header'}
  2. <ul class="nav nav-tabs">
  3. <li {if $do == 'post'}class="active"{/if}><a href="{php echo url('site/article/post');}">添加文章</a></li>
  4. <li {if $do == 'display'}class="active"{/if}><a href="{php echo url('site/article/display');}">文章列表</a></li>
  5. </ul>
  6. <style>
  7. .table td span{display:inline-block;margin-top:4px;}
  8. .table td input{margin-bottom:0;}
  9. </style>
  10. {if $do == 'display'}
  11. <div class="panel panel-info">
  12. <div class="panel-heading">筛选</div>
  13. <div class="panel-body">
  14. <form action="./index.php" method="get" class="form-horizontal" role="form">
  15. <input type="hidden" name="a" value="article" />
  16. <input type="hidden" name="c" value="site" />
  17. <input type="hidden" name="do" value="display" />
  18. <div class="form-group">
  19. <label class="col-xs-12 col-sm-2 col-md-2 control-label">关键字</label>
  20. <div class="col-sm-8 col-md-8 col-lg-8 col-xs-12">
  21. <input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}">
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. <label class="col-xs-12 col-sm-2 col-md-2 control-label">文章分类</label>
  26. <div class="col-sm-8 col-md-8 col-lg-8 col-xs-12">
  27. {php echo tpl_form_field_category_2level('category', $parent, $children, $_GPC['category']['parentid'], $_GPC['category']['childid']);}
  28. </div>
  29. <div class="pull-right col-xs-12 col-sm-2 col-md-2 col-lg-2">
  30. <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
  31. </div>
  32. </div>
  33. </form>
  34. </div>
  35. </div>
  36. <div class="panel panel-default">
  37. <div class="table-responsive panel-body">
  38. <table class="table">
  39. <thead>
  40. <tr>
  41. <th style="width:50px">排序</th>
  42. <th>标题</th>
  43. <th style="width:180px;">属性</th>
  44. <th style="width:200px; text-align:right;">操作</th>
  45. </tr>
  46. </thead>
  47. <tbody>
  48. {loop $list $item}
  49. <tr>
  50. <td>{if !empty($item['pcate'])}<span>{$item['displayorder']}</span>{else}{$item['displayorder']}{/if}</td>
  51. <td>
  52. {if !empty($item['pcate'])}<span class="text-error">[{$category[$item['pcate']]['name']}]</span>{/if}{if !empty($item['ccate'])}<span class="text-info">[{$category[$item['ccate']]['name']}]</span>{/if}
  53. <a href="{php echo url('site/article/post/', array('id' => $item['id']))}" style="color:#333;">{$item['title']}</a>
  54. </td>
  55. <td>
  56. {if $item['ishot']}<span class="label label-success">头条</span>{/if}
  57. {if $item['iscommend']}<span class="label label-warning">推荐</span>{/if}
  58. </td>
  59. <td style="text-align:right; position:relative;">
  60. <a href="javascript:;" data-url="{php echo murl('site/site/detail', array('id' => $item['id']), true, true)}" class="js-clip" title="复制链接">复制链接</a>&nbsp;-&nbsp;
  61. <a href="{php echo url('site/article/post', array('id' => $item['id']))}" title="编辑">编辑</a>&nbsp;-&nbsp;
  62. <a onclick="return confirm('此操作不可恢复,确认吗?'); return false;" href="{php echo url('site/article/delete', array('id' => $item['id']))}" title="删除">删除</a>
  63. </td>
  64. </tr>
  65. {/loop}
  66. </tbody>
  67. </table>
  68. </div>
  69. </div>
  70. {$pager}
  71. <script type="text/javascript">
  72. var category = {php echo json_encode($children)};
  73. </script>
  74. {elseif $do == 'post'}
  75. <div class="clearfix">
  76. <form class="form-horizontal form" action="" method="post" enctype="multipart/form-data">
  77. <div class="panel panel-default">
  78. <div class="panel-heading">文章管理</div>
  79. <div class="panel-body">
  80. <input type="hidden" name="id" value="{$item[id]}">
  81. {if !empty($item) && empty($item['linkurl']) && $id > 0}
  82. <div class="form-group">
  83. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">访问地址</label>
  84. <div class="col-sm-8 col-xs-12">
  85. <p class="form-control-static"><a href="{$_W['siteroot']}/app/index.php?c=site&a=site&do=detail&id={$item['id']}&i={$_W['uniacid']}" target="_blank">{$_W['siteroot']}/app/index.php?c=site&a=site&do=detail&id={$item['id']}&i={$_W['uniacid']}</a></p>
  86. <div class="help-block">您可以根据此地址,添加回复规则,设置访问。</div>
  87. </div>
  88. </div>
  89. {/if}
  90. <div class="form-group">
  91. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">排序</label>
  92. <div class="col-sm-8 col-xs-12">
  93. <input type="text" class="form-control" placeholder="" name="displayorder" value="{$item['displayorder']}">
  94. <span class="help-block">文章的显示顺序,越大则越靠前</span>
  95. </div>
  96. </div>
  97. <div class="form-group">
  98. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">标题</label>
  99. <div class="col-sm-8 col-xs-12">
  100. <input type="text" class="form-control" placeholder="" name="title" value="{$item['title']}">
  101. </div>
  102. </div>
  103. <div class="form-group">
  104. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">文章触发关键字</label>
  105. <div class="col-sm-8 col-xs-12">
  106. <input type="text" class="form-control" placeholder="" name="keyword" value="{$keywords}">
  107. <div class="help-block">添加关键字以后,系统将生成一条图文规则,用户可以通过输入关键字来阅读文章。多个关键字请用英文“,”隔开</div>
  108. </div>
  109. </div>
  110. <div class="form-group">
  111. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">自定义属性</label>
  112. <div class="col-sm-8 col-xs-12">
  113. <label class="checkbox-inline"><input type="checkbox" name="option[hot]" value="1" {if $item['ishot']} checked{/if}> 头条[h]</label>
  114. <label class="checkbox-inline"><input type="checkbox" name="option[commend]" value="1" {if $item['iscommend']} checked{/if}> 推荐[c]</label>
  115. </div>
  116. </div>
  117. <div class="form-group">
  118. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">文章来源</label>
  119. <div class="col-sm-8 col-xs-12">
  120. <input type="text" class="form-control" placeholder="" name="source" value="{$item['source']}">
  121. </div>
  122. </div>
  123. <div class="form-group">
  124. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">文章作者</label>
  125. <div class="col-sm-8 col-xs-12">
  126. <input type="text" class="form-control" id="writer" name="author" value="{$item['author']}">
  127. </div>
  128. </div>
  129. <div class="form-group">
  130. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">缩略图</label>
  131. <div class="col-sm-8 col-xs-12">
  132. {php echo tpl_form_field_image('thumb', $item['thumb'])}
  133. </div>
  134. </div>
  135. <div class="form-group">
  136. <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
  137. <div class="col-sm-9 col-xs-12">
  138. <label>
  139. 封面(大图片建议尺寸:360像素 * 200像素)
  140. </label>
  141. </div>
  142. </div>
  143. <div class="form-group">
  144. <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
  145. <div class="col-sm-9 col-xs-12">
  146. <label class="checkbox-inline">
  147. <input type="checkbox" name="incontent" value="1" {if !empty($item['incontent'])} checked="checked" {/if} /> 封面图片显示在正文中
  148. </label>
  149. </div>
  150. </div>
  151. <div class="form-group">
  152. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">文章类别</label>
  153. <div class="col-sm-8 col-xs-12">
  154. {php echo tpl_form_field_category_2level('category', $parent, $children, $pcate, $ccate)}
  155. </div>
  156. </div>
  157. <div class="form-group">
  158. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">选择内容模板</label>
  159. <div class="col-sm-8 col-xs-12">
  160. <select name="template" class="form-control">
  161. <option value="">使用默认设置</option>
  162. {loop $template $v}
  163. <option value="{$v['name']}"{if $item['template'] == $v['name']} selected{/if}>{$v['title']}</option>
  164. {/loop}
  165. </select>
  166. </div>
  167. </div>
  168. <div class="form-group">
  169. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">简介</label>
  170. <div class="col-sm-8 col-xs-12">
  171. <textarea class="form-control" name="description" rows="5">{$item['description']}</textarea>
  172. </div>
  173. </div>
  174. <div class="form-group">
  175. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label"></label>
  176. <div class="col-sm-8">
  177. <div class="help-block"><label class="checkbox-inline"><input type="checkbox" name="autolitpic" value="1"{if empty($item['thumb'])} checked="true"{/if}>提取内容的第一个图片为缩略图</label></div>
  178. </div>
  179. </div>
  180. <div class="form-group">
  181. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">内容</label>
  182. <div class="col-sm-8 col-xs-12">
  183. {php echo tpl_ueditor('content', $item['content']);}
  184. </div>
  185. </div>
  186. <div class="form-group">
  187. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">直接链接</label>
  188. <div class="col-sm-8 col-xs-12">
  189. {php echo tpl_form_field_link('linkurl', $item['linkurl']);}
  190. </div>
  191. </div>
  192. <div class="form-group">
  193. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">阅读次数</label>
  194. <div class="col-sm-8 col-xs-12">
  195. <input type="text" name="click" value="{$item['click']}" class="form-control"/>
  196. <div class="help-block">默认为0。您可以设置一个初始值,阅读次数会在该初始值上增加。</div>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <div class="panel panel-default">
  202. <div class="panel-heading">积分设置</div>
  203. <div class="panel-body">
  204. <div class="form-group">
  205. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">是否赠送积分</label>
  206. <div class="col-sm-8 col-xs-12">
  207. <label class="radio-inline"><input type="radio" name="credit[status]" value="1" {if $item['credit']['status'] == 1} checked{/if} id="credit1"> 赠送</label>
  208. <label class="radio-inline"><input type="radio" name="credit[status]" value="0" {if $item['credit']['status'] == 0} checked{/if} id="credit0"> 不赠送</label>
  209. <span class="help-block">设置赠送积分后,粉丝在分享时赠送积分.粉丝的好友在点击阅读时,也会赠送积分</span>
  210. </div>
  211. </div>
  212. <div id="credit-status1" {if $item['credit']['status'] == 1}style="display:block"{else}style="display:none"{/if}>
  213. <div class="form-group">
  214. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">赠送积分上限</label>
  215. <div class="col-sm-8 col-xs-12">
  216. <input type="text" class="form-control" name="credit[limit]" value="{$item['credit']['limit']}">
  217. <span class="help-block">设置赠送积分的上限,到达上限后将不再赠送积分</span>
  218. {if !empty($id)}
  219. <span class="help-block">已经赠送了<strong class="text-danger"> {$credit_num} </strong>积分,还可以赠送<strong class="text-danger"> {$credit_yu} </strong>积分</span>
  220. {/if}
  221. </div>
  222. </div>
  223. <div class="form-group">
  224. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">转发赠送积分</label>
  225. <div class="col-sm-8 col-xs-12">
  226. <input type="text" class="form-control" name="credit[share]" value="{$item['credit']['share']}">
  227. <span class="help-block">设置转发时赠送积分</span>
  228. </div>
  229. </div>
  230. <div class="form-group">
  231. <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">阅读赠送积分</label>
  232. <div class="col-sm-8 col-xs-12">
  233. <input type="text" class="form-control" name="credit[click]" value="{$item['credit']['click']}">
  234. <span class="help-block">设置阅读时赠送给分享人的积分</span>
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. </div>
  240. <div class="form-group">
  241. <div class="col-sm-12">
  242. <input name="submit" type="submit" value="提交" class="btn btn-primary col-lg-1">
  243. <input type="hidden" name="token" value="{$_W['token']}" />
  244. </div>
  245. </div>
  246. </form>
  247. </div>
  248. <script type="text/javascript">
  249. var category = {php echo json_encode($children)};
  250. $('#credit1').click(function(){
  251. $('#credit-status1').show();
  252. });
  253. $('#credit0').click(function(){
  254. $('#credit-status1').hide();
  255. });
  256. </script>
  257. {/if}
  258. {template 'common/footer'}