/// Initialise some variables
$sqlorderby = '';
$sqlsortkey = NULL;
+ $textlib = textlib_get_instance();
/// Pivot is the field that set the break by groups (category, initial, author name, etc)
} else {
$usernamefield = "u.lastname || ' ' || u.firstname";
}
- $where = "AND substr(upper($usernamefield),1," . strlen($hook) . ") = '" . strtoupper($hook) . "'";
+ $where = "AND substr(upper($usernamefield),1," . $textlib->strlen($hook, current_charset()) . ") = '" . $textlib->strtoupper($hook, current_charset()) . "'";
break;
case 'mysql':
if ( $sqlsortkey == 'FIRSTNAME' ) {
} else {
$usernamefield = "CONCAT(CONCAT(u.lastname,' '), u.firstname)";
}
- $where = "AND left(ucase($usernamefield)," . strlen($hook) . ") = '$hook'";
+ $where = "AND left(ucase($usernamefield)," . $textlib->strlen($hook, current_charset()) . ") = '$hook'";
break;
}
if ( $hook == 'ALL' ) {
if ($hook != 'ALL' and $hook != 'SPECIAL') {
switch ($CFG->dbtype) {
case 'postgres7':
- $where = 'AND substr(upper(concept),1,' . strlen($hook) . ') = \'' . strtoupper($hook) . '\'';
+ $where = 'AND substr(upper(concept),1,' . $textlib->strlen($hook, current_charset()) . ') = \'' . $textlib->strtoupper($hook, current_charset()) . '\'';
break;
case 'mysql':
- $where = 'AND left(ucase(concept),' . strlen($hook) . ") = '$hook'";
+ $where = 'AND left(ucase(concept),' . $textlib->strlen($hook, current_charset()) . ") = '$hook'";
break;
}
}
if ($hook != 'ALL' and $hook != 'SPECIAL') {
switch ($CFG->dbtype) {
case 'postgres7':
- $where = 'AND substr(upper(concept),1,' . strlen($hook) . ') = \'' . strtoupper($hook) . '\'';
+ $where = 'AND substr(upper(concept),1,' . $textlib->strlen($hook, current_charset()) . ') = \'' . $textlib->strtoupper($hook, current_charset()) . '\'';
break;
case 'mysql':
- $where = 'AND left(ucase(concept),' . strlen($hook) . ") = '" . strtoupper($hook) . "'";
+ $where = 'AND left(ucase(concept),' . $textlib->strlen($hook, current_charset()) . ") = '" . $textlib->strtoupper($hook, current_charset()) . "'";
break;
}
}
}
switch ($CFG->dbtype) {
case 'postgres7':
- $where = 'AND substr(upper(concept),1,1) NOT IN (' . strtoupper($sqlalphabet) . ')';
+ $where = 'AND substr(upper(concept),1,1) NOT IN (' . $textlib->strtoupper($sqlalphabet, current_charset()) . ')';
break;
case 'mysql':
- $where = 'AND left(ucase(concept),1) NOT IN (' . strtoupper($sqlalphabet) . ')';
+ $where = 'AND left(ucase(concept),1) NOT IN (' . $textlib->strtoupper($sqlalphabet, current_charset()) . ')';
break;
}
}
break;
}
}
-
$allentries = get_records_sql("$sqlselect $sqlfrom $sqlwhere $sqlorderby $sqllimit");
-
?>