人人商城

resource.html 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. {template 'common/header'}
  2. <ul class="nav nav-tabs">
  3. <li{if $do == 'display' && $t == 'news'} class="active"{/if}><a href="{php echo url('platform/resource', array('t' => 'news'))}">图文</a></li>
  4. <li{if $do == 'display' && $t == 'image'} class="active"{/if}><a href="{php echo url('platform/resource', array('t' => 'image'))}">图片</a></li>
  5. <li{if $do == 'display' && $t == 'voice'} class="active"{/if}><a href="{php echo url('platform/resource', array('t' => 'voice'))}">语音</a></li>
  6. <li{if $do == 'display' && $t == 'music'} class="active"{/if}><a href="{php echo url('platform/resource', array('t' => 'music'))}">音乐</a></li>
  7. <li{if $do == 'display' && $t == 'video'} class="active"{/if}><a href="{php echo url('platform/resource', array('t' => 'video'))}">视频</a></li>
  8. </ul>
  9. {if $do == 'display'}
  10. <div class="main">
  11. <div class="search">
  12. <form action="platform.php" method="get">
  13. <input type="hidden" name="act" value="{$_GPC['act']}" />
  14. <input type="hidden" name="eid" value="{$_GPC['eid']}" />
  15. <input type="hidden" name="name" value="{$_GPC['name']}" />
  16. <input type="hidden" name="do" value="{$_GPC['do']}" />
  17. <input type="hidden" name="weid" value="{$_GPC['weid']}" />
  18. <table class="table table-bordered tb">
  19. <tbody>
  20. <tr>
  21. <th>素材类型</th>
  22. <td>
  23. <label class="checkbox inline">
  24. <input name="types[]" type="checkbox" value="image" {if in_array('image', $types)}checked="checked"{/if} > 图片
  25. </label>
  26. <label class="checkbox inline">
  27. <input name="types[]" type="checkbox" value="voice" {if in_array('voice', $types)}checked="checked"{/if}> 音频
  28. </label>
  29. <label class="checkbox inline">
  30. <input name="types[]" type="checkbox" value="video" {if in_array('video', $types)}checked="checked"{/if}> 视频
  31. </label>
  32. </td>
  33. </tr>
  34. <tr class="search-submit">
  35. <td colspan="2"><button class="btn pull-right span2"><i class="icon-search icon-large"></i> 搜索</button></td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. </form>
  40. </div>
  41. <div style="padding:15px;">
  42. <h4>上传的媒体列表</h4>
  43. <table class="table table-hover">
  44. <thead class="navbar-inner">
  45. <tr>
  46. <th>ID</th>
  47. <th>媒体</th>
  48. <th>类型</th>
  49. <th>缩略图</th>
  50. <th>上传时间</th>
  51. <th>过期时间</th>
  52. </tr>
  53. </thead>
  54. {loop $list $m}
  55. <thead>
  56. <tr>
  57. <td>{$m['mid']}</td>
  58. <td>
  59. <img src="http://file.api.weixin.qq.com/cgi-bin/media/get?access_token={$token}&media_id={$m['media_id']}" width="32" height="32">
  60. </td>
  61. <td>{$m['type']}</td>
  62. <td>
  63. {if !empty($m['thumb'])}
  64. <img src="http://file.api.weixin.qq.com/cgi-bin/media/get?access_token={$token}&media_id={$m['thumb']['media_id']}" width="32" height="32">
  65. {/if}
  66. </td>
  67. <td>{php echo date('Y-m-d h:i:s',$m['dateline'])}</td>
  68. <td>{php echo date('Y-m-d h:i:s',$m['dateline']+86400*3)}</td>
  69. </tr>
  70. </thead>
  71. {/loop}
  72. </table>
  73. {$pager}
  74. </div>
  75. </div>
  76. {/if}
  77. {if $do == 'upload'}
  78. <div class="main">
  79. <form action="site.php" name="form" class="form-horizontal form" method="post" enctype="multipart/form-data">
  80. <h4>上传新素材</h4>
  81. <img src="http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=NyfWNn4aHfrau3zGcknMtriDXmMsMXLeSlQOVIrmR7rwE7fuHTH_rmv021RcnNY9w1rn5xUeu4HrC8w2cOdargb--_ZLXgvdL0OrndfWkNHj-HQuXhSHD7-pgJZOvDGZYFRlxRBrYdkZl4vJxhZy0w&media_id=E7ZMjvmT_HloVF_M2cj7b0vXdhZhD2lk5D4cU7bnbXmvaKPJOYktfAcC2tX-p4qR" >
  82. <div class="alert alert-block alert-new" id="cardmain">
  83. <table>
  84. <tr>
  85. <th><label for="">媒体类型</label></th>
  86. <td>
  87. <select id="uploadtype" name="type" method="GET" class="form-control">
  88. <option value="image">image</option>
  89. <option value="voice">voice</option>
  90. <option value="video">video</option>
  91. </select>
  92. </td>
  93. </tr>
  94. <tr>
  95. <th><label for="">媒体文件</label></th>
  96. <td>
  97. <input type="file" name="media" class="form-control">
  98. </td>
  99. </tr>
  100. <tr id="thumb" style="display:none;">
  101. <th><label for="">缩略图</label></th>
  102. <td>
  103. {php echo tpl_form_field_image('thumb','');}
  104. </td>
  105. </tr>
  106. <tr>
  107. <th><label for=""></label></th>
  108. <td>
  109. <button type="submit" class="btn btn-primary span3" name="submit" value="提交">提交</button>
  110. <input type="hidden" name="token" value="{$_W['token']}" />
  111. <input type="hidden" name="act" value="module" />
  112. <input type="hidden" name="name" value="broadcast" />
  113. <input type="hidden" name="foo" value="upload" />
  114. <input type="hidden" name="do" value="media" />
  115. </td>
  116. </tr>
  117. </table>
  118. </div>
  119. </form>
  120. </div>
  121. <script>
  122. $(function(){
  123. $('#uploadtype').change(function(){
  124. var val = $(this).val();
  125. if(val == 'voice' || val == 'video'){
  126. $('#thumb').show();
  127. } else {
  128. $('#thumb').hide();
  129. }
  130. });
  131. });
  132. </script>
  133. {/if}
  134. {template 'common/footer'}