post_sortoption.htm 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <input type="hidden" name="selectsortid" size="45" value="$_G['forum_selectsortid']" />
  2. <!--{if $_G['forum_typetemplate']}-->
  3. <!--{if $_G['forum']['threadsorts']['description'][$_G['forum_selectsortid']] || $_G['forum']['threadsorts']['expiration'][$_G['forum_selectsortid']]}-->
  4. <div class="sinf bw0">
  5. <dl>
  6. <!--{if $_G['forum']['threadsorts']['description'][$_G['forum_selectsortid']]}-->
  7. <dt>{lang threadtype_description}</dt>
  8. <dd>$_G[forum][threadsorts][description][$_G[forum_selectsortid]]</dd>
  9. <!--{/if}-->
  10. <!--{if $_G['forum']['threadsorts']['expiration'][$_G['forum_selectsortid']]}-->
  11. <dt><span class="rq">*</span>{lang threadtype_expiration}</dt>
  12. <dd>
  13. <div class="ftid">
  14. <select name="typeexpiration" tabindex="1" id="typeexpiration">
  15. <option value="259200">{lang three_days}</option>
  16. <option value="432000">{lang five_days}</option>
  17. <option value="604800">{lang seven_days}</option>
  18. <option value="2592000">{lang one_month}</option>
  19. <option value="7776000">{lang three_months}</option>
  20. <option value="15552000">{lang half_year}</option>
  21. <option value="31536000">{lang one_year}</option>
  22. </select>
  23. </div>
  24. <!--{if $_G['forum_optiondata']['expiration']}--><span class="fb">{lang valid_before}: $_G[forum_optiondata][expiration]</span><!--{/if}-->
  25. </dd>
  26. <!--{/if}-->
  27. </dl>
  28. </div>
  29. <!--{/if}-->
  30. $_G[forum_typetemplate]
  31. <!--{else}-->
  32. <table cellspacing="0" cellpadding="0" class="tfm">
  33. <!--{if $_G['forum']['threadsorts']['description'][$_G['forum_selectsortid']]}-->
  34. <tr>
  35. <th class="ptm pbm bbda">{lang threadtype_description}</th>
  36. <td class="ptm pbm bbda" colspan="2">$_G[forum][threadsorts][description][$_G[forum_selectsortid]]</td>
  37. </tr>
  38. <!--{/if}-->
  39. <!--{if $_G['forum']['threadsorts']['expiration'][$_G['forum_selectsortid']]}-->
  40. <tr>
  41. <th class="ptm pbm bbda">{lang threadtype_expiration}</th>
  42. <td class="ptm pbm bbda" colspan="2">
  43. <div class="ftid">
  44. <select name="typeexpiration" tabindex="1" id="typeexpiration">
  45. <option value="259200">{lang three_days}</option>
  46. <option value="432000">{lang five_days}</option>
  47. <option value="604800">{lang seven_days}</option>
  48. <option value="2592000">{lang one_month}</option>
  49. <option value="7776000">{lang three_months}</option>
  50. <option value="15552000">{lang half_year}</option>
  51. <option value="31536000">{lang one_year}</option>
  52. </select>
  53. </div>
  54. <!--{if $_G['forum_optiondata']['expiration']}-->{lang valid_before}: $_G[forum_optiondata][expiration]<!--{/if}-->
  55. </td>
  56. </tr>
  57. <!--{/if}-->
  58. <!--{loop $_G['forum_optionlist'] $optionid $option}-->
  59. <tr>
  60. <th class="ptm pbm bbda"><!--{if $option['required']}--><span class="rq">*</span><!--{/if}-->$option[title]</th>
  61. <td class="ptm pbm bbda">
  62. <div id="select_$option[identifier]">
  63. <!--{if in_array($option['type'], array('number', 'text', 'email', 'calendar', 'image', 'url', 'range', 'upload', 'range'))}-->
  64. <!--{if $option['type'] == 'calendar'}-->
  65. <script type="text/javascript" src="{$_G['setting']['jspath']}calendar.js?{VERHASH}"></script>
  66. <input type="text" name="typeoption[{$option[identifier]}]" id="typeoption_$option[identifier]" tabindex="1" size="$option[inputsize]" onchange="checkoption('$option[identifier]', '$option[required]', '$option[type]')" value="$option[value]" onclick="showcalendar(event, this, false)" $option[unchangeable] class="px"/>
  67. <!--{elseif $option['type'] == 'image'}-->
  68. <!--{if !($option[unchangeable] && $option['value'])}-->
  69. <button type="button" class="pn" onclick="uploadWindow(function (aid, url){sortaid_{$option[identifier]}_upload(aid, url)})"><em><!--{if $option['value']}-->{lang update}<!--{else}-->{lang upload}<!--{/if}--></em></button>
  70. <input type="hidden" name="typeoption[{$option[identifier]}][aid]" value="$option[value][aid]" id="sortaid_{$option[identifier]}" />
  71. <input type="hidden" name="sortaid_{$option[identifier]}_url" id="sortaid_{$option[identifier]}_url" />
  72. <!--{if $option[value]}--><input type="hidden" name="oldsortaid[{$option[identifier]}]" value="$option[value][aid]" tabindex="1" /><!--{/if}-->
  73. <input type="hidden" name="typeoption[{$option[identifier]}][url]" id="sortattachurl_{$option[identifier]}" {if $option[value][url]}value="$option[value][url]"{/if} tabindex="1" />
  74. <!--{/if}-->
  75. <div id="sortattach_image_{$option[identifier]}" class="ptn">
  76. <!--{if $option['value']['url']}-->
  77. <a href="$option[value][url]" target="_blank"><img class="spimg" src="$option[value][url]" alt="" /></a>
  78. <!--{/if}-->
  79. </div>
  80. <script type="text/javascript" reload="1">
  81. function sortaid_{$option[identifier]}_upload(aid, url) {
  82. $('sortaid_{$option[identifier]}_url').value = url;
  83. updatesortattach(aid, url, '{$_G['setting']['attachurl']}forum', '{$option[identifier]}');
  84. }
  85. </script>
  86. <!--{else}-->
  87. <input type="text" name="typeoption[{$option[identifier]}]" id="typeoption_$option[identifier]" class="px" tabindex="1" size="$option[inputsize]" onBlur="checkoption('$option[identifier]', '$option[required]', '$option[type]'{if $option[maxnum]}, '$option[maxnum]'{else}, '0'{/if}{if $option[minnum]}, '$option[minnum]'{else}, '0'{/if}{if $option[maxlength]}, '$option[maxlength]'{/if})" value="{if $_G['tid']}$option[value]{else}{if $member_profile[$option['profile']]}$member_profile[$option['profile']]{else}$option['defaultvalue']{/if}{/if}" $option[unchangeable] />
  88. <!--{/if}-->
  89. <!--{elseif in_array($option['type'], array('radio', 'checkbox', 'select'))}-->
  90. <!--{if $option[type] == 'select'}-->
  91. <!--{loop $option['value'] $selectedkey $selectedvalue}-->
  92. <!--{if $selectedkey}-->
  93. <script type="text/javascript">
  94. changeselectthreadsort('$selectedkey', $optionid, 'update');
  95. </script>
  96. <!--{else}-->
  97. <select tabindex="1" onchange="changeselectthreadsort(this.value, '$optionid');checkoption('$option[identifier]', '$option[required]', '$option[type]')" $option[unchangeable] class="ps">
  98. <option value="0">{lang please_select}</option>
  99. <!--{loop $option['choices'] $id $value}-->
  100. <!--{if !$value[foptionid]}-->
  101. <option value="$id">$value[content] <!--{if $value['level'] != 1}-->&raquo;<!--{/if}--></option>
  102. <!--{/if}-->
  103. <!--{/loop}-->
  104. </select>
  105. <!--{/if}-->
  106. <!--{/loop}-->
  107. <!--{if !is_array($option['value'])}-->
  108. <select tabindex="1" onchange="changeselectthreadsort(this.value, '$optionid');checkoption('$option[identifier]', '$option[required]', '$option[type]')" $option[unchangeable] class="ps">
  109. <option value="0">{lang please_select}</option>
  110. <!--{loop $option['choices'] $id $value}-->
  111. <!--{if !$value[foptionid]}-->
  112. <option value="$id">$value[content] <!--{if $value['level'] != 1}-->&raquo;<!--{/if}--></option>
  113. <!--{/if}-->
  114. <!--{/loop}-->
  115. </select>
  116. <!--{/if}-->
  117. <!--{elseif $option['type'] == 'radio'}-->
  118. <ul class="xl2">
  119. <!--{loop $option['choices'] $id $value}-->
  120. <li><label><input type="radio" name="typeoption[{$option[identifier]}]" id="typeoption_$option[identifier]" class="pr" tabindex="1" onclick="checkoption('$option[identifier]', '$option[required]', '$option[type]')" value="$id" $option['value'][$id] $option[unchangeable] class="pr"> $value</label></li>
  121. <!--{/loop}-->
  122. </ul>
  123. <!--{elseif $option['type'] == 'checkbox'}-->
  124. <ul class="xl2">
  125. <!--{loop $option['choices'] $id $value}-->
  126. <li><label><input type="checkbox" name="typeoption[{$option[identifier]}][]" id="typeoption_$option[identifier]" class="pc" tabindex="1" onclick="checkoption('$option[identifier]', '$option[required]', '$option[type]')" value="$id" $option['value'][$id][$id] $option[unchangeable] class="pc"> $value</label></li>
  127. <!--{/loop}-->
  128. </ul>
  129. <!--{/if}-->
  130. <!--{elseif in_array($option['type'], array('textarea'))}-->
  131. <textarea name="typeoption[{$option[identifier]}]" tabindex="1" id="typeoption_$option[identifier]" rows="$option[rowsize]" cols="$option[colsize]" onBlur="checkoption('$option[identifier]', '$option[required]', '$option[type]', 0, 0{if $option[maxlength]}, '$option[maxlength]'{/if})" $option[unchangeable] class="pt">$option[value]</textarea>
  132. <!--{/if}-->
  133. $option[unit]
  134. </div>
  135. <!--{if $option['maxnum'] || $option['minnum'] || $option['maxlength'] || $option['unchangeable'] || $option[description]}-->
  136. <div class="d">
  137. <!--{if $option['maxnum']}-->
  138. {lang maxnum} $option[maxnum]&nbsp;
  139. <!--{/if}-->
  140. <!--{if $option['minnum']}-->
  141. {lang minnum} $option[minnum]&nbsp;
  142. <!--{/if}-->
  143. <!--{if $option['maxlength']}-->
  144. {lang maxlength} $option[maxlength]&nbsp;
  145. <!--{/if}-->
  146. <!--{if $option['unchangeable']}-->
  147. {lang unchangeable}&nbsp;
  148. <!--{/if}-->
  149. <!--{if $option[description]}-->
  150. $option[description]
  151. <!--{/if}-->
  152. </div>
  153. <!--{/if}-->
  154. </td>
  155. <td class="ptm pbm bbda" width="180"><span id="check{$option[identifier]}"></span></td>
  156. </tr>
  157. <!--{/loop}-->
  158. </table>
  159. <!--{/if}-->
  160. <script type="text/javascript" reload="1">
  161. var CHECKALLSORT = false;
  162. function warning(obj, msg) {
  163. obj.style.display = '';
  164. obj.innerHTML = '<img src="{IMGDIR}/check_error.gif" width="16" height="16" class="vm" /> ' + msg;
  165. obj.className = "warning";
  166. if(CHECKALLSORT) {
  167. showDialog(msg);
  168. }
  169. }
  170. EXTRAFUNC['validator']['special'] = 'validateextra';
  171. function validateextra() {
  172. CHECKALLSORT = true;
  173. <!--{loop $_G['forum_optionlist'] $optionid $option}-->
  174. if(!checkoption('$option[identifier]', '$option[required]', '$option[type]')) {
  175. return false;
  176. }
  177. <!--{/loop}-->
  178. return true;
  179. }
  180. <!--{if $_G['forum']['threadsorts']['expiration'][$_G['forum_selectsortid']]}-->
  181. simulateSelect('typeexpiration');
  182. <!--{/if}-->
  183. </script>