コード例 #1
0
ファイル: servers.php プロジェクト: rair/yacs
 /**
  * list servers to be searched
  *
  * This script is used internally to locate servers to which search requests may be submitted.
  *
  * All entries are seeked, and the active field is not taken into account.
  *
  * @param int the offset from the start of the list; usually, 0 or 1
  * @param int the number of items to display
  * @param string the list variant, if any
  * @return NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $type, $icon)
  *
  * @see search.php
  */
 public static function list_for_search($offset = 0, $count = 10, $variant = 'search')
 {
     global $context;
     // limit the scope of the request
     $query = 'SELECT * FROM ' . SQL::table_name('servers') . " WHERE (submit_search = 'Y')" . ' ORDER BY edit_date DESC, title LIMIT ' . $offset . ',' . $count;
     // the list of servers
     $output = Servers::list_selected(SQL::query($query), $variant);
     return $output;
 }