if (empty($_GET['type'])) { $type = ""; } else { $type = $_GET['type']; } if ($str == '') { ERROR('⊙﹏⊙', '傻孩子,你啥都不输入叫我搜索什么?'); } if (empty($page) || $page <= 0) { $page = 1; } /*载入搜索配置*/ include_once MOP . 'config.php'; /*先检索数据*/ $resb = FILE_SEARCH('name', $str, $type); $resb = STR_ARRSORT($resb, 'down'); /*分页并返回数据*/ $resc = count($resb); if (SO_MAX != '0') { if ($resc > SO_MAX) { $resc = SO_MAX; } for ($i = 0; $i < $resc; $i++) { $res[$i] = $resb[$i]; } } else { $res = $resb; } $res = STR_PAGE($res, $page, SEARCH_NUM); if ($res == false || $resc == 0 || $resb == "") { $FFS['html']['path'] = MOP . 'index.html';
} if (!empty($_GET['data'])) { $data = trim($_GET['data']); $filter = trim($_GET['filter']); } else { $data = ""; $filter = ""; $searchword = ""; } /*显示筛选*/ $FFS['html']['tag']['{html:filter}'] = '<option value="searchword" ' . ($filter == 'searchword' ? 'selected="selected"' : '') . '>关键词</option><option value="fid" ' . ($filter == 'fid' ? 'selected="selected"' : '') . ' >分享码</option><option value="day" ' . ($filter == 'day' ? 'selected="selected"' : '') . '>最后下载距当前大于(天)</option><option value="down" ' . ($filter == 'down' ? 'selected="selected"' : '') . '>下载次数小于(次)</option>'; $res = FILE_CLEAR($filter, $data); /*总个数*/ $resc = count($res); /*给数据排序*/ $res = STR_ARRSORT($res, 'time'); /*获取分页数据*/ if (empty($_GET['page'])) { $page = 1; } else { $page = $_GET['page']; } /*分页并返回数据*/ $res = STR_PAGE($res, $page, 50); if ($res == false || $resc == 0) { $FFS['html']['tag']['{html:counts}'] = 0; $FFS['html']['tag']['{html:filelist}'] = '<td></td><td colspan="9">抱歉,暂无任何数据!</td>'; $FFS['html']['tag']['{html:pages}'] = ''; $FFS['html']['tag']['{html:pages}'] = '<option>暂无任何数据</option>'; $FFS['html']['tag']['{html:nextpage}'] = ''; $FFS['html']['tag']['{html:previouspage}'] = '';
<?php if (RUN) { /*开始读取全部数据*/ include_once ROT . 'app/index/config.php'; if (INDEX_UPDATE) { $all = FILE_READDB(); if ($all['count'] == 0) { /*保存记录*/ file_put_contents(ROT . 'app/index/update.vds', 'N'); } else { /*生成最近上传*/ $newupload = STR_ARRSORT($all['data'], 'time'); /*生成热门下载*/ $hotdown = STR_ARRSORT($all['data'], 'down'); /*根据配置,取定量数据*/ for ($a = 0; $a < INDEX_UPDATE_NUMS; $a++) { $new_upload[$a] = $newupload[$a]; } for ($a = 0; $a < INDEX_UPDATE_NUMS; $a++) { $hot_down[$a] = $hotdown[$a]; } $res['new'] = $new_upload; $res['hot'] = $hot_down; /*保存记录*/ file_put_contents(ROT . 'app/index/update.vds', serialize($res)); } } }
$FFS['html']['tag']['{html:tongji}'] = stripslashes(SITE_TONGJI); $FFS['html']['tag']['{html:ICP}'] = SITE_ICP; $FFS['html']['tag']['{html:reportKey}'] = ""; $FFS['html']['tag']['{html:yourEmail}'] = !empty($_COOKIE['email']) ? $_COOKIE['email'] : ''; $FFS['html']['tag']['{html:viewtype}'] = strstr(VAL, 'hot') ? '热门文件' : '最近分享'; if (empty($_GET['page'])) { $page = "1"; } else { $page = $_GET['page']; } if (empty($page) || $page <= 0) { $page = 1; } /*先检索数据*/ $resa = FILE_READDB(); $resb = STR_ARRSORT($resa['data'], strstr(VAL, 'hot') ? 'down' : 'time'); $resc = count($resb); $resc > 199 ? $resc = 199 : ($resc = $resc); for ($i = 0; $i < $resc; $i++) { $resd[$i] = $resb[$i]; } /*分页并返回数据*/ $rese = STR_PAGE($resd, $page, 20); $res = $rese['data']; if ($res == false || $resc == 0 || $resd == "") { $FFS['html']['tag']['{html:hotNew}'] = "暂无数据"; $FFS['html']['tag']['{html:pages}'] = '<option>暂无数据</option>'; $FFS['html']['tag']['{html:nextpage}'] = ''; $FFS['html']['tag']['{html:previouspage}'] = ''; } else { /*处理分页*/
function FILE_SITEMAP() { $array = json_decode(file_get_contents(SYS . 'file.vds'), true); $array = STR_ARRSORT($array, 'time'); $count = count($array); if ($count >= 49999) { $count = 49999; } $contentA = ""; $contentB = ""; //txt格式 //for($rowA=0;$rowA<$count;$rowA++){ //$contentA=$contentA.URL.'index.php?/file/view-'.$array[$rowA]['id'].'.html'."\n"; //xml格式 for ($rowB = 0; $rowB < $count; $rowB++) { $contentB = $contentB . ' <url> <loc>' . URL . '?/file/view-' . $array[$rowB]['id'] . '.html</loc> <lastmod>' . date('Y-m-d', $array[$rowB]['last']) . '</lastmod> <changefreq>always</changefreq> <priority>0.8</priority> </url> '; } $contentB = '<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . $contentB . ' </urlset>'; file_put_contents('sitemap.xml', $contentB); chmod("sitemap.xml", 0777); }