Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/forum/search.php File Reference

Go to the source code of this file.

Namespaces

namespace  mod
 

Local Library of functions for module scorm.


Functions

 forum_print_big_search_form ($course)
 forum_clean_search_terms ($words, $prefix='')
 forum_menu_list ($course)

Variables

 $id = required_param('id', PARAM_INT)
 $search = trim(optional_param('search', '', PARAM_NOTAGS))
 $page = optional_param('page', 0, PARAM_INT)
 $perpage = optional_param('perpage', 10, PARAM_INT)
 $showform = optional_param('showform', 0, PARAM_INT)
 $user = trim(optional_param('user', '', PARAM_NOTAGS))
 $userid = trim(optional_param('userid', 0, PARAM_INT))
 $forumid = trim(optional_param('forumid', 0, PARAM_INT))
 $subject = trim(optional_param('subject', '', PARAM_NOTAGS))
 $phrase = trim(optional_param('phrase', '', PARAM_NOTAGS))
 $words = trim(optional_param('words', '', PARAM_NOTAGS))
 $fullwords = trim(optional_param('fullwords', '', PARAM_NOTAGS))
 $notwords = trim(optional_param('notwords', '', PARAM_NOTAGS))
 $timefromrestrict = optional_param('timefromrestrict', 0, PARAM_INT)
 $fromday = optional_param('fromday', 0, PARAM_INT)
 $frommonth = optional_param('frommonth', 0, PARAM_INT)
 $fromyear = optional_param('fromyear', 0, PARAM_INT)
 $fromhour = optional_param('fromhour', 0, PARAM_INT)
 $fromminute = optional_param('fromminute', 0, PARAM_INT)
 $today = optional_param('today', 0, PARAM_INT)
 $tomonth = optional_param('tomonth', 0, PARAM_INT)
 $toyear = optional_param('toyear', 0, PARAM_INT)
 $tohour = optional_param('tohour', 0, PARAM_INT)
 $tominute = optional_param('tominute', 0, PARAM_INT)
 $strforums = get_string("modulenameplural", "forum")
 $strsearch = get_string("search", "forum")
 $strsearchresults = get_string("searchresults", "forum")
 $strpage = get_string("page")
if(!$search||$showform) $searchterms = str_replace('forumid:', 'instance:', $search)
 We need to do a search now and print results.
 $searchform = forum_search_form($course, $search)
 if (!$posts=forum_search_posts($searchterms, $course->id, $page *$perpage, $perpage, $totalcount))
 $ratingoptions = new stdClass()
$ratingoptions component = 'mod_forum'
$ratingoptions ratingarea = 'post'
$ratingoptions userid = $USER->id
$ratingoptions returnurl = $PAGE->url->out(false)
 $rm = new rating_manager()
 $url = new moodle_url('search.php', array('search' => $search, 'id' => $course->id, 'perpage' => $perpage))
 $strippedsearch = str_replace('user:','',$search)
 foreach ($posts as $post)

Function Documentation

forum_clean_search_terms ( words,
prefix = '' 
)

This function takes each word out of the search string, makes sure they are at least two characters long and returns an array containing every good word.

Parameters:
string$wordsString containing space-separated strings to search for
string$prefixString to prepend to the each token taken out of $words
Returns:
array
Todo:
Take the hardcoded limit out of this function and put it into a user-specified parameter

Definition at line 428 of file search.php.

forum_menu_list ( course)
Todo:
Document this function

Definition at line 443 of file search.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Todo:
Document this function

Definition at line 300 of file search.php.

Here is the call graph for this function:


Variable Documentation

$forumid = trim(optional_param('forumid', 0, PARAM_INT))

Definition at line 35 of file search.php.

$fromday = optional_param('fromday', 0, PARAM_INT)

Definition at line 43 of file search.php.

$fromhour = optional_param('fromhour', 0, PARAM_INT)

Definition at line 46 of file search.php.

$fromminute = optional_param('fromminute', 0, PARAM_INT)

Definition at line 47 of file search.php.

$frommonth = optional_param('frommonth', 0, PARAM_INT)

Definition at line 44 of file search.php.

$fromyear = optional_param('fromyear', 0, PARAM_INT)

Definition at line 45 of file search.php.

$fullwords = trim(optional_param('fullwords', '', PARAM_NOTAGS))

Definition at line 39 of file search.php.

Definition at line 27 of file search.php.

$notwords = trim(optional_param('notwords', '', PARAM_NOTAGS))

Definition at line 40 of file search.php.

Definition at line 29 of file search.php.

$perpage = optional_param('perpage', 10, PARAM_INT)

Definition at line 30 of file search.php.

$phrase = trim(optional_param('phrase', '', PARAM_NOTAGS))

Definition at line 37 of file search.php.

$ratingoptions = new stdClass()

Definition at line 165 of file search.php.

$rm = new rating_manager()

Definition at line 170 of file search.php.

Definition at line 28 of file search.php.

$searchform = forum_search_form($course, $search)

Definition at line 141 of file search.php.

$searchterms = str_replace('forumid:', 'instance:', $search)

We need to do a search now and print results.

Definition at line 138 of file search.php.

$showform = optional_param('showform', 0, PARAM_INT)

Definition at line 31 of file search.php.

$strforums = get_string("modulenameplural", "forum")

Definition at line 117 of file search.php.

foreach ($searchterms as $key=> $searchterm) $strippedsearch = str_replace('user:','',$search)

Definition at line 199 of file search.php.

$strpage = get_string("page")

Definition at line 120 of file search.php.

$strsearch = get_string("search", "forum")

Definition at line 118 of file search.php.

$strsearchresults = get_string("searchresults", "forum")

Definition at line 119 of file search.php.

$subject = trim(optional_param('subject', '', PARAM_NOTAGS))

Definition at line 36 of file search.php.

$timefromrestrict = optional_param('timefromrestrict', 0, PARAM_INT)

Definition at line 42 of file search.php.

$today = optional_param('today', 0, PARAM_INT)

Definition at line 55 of file search.php.

$tohour = optional_param('tohour', 0, PARAM_INT)

Definition at line 58 of file search.php.

$tominute = optional_param('tominute', 0, PARAM_INT)

Definition at line 59 of file search.php.

$tomonth = optional_param('tomonth', 0, PARAM_INT)

Definition at line 56 of file search.php.

$toyear = optional_param('toyear', 0, PARAM_INT)

Definition at line 57 of file search.php.

$url = new moodle_url('search.php', array('search' => $search, 'id' => $course->id, 'perpage' => $perpage))

Definition at line 194 of file search.php.

Definition at line 33 of file search.php.

Definition at line 34 of file search.php.

$words = trim(optional_param('words', '', PARAM_NOTAGS))

Definition at line 38 of file search.php.

$ratingoptions component = 'mod_forum'

Definition at line 166 of file search.php.

foreach($posts as $post)

Definition at line 212 of file search.php.

if(!$posts=forum_search_posts($searchterms, $course->id, $page *$perpage, $perpage, $totalcount))

Definition at line 145 of file search.php.

$ratingoptions ratingarea = 'post'

Definition at line 167 of file search.php.

$ratingoptions returnurl = $PAGE->url->out(false)

Definition at line 169 of file search.php.

$ratingoptions userid = $USER->id

Definition at line 168 of file search.php.

 All Data Structures Namespaces Files Functions Variables Enumerations