root/devel/mod/profile/lib/function_search_ecl.php

Revision 1301, 1.9 kB (checked in by dramirez, 1 year ago)

Moved from units to mod:

  • profile
  • users
  • template

Updated .htaccess rules

  • Property svn:eol-style set to native
Line 
1 <?php
2 global $CFG;
3 global $db;
4     // Search criteria are passed in $parameter from run("search:display")
5     
6         $handle = 0;
7         foreach($data['profile:details'] as $profiletype) {
8             if ($profiletype->internal_name == $parameter[0] && $profiletype->field_type == "keywords") {
9                 $handle = 1;
10             }
11         }
12     
13         if ($handle) {
14             
15             $sub_result = "";
16             
17             $searchline = "tagtype = " . $db->qstr($parameter[0]) ." AND tag = " . $db->qstr($parameter[1]) . "";
18             $searchline = "(" . run("users:access_level_sql_where",$_SESSION['userid']) . ") and " . $searchline;
19             $searchline = str_replace("owner", "t.owner", $searchline);
20             //$parameter[1] = stripslashes($parameter[1]);
21             if ($result = get_record_sql('SELECT DISTINCT u.* FROM '.$CFG->prefix.'tags t
22                                           JOIN '.$CFG->prefix.'users u ON u.ident = t.owner
23                                           WHERE '.$searchline)) {
24                 foreach($result as $key => $info) {
25                     
26                     $icon = user_icon_html($info->ident,100,true);
27                     
28                     $sub_result .= "\t\t\t<item>\n";
29                     $sub_result .= "\t\t\t\t<name><![CDATA[" . htmlspecialchars(stripslashes(user_name($info->ident)), ENT_COMPAT, 'utf-8') . "]]></name>\n";
30                     $sub_result .= "\t\t\t\t<link>" . url . htmlspecialchars($info->username, ENT_COMPAT, 'utf-8') . "</link>\n";
31                     $sub_result .= "\t\t\t\t<link>$icon</link>\n";
32                     $sub_result .= "\t\t\t</item>\n";
33                 }
34             }
35             
36             if ($sub_result != "") {
37                 
38                 $run_result .= "\t\t<profiles tagtype=\"".addslashes(htmlspecialchars($parameter[0], ENT_COMPAT, 'utf-8'))."\">\n" . $sub_result . "\t\t</profiles>\n";
39                 
40             }
41             
42         }
43
44 ?>
Note: See TracBrowser for help on using the browser.