Changeset 543
- Timestamp:
- 09/13/06 12:41:44 (2 years ago)
- Files:
-
- devel/mod/community/lib.php (modified) (1 diff)
- devel/mod/profile/lib.php (modified) (1 diff)
- devel/search/index.php (modified) (2 diffs)
- devel/units/files/function_search.php (modified) (2 diffs)
- devel/units/profile/function_search.php (modified) (4 diffs)
- devel/units/search/function_display.php (modified) (1 diff)
- devel/units/search/function_search_all_display.php (modified) (1 diff)
- devel/units/weblogs/function_search.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/mod/community/lib.php
r499 r543 58 58 59 59 } 60 61 $PAGE->search_menu[] = array( 'name' => gettext("Communities"), 62 'user_type' => 'community'); 60 63 61 64 } devel/mod/profile/lib.php
r527 r543 36 36 } 37 37 } 38 39 $PAGE->search_menu[] = array( 'name' => gettext("People"), 40 'user_type' => 'person'); 41 38 42 } 39 43 devel/search/index.php
r526 r543 3 3 // ELGG profile search page 4 4 5 global $PAGE, $db, $search_exclusions; 6 5 7 // Run includes 6 8 require_once(dirname(dirname(__FILE__))."/includes.php"); … … 13 15 $title = gettext("Search"); 14 16 templates_page_setup(); 15 16 $body = run("content:profile:search"); 17 18 $PAGE->search_type_unformatted = optional_param('user_type',''); 19 $PAGE->search_type = $db->qstr($PAGE->search_type_unformatted); 20 21 $querystring = ""; 22 if (isset($_GET) && !empty($_GET)) { 23 foreach($_GET as $key => $value) { 24 if ($key != 'user_type') { 25 if (!empty($querystring)) { 26 $querystring .= "&"; 27 } 28 $querystring .= urlencode($key); 29 $querystring .= "="; 30 $querystring .= urlencode(optional_param($key,'')); 31 } 32 } 33 } 34 $querystring = $CFG->wwwroot . "search/index.php?" . $querystring; 35 36 $body .= "<p>" . gettext("Searching") . " "; 37 38 if ($PAGE->search_type == "''") { 39 $body .= "<b class=\"selected_search_type\">"; 40 } 41 $body .= "<a href=\"$querystring\">" . gettext("All") . "</a> "; 42 if ($PAGE->search_type == "''") { 43 $body .= "</b>"; 44 } 45 46 if (isset($PAGE->search_menu) && is_array($PAGE->search_menu) && !empty($PAGE->search_menu)) { 47 foreach($PAGE->search_menu as $search_type) { 48 if ($PAGE->search_type_unformatted == $search_type['user_type']) { 49 $body .= "<b class=\"selected_search_type\">"; 50 } 51 $body .= "<a href=\"$querystring&user_type=" . $search_type['user_type'] . "\">" . $search_type['name'] . "</a> "; 52 if ($PAGE->search_type_unformatted == $search_type['user_type']) { 53 $body .= "</b>"; 54 } 55 } 56 } 57 $body .= "</p>"; 58 17 59 $body .= run("search:display"); 18 60 devel/units/files/function_search.php
r458 r543 1 1 <?php 2 global $CFG,$USER ;2 global $CFG,$USER,$PAGE; 3 3 global $db; 4 4 global $search_exclusions; … … 23 23 } 24 24 $searchline = " ff.ident IN (" . implode(", ", $searchlist) . ") "; 25 if (!empty($PAGE->search_type_unformatted)) { 26 $searchline .= " AND u.user_type = " . $PAGE->search_type; 27 } 25 28 $folders = get_records_sql('SELECT ff.name,u.name AS userfullname,u.ident as userid,u.username,ff.ident 26 29 FROM '.$CFG->prefix.'file_folders ff devel/units/profile/function_search.php
r458 r543 1 1 <?php 2 global $CFG; 3 global $db; 2 3 global $CFG, $db, $PAGE; 4 4 5 // Search criteria are passed in $parameter from run("search:display") 5 6 … … 17 18 $searchline = "tagtype = " . $db->qstr($parameter[0]) . " AND tag = " . $db->qstr($parameter[1]) . ""; 18 19 $searchline = "(" . run("users:access_level_sql_where",$_SESSION['userid']) . ") and " . $searchline; 20 if (!empty($PAGE->search_type_unformatted)) { 21 $searchline .= " AND u.user_type = " . $PAGE->search_type; 22 } 23 19 24 $searchline = str_replace("owner","t.owner",$searchline); 20 25 … … 48 53 $friends_name = run("profile:display:name",$info->ident); 49 54 $info->icon = run("icons:get",$info->ident); 50 $friends_menu = run("users:infobox:menu",array($info->ident));51 55 $body .= <<< END 52 56 <td align="center"> … … 55 59 <img src="{$CFG->wwwroot}{$friends_username}/icons/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br /> 56 60 <span class="userdetails"> 57 {$friends_name} 58 {$friends_menu} 61 <a href="{$CFG->wwwroot}{$friends_username}/">{$friends_name}</a> 59 62 </span> 60 63 </p> devel/units/search/function_display.php
r269 r543 16 16 17 17 foreach($query as $field => $value) { 18 if ($field != user_session_name && $field != "ref" && $field != "owner" && $field != "psaContext" && $field != "PHPSESSID" ) {18 if ($field != user_session_name && $field != "ref" && $field != "owner" && $field != "psaContext" && $field != "PHPSESSID" && $field != "user_type") { 19 19 // $searchline = "tagtype = '".addslashes($field)."' and tag = '".addslashes($value)."'"; 20 20 $run_result .= run("search:display_results", array($field,$value)); devel/units/search/function_search_all_display.php
r269 r543 14 14 15 15 } 16 if ($tag != "ref" && $tag != "owner" && $tag != user_session_name ) {16 if ($tag != "ref" && $tag != "owner" && $tag != user_session_name && $tag != "user_type") { 17 17 $run_result .= run("search:tags:suggest",$tag); 18 18 $run_result .= run("search:users:suggest",$tag); devel/units/weblogs/function_search.php
r458 r543 1 1 <?php 2 global $CFG, $USER, $db ;2 global $CFG, $USER, $db, $PAGE; 3 3 global $search_exclusions; 4 4 … … 17 17 $searchline = "(" . run("users:access_level_sql_where",$_SESSION['userid']) . ") AND " . $searchline; 18 18 $searchline = str_replace("owner","t.owner",$searchline); 19 if (!empty($PAGE->search_type_unformatted)) { 20 $searchline .= " AND u.user_type = " . $PAGE->search_type; 21 } 19 22 if ($refs = get_records_select('tags t',$searchline)) { 20 23 $searchline = "";
