public function GetOne($id) { $id = (int)$id; if (!$id) return array(); $ckey = 'upload.getone.'.$id; $list = cached($ckey); if ($list) return $list; return cached($ckey, dbc(DBCMax)->query('SELECT * FROM '.table('uploads').' WHERE id='.$id)->limit(1)->done()); }
function getARS($type, $parameters) { $cache = cached($type, $parameters); if ($cache) { return $cache; } else { $ars = new AmazonResultSet(); if ($type == 'asin') { $ars->ASINSearch(padASIN($parameters['asin']), $parameters['mode']); } if ($type == 'browse') { $ars->browseNodeSearch($parameters['browsenode'], $parameters['page'], $parameters['mode']); } if ($type == 'search') { $ars->keywordSearch($parameters['search'], $parameters['page'], $parameters['mode']); } cache($type, $parameters, $ars); } return $ars; }
cache_clean(); // 漫画 ID $id = $_GET["id"]; $id = intval(str_replace('comic_', '', $id)); if ($id < 1) { $id = 1; } // 現在のページ $page = intval($_GET["page"]); if ($page < 1) { $page = 1; } $zip_path = COMIC_DIR . "/" . $dir[$id - 1]; $manga_title = get_filename_without_ext($zip_path); // cache ディレクトリに ZIP 内のファイルを展開 if (!cached($id)) { caching($id, $zip_path, $image_ext); } // 表示するページのパスを返却 $response = '{"title":"' . get_title($id) . '", "pages":"' . get_pages($id) . '", "files":['; $load_images = $page + PRELOAD + 2; for ($i = $page; $i <= $load_images; $i++) { $response .= '"' . get_filepath($id, $i) . '"'; if ($i == $load_images) { $response .= ']}'; } else { $response .= ','; } } echo $response; function cached($comics_id)
function GetOne( $id, $cached = true ) { $ckey = 'product.getone.'.$id; $list = $cached ? cached($ckey) : false; if ($list) return $list; $sql = 'SELECT p.*,s.sellername,s.sellerphone,s.selleraddress,s.sellerurl,s.sellermap FROM ' . table('product') . ' p LEFT JOIN ' . table('seller') . ' s ON (p.sellerid = s.id) WHERE p.id = ' . (int)$id; $data = $this->__parse_result( dbc(DBCMax)->query($sql)->limit(1)->done() ); if( $data ){ if( $data['begintime'] > time() ){ $lasttime = $data['begintime'] - time(); if( $lasttime > 86400 ){ $data['begin_date'] = date('Y-m-d H:i:s',$data['begintime']); }else{ $data['limit_time'] = $lasttime; } } if($data['is_countdown'] == 1){ logic('order')->FreeCountDownOrder($id); } $data['product_link'] = $this->get_link_product($data['linkid']); } return cached($ckey, $data); }
public function AskList($limit = null) { $sql_limit = ''; if (!is_null($limit)) { $sql_limit = 'LIMIT '.$limit; } $ckey = 'misc.asklist'.$sql_limit; $list = cached($ckey); if ($list) return $list; $sql = 'SELECT * FROM '.table('question').' WHERE reply <> "" ORDER BY time DESC '.$sql_limit; $sql_limit != '' || $sql = page_moyo($sql); return dbc(DBCMax)->query($sql)->done(); }