示例#1
0
文件: global.func.php 项目: nanfs/lt
function file_down($file)
{
    global $lang_setdbNotExist;
    !file_exists($file) && okinfox('database.php?action=import', $lang_setdbNotExist);
    $filename = $filename ? $filename : basename($file);
    $filetype = fileext($filename);
    $filesize = filesize($file);
    header('Cache-control: max-age=31536000');
    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT');
    header('Content-Encoding: none');
    header('Content-Length: ' . $filesize);
    header('Content-Disposition: attachment; filename=' . $filename);
    header('Content-Type: ' . $filetype);
    readfile($file);
    exit;
}
示例#2
0
    $newslit .= "<td class='list-text'><a href='javascript:;' style='padding:0px 5px;' onclick='delettr(\$(this));'>{$lang_js49}</a></td>\n";
    $newslit .= "</tr>";
    echo $newslit;
} elseif ($action == "delete") {
    if ($action_type == "del") {
        $allidlist = explode(',', $allid);
        foreach ($allidlist as $key => $val) {
            $query = "delete from {$met_label} where id='{$val}'";
            $db->query($query);
        }
        file_unlink("../../cache/str_{$lang}.inc.php");
        metsave('../seo/strcontent.php?lang=' . $lang . '&anyid=' . $anyid);
    } else {
        $skin_m = $db->get_one("SELECT * FROM {$met_label} WHERE id='{$id}'");
        if (!$skin_m) {
            okinfox('strcontent.php?lang=' . $lang, $lang_dataerror);
        }
        $query = "delete from {$met_label} where id='{$id}'";
        $db->query($query);
        file_unlink("../../cache/str_{$lang}.inc.php");
        metsave('../seo/strcontent.php?lang=' . $lang . '&anyid=' . $anyid);
    }
} else {
    $total_count = $db->counter($met_label, " where lang='{$lang}'", "*");
    require_once 'include/pager.class.php';
    $page = (int) $page;
    if ($page_input) {
        $page = $page_input;
    }
    $list_num = 16;
    $rowset = new Pager($total_count, $list_num, $page);