ExpressionEngine® User Guide

Legacy Documentation

You are using the documentation for version 4.3.8. Go here for the latest version.

Forum Module Extension Hooks

forum_add_template

forum_add_template($which, $classname)

Allows the addition and loading of entirely new templates.

How it’s called:

$classname = ee()->extensions->call('forum_add_template', $which, $classname);
Parameters:
  • $which (string) – The name of the template to be loaded.
  • $classname (string) – The name of the class and thus folder associated with the template name or FALSE.
Returns:

Modified $classname

Return type:

String

New in version 2.5.0.

forum_include_extras

forum_include_extras($this, $function, $element)

Allows additional processing of forum templates that are not associated with an existing forum method call. Can be used in conjunction with the forum_add_template hook to parse entirely new templates.

How it’s called:

$element = ee()->extensions->call('forum_include_extras', $this, $function, $element);
Parameters:
  • $this (object) – The current Forum object
  • $function (string) – The name of the template being parsed.
  • $element (string) – A string containing the contents of the template.
Returns:

Modified temlate ($element)

Return type:

String

New in version 2.5.0.

forum_submission_form_start

forum_submission_form_start($this, $str)

Allows rewrite or modify of Submission form template before processing

How it’s called:

$str = ee()->extensions->universal_call('forum_submission_form_start', $this, $str);
if (ee()->extensions->end_script === TRUE) return $str;
Parameters:
  • $this (object) – The current Forum Core object
  • $str (string) – Submission form template
Returns:

Modified forum template ($str)

Return type:

String

New in version 1.4.0.

forum_submission_form_end

forum_submission_form_end($this, $str)

Final chance to modify the submission form before it is displayed

How it’s called:

$str = ee()->extensions->universal_call('forum_submission_form_end', $this, $str);
if (ee()->extensions->end_script === TRUE) return $str;
Parameters:
  • $this (object) – The current Forum Core object
  • $str (string) – Submission form template
Returns:

Modified form template ($str)

Return type:

String

New in version 1.4.0.

forum_submission_page

forum_submission_page($this, $type)

Allows usurping of forum submission forms and more error checking and permissions, too.

How it’s called:

$edata = $this->extensions->universal_call('forum_submission_page', $this, $type);
if ($this->extensions->end_script === TRUE) return $edata;
Parameters:
  • $this (object) – The current Forum Core object
  • $type (string) – new_topic, edit_topic, new_reply, edit_reply
Return type:

Void

New in version 1.4.0.

forum_submit_post_start

forum_submit_post_start($this)

Allows usurping of forum submission routine or possible adding more checks and permissions.

How it’s called:

$edata = ee()->extensions->universal_call('forum_submit_post_start', $this);
if (ee()->extensions->end_script === TRUE) return $edata;
Parameters:
  • $this (object) – The current Forum Core object
Return type:

Void

New in version 1.4.0.

forum_submit_post_end

forum_submit_post_end($this, $data)

Do more processing after the post is submitted.

How it’s called:

$edata = ee()->extensions->universal_call('forum_submit_post_end', $this, $data);
if (ee()->extensions->end_script === TRUE) return $edata;
Parameters:
  • $this (object) – The current Forum Core object
  • $data (array) – the forum post data array
Return type:

Void

Note

User notifications have not been sent at this point.

New in version 1.5.2.

forum_threads_template

forum_threads_template($this, $str, $tquery)

Allows modifying of the Threads display template before it is processed.

How it’s called:

$str = ee()->extensions->universal_call('forum_threads_template', $this, $str, $tquery);
if (ee()->extensions->end_script === TRUE) return $str;
Parameters:
  • $this (object) – The current Forum Core object
  • $str (string) – The topics thread template
  • $tquery (object) – Thread database object
Returns:

Modified threads template ($str) before processing

Return type:

String

New in version 1.4.0.

forum_thread_rows_absolute_end

forum_thread_rows_absolute_end($this, $data, $thread_rows)

Take the processed thread rows and do what you wish

How it’s called:

$thread_rows = ee()->extensions->universal_call('forum_thread_rows_absolute_end', $this, $data, $thread_rows);
if (ee()->extensions->end_script === TRUE) return $thread_rows;
Parameters:
  • $this (object) – The current Forum Core object
  • $data (array) – Information about the current group of thread_rows (announcement, topic, all posts, etc.)
  • $thread_rows (string) – The fully processed thread row template
Returns:

Modified thread row template ($thread_rows)

Return type:

String

New in version 1.5.1.

forum_thread_rows_loop_start

forum_thread_rows_loop_start($this, $data, $row, $temp)

Modify the thread row template and data before any processing takes place.

How it’s called:

$temp = ee()->extensions->universal_call('forum_thread_rows_loop_start', $this, $data, $row, $temp);
if (ee()->extensions->end_script === TRUE) return;
Parameters:
  • $this (object) – The current Forum Core object
  • $data (array) – The data for all thread rows
  • $row (array) – The data for this thread row (post)
  • $temp (string) – The processed thread row
Returns:

Modified thread row ($temp)

Return type:

String

New in version 1.5.1.

forum_thread_rows_loop_end

forum_thread_rows_loop_end($this, $data, $row, $temp)

Modify the processed row before it is appended to the template output.

How it’s called:

$temp = ee()->extensions->universal_call('forum_thread_rows_loop_end', $this, $data, $row, $temp);
if (ee()->extensions->end_script === TRUE) return;
Parameters:
  • $this (object) – The current Forum Core object
  • $data (array) – The data for all thread rows
  • $row (array) – The data for this thread row (post)
  • $temp (string) – The processed thread row
Returns:

Modified thread row ($temp)

Return type:

String

New in version 1.5.1.

forum_thread_rows_start

forum_thread_rows_start($this, $template, $data, $is_announcement, $thread_review)

Allows modifying of the thread rows template.

How it’s called:

$template = ee()->extensions->universal_call('forum_thread_rows_start', $this, $template, $data, $is_announcement, $thread_review);
if (ee()->extensions->end_script === TRUE) return $template;
Parameters:
  • $this (object) – The current Forum Core object
  • $template (string) – The topics thread row template
  • $data (array) – The data for this thread row (post)
  • $is_announcement (boolean) – TRUE if announcement
  • $thread_review (boolean) – TRUE if thread review
Returns:

Modified thread rows template ($template)

Return type:

String

New in version 1.4.0.

forum_topics_absolute_end

forum_topics_absolute_end($this, $result, $str)

Modify the finalized topics template and do what you wish.

How it’s called:

$str = ee()->extensions->universal_call('forum_topics_absolute_end', $this, $query->result(), $str);
if (ee()->extensions->end_script === TRUE) return $str;
Parameters:
  • $this (object) – The current Forum Core object
  • $result (array) – Array of all of the displayed topics
  • $str (string) – The finalized topics template
Returns:

Modified topics template ($str)

Return type:

String

New in version 1.5.1.

forum_topics_loop_start

forum_topics_loop_start($this, $result, $row, $temp)

Modify the topic row template and data before any processing takes place.

How it’s called:

$temp = ee()->extensions->universal_call('forum_topics_loop_start', $this, $query->result(), $row, $temp);
if (ee()->extensions->end_script === TRUE) return;
Parameters:
  • $this (object) – The current Forum Core object
  • $result (array) – Array of all of the topics
  • $row (array) – The data for this topic
  • $temp (string) – The yet-to-be-processed template
Returns:

Modified topic row template ($temp)

Return type:

String

New in version 1.5.1.

forum_topics_loop_end

forum_topics_loop_end($this, $result, $row, $temp)

Modify the processed topic row before it is appended to the template output.

How it’s called:

$temp = ee()->extensions->universal_call('forum_topics_loop_end', $this, $query->result(), $row, $temp);
if (ee()->extensions->end_script === TRUE) return;
Parameters:
  • $this (object) – The current Forum Core object
  • $result (array) – Array of all of the topics
  • $row (array) – The data for this topic
  • $temp (string) – The yet-to-be-processed template
Returns:

Modified topic row ($temp)

Return type:

String

New in version 1.5.1.

forum_topics_start

forum_topics_start($this, $str)

Allows modifying of the Topics display template before it is processed.

How it’s called:

$str = ee()->extensions->universal_call('forum_topics_start', $this, $str);
if (ee()->extensions->end_script === TRUE) return $str;
Parameters:
  • $this (object) – The current Forum Core object
  • $str (string) – The topics template
Returns:

Modified topics template ($str)

Return type:

String

New in version 1.4.0.

main_forum_table_rows_template

main_forum_table_rows_template()

Allows modifying of the forum_table_rows template

How it’s called:

$table_rows = ee()->extensions->universal_call('main_forum_table_rows_template', $this, $table_rows, $row, $markers, $read_topics);
if (ee()->extensions->end_script === TRUE) return $table_rows;
Parameters:
  • $this (object) – The current Forum Core object
  • $table_rows (string) – The unparsed forum table rows template
  • $row (array) – Array of data for the current row
  • $markers (array) – Array of topic markers
  • $read_topics (array) – Array of topics read by current visitor
Returns:

Modified and parsed forum table rows template ($table_rows)

Return type:

Array

New in version 1.6.8.