]> git.mjollnir.org Git - moodle.git/commitdiff
message_history_link() - replace use sql_concat() and sql_like()
authormartinlanghoff <martinlanghoff>
Tue, 26 Sep 2006 05:05:32 +0000 (05:05 +0000)
committermartinlanghoff <martinlanghoff>
Tue, 26 Sep 2006 05:05:32 +0000 (05:05 +0000)
message/lib.php

index acdec0c456a7ac15c84b3dae17aeedc4f0619def..f09612fa85fad733ea186dad40b57b6a2c638ae0 100644 (file)
@@ -664,19 +664,8 @@ function message_history_link($userid1, $userid2=0, $returnstr=false, $keywords=
 function message_search_users($courseid, $searchtext, $sort='', $exceptions='') {
     global $CFG;
 
-    switch ($CFG->dbtype) {
-        case 'mysql':
-             $fullname = ' CONCAT(u.firstname," ",u.lastname) ';
-             $LIKE = 'LIKE';
-             break;
-        case 'postgres7':
-             $fullname = " u.firstname||' '||u.lastname ";
-             $LIKE = 'ILIKE';
-             break;
-        default:
-             $fullname = ' u.firstname||" "||u.lastname ';
-             $LIKE = 'ILIKE';
-    }
+    $fullname = sql_fullname();
+    $LIKE     = sql_like();
 
     if (!empty($exceptions)) {
         $except = ' AND u.id NOT IN ('. $exceptions .') ';