Menu

YellowBeetle Forum

Sub-Menu

Function Reference

yb_forum_topics_list()

This fetches the list of existing topic titles. A topic here is a collection of posts on one subject. The subject is the title of the topic.

Parameters: $opts = array(), $catslug=false, $return = false

Options in $opt:

Option String Description
'template' The template to use to output the list. The default value is  'topiclisting.html'
skip-template Default = false. If set to true the function will not output the list of topics to the browser but instead return an array. The array has two elements: 'topics' is an array of the data for the topics list that would have been displayed, 'paging' is false unless 'pagination' is non-zero. If pagination is non-zero then paging contain information about which entries are on the current page, including links to previous and next pages.
hide-empty Default = false. If true then topics with no associated posts are not included in the list. Note: There is a schedule task that will delete topics with no posts after a delay., see the settings page.
sort-order Default = "recent-first". Values: "recent-first", "recent-last". Display topics with the most recent at the top of the list or bottom of the list respectively
pagination Default = 0. If >0 then that many topics will be displayed 

$catslug 

Filter the topics returned by a Forum Category, enter the slug for the category here.

$return

If return is true then the HTML output is returned by the function rather than it being echoed to the browser. 

 

yb_forum_topic_title()

Fetches the text of the topic title identified by the value of $topicID. Generally used to add the title of the topic to the top of the list of posts on that topic.

Parameters: $topicID, $opts=array(), $return=false

$topicID

The ID of the topic you want the title for.

Options in $opt:

Option String Description
'template' The template to use to output the list. The default value is 'topictitle.html'
'skip-template' If true the function returns the topic identified by topicID as an array

$return

If return is true then the HTML output is returned by the function rather than it being echoed to the browser. 

 

yb_forum_posts_list()

List of posts on the given topic given by $topicID

Parameters: $topicID, $opts=array(), $return=false

$topicID

The ID of the topic you want the title for.

Options in $opt:

Option String Description
'template' The template to use to output the list. The default value is 'postlisting.html'
skip-template Default = false. If set to true the function will not output the list of topics to the browser but instead return an array. The array has two elements: 'topics' is an array of the data for the topics list that would have been displayed, 'paging' is false unless 'pagination' is non-zero. If pagination is non-zero then paging contain information about which entries are on the current page, including links to previous and next pages.
sort-order Default = "recent-first". Values: "recent-first", "recent-last". Display topics with the most recent at the top of the list or bottom of the list respectively
pagination Default = 0. If >0 then that many topics will be displayed 

$return

If return is true then the HTML output is returned by the function rather than it being echoed to the browser.

 

yb_forum_categories_list

Get a list of forum categories.

Paramters: $opts = array(), $return = false

Options in $opt:

Option String Description
'template' Default = 'catlisting.html'
'skip-template' Default = false. If set to true the function will not output the list of topics to the browser but instead return an array.

$return

If return is true then the HTML output is returned by the function rather than it being echoed to the browser.

 

yb_forum_category

Get/Display the required Forum Category

Parameters: $identifier, $opts=array(), $return=false

$identifier

The id or the slug for the required category

Options for $opt

Option String Description
'template' Default = 'cattitle.html'
'skip-template' Default = false. If set to true the function will not output the list of topics to the browser but instead return an array.

$return

If return is true then the HTML output is returned by the function rather than it being echoed to the browser.

 

 

yb_forum_topic_create_form()

Generates a form where the user can input the title of the topic they want to start. After entering this form the user is redirected to the page given in Perch Settings.

Parameters: $opts=array(), $return=false

Options in $opt:

Option String Description
'template' The template to use to output the list. The default value is 'topic_form.html'

$return

If return is true then the HTML output is returned by the function rather than it being echoed to the browser.

 

yb_forum_topic_edit_form()

Generate a form where a user can edit an existing topic title given by $topicID

Parameters: $topicID, $opts=array(), $return=false

$topicID

The ID number of the topic to edit

Options in $opt:

Option String Description
'template' The template to use to output the list. The default value is 'topic_form.html'

$return

If return is true then the HTML output is returned by the function rather than it being echoed to the browser.

 

yb_forum_post_create_form()

Generate a form where a user can add a new post to an existing topic. The post will be added to the topic given by $topicID. After entering this form the user is redirected to the page given in Perch Settings.

Parameters: $topicID, $opts=array(), $return=false

$topicID

The ID of the topic that the new post will belong to.

Options in $opt:

Option String Description
'template' The template to use to output the list. The default value is 'post_form.html'

$return

If return is true then the HTML output is returned by the function rather than it being echoed to the browser.

 

yb_forum_post_edit_form()

Generate a form where a user can edit an existing post identified by $postID. After entering this form the user will be redirected to the page given in Perch Settings.

Parameters: $postID, $opts=array(), $return=false

$postID:

The ID number of the post to edit

Options in $opt:

Option String Description
'template' The template to use to output the list. The default value is 'post_form.html'

$return

If return is true then the HTML output is returned by the function rather than it being echoed to the browser.

 

yb_forum_add_watch

Adds an entry into the watch table for the specified member on the specified topic. When someone else adds a post to that topic an email will be sent to that member.

Parameters: $topicID, $memberID=0

$topicID

The ID number of the topic that will be watched.

$memberID

The ID number of the member to add to the watch list. If 0 (default) the ID will be obtained from the currently logged in member.

 

yb_forum_remove_watch

Removes the entry in the watch table for the specified member on the specified topic. 

Parameters: $topicID, $memberID=0

$topicID

The ID number of the topic that will be watched.

$memberID

The ID number of the member to add to the watch list. If 0 (default) the ID will be obtained from the currently logged in member.

 

yb_forum_is_watched

Returns true if the $topicID, $memberID pair is found in the watches list.

Parameters: $topicID, $memberID=0

$topicID

The ID number of the topic that will be watched.

$memberID

The ID number of the member to add to the watch list. If 0 (default) the ID will be obtained from the currently logged in member.