/development/extension_hooks/module/forum/index.html
HTML | 362 lines | 268 code | 93 blank | 1 comment | 0 complexity | 1587cc7bfe1f971df85ff8eda3a06f17 MD5 | raw file
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <title>Forum Module Extension Hooks – ExpressionEngine Developer Documentation</title>
- <meta name="MSSmartTagsPreventParsing" content="TRUE" />
- <link rel="contents" href="../../index.html" />
- <style type="text/css" media="screen,print">@import url(../../../../docs.css);</style>
- </head>
- <body>
- <div><a name="top"></a></div>
- <div id="header">
- <table cellpadding="0" cellspacing="0" border="0" style="width:100%;"><tr>
- <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>
- <td class="searchbox"><form method="get" action="http://www.google.com/search" class="searchbox"><div>Search <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/" /> <input type="submit" class="submit" name="sa" value="Search" /></div></form></td>
- </tr>
- </table>
- </div>
- <div id="navlinks">
- <a href="../../../../index.html">Table of Contents</a> >
- <a href="../../../index.html">Development</a> >
- <a href="../../index.html">Extension Hooks</a> >
- <strong>Forum Module Extension Hooks</strong>
- </div>
- <div id="content">
- <h1>Forum Module Extension Hooks</h1>
- <p>In the menu below you will find links to details about available extension hooks in the Forum module (mod.forum_core.php).</p>
- <ul class="toc">
- <li><a href="#forum_submission_form_start">forum_submission_form_start</a></li>
- <li><a href="#forum_submission_form_end">forum_submission_form_end</a></li>
- <li><a href="#forum_submission_page">forum_submission_page</a></li>
- <li><a href="#forum_submit_post_start">forum_submit_post_start</a></li>
- <li><a href="#forum_submit_post_end">forum_submit_post_end</a></li>
- <li><a href="#forum_threads_template">forum_threads_template</a></li>
- <li><a href="#forum_thread_rows_absolute_end">forum_thread_rows_absolute_end</a></li>
- <li><a href="#forum_thread_rows_loop_start">forum_thread_rows_loop_start</a></li>
- <li><a href="#forum_thread_rows_loop_end">forum_thread_rows_loop_end</a></li>
- <li><a href="#forum_thread_rows_start">forum_thread_rows_start</a></li>
- <li><a href="#forum_topics_absolute_end">forum_topics_absolute_end</a></li>
- <li><a href="#forum_topics_loop_start">forum_topics_loop_start</a></li>
- <li><a href="#forum_topics_loop_end">forum_topics_loop_end</a></li>
- <li><a href="#forum_topics_start">forum_topics_start</a></li>
- <li><a href="#main_forum_table_rows_template">main_forum_table_rows_template</a></li>
- </ul>
- <h3><small>Added in v1.4.0</small><a name="forum_submission_form_start">forum_submission_form_start</a></h3>
- <p>Allows rewrite or modify of Submission form template before processing</p>
- <code><samp>$str</samp> = $this->extensions->universal_call('<strong>forum_submission_form_start</strong>', <var>$this</var>, <var>$str</var>);
- if ($this->extensions->end_script === TRUE) return $str;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$str</dt>
- <dd>Submission form template</dd>
- <dt><em>Return value</em></dt>
- <dd>String</dd>
- </dl>
- <h3><small>Added in v1.4.0</small><a name="forum_submission_form_end">forum_submission_form_end</a></h3>
- <p>Final chance to modify the submission form before it is displayed</p>
- <code><samp>$str</samp> = $this->extensions->universal_call('<strong>forum_submission_form_end</strong>', <var>$this</var>, <var>$str</var>);
- if ($this->extensions->end_script === TRUE) return $str;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$str</dt>
- <dd>Submission form template</dd>
- <dt><em>Return value</em></dt>
- <dd>String</dd>
- </dl>
- <h3><small>Added in v1.4.0</small><a name="forum_submission_page">forum_submission_page</a></h3>
- <p>
- - Allows usurping of forum submission forms<br />
- - More error checking and permissions, too
- </p>
- <code><samp>$edata</samp> = $this->extensions->universal_call('<strong>forum_submission_page</strong>', <var>$this</var>, <var>$type</var>);
- if ($this->extensions->end_script === TRUE) return $edata;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$type</dt>
- <dd>new_topic, edit_topic, new_reply, edit_reply</dd>
- <dt><em>Return value</em></dt>
- <dd>void</dd>
- </dl>
- <h3><small>Added in v1.4.0</small><a name="forum_submit_post_start">forum_submit_post_start</a></h3>
- <p>Allows usurping of forum submission routine or possible adding more checks and permissions</p>
- <code><samp>$edata</samp> = $this->extensions->universal_call('<strong>forum_submit_post_start</strong>', <var>$this</var>);
- if ($this->extensions->end_script === TRUE) return $edata;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt><em>Return value</em></dt>
- <dd>void</dd>
- </dl>
-
- <h3><small>Added in v1.5.2</small><a name="forum_submit_post_end">forum_submit_post_end</a></h3>
- <p>Do more processing after the post is submitted.</p>
- <code><samp>$edata</samp> = $this->extensions->universal_call('<strong>forum_submit_post_end</strong>', <var>$this</var>, <var>$data</var>);
- if ($this->extensions->end_script === TRUE) return $edata;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$data</dt>
- <dd>the forum post data array</dd>
- <dt><em>Return value</em></dt>
- <dd>void</dd>
- </dl>
-
- <h4>Additional Notes</h4>
- <p>Note that user notifications have not been sent at this point. The $data array was added in build 20080626</p>
- <h3><small>Added in v1.4.0</small><a name="forum_threads_template">forum_threads_template</a></h3>
- <p>Allows modifying of the Threads display template before it is processed</p>
- <code><samp>$str</samp> = $this->extensions->universal_call('<strong>forum_threads_template</strong>', <var>$this</var>, <var>$str</var>, <var>$tquery</var>);
- if ($this->extensions->end_script === TRUE) return $str;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$str</dt>
- <dd>The topics thread template</dd>
- <dt>$tquery</dt>
- <dd>The data for this thread</dd>
- <dt><em>Return value</em></dt>
- <dd>String</dd>
- </dl>
- <h3><small>Added in v1.5.1</small><a name="forum_thread_rows_absolute_end">forum_thread_rows_absolute_end</a></h3>
- <p>Take the processed thread rows and do what you wish</p>
- <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>);
- if ($this->extensions->end_script === TRUE) return $thread_rows;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$data</dt>
- <dd>Information about the current group of thread_rows (announcement, topic, all posts, etc.)</dd>
- <dt>$thread_rows</dt>
- <dd>The fully processed thread row template</dd>
- <dt><em>Return value</em></dt>
- <dd>String</dd>
- </dl>
- <h3><small>Added in v1.5.1</small><a name="forum_thread_rows_loop_start">forum_thread_rows_loop_start</a></h3>
- <p>Modify the thread row template and data before any processing takes place</p>
- <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>);
- if ($this->extensions->end_script === TRUE) return;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$data</dt>
- <dd>The data for all thread rows</dd>
- <dt>$row</dt>
- <dd>The data for this thread row (post)</dd>
- <dt>$temp</dt>
- <dd>The processed thread row</dd>
- <dt><em>Return value</em></dt>
- <dd>String</dd>
- </dl>
- <h3><small>Added in v1.5.1</small><a name="forum_thread_rows_loop_end">forum_thread_rows_loop_end</a></h3>
- <p>Modify the processed row before it is appended to the template output</p>
- <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>);
- if ($this->extensions->end_script === TRUE) return;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$data</dt>
- <dd>The data for all thread rows</dd>
- <dt>$row</dt>
- <dd>The data for this thread row (post)</dd>
- <dt>$temp</dt>
- <dd>The processed thread row</dd>
- <dt><em>Return value</em></dt>
- <dd>String</dd>
- </dl>
- <h3><small>Added in v1.4.0</small><a name="forum_thread_rows_start">forum_thread_rows_start</a></h3>
- <p>Allows modifying of the thread rows template</p>
- <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>);
- if ($this->extensions->end_script === TRUE) return $template;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$template</dt>
- <dd>The topics thread row template</dd>
- <dt>$data</dt>
- <dd>The data for this thread row (post)</dd>
- <dt>$is_announcement</dt>
- <dd>TRUE/FALSE</dd>
- <dt>$thread_review</dt>
- <dd>TRUE/FALSE</dd>
- <dt><em>Return value</em></dt>
- <dd>String</dd>
- </dl>
- <h3><small>Added in v1.5.1</small><a name="forum_topics_absolute_end">forum_topics_absolute_end</a></h3>
- <p>Modify the finalized topics template and do what you wish</p>
- <code><samp>$str</samp> = $this->extensions->universal_call('<strong>forum_topics_absolute_end</strong>', <var>$this</var>, <var>$query->result</var>, <var>$str</var>);
- if ($this->extensions->end_script === TRUE) return $str;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$query->result</dt>
- <dd>Array of all of the displayed topics</dd>
- <dt>$str</dt>
- <dd>The finalized topics template</dd>
- <dt><em>Return value</em></dt>
- <dd>String</dd>
- </dl>
- <h3><small>Added in v1.5.1</small><a name="forum_topics_loop_start">forum_topics_loop_start</a></h3>
- <p>Modify the topic row template and data before any processing takes place</p>
- <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>);
- if ($this->extensions->end_script === TRUE) return;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$query->result</dt>
- <dd>Array of all of the topics</dd>
- <dt>$row</dt>
- <dd>The data for this topic</dd>
- <dt>$temp</dt>
- <dd>The yet-to-be-processed template</dd>
- <dt><em>Return value</em></dt>
- <dd>String</dd>
- </dl>
- <h3><small>Added in v1.5.1</small><a name="forum_topics_loop_end">forum_topics_loop_end</a></h3>
- <p>Modify the processed topic row before it is appended to the template output</p>
- <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>);
- if ($this->extensions->end_script === TRUE) return;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$query->result</dt>
- <dd>Array of all of the topics</dd>
- <dt>$row</dt>
- <dd>The data for this topic</dd>
- <dt>$temp</dt>
- <dd>The yet-to-be-processed template</dd>
- <dt><em>Return value</em></dt>
- <dd>String</dd>
- </dl>
- <h3><small>Added in v1.4.0</small><a name="forum_topics_start">forum_topics_start</a></h3>
- <p>Allows modifying of the Topics display template before it is processed</p>
- <code><samp>$str</samp> = $this->extensions->universal_call('<strong>forum_topics_start</strong>', <var>$this</var>, <var>$str</var>);
- if ($this->extensions->end_script === TRUE) return $str;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$str</dt>
- <dd>The topics template</dd>
- <dt><em>Return value</em></dt>
- <dd>String</dd>
- </dl>
- <h3><small>Added in v1.6.8</small><a name="main_forum_table_rows_template">main_forum_table_rows_template</a></h3>
- <p>Allows modifying of the forum_table_rows template</p>
- <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>);
- if ($this->extensions->end_script === TRUE) return $table_rows;</code>
- <dl>
- <dt>$this</dt>
- <dd>The current Forum Core object</dd>
- <dt>$table_rows</dt>
- <dd>The unparsed forum table rows template</dd>
- <dt>$row</dt>
- <dd>Array of data for the current row</dd>
- <dt>$markers</dt>
- <dd>Array of topic markers</dd>
- <dt>$read_topics</dt>
- <dd>Array of topics read by current visitor</dd>
- <dt><em>Return value</em></dt>
- <dd>Array</dd>
- </dl>
- </div><!-- content -->
- <p class="center"><a href="#top">Top of Page</a></p>
- <!-- {user_guide_comments} -->
- <div id="footer">
- <address><a href="http://expressionengine.com/">ExpressionEngine</a> – Copyright © 2002-2011 – <a href="http://ellislab.com/">EllisLab, Inc.</a></address>
- </div>
- </body>
- </html>