Esempio n. 1
0
function sitemap_tag($str)
{
    $str = rawurlencode($str);
    $url = base64_encode($_SERVER['QUERY_STRING']);
    $rtn = '&nbsp;<a href="' . urr(ADMINCP, "item=sitemap&action=add_shortcut&title={$str}&url={$url}") . '" title="' . __('add_sitemap_tips') . '">[+]</a>';
    echo $rtn;
}
Esempio n. 2
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;
}
Esempio n. 3
0
function get_openid()
{
    global $db, $tpf, $settings, $timestamp, $onlineip, $user_tpl_dir;
    $graph_url = "https://graph.qq.com/oauth2.0/me?access_token=" . $_SESSION['access_token'];
    $str = get_url_contents($graph_url);
    if (strpos($str, "callback") !== false) {
        $lpos = strpos($str, "(");
        $rpos = strrpos($str, ")");
        $str = substr($str, $lpos + 1, $rpos - $lpos - 1);
    }
    $user = json_decode($str);
    if (isset($user->error)) {
        echo "<h3>error:</h3>" . $user->error;
        echo "<h3>msg  :</h3>" . $user->error_description;
        exit;
    }
    //debug
    //echo("Hello " . $user->openid);
    //set openid to session
    $_SESSION["openid"] = $user->openid;
    if ($_SESSION["openid"]) {
        $arr = get_user_info();
        $nickname = $arr["nickname"];
        $abs_path = '../../../';
        $flid = @$db->result_first("select flid from {$tpf}fastlogin where auth_type='qq' and auth_name='{$_SESSION["openid"]}'");
        if ($flid) {
            $userid = @$db->result_first("select userid from {$tpf}fastlogin where flid='{$flid}'");
            if ($userid) {
                $rs = $db->fetch_one_array("select userid,gid,username,password,email from {$tpf}users where userid='{$userid}'");
                if ($rs) {
                    pd_setcookie('phpdisk_zcore_info', pd_encode("{$rs[userid]}\t{$rs[gid]}\t{$rs[username]}\t{$rs[password]}\t{$rs[email]}"));
                    //login
                    $ins = array('last_login_time' => $timestamp, 'last_login_ip' => $onlineip);
                    $db->query_unbuffered("update {$tpf}users set " . $db->sql_array($ins) . " where userid='{$userid}'");
                    $db->query_unbuffered("update {$tpf}fastlogin set " . $db->sql_array($ins) . " where flid='{$flid}'");
                    //echo 'Login Success';
                    redirect($settings[phpdisk_url] . urr("mydisk", ""), '', 0);
                }
                unset($rs);
            } else {
                // to bind username
                $title = __('bind_disk_name');
                require_once template_echo('pd_fastlogin', $user_tpl_dir);
            }
        } else {
            $ins = array('nickname' => $nickname, 'auth_type' => 'qq', 'auth_name' => $_SESSION["openid"], 'last_login_time' => $timestamp, 'last_login_ip' => $onlineip);
            $db->query_unbuffered("insert into {$tpf}fastlogin set " . $db->sql_array($ins) . "");
            $flid = $db->insert_id();
            //echo 'Login Success';
            $title = __('bind_disk_name');
            require_once template_echo('pd_fastlogin', $user_tpl_dir);
        }
    } else {
        exit('QQ Login Error');
    }
}
Esempio n. 4
0
function uc_upload_public($file_id, $file_key, $file_name, $message = '')
{
    global $pd_uid, $pd_gid, $pd_username, $settings;
    $feed = array();
    $feed['icon'] = 'folder';
    $feed['title_template'] = "{$pd_username} " . __('upload_public') . " {$file_name}";
    $feed['title_data'] = array('username' => '<a href="' . $settings['phpdisk_url'] . urr("space", "username="******">' . $pd_username . '</a>', 'file_name' => '<a href="' . $settings['phpdisk_url'] . urr("viewfile", "file_id={$file_id}&file_key={$file_key}") . '">' . $file_name . '</a>');
    $feed['body_template'] = '';
    $feed['body_data'] = array();
    $feed['body_general'] = '';
    uc_feed_add($feed['icon'], $pd_uid, $pd_username, $feed['title_template'], $feed['title_data'], $feed['body_template'], $feed['body_data'], $feed['body_general'], '', array());
}
Esempio n. 5
0
function show_comment($file_id)
{
    global $db, $tpf, $pg, $start_num, $perpage;
    $q = $db->query("select c.*,u.username from {$tpf}comments c,{$tpf}users u where file_id='{$file_id}' and is_checked=1 and c.userid=u.userid order by cmt_id asc limit {$start_num},{$perpage}");
    $cmts = array();
    while ($rs = $db->fetch_array($q)) {
        $rs['content'] = str_replace("\r\n", "<br>", $rs['content']);
        $rs['in_time'] = custom_time("Y-m-d H:i:s", $rs['in_time']);
        $rs['a_space'] = urr("space", "username=" . rawurlencode($rs['username']));
        $cmts[] = $rs;
    }
    $db->free($q);
    unset($rs);
    return $cmts;
}
Esempio n. 6
0
 static function build()
 {
     global $charset, $settings, $db, $tpf, $timestamp;
     $sitemap_file = PHPDISK_ROOT . 'sitemap.xml';
     if (!file_exists($sitemap_file) || $timestamp - @filemtime($sitemap_file) > 86400) {
         $arr = array();
         $q = $db->query("select file_id,file_time from {$tpf}files where in_share=1 order by file_id desc limit 50");
         while ($rs = $db->fetch_array($q)) {
             $rs[loc] = $settings[phpdisk_url] . urr("viewfile", "file_id={$rs[file_id]}");
             $rs[lastmod] = date('Y-m-d H:i:s', $rs[file_time]);
             $rs[changefreq] = 'daily';
             $rs[priority] = '0.8';
             $arr[] = $rs;
         }
         $db->free($q);
         unset($rs);
         //	ob_end_clean();
         /*		header( "Content-type: application/xml; charset=\"".$charset . "\"", true );
         			header( 'Pragma: no-cache' );*/
         $map = '<?xml version="1.0" encoding="' . $charset . '" ?>' . LF;
         $map .= '<!--  sitemap-generator-url="' . $settings[phpdisk_url] . '" -->' . LF;
         $map .= '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . LF;
         $map .= '<url>' . LF;
         $map .= "\t<loc>{$settings[phpdisk_url]}</loc>" . LF;
         $map .= "\t<lastmod>" . date('Y-m-d H:i:s') . "</lastmod>" . LF;
         $map .= "\t<changefreq>daily</changefreq>" . LF;
         $map .= "\t<priority>1.0</priority>" . LF;
         $map .= '</url>' . LF;
         foreach ($arr as $v) {
             $map .= '<url>' . LF;
             $map .= "\t<loc>{$v[loc]}</loc>" . LF;
             $map .= "\t<lastmod>{$v[lastmod]}</lastmod>" . LF;
             $map .= "\t<changefreq>{$v[changefreq]}</changefreq>" . LF;
             $map .= "\t<priority>{$v[priority]}</priority>" . LF;
             $map .= '</url>' . LF;
         }
         $map .= '</urlset>' . LF;
         $map .= '<!--  generated-on="' . date('Y-m-d H:i:s') . '" -->' . LF;
         write_file(PHPDISK_ROOT . 'sitemap.xml', $map, 'wb+');
     }
 }
Esempio n. 7
0
function get_plugin_info($plugin)
{
    global $db, $tpf;
    $file = PD_PLUGINS_DIR . "{$plugin}/plugin_info.php";
    if (file_exists($file)) {
        $_data = read_file($file);
        preg_match("/Plugin Name:(.*)/i", $_data, $plugin_name);
        preg_match("/Plugin URL:(.*)/i", $_data, $plugin_url);
        preg_match("/Description:(.*)/i", $_data, $plugin_desc);
        preg_match("/Author:(.*)/i", $_data, $plugin_author);
        preg_match("/Author Site:(.*)/i", $_data, $plugin_site);
        preg_match("/Version:(.*)/i", $_data, $plugin_version);
        preg_match("/PHPDISK Core:(.*)/i", $_data, $phpdisk_core);
    }
    if (file_exists(PD_PLUGINS_DIR . "{$plugin}/admin.inc.php")) {
        $admin_url = urr(ADMINCP, "item=plugins&app={$plugin}");
    }
    $actived = (int) @$db->result_first("select actived from {$tpf}plugins where plugin_name='{$plugin}' limit 1");
    $installed = file_exists(PD_PLUGINS_DIR . "{$plugin}/install.lock") ? 1 : 0;
    $arr = array('plugin_name' => trim($plugin_name[1]), 'plugin_url' => trim($plugin_url[1]), 'plugin_desc' => htmlspecialchars(trim($plugin_desc[1])), 'plugin_author' => trim($plugin_author[1]), 'plugin_site' => trim($plugin_site[1]), 'plugin_version' => trim($plugin_version[1]), 'phpdisk_core' => trim($phpdisk_core[1]), 'admin_url' => trim($admin_url), 'plugin_dir' => trim($plugin), 'actived' => $actived, 'installed' => $installed);
    return $arr;
}
Esempio n. 8
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;
    }
}
Esempio n. 9
0
write_file(PHPDISK_ROOT . 'system/b.txt', $sign . LF, 'ab');
$q = $db->query("select file_id from {$tpf}plugin_upload where hash='{$sign}'");
$file_ids = '';
while ($rs = $db->fetch_array($q)) {
    $file_ids .= $rs[file_id] . ',';
}
$db->free($q);
unset($rs);
$file_ids = $file_ids ? substr($file_ids, 0, -1) : '';
if ($file_ids) {
    $q = $db->query("select file_id,file_name,file_extension,file_time,file_size from {$tpf}files where file_id in ({$file_ids}) order by file_id desc limit 10");
    $str = '';
    while ($rs = $db->fetch_array($q)) {
        $tmp_ext = $rs['file_extension'] ? '.' . $rs['file_extension'] : "";
        $rs['file_name_all'] = cutstr($rs['file_name'] . $tmp_ext, 35);
        $rs['a_downfile'] = $settings[phpdisk_url] . urr("viewfile", "file_id=" . $rs['file_id']);
        $rs['file_time'] = date('Y-m-d', $rs['file_time']);
        $rs['file_size'] = get_size($rs['file_size']);
        $rs[ctn_2] = str_replace(array('"', "'"), '_', $rs['file_name_all']) . '\\\\r\\\\n下载地址: [url=' . $rs['a_downfile'] . ']' . $rs['a_downfile'] . '[/url]\\\\r\\\\n\\\\r\\\\n';
        $rs[ctn] = str_replace(array('"', "'"), '_', $rs['file_name_all']) . '<br>下载地址: [url=' . $rs['a_downfile'] . ']' . $rs['a_downfile'] . '[/url]<br><br>';
        $str .= '<div class="fl_list">' . LF;
        //$str .= '<div class="f1"><span style="float:right" class="txtgray">'.$rs[file_size].'</span>&nbsp;<a href="javascript:;" title="'.$rs['file_name'].'" onclick="addCodeToEditor(\\\''.$rs['ctn'].'\\\',\\\''.$rs['ctn_2'].'\\\',\\\''.$plugin_type.'\\\');">'.$rs['file_name_all'].'</a></div>'.LF;
        $str .= '<div class="f1"><span style="float:right" class="txtgray">' . $rs[file_size] . '</span>&nbsp;<a href="javascript:;" title="' . $rs['file_name'] . '" onclick="addCodeToEditor(\\\'' . $rs['ctn'] . '\\\',\\\'' . $rs['ctn_2'] . '\\\',\\\'' . $plugin_type . '\\\');">' . $rs['file_name_all'] . '</a></div>' . LF;
        //$str .= '<div class="f1"><span style="float:right" class="txtgray">'.$rs[file_size].'</span>&nbsp;<a href="###" title="'.$rs['file_name'].'" id="f_'.$rs[file_id].'" onclick="top.test(\''.$rs['a_downfile'].'\');">'.file_icon($rs['file_extension']).$rs['file_name_all'].'</a></div>'.LF;
        $str .= '<div class="f2"><span class="txtgray">' . $rs['file_time'] . '</span></div>' . LF;
        $str .= '</div>' . LF;
        $str .= '<div class="clear"></div>' . LF;
    }
    $db->free($q);
    unset($rs);
    //echo 'alert(\''.$str.'\')';
Esempio n. 10
0
     form_auth(gpc('formhash', 'P', ''), formhash());
     if (get_profile($pd_uid, 'wealth') < $money) {
         $error = true;
         $sysmsg[] = __('mywealth_too_small');
     }
     if (!$error) {
         $my_order = 'm' . get_order_number();
         $num = @$db->result_first("select count(*) from {$tpf}vip_orders where order_number='{$my_order}' and pay_method='{$task}' and userid='{$pd_uid}'");
         if (!$num) {
             $ins = array('pay_method' => $task, 'userid' => $pd_uid, 'vip_id' => $vip_id, 'order_number' => $my_order, 'total_fee' => $money, 'pay_status' => 'pendding', 'in_time' => $timestamp, 'ip' => $onlineip);
             $db->query_unbuffered("insert into {$tpf}vip_orders set " . $db->sql_array($ins) . ";");
         }
         $db->query_unbuffered("update {$tpf}users set wealth=wealth-{$money} where userid='{$pd_uid}'");
         $md5_sign = md5($my_order . $money . $pd_uid . $task);
         echo '<div align="center">' . __('buy_vip_doing') . '</div>';
         echo '<script>document.location="' . urr("payment", "action={$task}&order_number={$my_order}&sign={$md5_sign}") . '";</script>';
     } else {
         redirect('back', $sysmsg);
     }
 } elseif ($task == 'alipay') {
     form_auth(gpc('formhash', 'P', ''), formhash());
     if (!$error) {
         require_once PD_PLUGINS_DIR . "payment/alipay/alipay_config.php";
         require_once PD_PLUGINS_DIR . "payment/alipay/class/alipay_service.php";
         $out_trade_no = date('YmdHis');
         $parameter = array("service" => "create_direct_pay_by_user", "payment_type" => "1", "partner" => $partner, "seller_email" => $seller_email, "return_url" => $return_url, "notify_url" => $notify_url, "_input_charset" => $_input_charset, "show_url" => $show_url, "out_trade_no" => $out_trade_no, "subject" => $settings['site_title'] . ' ' . __('ali_subject_pay'), "body" => __('ali_body_pay') . ' ' . $money . ' RMB', "total_fee" => $money, "paymethod" => 'directPay', "defaultbank" => $defaultbank, "anti_phishing_key" => $anti_phishing_key, "exter_invoke_ip" => $exter_invoke_ip, "buyer_email" => $buyer_email, "extra_common_param" => $extra_common_param, "royalty_type" => $royalty_type, "royalty_parameters" => $royalty_parameters);
         //
         $num = @$db->result_first("select count(*) from {$tpf}vip_orders where order_number='{$out_trade_no}' and pay_method='{$task}' and userid='{$pd_uid}'");
         if (!$num) {
             $ins = array('pay_method' => $task, 'userid' => $pd_uid, 'vip_id' => $vip_id, 'order_number' => $out_trade_no, 'total_fee' => $money, 'pay_status' => 'pendding', 'in_time' => $timestamp, 'ip' => $onlineip);
             $db->query_unbuffered("insert into {$tpf}vip_orders set " . $db->sql_array($ins) . ";");
Esempio n. 11
0
            $rs['file_size'] = get_size($rs['file_size']);
            $rs['file_time'] = date("Y-m-d", $rs['file_time']);
            $rs['a_downfile'] = urr("downfile", "file_id={$rs['file_id']}&file_key={$rs['file_key']}");
            $rs['a_viewfile'] = urr("viewfile", "file_id={$rs['file_id']}");
            $rs[file_description] = clear_html($rs[file_description], 50);
            $rs['a_space'] = urr("space", "username="******"search", "action=search&word=" . rawurlencode($word) . "&scope={$scope}&n={$n_t}");
        $u_url = urr("search", "action=search&word=" . rawurlencode($word) . "&scope={$scope}&u={$u_t}");
        $s_url = urr("search", "action=search&word=" . rawurlencode($word) . "&scope={$scope}&s={$s_t}");
        $t_url = urr("search", "action=search&word=" . rawurlencode($word) . "&scope={$scope}&t={$t_t}");
        $arr = explode('&', $_SERVER['QUERY_STRING']);
        $page_nav = multi($total_num, $perpage, $pg, urr("search", "action=search&word=" . rawurlencode($word) . "&scope={$scope}&{$arr[3]}"));
        require_once template_echo('pd_search', $user_tpl_dir);
        break;
    default:
        require_once template_echo('pd_search', $user_tpl_dir);
}
include PHPDISK_ROOT . "./includes/footer.inc.php";
Esempio n. 12
0
exit('[PHPDisk] Access Deny!');
}
}
*/
$str = $_SERVER['QUERY_STRING'];
if (!$str) {
    exit('[PHPDisk] Access Denied');
}
$title = $settings['site_title'];
//include PHPDISK_ROOT."./includes/header.inc.php";
if ($action == 'upload') {
    include PHPDISK_ROOT . "./includes/header.inc.php";
    require_once template_echo('upload', $user_tpl_dir);
    include PHPDISK_ROOT . "./includes/footer.inc.php";
} else {
    if ($settings['close_guest_upload'] && !$pd_uid) {
        die(__('close_guest_upload_tips'));
    } else {
        $max_user_file_size = str_replace(' ', '', get_user_file_size($pd_gid));
        $rand = random($settings[encrypt_key] ? strlen($settings[encrypt_key]) : 9);
        $guest_upload_url = urr("mydisk", "item=upload&param={$rand}" . base64_encode("ts={$timestamp}&uid={$pd_uid}&folder_id={$folder_id}&sess_id={$sess_id}"));
        require_once template_echo('guest_upload', $user_tpl_dir);
    }
}
//include PHPDISK_ROOT."./includes/footer.inc.php";
if ($q) {
    $db->free($q);
}
$db->close();
unset($C, $L, $tpf, $configs, $rs);
ob_end_flush();
Esempio n. 13
0
                    $db->query_unbuffered("update {$tpf}plans set show_order='" . (int) $show_order[$i] . "' where plan_id='" . (int) $plan_ids[$i] . "'");
                }
                redirect(urr(ADMINCP, "item={$item}&menu=user&action=list"), '', 0);
            } else {
                redirect('back', $sysmsg);
            }
        } else {
            $q = $db->query("select * from {$tpf}plans order by show_order asc,plan_id asc");
            $plans = array();
            while ($rs = $db->fetch_array($q)) {
                $rs[user_count] = get_plan_users($rs[plan_id]);
                $rs[is_default] = $rs[is_default] ? '<span class="txtgreen">' . __('set_default') . '</span>' : '';
                $rs['status_text'] = $rs['is_hidden'] ? '<span class="txtred">' . __('hidden') . '</span>' : '<span class="txtblue">' . __('display') . '</span>';
                $rs['a_change_status'] = urr(ADMINCP, "item={$item}&menu=user&action=change_status&plan_id={$rs['plan_id']}");
                $rs['a_edit_plan'] = urr(ADMINCP, "item={$item}&menu=user&action=edit&plan_id={$rs['plan_id']}");
                $rs['a_truncate_plan'] = urr(ADMINCP, "item={$item}&menu=user&action=truncate&plan_id={$rs['plan_id']}");
                $rs['a_del_plan'] = urr(ADMINCP, "item={$item}&menu=user&action=del&plan_id={$rs['plan_id']}");
                $rs[a_set_plan] = urr(ADMINCP, "item={$item}&menu=user&action=set_plan&plan_id={$rs['plan_id']}");
                $plans[] = $rs;
            }
            $db->free($q);
            unset($rs);
            $settings[down_active_interval] = $settings[down_active_interval] ? $settings[down_active_interval] : 'day';
            require_once template_echo($item, $admin_tpl_dir, '', 1);
        }
}
function get_plan_users($plan_id)
{
    global $db, $tpf;
    return @$db->result_first("select count(*) from {$tpf}users where plan_id='{$plan_id}'");
}
Esempio n. 14
0
        unset($rs);
        return $file_ids;
    }
    $file_ids = get_file_ids($tag);
    $file_ids = substr($file_ids, -1) == ',' ? substr($file_ids, 0, -1) : $file_ids;
    if (!$file_ids) {
        header("Location: " . urr("tag", ""));
        exit;
    }
    $sql_do = "{$tpf}files where file_id in ({$file_ids})";
    $rs = $db->fetch_one_array("select count(*) as total_num from {$sql_do}");
    $total_num = $rs['total_num'];
    $start_num = ($pg - 1) * $perpage;
    $q = $db->query("select file_id,file_key,file_name,file_extension,file_size,file_time,server_oid,file_store_path,file_real_name,is_image from {$sql_do} order by file_id desc limit {$start_num},{$perpage}");
    $files_array = array();
    while ($rs = $db->fetch_array($q)) {
        $tmp_ext = $rs['file_extension'] ? '.' . $rs['file_extension'] : "";
        $rs['file_thumb'] = get_file_thumb($rs);
        $rs['file_name_all'] = filter_word($rs['file_name'] . $tmp_ext);
        $rs['file_name'] = cutstr(filter_word($rs['file_name'] . $tmp_ext), 35);
        $rs['file_size'] = get_size($rs['file_size']);
        $rs['file_time'] = custom_time("Y-m-d", $rs['file_time']);
        $rs['a_viewfile'] = urr("viewfile", "file_id={$rs['file_id']}");
        $files_array[] = $rs;
    }
    $db->free($q);
    unset($rs);
    $page_nav = multi($total_num, $perpage, $pg, urr("tag", "tag=" . rawurlencode($tag)));
}
require_once template_echo('pd_tag', $user_tpl_dir);
include PHPDISK_ROOT . "./includes/footer.inc.php";
Esempio n. 15
0
    ?>
</a></div>
<?php 
    if ($settings['open_comment']) {
        ?>
<br />
<div class="f14"><img src="images/ico_cmt.gif" align="absmiddle" border="0" /><?php 
        echo __('add_cmt');
        ?>
:</div>
<div id="cmt_box">
<?php 
        if ($pd_uid) {
            ?>
<form action="<?php 
            echo urr("comment", "");
            ?>
" method="post" onsubmit="return docmt(this);">
<input type="hidden" name="action" value="cmt" />
<input type="hidden" name="file_id" value="<?php 
            echo $file_id;
            ?>
" />
<input type="hidden" name="formhash" value="<?php 
            echo $formhash;
            ?>
" />
<li class="txtgray"><?php 
            echo __('cmt_content');
            ?>
:</li>
Esempio n. 16
0
function nav_path($folder_id, $uid)
{
    global $db, $tpf;
    $username = $db->result_first("select username from {$tpf}users where userid='{$uid}' limit 1");
    $rs = $db->fetch_one_array("select parent_id,folder_name,folder_id from {$tpf}folders where folder_id='{$folder_id}' and userid='{$uid}'");
    $str = '';
    if ($rs['parent_id'] != 0) {
        $str .= nav_path($rs['parent_id'], $uid);
    }
    $str .= $rs['folder_name'] ? '<a href="' . urr("space", "username={$username}&folder_id={$rs['folder_id']}") . '">' . $rs['folder_name'] . '</a>&raquo; ' : '';
    unset($rs);
    return $str;
}
Esempio n. 17
0
                redirect('back', $sysmsg);
            }
        } else {
            $rs = $db->fetch_one_array("select * from {$tpf}navigations where navid='{$navid}'");
            if ($rs) {
                $nav_text = $rs['text'];
                $nav_title = $rs['title'];
                $nav_href = $rs['href'];
                $nav_target = $rs['target'];
                $nav_position = $rs['position'];
            }
            unset($rs);
            require_once template_echo($item, $admin_tpl_dir, '', 1);
        }
        break;
    case 'delete_nav':
        if ($settings['online_demo']) {
            $error = true;
            $sysmsg[] = __('online_demo_deny');
        }
        if (!$error) {
            $navid = (int) gpc('navid', 'G', 0);
            $db->query_unbuffered("delete from {$tpf}navigations where navid='{$navid}' limit 1");
            redirect(urr(ADMINCP, "item={$item}&menu=extend&action=index"), '', 0);
        } else {
            redirect('back', $sysmsg);
        }
        break;
    default:
        redirect(urr(ADMINCP, "item={$item}&menu=extend&action=index"), '', 0);
}
Esempio n. 18
0
                ?>
			<a href="<?php 
                echo urr(ADMINCP, "item=plugins&menu={$menu}&plugin_name=" . $v['plugin_dir'] . "&action=uninstall");
                ?>
" class="txtred" onclick="return confirm('<?php 
                echo __('confirm_uninstall_plugin');
                ?>
');"><?php 
                echo __('uninstall');
                ?>
</a>&nbsp;
		<?php 
            } else {
                ?>
		<a href="<?php 
                echo urr(ADMINCP, "item=plugins&menu={$menu}&plugin_name=" . $v['plugin_dir'] . "&action=install");
                ?>
" class="txtgreen" onclick="return confirm('<?php 
                echo __('confirm_install_plugin');
                ?>
');"><?php 
                echo __('install');
                ?>
</a>&nbsp;
		<?php 
            }
            ?>
		<span class="txtgray"><?php 
            echo __('plugin_author');
            ?>
:</span><a href="<?php 
Esempio n. 19
0
                    $info['a_restore'] = urr(ADMINCP, "item=database&action=restore&task=restore&pre={$info['pre']}");
                    $infos[] = $info;
                }
            }
            require_once template_echo($item, $admin_tpl_dir, '', 1);
        }
        break;
    case 'delete':
        if ($settings['online_demo']) {
            $error = true;
            $sysmsg[] = __('online_demo_deny');
        }
        if (!$error) {
            $pre = gpc('pre', 'G', '');
            $sqlfiles = glob(PHPDISK_ROOT . 'system/data/*.sql');
            if (is_array($sqlfiles)) {
                foreach ($sqlfiles as $k => $sqlfile) {
                    if (preg_match("/({$pre})([0-9]+)\\.sql/i", basename($sqlfile))) {
                        $sysmsg[] = __('delete') . '&nbsp;&nbsp;' . $sqlfile . ' ...... ' . __('success');
                        @unlink($sqlfile);
                    }
                }
            }
            redirect(urr(ADMINCP, "item=database&action=restore"), $sysmsg);
        } else {
            redirect('back', $sysmsg);
        }
        break;
    default:
        redirect(urr(ADMINCP, "item=database&action=backup"), $sysmsg);
}
Esempio n. 20
0
    echo __('public_setting');
    sitemap_tag(__('public_setting'));
    ?>
</h1>
<div>
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b><?php 
    echo __('tips');
    ?>
: </b>
<span class="txtgray"><?php 
    echo __('public_setting_tips');
    ?>
</span>
</div>
<form action="<?php 
    echo urr(ADMINCP, "item={$item}&menu={$menu}");
    ?>
" method="post">
<input type="hidden" name="action" value="<?php 
    echo $action;
    ?>
"/>
<input type="hidden" name="task" value="update"/>
<input type="hidden" name="formhash" value="<?php 
    echo $formhash;
    ?>
" />
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="40%"><span class="bold"><?php 
    echo __('check_public_file');
Esempio n. 21
0
        break;
    case 'course_view':
        if ($task) {
            switch ($task) {
                case 'course_view':
                    $file_id = gpc('file_ids', 'GP', 0);
                    $review_status = gpc('review_status', 'GP', 0);
                    $cs_id = gpc('cs_id', 'GP', 0);
                    $course_id = gpc('course_id', 'GP', 0);
                    foreach ($file_id as $k => $v) {
                        $sql = "UPDATE {$tpf}file_cs_relation\n\t\t\t\t\t\t\t\tSET (cs_id, course_id, status)\n\t\t\t\t\t\t\t\tVALUE ({$cs_id}, {$course_id}, {$review_status})\n\t\t\t\t\t\t\t\tWHERE cs_id = {$cs_id} AND course_id={$course_id}";
                        $db->query_unbuffered($sql);
                    }
                    break;
            }
        } else {
            $course_id = gpc('course_id', 'GP', '');
            $chapter_section_array = get_chapter_section_list($course_id);
            require_once template_echo($item, $admin_tpl_dir, '', 1);
        }
        break;
    case 'search':
        $status = (int) gpc('status', 'GP', 0);
        $status = 3;
        $course_array = !empty($status) ? get_course_form_status($status) : array();
        $course_array = $course_array['data'];
        $page_nav = multi($total_num, $perpage, $pg, urr(ADMINCP, "item={$item}&menu=file&action={$action}&view={$view}&uid={$uid}"));
        $dd = date('Y-m-d');
        require_once template_echo($item, $admin_tpl_dir, '', 1);
        break;
}
Esempio n. 22
0
</span> </td>
		</tr>
		<tr>
			<td colspan="2"><?php 
        echo __('file_tag');
        ?>
: <?php 
        echo $file['tags'];
        ?>
</td>
		</tr>
		<tr>
			<td colspan="2">
			<div class="op_btn">
			<a href="<?php 
        echo urr("shortcut", "url=" . $settings[phpdisk_url] . urr("viewfile", "file_id=" . $file[file_id]) . "&name=" . $file['file_name']);
        ?>
"><img src="images/valid.gif" width="17" height="17" align="absmiddle" border="0" /><?php 
        echo __('save_to_desktop');
        ?>
</a>
		<?php 
        if ($pd_uid) {
            ?>
		<a href="javascript:;" onclick="save_as('<?php 
            echo $file['file_id'];
            ?>
');"><img src="images/save_disk.gif" width="17" height="17" align="absmiddle" border="0" /><?php 
            echo __('save_to_mydisk');
            ?>
</a>
Esempio n. 23
0
                write_file(PD_PLUGINS_DIR . 'api/uc_configs.inc.php', $str);
                if ($settings['connect_uc'] && $username) {
                    $db->query_unbuffered("update `{$configs['dbname']}`.{$tpf}users set username='******' where userid=1 and gid=1;");
                }
                $sysmsg[] = __('uc_update_success');
                redirect(urr(ADMINCP, "item=plugins&app={$app}&action={$action}"), $sysmsg);
            } else {
                redirect('back', $sysmsg);
            }
        } else {
            $setting['connect_uc'] = $settings['connect_uc'] ? 1 : 0;
            $setting['connect_uc_type'] = $settings['connect_uc_type'] ? $settings['connect_uc_type'] : 'discuz';
            $setting['uc_charset'] = $settings['uc_charset'] ? $settings['uc_charset'] : $configs['charset'];
            $setting['uc_admin'] = $settings['uc_admin'] ? $settings['uc_admin'] : '';
            $setting['uc_dbhost'] = $settings['uc_dbhost'] ? $settings['uc_dbhost'] : '';
            $setting['uc_dbuser'] = $settings['uc_dbuser'] ? $settings['uc_dbuser'] : '';
            $setting['uc_dbpwd'] = $settings['uc_dbpwd'] ? encode_pwd($settings['uc_dbpwd']) : '';
            $setting['uc_dbname'] = $settings['uc_dbname'] ? $settings['uc_dbname'] : '';
            $setting['uc_dbtablepre'] = $settings['uc_dbtablepre'] ? $settings['uc_dbtablepre'] : "uc_";
            $setting['uc_key'] = $settings['uc_key'] ? $settings['uc_key'] : random(16);
            $setting['uc_api'] = $settings['uc_api'] ? $settings['uc_api'] : 'http://';
            $setting['uc_appid'] = $settings['uc_appid'] ? $settings['uc_appid'] : 0;
            $setting['uc_feed'] = $settings['uc_feed'] ? 1 : 0;
            $setting['uc_credit_exchange'] = $settings['uc_credit_exchange'] ? 1 : 0;
            require_once template_echo('admin', '', $app);
        }
        break;
    default:
        redirect(urr(ADMINCP, "item=plugins&app={$app}&action=uc"), '', 0);
}
update_action_time($app);
Esempio n. 24
0
            $perpage = 50;
            $userid = (int) gpc('userid', 'G', 0);
            $task_sql = in_array($task, array('download', 'ref')) ? " p.action='{$task}' and" : '';
            $uid_sql = $userid ? " p.userid='{$userid}' and" : '';
            $sql_do = get_table_credit_log() . " p,{$tpf}files f,{$tpf}users u where {$task_sql} {$uid_sql} p.userid=u.userid and p.file_id=f.file_id";
            $rs = $db->fetch_one_array("select count(*) as total_num from {$sql_do}");
            $total_num = $rs['total_num'];
            $start_num = ($pg - 1) * $perpage;
            $q = $db->query("select p.*,f.file_name,f.file_extension,u.username from {$sql_do} order by p.in_time desc limit {$start_num},{$perpage}");
            $orders = array();
            while ($rs = $db->fetch_array($q)) {
                $rs[a_view] = urr(ADMINCP, "item={$item}&menu={$menu}&action={$action}&userid={$rs[userid]}");
                $rs[action] = $ca_arr[$rs[action]];
                $tmp_ext = $rs[file_extension] ? '.' . $rs[file_extension] : '';
                $rs[file_name] = $rs[file_name] . $tmp_ext;
                $rs['in_time'] = date('Y-m-d H:i:s', $rs['in_time']);
                $orders[] = $rs;
            }
            $db->free($q);
            unset($rs);
            $page_nav = multi($total_num, $perpage, $pg, urr(ADMINCP, "item={$item}&menu={$menu}&action={$action}&task={$task}&userid={$userid}"));
            require_once template_echo($item, $admin_tpl_dir, '', 1);
        }
        break;
    default:
        redirect(urr(ADMINCP, "item=users&menu=user&action=index"), '', 0);
}
function merge_rate($downs, $money)
{
    return $downs && $money ? $downs . ',' . $money : '';
}
Esempio n. 25
0
                $error = true;
                $sysmsg[] = $ids_arr[1];
            } else {
                $plugin_ids = $ids_arr[1];
            }
            if (!$error) {
                $db->query_unbuffered("update {$tpf}plugins set actived=0 where plugin_name in({$plugin_ids})");
                $sysmsg[] = __('plugins_inactived_success');
                redirect($_SERVER['HTTP_REFERER'], $sysmsg);
            } else {
                redirect('back', $sysmsg);
            }
        } else {
            syn_plugins();
            $sql_do = "";
            $perpage = 10;
            $rs = $db->fetch_one_array("select count(*) as total_num from {$tpf}plugins {$sql_do}");
            $total_num = $rs['total_num'];
            $start_num = ($pg - 1) * $perpage;
            $q = $db->query("select * from {$tpf}plugins {$sql_do} order by actived desc, plugin_name asc limit {$start_num},{$perpage}");
            while ($rs = $db->fetch_array($q)) {
                if (check_plugin($rs['plugin_name'])) {
                    $plugins_arr[] = get_plugin_info($rs['plugin_name']);
                }
            }
            $db->free($q);
            unset($rs);
            $page_nav = multi($total_num, $perpage, $pg, urr(ADMINCP, "item={$item}&menu=plugin&action={$action}"));
            require_once template_echo($item, $admin_tpl_dir, '', 1);
        }
}
Esempio n. 26
0
}
?>
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>
	<td width="15%" align="right"><?php 
echo __('users_count');
?>
: </td>
	<td><?php 
echo $stats['users_count'];
?>
 , <?php 
echo __('users_locked_count');
?>
&nbsp;&nbsp;<a href="<?php 
echo urr(ADMINCP, "item=users&menu=extend&action=index&gid=0&orderby=is_locked");
?>
"><span class="txtred bold"><?php 
echo $stats['users_locked_count'];
?>
</span></a>  , <?php 
echo __('users_open_count');
?>
&nbsp;&nbsp;<span class="txtblue bold"><?php 
echo $stats['users_open_count'];
?>
</span></td>
</tr>
<tr>
	<td align="right"><?php 
echo __('user_files_count');
Esempio n. 27
0
		<li><a href="<?php 
echo urr("mydisk", "item=profile&action=dl_users");
?>
" id="n_dl_users"><img src="images/user/ico_buddy.gif" align="absmiddle" border="0" /><?php 
echo __('downline_user');
?>
</a></li>
		<li><a href="<?php 
echo urr("mydisk", "item=profile&action=mod_pwd");
?>
" id="n_mod_pwd"><img src="images/user/ico_profile.gif" align="absmiddle" border="0" /><?php 
echo __('mod_pwd');
?>
</a></li>
		<li><a href="<?php 
echo urr("account", "action=logout");
?>
" onclick="return confirm('<?php 
echo __('confirm_logout');
?>
');"><img src="images/admin_icon.gif" align="absmiddle" border="0" /><?php 
echo __('exit');
?>
</a></li>
</ul>
</div>
	</div>
	<div class="md_r"><?php 
require_once $action_module;
?>
</div>
Esempio n. 28
0
    if (count($cate_list)) {
        foreach ($cate_list as $k => $v) {
            $style = ($k + 1) % 3 == 0 ? 'r_box' : 'l_box';
            ?>
<div class="pub_box <?php 
            echo $style;
            ?>
">
<div class="tit2"><span style="float:right;"><a href="<?php 
            echo urr("public", "cate_id={$v['cate_id']}");
            ?>
" title="<?php 
            echo __('more');
            ?>
" target="_blank"><img src="images/more.gif" align="absmiddle" border="0"></a></span><a href="<?php 
            echo urr("public", "cate_id={$v['cate_id']}");
            ?>
"><?php 
            echo $v[cate_name];
            ?>
</a></div>
	<?php 
            $file_list = get_cate_file($v[cate_id]);
            if (count($file_list)) {
                ?>
	<ul>
	<?php 
                foreach ($file_list as $v2) {
                    ?>
	<li><?php 
                    echo $v2['file_time'];
Esempio n. 29
0
     $meta_keywords_d = trim(gpc('meta_keywords_d', 'P', ''));
     $meta_description_d = trim(gpc('meta_description_d', 'P', ''));
     $setting = array('open_rewrite' => 0);
     $settings = gpc('setting', 'P', $setting);
     if (!$error) {
         update_seo('index', 0, $meta_title, $meta_keywords, $meta_description);
         if ($auth[pd_a]) {
             update_seo('public', 0, $meta_title2, $meta_keywords2, $meta_description2);
             update_seo('hotfile', 0, $meta_title3, $meta_keywords3, $meta_description3);
             update_seo('space', 0, $meta_title_s, $meta_keywords_s, $meta_description_s);
             update_seo('viewfile', 0, $meta_title_v, $meta_keywords_v, $meta_description_v);
             update_seo('download', 0, $meta_title_d, $meta_keywords_d, $meta_description_d);
         }
         settings_cache($settings);
         $sysmsg[] = __('seo_update_success');
         redirect(urr(ADMINCP, "item={$item}&menu={$menu}"), $sysmsg);
     } else {
         redirect('back', $sysmsg);
     }
 } else {
     $s = get_seo('index', 0);
     if ($auth[pd_a]) {
         $s2 = get_seo('public', 0);
         $s3 = get_seo('hotfile', 0);
         $ss = get_seo('space', 0);
         $sv = get_seo('viewfile', 0);
         $sd = get_seo('download', 0);
     }
     $setting = $settings;
     require_once template_echo($item, $admin_tpl_dir, '', 1);
 }
Esempio n. 30
0
    ?>
</td>
						</tr>
						<tr>
							<td><?php 
    echo __('income_item');
    ?>
:</td>
							<td><?php 
    echo __('now_money');
    ?>
:<b class="f14 txtred">¥<?php 
    echo $myinfo['wealth'];
    ?>
</b>&nbsp;&nbsp;<a href="<?php 
    echo urr("mydisk", "item=profile&action=income");
    ?>
">【<?php 
    echo __('app_income');
    ?>
】</a>&nbsp;&nbsp;</td>
						</tr>
						<tbody id="cb">
						<tr>
							<td>&nbsp;</td>
							<td><?php 
    echo __('my_credit');
    ?>
:<b class="f14">
									<?php 
    if ($auth[view_credit]) {