コード例 #1
0
ファイル: bencandy.php プロジェクト: GHubgenius/qbbj
//多模型扩展接口
@(include ROOT_PATH . "inc/bencandy_{$rsdb[mid]}.php");
require ROOT_PATH . "inc/head.php";
require $chdb[main_tpl];
require ROOT_PATH . "inc/foot.php";
/*处理伪静态*/
if ($webdb[NewsMakeHtml] == 2) {
    $content = ob_get_contents();
    ob_end_clean();
    ob_start();
    $content = fake_html($content);
    echo "{$content}";
}
if (!$jobs && $webdb[bencandy_cache_time] && time() - filemtime($Cache_FileName) > $webdb[bencandy_cache_time] * 60) {
    if (!is_dir(dirname($Cache_FileName))) {
        makepath(dirname($Cache_FileName));
    }
    $content .= "<SCRIPT LANGUAGE='JavaScript' src='{$webdb['www_url']}/do/job.php?job=updatehits&aid={$id}'></SCRIPT>";
    write_file($Cache_FileName, $content);
} elseif ($jobs == 'show') {
    @unlink($Cache_FileName);
}
/**
*文章检查
**/
function check_article(&$rsdb)
{
    global $fidDB, $timestamp, $web_admin, $groupdb, $timestamp, $lfjid, $lfjuid, $fid, $id, $aid, $buy, $lfjdb, $webdb, $pre, $db;
    if (!$rsdb) {
        showerr("文章不存在");
    }
コード例 #2
0
ファイル: fu_sort.php プロジェクト: GHubgenius/qbbj
    require dirname(__FILE__) . "/" . "head.php";
    require dirname(__FILE__) . "/" . "template/fu_sort/menu.htm";
    require dirname(__FILE__) . "/" . "template/fu_sort/edit_channel.htm";
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($action == 'edit_channel' && $Apower[fu_sort_power]) {
    $rs_fid = $db->get_one("SELECT config FROM {$pre}fu_sort WHERE fid='{$fid}'");
    $rs_fid[config] = unserialize($rs_fid[config]);
    if ($channelDir && !eregi("^([a-z0-9_/]+)\$", $channelDir)) {
        showmsg("频道目录字符只能是:a-z0-9_/");
    }
    //当用户重命名后
    if ($channelDir && $channelDir != $rs_fid[config][channelDir]) {
        if (is_dir(ROOT_PATH . $channelDir)) {
            showmsg("{$channelDir},此目录已经存在了.请换一个吧");
        }
        makepath(ROOT_PATH . $channelDir);
        $paths = '';
        $detail = explode("/", $channelDir);
        foreach ($detail as $key => $value) {
            if ($value) {
                $paths .= '../';
            }
        }
        write_file(ROOT_PATH . "{$channelDir}/index.php", "<?php\n\$fid='{$fid}';\nif(is_file('index.htm')){header('location:index.htm');exit;}\nrequire_once(\"list.php\");\n\t\t");
        write_file(ROOT_PATH . "{$channelDir}/list.php", "<?php\nrequire_once(\"global.php\");\nrequire_once(THIS_PATH.\"list.php\");\n\t\t");
        write_file(ROOT_PATH . "{$channelDir}/bencandy.php", "<?php\nrequire_once(\"global.php\");\nrequire_once(THIS_PATH.\"bencandy.php\");\n\t\t");
        write_file(ROOT_PATH . "{$channelDir}/global.php", "<?php\ndefined(\"THIS_PATH\") || define(\"THIS_PATH\",\"{$paths}\");\nrequire_once(THIS_PATH.\"global.php\");\t\n\t\t");
    }
    $rs_fid[config][channelDir] = $channelDir;
    $rs_fid[config][channelDomain] = $channelDomain;
    $config = addslashes(serialize($rs_fid[config]));
コード例 #3
0
ファイル: fujsarticle.php プロジェクト: GHubgenius/qbbj
    }
    if (!$show) {
        $show = "暂无...";
    }
}
$show = stripslashes($show);
//真静态
if ($webdb[NewsMakeHtml] == 1 || $gethtmlurl) {
    $show = make_html($show, $pagetype = 'N');
    //伪静态
} elseif ($webdb[NewsMakeHtml] == 2) {
    $show = fake_html($show);
}
$show = str_replace(array("\n", "\r", "'"), array("", "", "\\'"), $show);
if (!is_dir(dirname($FileName))) {
    makepath(dirname($FileName));
}
if (time() - filemtime($FileName) > $webdb["cache_time_{$type}"] * 60) {
    write_file($FileName, "<?php \r\n\$show=stripslashes('" . addslashes($show) . "'); ?>");
}
if ($iframeID) {
    //框架方式不会拖慢主页面打开速度,推荐
    //处理跨域问题
    if ($webdb[cookieDomain]) {
        echo "<SCRIPT LANGUAGE=\"JavaScript\">document.domain = \"{$webdb['cookieDomain']}\";</SCRIPT>";
    }
    echo "<SCRIPT LANGUAGE=\"JavaScript\">\n\tparent.document.getElementById('{$iframeID}').innerHTML='{$show}';\n\t</SCRIPT>";
} else {
    //JS式会拖慢主页面打开速度,不推荐
    echo "document.write('{$show}');";
}
コード例 #4
0
ファイル: form_module.php プロジェクト: GHubgenius/qbbj
    if (is_file(Adminpath . "template/form_module/tpl/admin_bencandy_{$id}.htm")) {
        $admin_show_tpl_file = Adminpath . "template/form_module/tpl/admin_bencandy_{$id}.htm";
    } else {
        $admin_show_tpl_file = Adminpath . "template/form_module/tpl/admin_bencandy.htm";
    }
    $admin_show_tpl = str_replace(array('$TempLate', "<", ">"), array($tpl_s, "&lt;", "&gt;"), read_file($admin_show_tpl_file));
    get_admin_html('tpl');
} elseif ($action == 'tpl') {
    $tpl_post = stripslashes($tpl_post);
    $tpl_list = stripslashes($tpl_list);
    $tpl_show = stripslashes($tpl_show);
    $tpl_search = stripslashes($tpl_search);
    $admin_tpl_list = stripslashes($admin_tpl_list);
    $admin_tpl_show = stripslashes($admin_tpl_show);
    if (!is_dir(ROOT_PATH . "{$dirname}/data/form_tpl")) {
        makepath(ROOT_PATH . "{$dirname}/data/form_tpl");
    }
    write_file(ROOT_PATH . "{$dirname}/data/form_tpl/post_{$id}.htm", $tpl_post);
    write_file(ROOT_PATH . "{$dirname}/data/form_tpl/search_{$id}.htm", $tpl_search);
    write_file(ROOT_PATH . "{$dirname}/data/form_tpl/bencandy_{$id}.htm", $tpl_show);
    write_file(ROOT_PATH . "{$dirname}/data/form_tpl/list_{$id}.htm", $tpl_list);
    write_file(ROOT_PATH . "{$dirname}/data/form_tpl/admin_bencandy_{$id}.htm", $admin_tpl_show);
    write_file(ROOT_PATH . "{$dirname}/data/form_tpl/admin_list_{$id}.htm", $admin_tpl_list);
    if (!is_writable(ROOT_PATH . "{$dirname}/data/form_tpl/post_{$id}.htm")) {
        showmsg("/{$dirname}/data/form_tpl/post_{$id}.htm模板生成失败,有可能是目录权限不可写,请手工创建一个,复制代码进去");
    }
    if (!is_writable(ROOT_PATH . "{$dirname}/data/form_tpl/search_{$id}.htm")) {
        showmsg("/{$dirname}/data/form_tpl/search_{$id}.htm模板生成失败,有可能是目录权限不可写,请手工创建一个,复制代码进去");
    }
    if (!is_writable(ROOT_PATH . "{$dirname}/data/form_tpl/bencandy_{$id}.htm")) {
        showmsg("/{$dirname}/data/form_tpl/bencandy_{$id}.htm模板生成失败,有可能是目录权限不可写,请手工创建一个,复制代码进去");
コード例 #5
0
ファイル: artic_function.php プロジェクト: GHubgenius/qbbj
/**
*真静态功能函数
**/
function make_html($content, $pagetype = 'N')
{
    $content = preg_replace("/ href=('|\"|)([-_a-z0-9\\.:\\/]{0,}\\/|)bencandy\\.php\\?fid=([\\d]+)&(aid|id)=([\\d]+)&page=([\\d]+)/eis", "make_html_Function('\\3','\\5','\\6','\\2',' href=\\1')", $content);
    //有分页的最终页
    $content = preg_replace("/ href=('|\"|)([-_a-z0-9\\.:\\/]{0,}\\/|)bencandy\\.php\\?fid=([\\d]+)&(id|aid)=([\\d]+)/eis", "make_html_Function('\\3','\\5','1','\\2',' href=\\1')", $content);
    //无分页的最终页
    $content = preg_replace("/ href=('|\"|)([-_a-z0-9\\.:\\/]{0,}\\/|)list\\.php\\?fid=([\\d]+)&page=([\\d]+)/eis", "make_html_Function('\\3','','\\4','\\2',' href=\\1')", $content);
    //有分页的列表页
    $content = preg_replace("/ href=('|\"|)([-_a-z0-9\\.:\\/]{0,}\\/|)list\\.php\\?fid=([\\d]+)/eis", "make_html_Function('\\3','','1','\\2',' href=\\1')", $content);
    //无分页的列表页
    //专题静态
    $content = preg_replace("/ href=('|\"|)([-_a-z0-9\\.:\\/]{0,}\\/|)showsp\\.php\\?fid=([\\d]+)&(id|aid)=([\\d]+)/eis", "make_sphtml_Function('\\3','\\5','1','\\2',' href=\\1')", $content);
    //无分页的最终页
    $content = preg_replace("/ href=('|\"|)([-_a-z0-9\\.:\\/]{0,}\\/|)listsp\\.php\\?fid=([\\d]+)&page=([\\d]+)/eis", "make_sphtml_Function('\\3','','\\4','\\2',' href=\\1')", $content);
    //有分页的列表页
    $content = preg_replace("/ href=('|\"|)([-_a-z0-9\\.:\\/]{0,}\\/|)listsp\\.php\\?fid=([\\d]+)/eis", "make_sphtml_Function('\\3','','1','\\2',' href=\\1')", $content);
    //无分页的列表页
    if ($pagetype == 'N') {
        return $content;
    }
    global $fid, $id, $fidDB, $webdb, $page, $rsdb, $Html_Type, $showHtml_Type;
    $content = str_replace("jsspecial.php?", "jsspecial.php?gethtmlurl=1&", $content);
    $content = str_replace("jsarticle.php?", "jsarticle.php?gethtmlurl=1&", $content);
    if ($pagetype == 'bencandy') {
        if ($showHtml_Type[bencandy][$id]) {
            $filename = $showHtml_Type[bencandy][$id];
        } elseif ($fidDB[bencandy_html]) {
            $filename = $fidDB[bencandy_html];
        } else {
            $filename = $webdb[bencandy_filename];
        }
        //对于内容页的首页把$page去除
        if ($page == 1) {
            $filename = preg_replace("/(.*)(-{\\\$page}|_{\\\$page})(.*)/is", "\\1\\3", $filename);
        }
        $dirid = floor($id / 1000);
        //对于内容页的栏目小于1000篇文章时,把DIR分目录去除
        if ($dirid == 0) {
            $filename = preg_replace("/(.*)(-{\\\$dirid}|_{\\\$dirid})(.*)/is", "\\1\\3", $filename);
        }
        if (strstr($filename, '$time_')) {
            $time_Y = date("Y", $rsdb[full_posttime]);
            $time_y = date("y", $rsdb[full_posttime]);
            $time_m = date("m", $rsdb[full_posttime]);
            $time_d = date("d", $rsdb[full_posttime]);
            $time_W = date("W", $rsdb[full_posttime]);
            $time_H = date("H", $rsdb[full_posttime]);
            $time_i = date("i", $rsdb[full_posttime]);
            $time_s = date("s", $rsdb[full_posttime]);
        }
        $content .= "<div style='display:none;'><iframe width=0 height=0 src='{$webdb['www_url']}/do/job.php?job=updatehits&aid={$id}'></iframe></div>";
    } elseif ($pagetype == 'list') {
        if ($fidDB[list_html]) {
            $filename = $fidDB[list_html];
        } else {
            $filename = $webdb[list_filename];
        }
        if ($page == 1) {
            if ($webdb[DefaultIndexHtml] == 2) {
                $filename = preg_replace("/(.*)\\/([^\\/]+)/is", "\\1/index.shtml", $filename);
            } elseif ($webdb[DefaultIndexHtml] == 1) {
                $filename = preg_replace("/(.*)\\/([^\\/]+)/is", "\\1/index.html", $filename);
            } else {
                $filename = preg_replace("/(.*)\\/([^\\/]+)/is", "\\1/index.htm", $filename);
            }
        }
    } elseif ($pagetype == 'listsp') {
        if ($fidDB[list_html]) {
            $filename = $fidDB[list_html];
        } else {
            $filename = $webdb[SPlist_filename];
        }
    } elseif ($pagetype == 'showsp') {
        if ($showHtml_Type[SPbencandy][$id]) {
            $filename = $showHtml_Type[SPbencandy][$id];
        } elseif ($fidDB[bencandy_html]) {
            $filename = $fidDB[bencandy_html];
        } else {
            $filename = $webdb[SPbencandy_filename];
        }
        if (strstr($filename, '$time_')) {
            $time_Y = date("Y", $rsdb[full_posttime]);
            $time_y = date("y", $rsdb[full_posttime]);
            $time_m = date("m", $rsdb[full_posttime]);
            $time_d = date("d", $rsdb[full_posttime]);
            $time_W = date("W", $rsdb[full_posttime]);
            $time_H = date("H", $rsdb[full_posttime]);
            $time_i = date("i", $rsdb[full_posttime]);
            $time_s = date("s", $rsdb[full_posttime]);
        }
        $content .= "<SCRIPT LANGUAGE='JavaScript' src='{$webdb['www_url']}/do/job.php?job=update_special_hits&id={$id}'></SCRIPT>";
    }
    eval("\$filename=\"{$filename}\";");
    $HtmlDir = dirname($filename);
    if (!is_dir(ROOT_PATH . $HtmlDir)) {
        makepath(ROOT_PATH . $HtmlDir);
    }
    write_file(ROOT_PATH . $filename, $content);
    return $content;
}
コード例 #6
0
ファイル: label_module.php プロジェクト: GHubgenius/qbbj
    preg_replace('/\\$label\\[([\'a-zA-Z0-9\\_]+)\\]/eis', "label_array_hf('\\1')", read_file(getTpl("foot", $foot_tpl)));
    //$label_hf为头部的检索数组,检查头部有多少个标签
    is_array($label_hf) || ($label_hf = array());
    foreach ($label_hf as $key => $value) {
        $rs = $db->get_one("SELECT * FROM {$pre}label WHERE tag='{$key}' AND chtype='99'");
        if ($rs[tag]) {
            $divdb = unserialize($rs[divcode]);
            $label[$key] = add_div($label[$key] ? $label[$key] : '&nbsp;', $rs[tag], $rs[type], $divdb[div_w], $divdb[div_h], $divdb[div_bgcolor], '99');
        } else {
            $label[$key] || ($label[$key] = add_div("新标签,无内容", $key, 'NewTag', '', '', '', '99'));
        }
    }
} else {
    $FileName = ROOT_PATH . "cache/label_cache/";
    if (!is_dir($FileName)) {
        makepath($FileName);
    }
    $FileName .= (ereg("\\.php", basename($WEBURL)) ? preg_replace("/\\.php(.*)/", "", basename($WEBURL)) : 'index') . "_" . intval($ch) . "_" . intval($ch_pagetype) . "_" . intval($ch_module) . "_" . intval($ch_fid) . "_" . intval($city_id) . '_' . substr(md5(getTpl("index", $chdb[main_tpl])), 0, 5) . ".php";
    //默认缓存3分钟.
    if (!$webdb[label_cache_time]) {
        $webdb[label_cache_time] = 3;
    }
    if (time() - filemtime($FileName) < $webdb[label_cache_time] * 60) {
        @(include $FileName);
    }
}
if (!$haveCache) {
    //获取内容页的标签
    preg_replace('/\\$label\\[([\'a-zA-Z0-9\\_]+)\\]/eis', "label_array('\\1')", read_file(getTpl("index", $chdb[main_tpl])));
    unset($label_rubbish);
    //屏蔽了错误.考虑到有时切换其他系统的时候SQL语句有错
コード例 #7
0
ファイル: channel.php プロジェクト: GHubgenius/qbbj
    //$tpl_foot=select_template("postdb[foot_tpl]",8,$rsdb[foot_tpl]);
    $style_select = select_style('postdb[style]', $rsdb[style]);
    require dirname(__FILE__) . "/" . "head.php";
    require dirname(__FILE__) . "/" . "template/channel/menu.htm";
    require dirname(__FILE__) . "/" . "template/channel/edit.htm";
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($job == 'autoadd' && $Apower[channel_list]) {
    require dirname(__FILE__) . "/" . "head.php";
    require dirname(__FILE__) . "/" . "template/channel/menu.htm";
    require dirname(__FILE__) . "/" . "template/channel/autoadd.htm";
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($action == 'autoadd' && $Apower[channel_list]) {
    if (is_dir(ROOT_PATH . $postdb[path])) {
        showmsg("{$postdb['path']},此目录已经存在了.请换一个吧");
    }
    makepath(ROOT_PATH . $postdb[path]);
    $postdb[phpname] = "{$postdb['path']}/index.php";
    $postdb[htmlname] = "{$postdb['path']}/index.htm";
    $db->query("INSERT INTO `{$pre}channel` ( `type`, `name`, `path`, `phpname`, `htmlname`, `fids`, `style`, `head_tpl`, `main_tpl`, `foot_tpl`, `url`, `logo`, `descrip`, `admin`, `list`,config) VALUES ('1','{$postdb['name']}','{$postdb['path']}','{$postdb['phpname']}','{$postdb['htmlname']}','{$postdb['fids']}','{$postdb['style']}','{$postdb['head_tpl']}','{$postdb['main_tpl']}','{$postdb['foot_tpl']}','{$postdb['url']}','{$postdb['logo']}','{$postdb['descrip']}','{$postdb['admin']}','{$postdb['list']}','{$config}')");
    $rs = $db->get_one("SELECT * FROM `{$pre}channel` ORDER BY id DESC LIMIT 1");
    $paths = '';
    $detail = explode("/", $postdb[path]);
    foreach ($detail as $key => $value) {
        if ($value) {
            $paths .= '../';
        }
    }
    write_file(ROOT_PATH . "{$postdb['path']}/index.php", "<?php\nrequire_once(\"global.php\");\nrequire_once(THIS_PATH.\"index.php\");\n");
    write_file(ROOT_PATH . "{$postdb['path']}/list.php", "<?php\nrequire_once(\"global.php\");\nrequire_once(THIS_PATH.\"list.php\");\n\t");
    write_file(ROOT_PATH . "{$postdb['path']}/bencandy.php", "<?php\nrequire_once(\"global.php\");\nrequire_once(THIS_PATH.\"bencandy.php\");\n\t");
    write_file(ROOT_PATH . "{$postdb['path']}/global.php", "<?php\ndefined(\"THIS_PATH\") || define(\"THIS_PATH\",\"{$paths}\");\n\$ch={$rs['id']};\nrequire_once(THIS_PATH.\"global.php\");\t\n\t");
コード例 #8
0
ファイル: getimg.php プロジェクト: Jesuslagliva12/OpenAPI
function vthumb($aid)
{
    global $db, $pre, $webdb;
    $path = ROOT_PATH . "cache/vimg/{$aid}.jpg";
    if (file_exists($path) && filesize($path) != 0) {
        $vtb[bimg] = $webdb[www_url] . "/cache/vimg/{$aid}.jpg";
    } else {
        makepath(ROOT_PATH . "cache/vimg/");
        if (filesize($path) == 0) {
            del_file($path);
        }
        $vdb = $db->get_one("SELECT R.*,A.* FROM {$pre}article A LEFT JOIN {$pre}reply R ON A.aid=R.aid WHERE A.aid='{$aid}' ORDER BY R.rid ASC LIMIT 1");
        preg_match('/\\<embed.+?src="(.+?)".*?>/is', $vdb[content], $embed);
        $temp = explode('/', htmlspecialchars($embed[1]));
        $host = $temp[2];
        switch ($host) {
            case "player.56.com":
                preg_match("#http://player.56.com/v_(\\w+)#i", $embed[1], $match);
                $info = json_decode(vcurl($host, "http://vxml.56.com/json/{$match['1']}/"), true);
                if ($info[status] == 1) {
                    $vtb[bimg] = $info[info][bimg];
                    write_file($path, vcurl($host, $vtb[bimg]));
                } else {
                    $vtb[bimg] = $webdb[www_url] . '/images/video.jpg';
                }
                break;
            case "player.youku.com":
                preg_match("#http://player.youku.com/player.php/sid/(\\w+)/v.swf#i", $embed[1], $match);
                $info = json_decode(vcurl($host, "http://v.youku.com/player/getPlayList/VideoIDS/{$match['1']}/"), true);
                if (!empty($info[data][0])) {
                    $vtb[bimg] = $info[data][0][logo];
                    write_file($path, vcurl($host, $vtb[bimg]));
                } else {
                    $vtb[bimg] = $webdb[www_url] . '/images/video.jpg';
                }
                break;
            case "www.tudou.com":
                preg_match("#http://www.tudou.com/(v|l)/([\\w-]+)/#i", $embed[1], $match);
                $info = json_decode(vcurl($host, "http://api.tudou.com/v3/gw?method=item.info.get&appKey=myKey&format=json&itemCodes={$match['2']}"), true);
                if (!empty($info[multiResult][results][0])) {
                    $vtb[bimg] = $info[multiResult][results][0][bigPicUrl];
                    write_file($path, vcurl($host, $vtb[bimg]));
                } else {
                    $vtb[bimg] = $webdb[www_url] . '/images/video.jpg';
                }
                break;
            case "player.video.qiyi.com":
                preg_match("#http://player.video.qiyi.com/(\\w+)/(\\d+)/(\\d+)/v_(\\w+).swf#i", $embed[1], $match);
                if (!empty($match)) {
                    $cont = vcurl($host, "http://www.iqiyi.com/v_{$match['4']}.html");
                    preg_match('/itemprop="image" content="(.*?).jpg"/s', $cont, $info);
                    if (empty($info)) {
                        preg_match('/itemprop="thumbnailUrl" content=\'(.*?)\'/s', $cont, $info);
                        $vtb[bimg] = $info[1];
                    } else {
                        $vtb[bimg] = !preg_match("/404/", implode(",", get_headers($vtb[bimg]))) ? $info[1] . "_116_65.jpg" : $info[1] . "_180_101.jpg";
                    }
                    write_file($path, vcurl($host, $vtb[bimg]));
                } else {
                    $vtb[bimg] = $webdb[www_url] . '/images/video.jpg';
                }
                break;
            case "player.pps.tv":
                preg_match("#http://player.pps.tv/player/sid/(\\w+)/v.swf#i", $embed[1], $match);
                if (!empty($match)) {
                    $cont = vcurl($host, "http://v.pps.tv/play_{$match['1']}.html");
                    preg_match('/sharepic":"(.*?)","/s', $cont, $info);
                    if (!empty($info)) {
                        $vtb[bimg] = stripslashes($info[1]);
                        write_file($path, vcurl($host, $vtb[bimg]));
                    } else {
                        $vtb[bimg] = $webdb[www_url] . '/images/video.jpg';
                    }
                } else {
                    $vtb[bimg] = $webdb[www_url] . '/images/video.jpg';
                }
                break;
            case "static.video.qq.com":
                preg_match("#http://static.video.qq.com/TPout.swf\\?vid=(\\w+)#i", $embed[1], $match);
                $vtb[bimg] = "http://vpic.video.qq.com/{$match['1']}_ori_1.jpg";
                write_file($path, vcurl($host, $vtb[bimg]));
                break;
            case "resources.baomihua.com":
                preg_match("#http://resources.baomihua.com/(\\d+).swf#i", $embed[1], $match);
                $vtb[bimg] = "http://img02.video.baomihua.com/x/{$match['1']}.jpg";
                write_file($path, vcurl($host, $vtb[bimg]));
                break;
            default:
                $vtb[host] = $host;
                $vtb[bimg] = $webdb[www_url] . '/images/video.jpg';
        }
    }
    return $vtb;
}
コード例 #9
0
ファイル: global.php プロジェクト: xubo245/liuyangzhang
/**
*真静态功能函数
**/
function make_html($content, $pagetype = '')
{
    global $fid, $id, $fidDB, $webdb, $page, $rsdb;
    $content = preg_replace("/bencandy\\.php\\?fid=([\\d]+)&(aid|id)=([\\d]+)&page=([\\d]+)/eis", "make_html_Function('\\1','\\3','\\4','')", $content);
    //有分页的最终页
    $content = preg_replace("/([a-z0-9-\\.:\\/]{0,})bencandy\\.php\\?fid=([\\d]+)&(id|aid)=([\\d]+)/eis", "make_html_Function('\\2','\\4','1','\\1')", $content);
    //无分页的最终页
    $content = preg_replace("/list\\.php\\?fid=([\\d]+)&page=([\\d]+)/eis", "make_html_Function('\\1','','\\2','')", $content);
    //有分页的列表页
    $content = preg_replace("/([a-z0-9-\\.:\\/]{0,})list\\.php\\?fid=([\\d]+)/eis", "make_html_Function('\\2','','1','\\1')", $content);
    //无分页的列表页
    if ($pagetype == 'index') {
        $filename = 'index.htm';
    } elseif ($id) {
        if ($fidDB[bencandy_html]) {
            $filename = $fidDB[bencandy_html];
        } else {
            $filename = $webdb[Info_bencandy_filename];
        }
        $dirid = floor($id / 1000);
        if (strstr($filename, '$time_')) {
            $time_Y = date("Y", $rsdb[full_posttime]);
            $time_y = date("y", $rsdb[full_posttime]);
            $time_m = date("m", $rsdb[full_posttime]);
            $time_d = date("d", $rsdb[full_posttime]);
            $time_W = date("W", $rsdb[full_posttime]);
            $time_H = date("H", $rsdb[full_posttime]);
            $time_i = date("i", $rsdb[full_posttime]);
            $time_s = date("s", $rsdb[full_posttime]);
        }
    } else {
        if ($fidDB[list_html]) {
            $filename = $fidDB[list_html];
        } else {
            $filename = $webdb[Info_list_filename];
        }
        if ($page == 1) {
            $filename = preg_replace("/(.*)\\/([^\\/]+)/is", "\\1/index.htm", $filename);
        }
    }
    eval("\$filename=\"{$filename}\";");
    $HtmlDir = dirname($filename);
    if (!is_dir(ROOT_PATH . Mdirname . "/{$HtmlDir}")) {
        makepath(ROOT_PATH . Mdirname . "/{$HtmlDir}");
    }
    if ($pagetype != 'index') {
        write_file($filename, $content);
    }
    return $content;
}
コード例 #10
0
ファイル: post.php プロジェクト: xubo245/liuyangzhang
function get_outpic($str, $fid = 0, $getpic = 1)
{
    global $webdb, $_pre;
    if (!$getpic) {
        return $str;
    }
    preg_match_all("/http:\\/\\/([^ '\"<>]+)\\.(gif|jpg|png)/is", $str, $array);
    $filedb = $array[0];
    foreach ($filedb as $key => $value) {
        if (strstr($value, $webdb[www_url])) {
            continue;
        }
        $listdb["{$value}"] = $value;
    }
    unset($filedb);
    foreach ($listdb as $key => $value) {
        $filedb[] = $value;
        $name = rands(5) . "__" . basename($value);
        if (!is_dir(ROOT_PATH . "{$webdb['updir']}/{$_pre}")) {
            makepath(ROOT_PATH . "{$webdb['updir']}/{$_pre}");
        }
        if (!is_dir(ROOT_PATH . "{$webdb['updir']}/{$_pre}/{$fid}")) {
            makepath(ROOT_PATH . "{$webdb['updir']}/{$_pre}/{$fid}");
        }
        $ck = 0;
        if (@copy($value, ROOT_PATH . "{$webdb['updir']}/{$_pre}/{$fid}/{$name}")) {
            $ck = 1;
        } elseif ($filestr = file_get_contents($value)) {
            $ck = 1;
            write_file(ROOT_PATH . "{$webdb['updir']}/{$_pre}/{$fid}/{$name}", $filestr);
        }
        /*加水印*/
        if ($ck && $webdb[is_waterimg] && $webdb[if_gdimg]) {
            include_once ROOT_PATH . "inc/waterimage.php";
            $uploadfile = ROOT_PATH . "{$webdb['updir']}/{$_pre}/{$fid}/{$name}";
            imageWaterMark($uploadfile, $webdb[waterpos], ROOT_PATH . $webdb[waterimg]);
        }
        if ($ck) {
            $str = str_replace("{$value}", "http://www_qibosoft_com/Tmp_updir/{$_pre}/{$fid}/{$name}", $str);
        }
    }
    return $str;
}
コード例 #11
0
ファイル: admin.php プロジェクト: xubo245/liuyangzhang
} elseif ($action == "addstyle" && $Apower[style_editstyle]) {
    if (!$postdb[keywords]) {
        showmsg("关键字不能为空");
    } elseif (!$postdb[name]) {
        showmsg("风格名称不能为空");
    }
    if (is_dir(ROOT_PATH . "data/style/{$postdb['keywords']}.php") || is_dir(ROOT_PATH . "template/{$postdb['keywords']}/") || is_dir(ROOT_PATH . "images/{$postdb['keywords']}/")) {
        showmsg("关键字已经存在了,请换一个关键字吧");
    }
    $show = "<?php\tunset(\$styledb);";
    foreach ($postdb as $key => $value) {
        $show .= "\n\t\t\$styledb['{$key}']='{$value}';";
    }
    write_file(ROOT_PATH . "data/style/{$postdb['keywords']}.php", $show . '?>');
    makepath(ROOT_PATH . "images/{$postdb['keywords']}");
    makepath(ROOT_PATH . "template/{$postdb['keywords']}");
    write_file(ROOT_PATH . "images/{$postdb['keywords']}/style.css", stripslashes("{$CssCode}\r\n"));
    copy(ROOT_PATH . "template/default/head.htm", ROOT_PATH . "template/{$postdb['keywords']}/head.htm");
    copy(ROOT_PATH . "template/default/foot.htm", ROOT_PATH . "template/{$postdb['keywords']}/foot.htm");
    copy(ROOT_PATH . "template/default/index.htm", ROOT_PATH . "template/{$postdb['keywords']}/index.htm");
    copy(ROOT_PATH . "template/default/list.htm", ROOT_PATH . "template/{$postdb['keywords']}/list.htm");
    copy(ROOT_PATH . "template/default/bencandy.htm", ROOT_PATH . "template/{$postdb['keywords']}/bencandy.htm");
    $dir = opendir(ROOT_PATH . "images/default/");
    while ($file = readdir($dir)) {
        if (eregi("(png|jpg|gif)\$", $file)) {
            copy(ROOT_PATH . "images/default/{$file}", ROOT_PATH . "images/{$postdb['keywords']}/{$file}");
        }
    }
    jump("添加成功", "index.php?lfj=style&job=editstyle&keywords={$postdb['keywords']}");
} elseif ($job == "editstyle" && $Apower[style_editstyle]) {
    $style_select = select_style('keywords', $keywords, "index.php?lfj=style&job=editstyle");
コード例 #12
0
ファイル: function.inc.php プロジェクト: xubo245/liuyangzhang
function move_attachment($uid, $str, $newdir, $type = '')
{
    global $webdb, $db, $pre, $id, $aid, $fid, $timestamp, $webdb, $Fid_db;
    if (!$str || !$uid || !$newdir) {
        return $str;
    }
    $_id = $id ? $id : $aid;
    //Ä¿Ç°½ö¶ÔÎÄÕÂ×÷´¦Àí,з¢ÎÄÕÂʱ,Éè·¨»ñÈ¡ID
    if (!$webdb[module_id] && !$_id) {
        $erp = $Fid_db[iftable][$fid];
        $rs = $db->get_one("SHOW TABLE STATUS LIKE '{$pre}article{$erp}'");
        $_id = $rs[Auto_increment];
    }
    $filedb = get_content_attachment($str);
    foreach ($filedb as $key => $value) {
        $name = basename($value);
        if ($rs = $db->get_one("SELECT * FROM {$pre}upfile WHERE filename='{$name}'")) {
            if ($_id && !in_array($_id, explode(",", $rs[ids]))) {
                $db->query("UPDATE `{$pre}upfile` SET `num`=`num`+1,ids='{$rs['ids']},{$_id}' WHERE filename='{$name}'");
            }
            continue;
        }
        $detail = explode("_", $name);
        //»ñÈ¡ÎļþµÄUIDÓëÓû§µÄUIDÒ»Ñùʱ.²Åɾ³ý.²»ÒªÂÒɾ³ý
        if ($detail[0] && $detail[0] == $uid) {
            $turepath = ROOT_PATH . $webdb[updir] . "/" . $value;
            if (!is_dir(ROOT_PATH . $webdb[updir] . "/" . $newdir)) {
                makepath(ROOT_PATH . $webdb[updir] . "/" . $newdir);
            }
            //×Ô¶¯ËõС̫´óÕŵÄͼƬ
            if ($webdb[ArticlePicWidth] && $webdb[ArticlePicHeight] && (eregi(".gif\$", $turepath) || eregi(".jpg\$", $turepath))) {
                $img_array = getimagesize($turepath);
                if ($img_array[0] > $webdb[ArticlePicWidth] || $img_array[1] > $webdb[ArticlePicHeight]) {
                    gdpic($turepath, $turepath, $webdb[ArticlePicWidth], $webdb[ArticlePicHeight], 1);
                }
            }
            //ͼƬ¼Óˮӡ
            if ($type != 'small' && $webdb[is_waterimg] && (eregi(".gif\$", $turepath) || eregi(".jpg\$", $turepath))) {
                include_once ROOT_PATH . "inc/waterimage.php";
                imageWaterMark($turepath, $webdb[waterpos], ROOT_PATH . $webdb[waterimg]);
            }
            if (@rename($turepath, ROOT_PATH . $webdb[updir] . "/{$newdir}/{$name}")) {
                $str = str_replace("{$value}", "{$newdir}/{$name}", $str);
                $db->query("INSERT INTO `{$pre}upfile` ( `module_id` , `ids` , `fid` , `uid` , `posttime` , `url` , `filename` , `num` ) VALUES ('{$webdb['module_id']}','{$_id}','{$fid}','{$uid}','{$timestamp}','{$newdir}/{$name}','{$name}','1')");
            }
        }
    }
    return $str;
}
コード例 #13
0
ファイル: bootstrap.php プロジェクト: dlehmann/DevCE
// set if not available
if (!isset($_SERVER['HTTP_REFERER'])) {
    $_SERVER['HTTP_REFERER'] = '';
}
// set protocol
$protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : false;
if (!$protocol || $protocol != '1.0' && $protocol != 'HTTP/1.1') {
    $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0';
}
// set if not available
$_SERVER = array_merge(array('REQUEST_URI' => ''), $_SERVER);
// -------------------------------------------------
// define preset data
// -------------------------------------------------
// preset data path
define('PRESET_PATH', makepath(array(ABS_PATH, 'applications', 'preset')));
// -------------------------------------------------
// connect to database
// -------------------------------------------------
setConnectionName('default');
setConnectionConf(config('mysql'));
// -------------------------------------------------
// run system
// -------------------------------------------------
if (version_compare(PHP_VERSION, '5.3') == -1) {
    $err = 'The current PHP version ' . PHP_VERSION . ' is not supported.' . PHP_EOL;
    $err .= 'Please upgrade your PHP installation to 5.3 or later.';
    system_error($err);
} else {
    // create front controller object
    $FrontController = new FrontController();
コード例 #14
0
ファイル: FrontController.php プロジェクト: dlehmann/DevCE
 private function execAction()
 {
     $name = ltrim(substr($this->uri, strlen(URI_ACTION_KEYWORD)), '/');
     $data = tellme('actions');
     if (isset($data[$name])) {
         $path = str_replace('::', '/', $data[$name]['path']);
         $filename = $data[$name]['file'] . '.inc.php';
         if ($data[$name]['webdir'] === true) {
             $file = makepath(array(RESOURCE_PATH, $path, $filename));
         } else {
             $file = makepath(array(ABS_PATH, $path, $filename));
         }
         if (file_exists($file)) {
             Autoloader::register($data[$name]['class'], $file);
             if (class_exists($data[$name]['class'])) {
                 $class = new $data[$name]['class']();
                 if (method_exists($class, 'execute')) {
                     $class->execute($this->req, $this->res);
                 } else {
                     trigger_error('The method "execute" of class "' . $data[$name]['class'] . '" was not found.', E_USER_ERROR);
                 }
             }
         } else {
             trigger_error('The action file named "' . $data[$name]['file'] . '" was not found.', E_USER_ERROR);
         }
     } else {
         trigger_error('The action named "' . $name . '" is not registered.', E_USER_ERROR);
     }
     // end function
 }
コード例 #15
0
ファイル: alonepage.php プロジェクト: GHubgenius/qbbj
require ROOT_PATH . "inc/label_module.php";
if (!$rsdb[ishtml]) {
    require_once ROOT_PATH . "inc/encode.php";
    $rsdb[content] = format_text($rsdb[content]);
} else {
    $rsdb[content] = En_TruePath($rsdb[content], 0);
}
$rsdb[posttime] = date("Y-m-d H:i:s", $rsdb[posttime]);
require ROOT_PATH . "inc/head.php";
require $chdb[main_tpl];
require ROOT_PATH . "inc/foot.php";
if ($job == 'makehtml' && $rsdb[filename]) {
    $content = ob_get_contents();
    $path = dirname(ROOT_PATH . $rsdb[filename]);
    if (!is_dir($path)) {
        makepath($path);
    }
    write_file(ROOT_PATH . "{$rsdb['filename']}", $content);
    ob_end_clean();
    if ($adminurl) {
        if ($ids) {
            $detail = explode(',', $ids);
            $id = $detail[0];
            unset($detail[0]);
            $ids = implode(',', $detail);
            echo "请稍候...{$ids}<META HTTP-EQUIV=REFRESH CONTENT='0;URL=?id={$id}&ids={$ids}&job={$job}&adminurl={$adminurl}'>";
        } else {
            echo "生成完毕!<META HTTP-EQUIV=REFRESH CONTENT='0;URL={$adminurl}/index.php?lfj=alonepage&job=list'>";
        }
    } else {
        echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL={$webdb['www_url']}/{$rsdb['filename']}'>";
コード例 #16
0
ファイル: admin.php プロジェクト: xubo245/liuyangzhang
                     } elseif (eregi("(\\.htm|\\.html)\$", $file2)) {
                         $ck = 1;
                         rename(dirname(ROOT_PATH . $postdb[filepath]) . "/tmp/{$file}/{$file2}", ROOT_PATH . $postdb[filepath]);
                         $truedir = dirname(ROOT_PATH . $postdb[filepath]) . "/tmp/{$file}/";
                     } elseif (eregi("(\\.php|\\.php3|\\.asp|\\.aspx)\$", $file2)) {
                         unlink(dirname(ROOT_PATH . $postdb[filepath]) . "/tmp/{$file}/{$file2}");
                     }
                 }
                 closedir($dir2);
             }
         }
         closedir($dir);
     }
     //图片目录转移
     $imgpath = str_replace(".htm", "", ROOT_PATH . $postdb[filepath]);
     makepath($imgpath);
     $dir = opendir($truedir);
     while ($file = readdir($dir)) {
         if ($file == '.' || $file == '..') {
             continue;
         }
         rename("{$truedir}/{$file}", "{$imgpath}/{$file}");
     }
     closedir($dir);
     //删除临时创建的目录
     del_file(dirname(ROOT_PATH . $postdb[filepath]) . "/tmp");
     //处理图片路径
     $file = read_file(ROOT_PATH . $postdb[filepath]);
     $file = preg_replace("/^([^>]+)>(.*)/is", "\\1>\r\n\r\n<!--这一行是系统自动添加的代码,目的是为了处理图片的路径--><base href='{$webdb['www_url']}/" . str_replace(".htm", "/", $postdb[filepath]) . "'>\r\n\r\n\\2", $file);
     write_file(ROOT_PATH . $postdb[filepath], $file);
 } else {
コード例 #17
0
ファイル: article_module.php プロジェクト: GHubgenius/qbbj
    require "head.php";
    require "template/article_module/tpl.htm";
    require "foot.php";
} elseif ($action == 'tpl' && $Apower[article_module]) {
    $tpl_post = stripslashes($tpl_post);
    $member_tpl_post = stripslashes($member_tpl_post);
    $tpl_bigsort = stripslashes($tpl_bigsort);
    $tpl_sort = stripslashes($tpl_sort);
    $tpl_show = stripslashes($tpl_show);
    $tpl_search = stripslashes($tpl_search);
    $tpl_list = stripslashes($tpl_list);
    if (!is_dir(ROOT_PATH . "data/article_tpl")) {
        makepath(ROOT_PATH . "data/article_tpl");
    }
    if (!is_dir(ROOT_PATH . "data/member_tpl")) {
        makepath(ROOT_PATH . "data/member_tpl");
    }
    write_file(ROOT_PATH . "data/admin_tpl/post_{$id}.htm", $tpl_post);
    write_file(ROOT_PATH . "data/member_tpl/post_{$id}.htm", $member_tpl_post);
    write_file(ROOT_PATH . "template/default/bencandy_{$id}.htm", $tpl_show);
    write_file(ROOT_PATH . "template/default/search_{$id}.htm", $tpl_search);
    $tpl_list && write_file(ROOT_PATH . "template/default/list_tpl/mod_{$id}.htm", $tpl_list);
    if (!is_writable(ROOT_PATH . "data/admin_tpl/post_{$id}.htm")) {
        showmsg("data/admin_tpl/post_{$id}.htm模板生成失败,有可能是目录权限不可写,请手工创建一个,复制代码进去");
    }
    if (!is_writable(ROOT_PATH . "data/member_tpl/post_{$id}.htm")) {
        showmsg("data/member_tpl/post_{$id}.htm模板生成失败,有可能是目录权限不可写,请手工创建一个,复制代码进去");
    }
    if (!is_writable(ROOT_PATH . "template/default/bencandy_{$id}.htm")) {
        showmsg("template/default/bencandy_{$id}.htm模板生成失败,有可能是目录权限不可写,请手工创建一个,复制代码进去");
    }
コード例 #18
0
ファイル: index.php プロジェクト: uchilaka/docfactory
// include 2D barcode class (search for installation path)
function makepath() {
    $array=func_get_args();
    return implode(DIRECTORY_SEPARATOR, $array);
}

require_once( makepath(dirname(__FILE__), 'tcpdf_barcodes_2d.php') );
require_once( makepath(dirname(__FILE__), 'tools', 'dir.php') );

// constants
if(array_key_exists('APPLICATION_ID', $_SERVER)) {
    # Google cloud!
    $tmp_dir = 'gs://com-larcity-static/temp/';
} else {
    $tmp_dir = makepath(dirname(__FILE__), 'temp') . DIRECTORY_SEPARATOR;
}
define('TMP_DIR', $tmp_dir);

$requested_code_type = empty($_GET['type']) ? 'PDF417' : strtoupper(trim(filter_var($_GET['type'], FILTER_SANITIZE_STRING)));

$data = [];
$text_data = '';

function set($key, $value) {
    $data[$key] = $value;
}

function json($key) {
    return empty($data[$key]) ? null : $data[$key];
}