暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

add.htm 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="overflow-y: scroll;min-width:auto;">
  3. <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  4. <div id="append_parent"></div>
  5. <div id="ajaxwaitid"></div>
  6. <div class="page" style="min-width: auto;box-shadow:none;">
  7. <form class="form-horizontal" id="post_form" action="{:U('Links/add')}" method="post">
  8. <div class="ncap-form-default">
  9. <dl class="row">
  10. <dt class="tit"><em>*</em>链接类型</dt>
  11. <dd class="opt">
  12. <div class="onoff">
  13. <label for="typeid1" class="cb-enable selected">文字</label>
  14. <label for="typeid2" class="cb-disable" >图片</label>
  15. <input id="typeid1" name="typeid" value="1" checked type="radio">
  16. <input id="typeid2" name="typeid" value="2" type="radio">
  17. </div>
  18. <p class="notic"></p>
  19. </dd>
  20. </dl>
  21. <dl class="row">
  22. <dt class="tit">
  23. <label><em>*</em>链接分组</label>
  24. </dt>
  25. <dd class="opt">
  26. <select name="groupid" id="groupid">
  27. {volist name="group_ids" id="vo"}
  28. <option value="{$vo.id}">{$vo.group_name}</option>
  29. {/volist}
  30. </select>
  31. </dd>
  32. </dl>
  33. <dl class="row">
  34. <dt class="tit">
  35. <label for="url"><em>*</em>网址URL</label>
  36. </dt>
  37. <dd class="opt">
  38. <input type="text" name="url" placeholder="http://" id="url" class="input-txt">
  39. <span class="err"></span>
  40. <p class="notic"></p>
  41. </dd>
  42. </dl>
  43. <dl class="row">
  44. <dt class="tit">
  45. <label for="title"><em>*</em>网站名称</label>
  46. </dt>
  47. <dd class="opt">
  48. <input type="text" name="title" value="" id="title" class="input-txt">
  49. <span class="err"></span>
  50. <p class="notic"></p>
  51. </dd>
  52. </dl>
  53. <dl class="row none typeid2">
  54. <dt class="tit">
  55. <label for="logo_local"><em>*</em>上传Logo</label>
  56. </dt>
  57. <dd class="opt">
  58. <div class="input-file-show div_logo_local">
  59. <span class="show">
  60. <a id="img_a" class="nyroModal" rel="gal" href="javascript:void(0);" onmouseout="layer.close(layer_tips);" target="_blank">
  61. <i id="img_i" class="fa fa-picture-o"></i>
  62. </a>
  63. </span>
  64. <span class="type-file-box">
  65. <input type="text" id="logo_local" name="logo_local" value="" class="type-file-text" autocomplete="off">
  66. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  67. <input class="type-file-file" onClick="GetUploadify(1,'','allimg','img_call_back')" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  68. </span>
  69. </div>
  70. <input type="text" id="logo_remote" name="logo_remote" value="" placeholder="http://" class="input-txt" style="display: none;">
  71. &nbsp;
  72. <label><input type="checkbox" name="is_remote" id="is_remote" value="1" onClick="clickRemote(this, 'logo');">远程图片</label>
  73. <span class="err"></span>
  74. <p class="notic">建议尺寸 88 * 31 (像素) 的gif或jpg文件</p>
  75. </dd>
  76. </dl>
  77. <dl class="row {empty name="$global.web_citysite_open"} none {/empty} ">
  78. <dt class="tit">
  79. <label for="title">所属区域</label>
  80. </dt>
  81. <dd class="opt">
  82. <select name="province_id" id="province_id" onchange="set_city_list(0);">
  83. <option value="0">全国</option>
  84. {volist name=':get_site_province_list()' id='vo'}
  85. <option value="{$vo.id}" {eq name="$Request.param.province_id" value="$vo.id" } selected="true" {/eq}>{$vo.name}</option>
  86. {/volist}
  87. </select>
  88. <select name="city_id" id="city_id" class="none ml5" onchange="set_area_list(0);">
  89. <option value="">--请选择--</option>
  90. </select>
  91. <select name="area_id" id="area_id" class="none ml5">
  92. <option value="">--请选择--</option>
  93. </select>
  94. <span class="err"></span>
  95. <p class="notic"></p>
  96. </dd>
  97. </dl>
  98. <dl class="row">
  99. <dt class="tit">
  100. <label for="sort_order">排序</label>
  101. </dt>
  102. <dd class="opt">
  103. <input type="text" name="sort_order" value="100" id="sort_order" class="input-txt">
  104. <span class="err"></span>
  105. <p class="notic">越小越靠前</p>
  106. </dd>
  107. </dl>
  108. <dl class="row">
  109. <dt class="tit">
  110. <label for="email">站长Email</label>
  111. </dt>
  112. <dd class="opt">
  113. <input type="text" name="email" value="" id="email" class="input-txt">
  114. <p class="notic"></p>
  115. </dd>
  116. </dl>
  117. <dl class="row">
  118. <dt class="tit">
  119. <label for="intro">网站备注</label>
  120. </dt>
  121. <dd class="opt">
  122. <textarea rows="5" cols="80" id="intro" name="intro" style="height:80px;" placeholder="备注一些站长联系方式、信息等内容"></textarea>
  123. <p class="notic"></p>
  124. </dd>
  125. </dl>
  126. <dl class="row">
  127. <dt class="tit">
  128. <label>链接属性</label>
  129. </dt>
  130. <dd class="opt">
  131. <label><input type="checkbox" name="target" value="1">新窗口打开</label>&nbsp;&nbsp;
  132. <label><input type="checkbox" name="nofollow" value="1">nofollow</label>&nbsp;&nbsp;
  133. <span class="err"></span>
  134. <p class="notic"></p>
  135. </dd>
  136. </dl>
  137. <div class="bot"><a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
  138. </div>
  139. </form>
  140. </div>
  141. <script type="text/javascript">
  142. $(function () {
  143. try {
  144. var web_citysite_open = {$global['web_citysite_open']|default=0};
  145. var site_province_id = {$site_province_id|default=0};
  146. var site_city_id = {$site_city_id|default=0};
  147. var site_area_id = {$site_area_id|default=0};
  148. if (web_citysite_open > 0 && site_province_id > 0) {
  149. $('select[name=province_id]').val(site_province_id);
  150. set_city_list(site_city_id);
  151. set_area_list(site_area_id);
  152. }
  153. }catch(e){}
  154. });
  155. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  156. // 判断输入框是否为空
  157. function checkForm(){
  158. if($('select[name=groupid]').val() == ''){
  159. showErrorMsg('链接分组不能为空!');
  160. $('select[name=groupid]').focus();
  161. return false;
  162. }
  163. if($('input[name=url]').val() == ''){
  164. showErrorMsg('网址URL不能为空!');
  165. $('input[name=url]').focus();
  166. return false;
  167. }
  168. if($('input[name=title]').val() == ''){
  169. showErrorMsg('网站名称不能为空!');
  170. $('input[name=title]').focus();
  171. return false;
  172. }
  173. if ($('input[name=typeid]:checked').val() == 2) {
  174. if ($('input[name=is_remote]').is(':checked')) {
  175. if($('input[name=logo_remote]').val() == ''){
  176. showErrorMsg('请上传网站Logo图片!');
  177. $('input[name=logo_remote]').focus();
  178. return false;
  179. }
  180. } else {
  181. if($('input[name=logo_local]').val() == ''){
  182. showErrorMsg('请上传网站Logo图片!');
  183. $('input[name=logo_local]').focus();
  184. return false;
  185. }
  186. }
  187. }
  188. layer_loading('正在处理');
  189. $.ajax({
  190. type : 'post',
  191. url : "{:url('Links/add', ['_ajax'=>1])}",
  192. data : $('#post_form').serialize(),
  193. dataType : 'json',
  194. success : function(res){
  195. layer.closeAll();
  196. if(res.code == 1){
  197. var _parent = parent;
  198. _parent.layer.close(parentObj);
  199. _parent.layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
  200. _parent.window.location.reload();
  201. });
  202. }else{
  203. showErrorMsg(res.msg);
  204. }
  205. },
  206. error: function(e){
  207. layer.closeAll();
  208. showErrorAlert(e.responseText);
  209. }
  210. });
  211. }
  212. function img_call_back(fileurl_tmp)
  213. {
  214. $("#logo_local").val(fileurl_tmp);
  215. $("#img_a").attr('href', fileurl_tmp);
  216. $("#img_i").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
  217. }
  218. $(function(){
  219. $('input[name=typeid]').click(function(){
  220. var val = $(this).val();
  221. if (val == 2) {
  222. $('.typeid2').show();
  223. } else {
  224. $('.typeid2').hide();
  225. }
  226. });
  227. });
  228. </script>
  229. {include file="public/footer" /}