| 1 |
<?php |
<?php |
| 2 |
// $Id: stormorganization.admin.inc,v 1.5 2008/05/20 08:11:56 robertogerola Exp $ |
// $Id: stormorganization.admin.inc,v 1.6 2008/06/11 12:56:52 robertogerola Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 34 |
), |
), |
| 35 |
); |
); |
| 36 |
|
|
| 37 |
$s = "SELECT n.*, sor.* FROM {stormorganization} sor INNER JOIN {node} n ON n.nid=sor.nid WHERE n.status=1 AND n.type='stormorganization'"; |
$s = "SELECT n.*, sor.* FROM {node} AS n INNER JOIN {stormorganization} AS sor ON n.nid=sor.nid WHERE n.status=1 AND n.type='stormorganization'"; |
| 38 |
$where = array(); |
$where = array(); |
| 39 |
if ($_SESSION['stormorganization_list_filter']['country']) { |
if ($_SESSION['stormorganization_list_filter']['country']) { |
| 40 |
$where[] = "sor.country='". $_SESSION['stormorganization_list_filter']['country'] ."'"; |
$where[] = "sor.country='". $_SESSION['stormorganization_list_filter']['country'] ."'"; |
| 44 |
} |
} |
| 45 |
$itemsperpage = $_SESSION['stormorganization_list_filter']['itemsperpage']; |
$itemsperpage = $_SESSION['stormorganization_list_filter']['itemsperpage']; |
| 46 |
|
|
| 47 |
$s = db_rewrite_sql($s, 'stormorganization', 'nid'); |
$s = db_rewrite_sql($s); |
| 48 |
$s = stormorganization_access_sql($s, $where); |
$s = stormorganization_access_sql($s, $where); |
| 49 |
|
|
| 50 |
$tablesort = tablesort_sql($header); |
$tablesort = tablesort_sql($header); |
| 153 |
function stormorganization_autocomplete($string = '') { |
function stormorganization_autocomplete($string = '') { |
| 154 |
$matches = array(); |
$matches = array(); |
| 155 |
if ($string) { |
if ($string) { |
| 156 |
$result = db_query_range("SELECT title FROM {node} n WHERE n.type='stormorganization' AND LOWER(title) LIKE LOWER('%s%%')", $string, 0, 10); |
$s = "SELECT title FROM {node} AS n WHERE n.type='stormorganization' AND LOWER(title) LIKE LOWER('%s%%')"; |
| 157 |
|
$s = stormorganization_access_sql($s); |
| 158 |
|
$s = db_rewrite_sql($s); |
| 159 |
|
|
| 160 |
|
$result = db_query_range($s, $string, 0, 10); |
| 161 |
while ($org = db_fetch_object($result)) { |
while ($org = db_fetch_object($result)) { |
| 162 |
$matches[$org->title] = check_plain($org->title); |
$matches[$org->title] = check_plain($org->title); |
| 163 |
} |
} |