Exemplo n.º 1
0
     sql_slave('CREATE TEMPORARY TABLE &tmpFTCaches (`cache_id` int (11) PRIMARY KEY) ' . $sqlFilter);
     $sql_select = array();
     $sql_from = '';
     $sql_innerjoin = array();
     $sql_leftjoin = array();
     $sql_where = array();
     $sql_select[] = '`caches`.`cache_id` `cache_id`';
     $sql_from = '&tmpFTCaches';
     $sql_innerjoin[] = '`caches` ON `caches`.`cache_id`=&tmpFTCaches.`cache_id`';
 } elseif ($options['searchtype'] == 'bynofilter') {
     $sql_select[] = '`caches`.`cache_id` `cache_id`';
     $sql_from = '`caches`';
 } elseif ($options['searchtype'] == 'bylist') {
     sql_temp_table_slave('result_caches');
     $list = new cachelist($options['listid']);
     if ($list->allowView($options['cachelist_pw'])) {
         $cachesFilter = "CREATE TEMPORARY TABLE &result_caches ENGINE=MEMORY\n\t\t\t\t\t\t\t\t\t\tSELECT `cache_id` FROM `cache_list_items`\n\t\t\t\t\t\t\t\t\t\tLEFT JOIN `cache_lists` ON `cache_lists`.`id`=`cache_list_items`.`cache_list_id`\n\t\t\t\t\t\t\t\t\t  WHERE `cache_list_id`=" . sql_escape($options['listid']);
         sql_slave($cachesFilter);
         sql_slave('ALTER TABLE &result_caches ADD PRIMARY KEY ( `cache_id` )');
         $sql_select[] = '&result_caches.`cache_id`';
         $sql_from = '&result_caches';
         $sql_innerjoin[] = '`caches` ON `caches`.`cache_id`=&result_caches.`cache_id`';
     } else {
         // should not happen, but just for the case ...
         $sql_select[] = '`caches`.`cache_id` `cache_id`';
         $sql_from = '`caches`';
         $sql_where[] = 'FALSE';
     }
 } else {
     if ($options['searchtype'] == 'all') {
         $sql_select[] = '`caches`.`cache_id` `cache_id`';
Exemplo n.º 2
0
 *  For license information see doc/license.txt
 *
 *  Unicode Reminder メモ
 *
 *  Shortcut for cachelist search
 ***************************************************************************/
require './lib2/web.inc.php';
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] + 0 : 0;
$password = isset($_REQUEST['key']) ? $_REQUEST['key'] : '';
$watch = isset($_REQUEST['watch']);
$dontwatch = isset($_REQUEST['dontwatch']);
$bookmark = isset($_REQUEST['bookmark']);
$unbookmark = isset($_REQUEST['unbookmark']);
if ($id) {
    $login->verify();
    $list = new cachelist($id);
    if ($list->exist()) {
        if ($watch && $list->allowView($password) || $dontwatch) {
            $list->watch($watch);
        }
        if ($bookmark) {
            $list->bookmark($password);
        }
        if ($unbookmark) {
            $list->unbookmark();
        }
    }
    $tpl->redirect("search.php?searchto=searchbylist&listid=" . $id . ($password != "" ? "&listkey=" . urlencode($password) : "") . "&showresult=1&f_disabled=0&f_inactive=0&f_ignored=1&sort=byname");
} else {
    $tpl->redirect("cachelists.php");
}