PageRenderTime 26ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/default/xs_topic.tpl

http://github.com/MightyGorgon/icy_phoenix
Smarty Template | 212 lines | 203 code | 9 blank | 0 comment | 37 complexity | 9f56f068aeea11be080d65bbdd7fffc0 MD5 | raw file
Possible License(s): AGPL-1.0
  1. <!-- INCLUDE overall_header.tpl -->
  2. <script type="text/javascript" src="{FULL_SITE_PATH}{T_COMMON_TPL_PATH}js/bbcb_mg.js"></script>
  3. <script type="text/javascript">
  4. // <![CDATA[
  5. function openAllSmiles()
  6. {
  7. smiles = window.open('{U_SMILEYS_MORE}', '_xs_smileys', 'width=600,height=400,resizable=yes,scrollbars=yes');
  8. smiles.focus();
  9. return false;
  10. }
  11. // ]]>
  12. </script>
  13. <!-- BEGIN postrow -->
  14. <?php
  15. // check if quick reply is enabled
  16. global $user, $config, $forum_id, $topic_id, $is_auth, $forum_topic_data, $lang, $images;
  17. $can_reply = $user->data['session_logged_in'] ? true : false;
  18. //$can_reply = true;
  19. if($can_reply)
  20. {
  21. $is_auth_type = 'auth_reply';
  22. if(!$is_auth[$is_auth_type])
  23. {
  24. $can_reply = false;
  25. }
  26. elseif ((($forum_topic_data['forum_status'] == FORUM_LOCKED) || ($forum_topic_data['topic_status'] == TOPIC_LOCKED)) && !$is_auth['auth_mod'])
  27. {
  28. $can_reply = false;
  29. }
  30. }
  31. if($can_reply)
  32. {
  33. $this->assign_block_vars('xs_quick_reply', array());
  34. }
  35. // Start Check Locked Status
  36. $lock = ($forum_topic_data['topic_status'] == TOPIC_LOCKED) ? true : false;
  37. $unlock = ($forum_topic_data['topic_status'] == TOPIC_UNLOCKED) ? true : false;
  38. if (($lock || $unlock) && $is_auth['auth_mod'])
  39. {
  40. if ($forum_topic_data['topic_status'] == TOPIC_LOCKED)
  41. {
  42. $this->assign_block_vars('switch_unlock_topic', array(
  43. 'L_UNLOCK_TOPIC' => $lang['Unlock_topic'],
  44. 'S_UNLOCK_CHECKED' => ($unlock) ? 'checked="checked"' : ''
  45. )
  46. );
  47. }
  48. elseif ($forum_topic_data['topic_status'] == TOPIC_UNLOCKED)
  49. {
  50. $this->assign_block_vars('switch_lock_topic', array(
  51. 'L_LOCK_TOPIC' => $lang['Lock_topic'],
  52. 'S_LOCK_CHECKED' => ($lock) ? 'checked="checked"' : ''
  53. )
  54. );
  55. }
  56. }
  57. // End check locked status
  58. $prev_id = false;
  59. $postrow_count = (isset($this->_tpldata['postrow.'])) ? count($this->_tpldata['postrow.']) : 0;
  60. for ($postrow_i = 0; $postrow_i < $postrow_count; $postrow_i++)
  61. {
  62. $postrow_item = &$this->_tpldata['postrow.'][$postrow_i];
  63. // set profile link and search button
  64. // check for new post
  65. $new_post = strpos($postrow_item['MINI_POST_IMG'], '_new') > 0 ? true : false;
  66. $postrow_item['LINK_CLASS'] = $new_post ? '-new' : '';
  67. // fix text
  68. $search = array(' ', "\t", "\n ");
  69. $replace = array('&nbsp;&nbsp;', '&nbsp;&nbsp;&nbsp;&nbsp;', "\n&nbsp;");
  70. $postrow_item['MESSAGE'] = str_replace($search, $replace, $postrow_item['MESSAGE']);
  71. // set prev/next post links
  72. $next_id = $postrow_i == ($postrow_count - 1) ? false : $this->_tpldata['postrow.'][$postrow_i + 1]['U_POST_ID'];
  73. if(($next_id !== false) || ($prev_id !== false))
  74. {
  75. $str = '';
  76. if($prev_id)
  77. {
  78. $str .= '<a href="#p' . $prev_id . '"><img src="' . $images['arrow_alt_up'] . '" alt="" /></a>';
  79. //$str .= '<br /><img src="' . $images['spacer'] . '" width="9" height="2" alt="" />';
  80. }
  81. else
  82. {
  83. $str .= '<img src="' . $images['spacer'] . '" width="9" height="2" alt="" />';
  84. }
  85. $str .= '&nbsp;';
  86. if($next_id)
  87. {
  88. //$str .= '<img src="' . $images['spacer'] . '" width="9" height="2" alt="" /><br />';
  89. $str .= '<a href="#p' . $next_id . '"><img src="' . $images['arrow_alt_down'] . '" alt="" /></a>';
  90. }
  91. else
  92. {
  93. $str .= '<img src="' . $images['spacer'] . '" width="9" height="2" alt="" />';
  94. }
  95. $str .= '';
  96. $postrow_item['ARROWS'] = $str;
  97. }
  98. $prev_id = $postrow_item['U_POST_ID'];
  99. ob_start();
  100. ?>
  101. {postrow.ATTACHMENTS}
  102. <?php
  103. $postrow_item['ATTACHMENTS'] = ob_get_contents();
  104. ob_end_clean();
  105. }
  106. ?>
  107. <!-- END postrow -->
  108. <?php
  109. // show quick reply
  110. if($can_reply)
  111. {
  112. // quick reply button
  113. global $images;
  114. $this->vars['CA_QUICK_REPLY_BUTTON'] = '<a href="javascript:showQuickEditor();" title="' . $lang['Post_a_reply'] . '"><img src="' . $images['quick_reply'] . '" alt="' . $lang['Quick_Reply'] . '" title="' . $lang['Quick_Reply'] . '" /></a>';
  115. // quick reply form
  116. ob_start();
  117. ?>
  118. <div id="quick_reply_error"></div>
  119. <div id="quick_reply" style="display: none; position: relative;">
  120. <a id="quick"></a>
  121. <form id="quick_reply_form" action="<?php echo append_sid(CMS_PAGE_POSTING); ?>" method="post" name="post" style="display: inline;">
  122. {S_HIDDEN_FIELDS}
  123. <input type="hidden" name="post_time" value="<?php echo time(); ?>" />
  124. {IMG_THL}{IMG_THC}<span class="forumlink"><?php echo $lang['Post_a_reply']; ?></span>{IMG_THR}<table class="forumlinenb">
  125. <tr>
  126. <td class="row1 tw200px tdnw"><span class="gen"><b><?php echo $lang['Subject']; ?>:</b></span></td>
  127. <td class="row2 tw100pct"><input type="text" name="subject" size="45" maxlength="120" style="width: 98%;" tabindex="2" class="post" value="{L_REPLY_PREFIX}{TOPIC_TITLE_QR}" /></td>
  128. </tr>
  129. <tr>
  130. <td class="row1 tw200px tdnw"><span class="gen"><b><?php echo $lang['Message_body']; ?>:<br /><img src="{T_TEMPLATE_PATH}/images/spacer.gif" width="200" height="1" alt="" /></b></span></td>
  131. <td class="row2 tw100pct"><div class="message-box"><textarea name="message" rows="15" cols="35" tabindex="3"></textarea></div></td>
  132. </tr>
  133. <tr>
  134. <td class="row1 tw200px tdnw"><span class="gen"><b>{L_SMILEYS}:</b></span></td>
  135. <td class="row2 row-center tw100pct">
  136. <table>
  137. <tr>
  138. <td class="tdalignc">
  139. <!-- BEGIN smilies -->
  140. <img src="{smilies.URL}" onmouseover="this.style.cursor='pointer';" onclick="emoticon('{smilies.CODE}');" alt="{smilies.DESC}" title="{smilies.DESC}" />
  141. <!-- END smilies -->
  142. </td>
  143. <td class="tdalignc tvalignm">&nbsp;<input type="button" class="liteoption" name="SmilesButt" value="{L_SMILEYS_MORE}" onclick="openAllSmiles();" /></td>
  144. </tr>
  145. </table>
  146. </td>
  147. </tr>
  148. <tr>
  149. <td class="row1 tdnw"><span class="gen"><b><?php echo $lang['Options']; ?>:</b></span></td>
  150. <td class="row2">
  151. <?php
  152. $user_sig = ($user->data['user_sig'] != '' && $config['allow_sig']) ? $user->data['user_sig'] : '';
  153. $html_on = $config['allow_html'] ? $user->data['user_allowhtml'] : 1;
  154. $bbcode_on = $config['allow_bbcode'] ? $user->data['user_allowbbcode'] : 0;
  155. $smilies_on = $config['allow_smilies'] ? $user->data['user_allowsmile'] : 0;
  156. ?>
  157. <label><input type="checkbox" name="disable_acro_auto" />&nbsp;<span class="genmed"><?php echo $lang['Disable_ACRO_AUTO_post']; ?></span></label><br />
  158. <?php if($config['allow_html'] || (($user->data['user_level'] == ADMIN) && $config['allow_html_only_for_admins'])) { ?>
  159. <label><input type="checkbox" name="disable_html" <?php echo ($html_on ? '' : 'checked="checked"'); ?> />&nbsp;<span class="genmed"><?php echo $lang['Disable_HTML_post']; ?></span></label><br />
  160. <?php } else { ?><input type="hidden" name="disable_html" value="checked" /><?php } ?>
  161. <?php if($config['allow_bbcode']) { ?>
  162. <label><input type="checkbox" name="disable_bbcode" <?php echo ($bbcode_on ? '' : 'checked="checked"'); ?> />&nbsp;<span class="genmed"><?php echo $lang['Disable_BBCode_post']; ?></span></label><br />
  163. <?php } else { ?><input type="hidden" name="disable_bbcode" value="checked" /><?php } ?>
  164. <?php if($config['allow_smilies']) { ?>
  165. <label><input type="checkbox" name="disable_smilies" <?php echo ($smilies_on ? '' : 'checked="checked"'); ?> />&nbsp;<span class="genmed"><?php echo $lang['Disable_Smilies_post']; ?></span></label><br />
  166. <?php } else { ?><input type="hidden" name="disable_smilies" value="checked" /><?php } ?>
  167. <?php if($user_sig) { ?>
  168. <label><input type="checkbox" name="attach_sig" <?php echo ($user->data['user_attachsig'] ? 'checked="checked"' : ''); ?> />&nbsp;<span class="genmed"><?php echo $lang['Attach_signature']; ?></span></label><br />
  169. <?php } else { ?><input type="hidden" name="attach_sig" value="" /><?php } ?>
  170. <label><input type="checkbox" name="notify" <?php echo ($user->data['user_notify'] ? 'checked="checked"' : ''); ?> />&nbsp;<span class="genmed"><?php echo $lang['Notify']; ?></span></label><br />
  171. <!-- BEGIN switch_lock_topic -->
  172. <label><input type="checkbox" name="lock" {switch_lock_topic.S_LOCK_CHECKED} />&nbsp;<span>{switch_lock_topic.L_LOCK_TOPIC}</span></label><br />
  173. <!-- END switch_lock_topic -->
  174. <!-- BEGIN switch_unlock_topic -->
  175. <label><input type="checkbox" name="unlock" {switch_unlock_topic.S_UNLOCK_CHECKED} />&nbsp;<span>{switch_unlock_topic.L_UNLOCK_TOPIC}</span></label><br />
  176. <!-- END switch_unlock_topic -->
  177. </td>
  178. </tr>
  179. <tr>
  180. <td class="cat" colspan="2">
  181. <input type="hidden" name="mode" value="reply" />
  182. <input type="hidden" name="f" value="<?php echo $forum_id; ?>" />
  183. <input type="hidden" name="t" value="<?php echo $topic_id; ?>" />
  184. <input type="hidden" name="sid" value="<?php echo $user->data['session_id']; ?>" />
  185. <input type="submit" tabindex="5" name="preview" class="liteoption" value="<?php echo $lang['Preview']; ?>" />&nbsp;
  186. <input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="<?php echo $lang['Submit']; ?>" />
  187. </td>
  188. </tr>
  189. </table>{IMG_TFL}{IMG_TFC}{IMG_TFR}
  190. </form>
  191. </div>
  192. <?php
  193. $str = ob_get_contents();
  194. ob_end_clean();
  195. $this->vars['CA_QUICK_REPLY_FORM'] = $str;
  196. }
  197. ?>
  198. <!-- IF IS_KB_MODE -->
  199. <!-- INCLUDE viewtopic_kb_body.tpl -->
  200. <!-- ELSE -->
  201. <!-- INCLUDE viewtopic_body.tpl -->
  202. <!-- ENDIF -->
  203. <!-- INCLUDE overall_footer.tpl -->