PageRenderTime 47ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/development/extension_hooks/module/forum/index.html

https://bitbucket.org/ellislab/expressionengine-user-guide/
HTML | 362 lines | 268 code | 93 blank | 1 comment | 0 complexity | 1587cc7bfe1f971df85ff8eda3a06f17 MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  5. <title>Forum Module Extension Hooks &#8211; ExpressionEngine Developer Documentation</title>
  6. <meta name="MSSmartTagsPreventParsing" content="TRUE" />
  7. <link rel="contents" href="../../index.html" />
  8. <style type="text/css" media="screen,print">@import url(../../../../docs.css);</style>
  9. </head>
  10. <body>
  11. <div><a name="top"></a></div>
  12. <div id="header">
  13. <table cellpadding="0" cellspacing="0" border="0" style="width:100%;"><tr>
  14. <td class="docheading" style="width:300px;"><a href="../../../../index.html"><img src="../../../../images/user_guide.gif" width="231" height="24" alt="ExpressionEngine User Guide" /></a></td>
  15. <td class="searchbox"><form method="get" action="http://www.google.com/search" class="searchbox"><div>Search&nbsp;&nbsp;<input type="text" class="input" name="q" id="q" size="31" maxlength="255" value="" /><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="expressionengine.com/docs/" />&nbsp;<input type="submit" class="submit" name="sa" value="Search" /></div></form></td>
  16. </tr>
  17. </table>
  18. </div>
  19. <div id="navlinks">
  20. <a href="../../../../index.html">Table of Contents</a> &gt;
  21. <a href="../../../index.html">Development</a> &gt;
  22. <a href="../../index.html">Extension Hooks</a> &gt;
  23. <strong>Forum Module Extension Hooks</strong>
  24. </div>
  25. <div id="content">
  26. <h1>Forum Module Extension Hooks</h1>
  27. <p>In the menu below you will find links to details about available extension hooks in the Forum module (mod.forum_core.php).</p>
  28. <ul class="toc">
  29. <li><a href="#forum_submission_form_start">forum_submission_form_start</a></li>
  30. <li><a href="#forum_submission_form_end">forum_submission_form_end</a></li>
  31. <li><a href="#forum_submission_page">forum_submission_page</a></li>
  32. <li><a href="#forum_submit_post_start">forum_submit_post_start</a></li>
  33. <li><a href="#forum_submit_post_end">forum_submit_post_end</a></li>
  34. <li><a href="#forum_threads_template">forum_threads_template</a></li>
  35. <li><a href="#forum_thread_rows_absolute_end">forum_thread_rows_absolute_end</a></li>
  36. <li><a href="#forum_thread_rows_loop_start">forum_thread_rows_loop_start</a></li>
  37. <li><a href="#forum_thread_rows_loop_end">forum_thread_rows_loop_end</a></li>
  38. <li><a href="#forum_thread_rows_start">forum_thread_rows_start</a></li>
  39. <li><a href="#forum_topics_absolute_end">forum_topics_absolute_end</a></li>
  40. <li><a href="#forum_topics_loop_start">forum_topics_loop_start</a></li>
  41. <li><a href="#forum_topics_loop_end">forum_topics_loop_end</a></li>
  42. <li><a href="#forum_topics_start">forum_topics_start</a></li>
  43. <li><a href="#main_forum_table_rows_template">main_forum_table_rows_template</a></li>
  44. </ul>
  45. <h3><small>Added in v1.4.0</small><a name="forum_submission_form_start">forum_submission_form_start</a></h3>
  46. <p>Allows rewrite or modify of Submission form template before processing</p>
  47. <code><samp>$str</samp> = $this->extensions->universal_call('<strong>forum_submission_form_start</strong>', <var>$this</var>, <var>$str</var>);
  48. if ($this->extensions->end_script === TRUE) return $str;</code>
  49. <dl>
  50. <dt>$this</dt>
  51. <dd>The current Forum Core object</dd>
  52. <dt>$str</dt>
  53. <dd>Submission form template</dd>
  54. <dt><em>Return value</em></dt>
  55. <dd>String</dd>
  56. </dl>
  57. <h3><small>Added in v1.4.0</small><a name="forum_submission_form_end">forum_submission_form_end</a></h3>
  58. <p>Final chance to modify the submission form before it is displayed</p>
  59. <code><samp>$str</samp> = $this->extensions->universal_call('<strong>forum_submission_form_end</strong>', <var>$this</var>, <var>$str</var>);
  60. if ($this->extensions->end_script === TRUE) return $str;</code>
  61. <dl>
  62. <dt>$this</dt>
  63. <dd>The current Forum Core object</dd>
  64. <dt>$str</dt>
  65. <dd>Submission form template</dd>
  66. <dt><em>Return value</em></dt>
  67. <dd>String</dd>
  68. </dl>
  69. <h3><small>Added in v1.4.0</small><a name="forum_submission_page">forum_submission_page</a></h3>
  70. <p>
  71. - Allows usurping of forum submission forms<br />
  72. - More error checking and permissions, too
  73. </p>
  74. <code><samp>$edata</samp> = $this->extensions->universal_call('<strong>forum_submission_page</strong>', <var>$this</var>, <var>$type</var>);
  75. if ($this->extensions->end_script === TRUE) return $edata;</code>
  76. <dl>
  77. <dt>$this</dt>
  78. <dd>The current Forum Core object</dd>
  79. <dt>$type</dt>
  80. <dd>new_topic, edit_topic, new_reply, edit_reply</dd>
  81. <dt><em>Return value</em></dt>
  82. <dd>void</dd>
  83. </dl>
  84. <h3><small>Added in v1.4.0</small><a name="forum_submit_post_start">forum_submit_post_start</a></h3>
  85. <p>Allows usurping of forum submission routine or possible adding more checks and permissions</p>
  86. <code><samp>$edata</samp> = $this->extensions->universal_call('<strong>forum_submit_post_start</strong>', <var>$this</var>);
  87. if ($this->extensions->end_script === TRUE) return $edata;</code>
  88. <dl>
  89. <dt>$this</dt>
  90. <dd>The current Forum Core object</dd>
  91. <dt><em>Return value</em></dt>
  92. <dd>void</dd>
  93. </dl>
  94. <h3><small>Added in v1.5.2</small><a name="forum_submit_post_end">forum_submit_post_end</a></h3>
  95. <p>Do more processing after the post is submitted.</p>
  96. <code><samp>$edata</samp> = $this->extensions->universal_call('<strong>forum_submit_post_end</strong>', <var>$this</var>, <var>$data</var>);
  97. if ($this->extensions->end_script === TRUE) return $edata;</code>
  98. <dl>
  99. <dt>$this</dt>
  100. <dd>The current Forum Core object</dd>
  101. <dt>$data</dt>
  102. <dd>the forum post data array</dd>
  103. <dt><em>Return value</em></dt>
  104. <dd>void</dd>
  105. </dl>
  106. <h4>Additional Notes</h4>
  107. <p>Note that user notifications have not been sent at this point. The $data array was added in build 20080626</p>
  108. <h3><small>Added in v1.4.0</small><a name="forum_threads_template">forum_threads_template</a></h3>
  109. <p>Allows modifying of the Threads display template before it is processed</p>
  110. <code><samp>$str</samp> = $this->extensions->universal_call('<strong>forum_threads_template</strong>', <var>$this</var>, <var>$str</var>, <var>$tquery</var>);
  111. if ($this->extensions->end_script === TRUE) return $str;</code>
  112. <dl>
  113. <dt>$this</dt>
  114. <dd>The current Forum Core object</dd>
  115. <dt>$str</dt>
  116. <dd>The topics thread template</dd>
  117. <dt>$tquery</dt>
  118. <dd>The data for this thread</dd>
  119. <dt><em>Return value</em></dt>
  120. <dd>String</dd>
  121. </dl>
  122. <h3><small>Added in v1.5.1</small><a name="forum_thread_rows_absolute_end">forum_thread_rows_absolute_end</a></h3>
  123. <p>Take the processed thread rows and do what you wish</p>
  124. <code><samp>$thread_rows</samp> = $this->extensions->universal_call('<strong>forum_thread_rows_absolute_end</strong>', <var>$this</var>, <var>$data</var>, <var>$thread_rows</var>);
  125. if ($this->extensions->end_script === TRUE) return $thread_rows;</code>
  126. <dl>
  127. <dt>$this</dt>
  128. <dd>The current Forum Core object</dd>
  129. <dt>$data</dt>
  130. <dd>Information about the current group of thread_rows (announcement, topic, all posts, etc.)</dd>
  131. <dt>$thread_rows</dt>
  132. <dd>The fully processed thread row template</dd>
  133. <dt><em>Return value</em></dt>
  134. <dd>String</dd>
  135. </dl>
  136. <h3><small>Added in v1.5.1</small><a name="forum_thread_rows_loop_start">forum_thread_rows_loop_start</a></h3>
  137. <p>Modify the thread row template and data before any processing takes place</p>
  138. <code><samp>$temp</samp> = $this->extensions->universal_call('<strong>forum_thread_rows_loop_start</strong>', <var>$this</var>, <var>$data</var>, <var>$row</var>, <var>$temp</var>);
  139. if ($this->extensions->end_script === TRUE) return;</code>
  140. <dl>
  141. <dt>$this</dt>
  142. <dd>The current Forum Core object</dd>
  143. <dt>$data</dt>
  144. <dd>The data for all thread rows</dd>
  145. <dt>$row</dt>
  146. <dd>The data for this thread row (post)</dd>
  147. <dt>$temp</dt>
  148. <dd>The processed thread row</dd>
  149. <dt><em>Return value</em></dt>
  150. <dd>String</dd>
  151. </dl>
  152. <h3><small>Added in v1.5.1</small><a name="forum_thread_rows_loop_end">forum_thread_rows_loop_end</a></h3>
  153. <p>Modify the processed row before it is appended to the template output</p>
  154. <code><samp>$temp</samp> = $this->extensions->universal_call('<strong>forum_thread_rows_loop_end</strong>', <var>$this</var>, <var>$data</var>, <var>$row</var>, <var>$temp</var>);
  155. if ($this->extensions->end_script === TRUE) return;</code>
  156. <dl>
  157. <dt>$this</dt>
  158. <dd>The current Forum Core object</dd>
  159. <dt>$data</dt>
  160. <dd>The data for all thread rows</dd>
  161. <dt>$row</dt>
  162. <dd>The data for this thread row (post)</dd>
  163. <dt>$temp</dt>
  164. <dd>The processed thread row</dd>
  165. <dt><em>Return value</em></dt>
  166. <dd>String</dd>
  167. </dl>
  168. <h3><small>Added in v1.4.0</small><a name="forum_thread_rows_start">forum_thread_rows_start</a></h3>
  169. <p>Allows modifying of the thread rows template</p>
  170. <code><samp>$template</samp> = $this->extensions->universal_call('<strong>forum_thread_rows_start</strong>', <var>$this</var>, <var>$template</var>, <var>$data</var>, <var>$is_announcement</var>, <var>$thread_review</var>);
  171. if ($this->extensions->end_script === TRUE) return $template;</code>
  172. <dl>
  173. <dt>$this</dt>
  174. <dd>The current Forum Core object</dd>
  175. <dt>$template</dt>
  176. <dd>The topics thread row template</dd>
  177. <dt>$data</dt>
  178. <dd>The data for this thread row (post)</dd>
  179. <dt>$is_announcement</dt>
  180. <dd>TRUE/FALSE</dd>
  181. <dt>$thread_review</dt>
  182. <dd>TRUE/FALSE</dd>
  183. <dt><em>Return value</em></dt>
  184. <dd>String</dd>
  185. </dl>
  186. <h3><small>Added in v1.5.1</small><a name="forum_topics_absolute_end">forum_topics_absolute_end</a></h3>
  187. <p>Modify the finalized topics template and do what you wish</p>
  188. <code><samp>$str</samp> = $this->extensions->universal_call('<strong>forum_topics_absolute_end</strong>', <var>$this</var>, <var>$query->result</var>, <var>$str</var>);
  189. if ($this->extensions->end_script === TRUE) return $str;</code>
  190. <dl>
  191. <dt>$this</dt>
  192. <dd>The current Forum Core object</dd>
  193. <dt>$query->result</dt>
  194. <dd>Array of all of the displayed topics</dd>
  195. <dt>$str</dt>
  196. <dd>The finalized topics template</dd>
  197. <dt><em>Return value</em></dt>
  198. <dd>String</dd>
  199. </dl>
  200. <h3><small>Added in v1.5.1</small><a name="forum_topics_loop_start">forum_topics_loop_start</a></h3>
  201. <p>Modify the topic row template and data before any processing takes place</p>
  202. <code><samp>$temp</samp> = $this->extensions->universal_call('<strong>forum_topics_loop_start</strong>', <var>$this</var>, <var>$query->result</var>, <var>$row</var>, <var>$temp</var>);
  203. if ($this->extensions->end_script === TRUE) return;</code>
  204. <dl>
  205. <dt>$this</dt>
  206. <dd>The current Forum Core object</dd>
  207. <dt>$query->result</dt>
  208. <dd>Array of all of the topics</dd>
  209. <dt>$row</dt>
  210. <dd>The data for this topic</dd>
  211. <dt>$temp</dt>
  212. <dd>The yet-to-be-processed template</dd>
  213. <dt><em>Return value</em></dt>
  214. <dd>String</dd>
  215. </dl>
  216. <h3><small>Added in v1.5.1</small><a name="forum_topics_loop_end">forum_topics_loop_end</a></h3>
  217. <p>Modify the processed topic row before it is appended to the template output</p>
  218. <code><samp>$temp</samp> = $this->extensions->universal_call('<strong>forum_topics_loop_end</strong>', <var>$this</var>, <var>$query->result</var>, <var>$row</var>, <var>$temp</var>);
  219. if ($this->extensions->end_script === TRUE) return;</code>
  220. <dl>
  221. <dt>$this</dt>
  222. <dd>The current Forum Core object</dd>
  223. <dt>$query->result</dt>
  224. <dd>Array of all of the topics</dd>
  225. <dt>$row</dt>
  226. <dd>The data for this topic</dd>
  227. <dt>$temp</dt>
  228. <dd>The yet-to-be-processed template</dd>
  229. <dt><em>Return value</em></dt>
  230. <dd>String</dd>
  231. </dl>
  232. <h3><small>Added in v1.4.0</small><a name="forum_topics_start">forum_topics_start</a></h3>
  233. <p>Allows modifying of the Topics display template before it is processed</p>
  234. <code><samp>$str</samp> = $this->extensions->universal_call('<strong>forum_topics_start</strong>', <var>$this</var>, <var>$str</var>);
  235. if ($this->extensions->end_script === TRUE) return $str;</code>
  236. <dl>
  237. <dt>$this</dt>
  238. <dd>The current Forum Core object</dd>
  239. <dt>$str</dt>
  240. <dd>The topics template</dd>
  241. <dt><em>Return value</em></dt>
  242. <dd>String</dd>
  243. </dl>
  244. <h3><small>Added in v1.6.8</small><a name="main_forum_table_rows_template">main_forum_table_rows_template</a></h3>
  245. <p>Allows modifying of the forum_table_rows template</p>
  246. <code><samp>$table_rows</samp> = $this->extensions->universal_call('<strong>main_forum_table_rows_template</strong>', <var>$this</var>, <var>$query->result</var>, <var>$row</var>, <var>$temp</var>);
  247. if ($this->extensions->end_script === TRUE) return $table_rows;</code>
  248. <dl>
  249. <dt>$this</dt>
  250. <dd>The current Forum Core object</dd>
  251. <dt>$table_rows</dt>
  252. <dd>The unparsed forum table rows template</dd>
  253. <dt>$row</dt>
  254. <dd>Array of data for the current row</dd>
  255. <dt>$markers</dt>
  256. <dd>Array of topic markers</dd>
  257. <dt>$read_topics</dt>
  258. <dd>Array of topics read by current visitor</dd>
  259. <dt><em>Return value</em></dt>
  260. <dd>Array</dd>
  261. </dl>
  262. </div><!-- content -->
  263. <p class="center"><a href="#top">Top of Page</a></p>
  264. <!-- {user_guide_comments} -->
  265. <div id="footer">
  266. <address><a href="http://expressionengine.com/">ExpressionEngine</a> &#8211; Copyright &#169; 2002-2011 &#8211; <a href="http://ellislab.com/">EllisLab, Inc.</a></address>
  267. </div>
  268. </body>
  269. </html>