您好,欢迎访问读文库

上传文档赚钱

当前位置:首页 > 常用文档 > 当书网阅读代码

当书网阅读代码

  • 小蚂蚁
  • 0 次阅读
  • 0 次下载
  • 2021-03-19 17:59:37
二扫码支付 微信
二扫码支付 支付宝

还剩... 页未读,继续阅读

免费阅读已结束,点击付费阅读剩下 ...

¥ 0 元,已有0人购买

免费阅读

阅读已结束,您可以下载文档离线阅读

¥ 5 元,已有0人下载

付费下载
文档简介:

1'http://shouji.360safe.com/360sj/dev/20130321/com.xs.cn_42_101322.apk','wandoujia'=>'http://opendata.readnovel.com/web/app/reader/xs.cn_XS_3.8.8.apk');//客户端下载地址publicfunction__construct(){$this->smarty=$this->smarty();}//设置页面过期时间;CDN缓存时间;publicfunction_set_header($maxAge=600){header(Expires:);header(Cache-Control:max-age=$maxAge);header(Pragma:public);}//设置无页面缓存publicfunction_set_no_cache(){header(Expires:Mon,26Jul199705:00:00GMT);header(Cache-Control:no-cache,must-revalidate,no-store,no-cache,must-revalidate,post-check=0,pre-check=0);header(Pragma:no-cache);}functionon_index(){$this->on_apk_bank();}//sougoufreeareafunctionon_sougou_free_area(){$this->_set_header();$this->smarty->display(CURRENT_TEMPLATE.show/sougou/free_area.html);}/***android合作推荐2*/functionon_app_partner_rec(){$this->_set_header();$this->smarty->display(CURRENT_TEMPLATE.app_partner_rec.html);}/***xap合作推荐*/functionon_winphone_app_partner_rec(){$this->_set_header();$this->smarty->display(CURRENT_TEMPLATE.winphone_app_partner_rec.html);}functionon_apk_bank(){$this->_set_header(3600*4);$booklist=newBookList();$total=$booklist->get_single_book_num();$pageSize=20;$maxPage=ceil($total/$pageSize);$pageNum=is_numeric($_GET['page'])&&$_GET['page']>0?($_GET['page']>$maxPage?$maxPage:$_GET['page']):1;$offset=$pageSize*($pageNum-1);$pUrl=web/show.php?a=apk_bank;$multi_page=multi_page($total,$pageNum,$pageSize,$pUrl,8);$apkBankList=$booklist->get_apk_bank($pageSize,$offset);if(is_array($apkBankList)){$img_server=array(,1,2,3,4,5);$rand_count=count($img_server)-1;foreach($apkBankListas$k=>&$v){$v['book_logo']=http://img.$img_server[rand(0,$rand_count)]..readnovel.com/img/app/icon/.$v['articleid']..png;}}$this->smarty->assign(multi_page,$multi_page);$this->smarty->assign(apkBankList,$apkBankList);$this->smarty->display(CURRENT_TEMPLATE.show/apkBank.html);}#根据传参获取合作伙伴标识3privatefunction_partner_tmp($partner=null){if(empty($partner)){$partner=isset($_GET['p'])?strtolower($_GET['p']):'360';//合作伙伴标识}switch($partner){case'360':$tmp='360';break;case'wandoujia':$tmp='wandoujia';break;case'sougou':$tmp='sougou';break;case'lianxiang':$tmp='lianxiang';break;default:$tmp='360';break;}return$tmp;}#提供给360单行本页面functionon_360($partner=null){#获取模板文件目录if(empty($partner)){$partner=isset($_GET['p'])?strtolower($_GET['p']):'360';//合作伙伴标识}$tmp=$this->_partner_tmp($partner);if($partner==sougou||$partner==lianxiang){$this->_set_header(0);}else{$this->_set_header(3600*4);}$this->smarty->assign(partner,$partner);$this->smarty->assign(down_apk,$this->down_apk[$partner]);$this->smarty->display(CURRENT_TEMPLATE.show/{$tmp}/apkStore.html);}#安卓桌面4functionon_android_desk(){#获取模板文件目录$this->_set_header(3600*4);$this->smarty->display(CURRENT_TEMPLATE.show/android_desk/android_desk.html);}#apk包搜索functionon_apk_search(){$this->_set_no_cache(3600*4);$keyword=urldecode($_GET['keyword']);if(!isset($_GET['page'])){#360传参字符集编码为utf8$keyword=gbk_to_utf8($keyword,'utf-8','gbk');}$partner=isset($_GET['p'])?strtolower($_GET['p']):'360';//合作伙伴标识#根据标识获取模板文件目录$tmp=$this->_partner_tmp();$booklist=newBookList();$total=$booklist->get_single_book_num('',$keyword);$pageSize=10;$maxPage=ceil($total/$pageSize);$pageNum=is_numeric($_GET['page'])&&$_GET['page']>0?($_GET['page']>$maxPage?$maxPage:$_GET['page']):1;$offset=$pageSize*($pageNum-1);$pUrl=web/show.php?a=apk_search&keyword={$keyword}&p={$partner};$multi_page=multi_page($total,$pageNum,$pageSize,$pUrl,8);$apkBankList=$booklist->get_apk_bank_new('','',$keyword,$pageSize,$offset);if(is_array($apkBankList)){foreach($apkBankListas$key=>&$val){if(!empty($val['description_new'])){$val['description']=$val['description_new'];}#为了兼容获取封面方法$val['articleid']=$val['bookid'];$val['parentid']=$val['parent_sort_id'];}#获取大图封面5convert_www_cover_path($apkBankList);convert_sougou_download_json($apkBankList);convert_lianxiang_download_json($apkBankList);}#获取分类信息$sortInfo=$booklist->get_sort_info();$sortInfo_new=array();if(!empty($sortInfo)){foreach($sortInfoas$va){$sortInfo_new[$va['sortid']]=$va['title'];}}$this->smarty->assign(partner,$partner);$this->smarty->assign(down_apk,$this->down_apk[$partner]);$this->smarty->assign(sortInfo,$sortInfo_new);$this->smarty->assign(multi_page,$multi_page);$this->smarty->assign(keyword,$keyword);$this->smarty->assign(total,$total);$this->smarty->assign(apkBankList,$apkBankList);$this->smarty->display(CURRENT_TEMPLATE.show/{$tmp}/apkSearch.html);}#apk包分类functionon_apk_sort(){$this->_set_header(3600*4);$primary_id=$_GET['id'];$partner=isset($_GET['p'])?strtolower($_GET['p']):'360';//合作伙伴标识#根据标识获取缓存目录$tmp=$this->_partner_tmp();if(empty($primary_id)||!is_numeric($primary_id)){$this->on_360($partner);exit;}#获取页码$pageNum=$_GET['page']?intval($_GET['page']):1;$dir=$tmp.'|'.$primary_id.'|'.$pageNum;$this->smarty->caching=true;6$this->smarty->cache_lifetime=3600*24*7;if($this->smarty->is_cached(CURRENT_TEMPLATE.show/{$tmp}/apkSort.html,$dir)){$this->

小蚂蚁
小蚂蚁
  • 126314

    文档
  • 10.12

    金币
Ta的主页 发私信

126314篇文档

相关搜索

当书网 阅读 代码

评论

发表评论
< /10 > 付费下载 ¥ 5 元
Copyright © 读文库 All Rights Reserved. 皖ICP备18020814号-3
×
保存成功