Beispiel #1
0
function curr_file($file_id)
{
    global $db, $tpf, $settings, $code;
    $file = $db->fetch_one_array("select * from {$tpf}files where file_id='{$file_id}'");
    if (!$file) {
        $file['is_del'] = 1;
    } else {
        $file['dl'] = create_down_url($file);
        $in_extract = $code == md5($file['file_key']) ? 1 : 0;
        $file['username'] = $file['p_name'] = @$db->result_first("select username from {$tpf}users where userid='{$file['userid']}' limit 1");
        $rs = $db->fetch_one_array("select folder_id,folder_name from {$tpf}folders where userid='{$file['userid']}' and folder_id='{$file['folder_id']}'");
        $file['file_category'] = $rs['folder_name'] ? '<a href="' . urr("space", "username="******"&folder_id=" . $rs['folder_id']) . '" target="_blank">' . $rs['folder_name'] . '</a>' : '- ' . __('uncategory') . ' -';
        $file_key = trim($file['file_key']);
        $tmp_ext = $file['file_extension'] ? '.' . $file['file_extension'] : "";
        $file_extension = $file['file_extension'];
        $file_ext = get_real_ext($file_extension);
        $file['file_description'] = str_replace('<br>', LF, $file[file_description]);
        $file['a_space'] = urr("space", "username="******"Y-m-d", $file['file_time']);
        $file['credit_down'] = $file['file_credit'] ? (int) $file['file_credit'] : (int) $settings['credit_down'];
        $file['username'] = $file[user_hidden] ? __('hidden') : ($file['username'] ? '<a href="' . $file['a_space'] . '">' . $file['username'] . '</a>' : __('hidden'));
        $file['file_downs'] = $file['stat_hidden'] ? __('hidden') : get_discount($file[userid], $file['file_downs']);
        $file['file_views'] = $file['stat_hidden'] ? __('hidden') : get_discount($file[userid], $file['file_views']);
        $file['file_url'] = $settings['phpdisk_url'] . urr("viewfile", "file_id={$file['file_id']}");
        if (get_plans(get_profile($file[userid], 'plan_id'), 'open_second_page') == 3) {
            $file['a_downfile'] = urr("download", "file_id={$file_id}&key=" . random(32));
            $file['a_downfile2'] = urr("download", "file_id={$file_id}&key=" . random(32));
        }
    }
    return $file;
}
Beispiel #2
0
function curr_file($file_id)
{
    global $db, $tpf, $settings;
    $file = $db->fetch_one_array("select * from {$tpf}files where file_id='{$file_id}' and is_del=0");
    if (!$file) {
        $file['is_del'] = 1;
        $file['file_name'] = __('visited_tips');
    } else {
        $file[dl] = create_down_url($file);
        $file['is_del'] = 0;
        $file_key = trim($file['file_key']);
        $tmp_ext = $file['file_extension'] ? '.' . $file['file_extension'] : "";
        $file_extension = $file['file_extension'];
        $file_ext = get_real_ext($file_extension);
        $file_description = $file['file_description'];
        $file['file_description'] = nl2br($file['file_description']);
        $file['a_space'] = urr("space", "username="******"viewfile", "file_id={$file['file_id']}");
        return $file;
    }
}
Beispiel #3
0
     break;
 case 'load_file_addr':
     $file_id = (int) gpc('file_id', 'P', 0);
     if ($file_id) {
         $rs = $db->fetch_one_array("select * from {$tpf}files where file_id='{$file_id}'");
         if ($rs[yun_fid]) {
             $a_down = 'http://d.yun.google.com/down-' . $rs[yun_fid];
         } else {
             if (display_plugin('multi_server', 'open_multi_server_plugin', $settings['open_multi_server'], 0)) {
                 $rs2 = $db->fetch_one_array("select server_host,server_dl_host from {$tpf}servers where server_oid='{$rs[server_oid]}' limit 1");
                 if ($rs2) {
                     $a_down = $rs2['server_host'] . create_down_url($rs);
                     if ($rs['file_time'] && $timestamp - $rs['file_time'] > 600) {
                         if ($rs2[server_dl_host]) {
                             $arr = explode(LF, $rs2[server_dl_host]);
                             $a_down = $arr[0] . create_down_url($rs);
                         }
                     }
                 }
                 unset($rs2);
             }
             unset($rs);
         }
         echo 'true|<a href="' . $a_down . '" target="_blank">[下载]</a>';
     } else {
         echo 'NO file_id';
     }
     break;
 case 'cp_index':
     $setting = array('open_index_fast_upload_box' => 0, 'open_index_site_desc' => 0, 'open_index_file_list' => 0);
     $settings = gpc('setting', 'P', $setting);