Example #1
0
 }
 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 == "") {
Example #2
0
 if ($val[0] == 'play') {
     /*导入预览页*/
     $id = substr($val[1], 0, -5);
     $info = FILE_REINFO($id);
     if ($info == false) {
         ERROR('提取错误啦', '该分享码无效,分享码不存在。');
     } elseif ($info['type'] != 'mp3') {
         ERROR('提取错误啦', '只能分享MP3格式的文件哦!');
     } elseif ($info['size'] > PLAY_LIT * 1024 * 1024) {
         ERROR('提取错误啦', '目前只能分享小于' . STR_FILESIZE(PLAY_LIT * 1024 * 1024) . '的文件');
     } else {
         if ($info == false) {
             ERROR('提取出错啦!', '您的分享码有误,请仔细检查,或者该分享码对应的文件已被删除。');
         }
         /*生成,猜你喜欢*/
         $data = FILE_SEARCH('type', $info['type']);
         if (count($data) < 3) {
             $rands = count($data);
         } else {
             $rands = 3;
         }
         $rand = array_rand($data, $rands);
         $yl = '';
         $name = '';
         if ($rand != "0") {
             foreach ($rand as $like) {
                 $yl = $yl . '<li><a href="?/mp/play-' . $data[$like]['id'] . '.html">' . $data[$like]['name'] . '</a></li>';
             }
         } else {
             $yl = "猜不到你喜欢的";
         }