예제 #1
0
function editall()
{
    global $db;
    $t_id = be("arr", "t_id");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $package_name = be("post", "package_name" . $id);
        $category_id = be("post", "category_id" . $id);
        //var_dump($t_type);
        $status = be("post", "status" . $id);
        $apk_icon = be("post", "apk_icon" . $id);
        //		$upload_count = be("post","upload_count" .$id);
        $disp_order = be("post", "disp_order" . $id);
        $app_name = be("post", "app_name" . $id);
        if (isN($app_name)) {
            echo "信息填写不完整!";
            exit;
        }
        if (isN($disp_order)) {
            $disp_order = $db->getOne("SELECT MAX(disp_order) FROM apk_master_base ") + 1;
        }
        if (!isNum($disp_order)) {
            echo "信息填写不完整!";
            exit;
        }
        $db->Update("apk_master_base", array("package_name", "category_id", "status", "disp_order", "app_name", "apk_icon"), array($package_name, $category_id, $status, $disp_order, $app_name, $apk_icon), "id=" . $id);
    }
    updateCacheFile();
    echo "修改完毕";
}
function editall()
{
    global $db;
    $t_id = be("arr", "ids");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $t_flag = be("post", "t_flag" . $id);
        $t_sort = be("post", "disp_order" . $id);
        if (isN($t_sort)) {
            $t_sort = $db->getOne("SELECT MAX(disp_order) FROM {pre}vod_topic_items") + 1;
        }
        if (!isNum($t_sort)) {
            echo "信息填写不完整!";
            exit;
        }
        $db->Update("{pre}vod_topic_items", array("flag", "disp_order"), array($t_flag, $t_sort), "id=" . $id);
    }
    updateCacheFile();
    $topic_id = getBody(getReferer(), 'topic_id=', '&');
    if (isN($topic_id)) {
        $topic_id = getBodys(getReferer(), 'topic_id=');
    }
    if (!isN($topic_id)) {
        replaceTopRecommend($topic_id);
    }
    echo "修改完毕";
}
예제 #3
0
function editall()
{
    global $db;
    $t_id = be("arr", "t_id");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $t_name = be("post", "t_name" . $id);
        $t_sort = be("post", "t_sort" . $id);
        $t_enname = be("post", "t_enname" . $id);
        $t_template = be("post", "t_template" . $id);
        $t_pic = be("post", "t_pic" . $id);
        if (isN($t_name)) {
            echo "信息填写不完整!";
            exit;
        }
        if (isN($t_enname)) {
            echo "信息填写不完整!";
            exit;
        }
        if (isN($t_sort)) {
            $t_sort = $db->getOne("SELECT MAX(t_sort) FROM {pre}vod_topic") + 1;
        }
        if (!isNum($t_sort)) {
            echo "信息填写不完整!";
            exit;
        }
        $db->Update("{pre}art_topic", array("t_name", "t_enname", "t_template", "t_sort", "t_pic"), array($t_name, $t_enname, $t_template, $t_sort, $t_pic), "t_id=" . $id);
    }
    updateCacheFile();
    echo "修改完毕";
}
function save()
{
    $areastr = be("post", "areastr");
    $langstr = be("post", "langstr");
    fwrite(fopen("../inc/vodarea.txt", "wb"), $areastr);
    fwrite(fopen("../inc/vodlang.txt", "wb"), $langstr);
    updateCacheFile();
    echo "修改完毕";
}
function save()
{
    $program_country = be("post", "program_country");
    $program_area = be("post", "program_area");
    $program_type = be("post", "program_type");
    $tv_playfrom = be("post", "tv_playfrom");
    fwrite(fopen("../inc/program_country.txt", "wb"), $program_country);
    fwrite(fopen("../inc/program_area.txt", "wb"), $program_area);
    fwrite(fopen("../inc/program_type.txt", "wb"), $program_type);
    fwrite(fopen("../inc/tv_playfrom.txt", "wb"), $tv_playfrom);
    updateCacheFile();
    echo "修改完毕";
}
예제 #6
0
function editall()
{
    global $db;
    $t_id = be("arr", "t_id");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $status = be("post", "status" . $id);
        $disp_order = be("post", "disp_order" . $id);
        if (isN($disp_order)) {
            $t_sort = $db->getOne("SELECT MAX(disp_order) FROM apk_master_items ") + 1;
        }
        if (!isNum($disp_order)) {
            echo "信息填写不完整!";
            exit;
        }
        $db->Update("apk_master_items", array("status", "disp_order"), array($status, $disp_order), "id=" . $id);
    }
    updateCacheFile();
    echo "修改完毕";
}
function editall()
{
    global $db;
    $t_id = be("arr", "t_id");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $t_name = be("post", "t_name" . $id);
        $t_sort = be("post", "t_sort" . $id);
        $t_key = be("post", "t_key" . $id);
        $t_des = be("post", "t_des" . $id);
        if (isN($t_name)) {
            echo "名称不能为空";
            exit;
        }
        if (!isNum($t_sort)) {
            echo "排序号不能为空或不是数字";
            exit;
        }
        $db->Update("apk_category", array("name", "disp_order", "type_key", "type_desc"), array($t_name, $t_sort, $t_key, $t_des), "id=" . $id);
    }
    updateCacheFile();
    echo "修改完毕";
}
function editall()
{
    global $db;
    $t_id = be("arr", "t_id");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $tv_playfrom = be("post", "tv_playfrom" . $id);
        $tv_playurl = be("post", "tv_playurl" . $id);
        //var_dump($t_type);
        $status = be("post", "status" . $id);
        if (isN($tv_playurl)) {
            echo "信息填写不完整!";
            exit;
        }
        if (isN($tv_playfrom)) {
            echo "信息填写不完整!";
            exit;
        }
        $db->Update("{pre}tv_play", array("tv_playfrom", "tv_playurl", "status"), array($tv_playfrom, $tv_playurl, $status), "id=" . $id);
    }
    updateCacheFile();
    echo "修改完毕";
}
예제 #9
0
function editall()
{
    global $db;
    $t_id = be("arr", "t_id");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $tv_name = be("post", "tv_name" . $id);
        $tv_code = be("post", "tv_code" . $id);
        //var_dump($t_type);
        $tv_type = be("post", "tv_type" . $id);
        $tv_playurl = be("post", "tv_playurl" . $id);
        $status = be("post", "status" . $id);
        $country = be("post", "country" . $id);
        $area = be("post", "area" . $id);
        if (isN($tv_name)) {
            echo "信息填写不完整!";
            exit;
        }
        $db->Update("{pre}tv", array("tv_name", "tv_code", "tv_type", "tv_playurl", "create_date", "status", "country", "area"), array($tv_name, $tv_code, $tv_type, $tv_playurl, date('Y-m-d H:i:s', time()), $status, $country, $area), "id=" . $id);
    }
    updateCacheFile();
    echo "修改完毕";
}
예제 #10
0
파일: admin_data.php 프로젝트: klarclm/sgv
                 $ids = be("arr", "c_id");
             }
             break;
         case "comment":
             $col = "c_id";
             $ids = be("get", "c_id");
             if (isN($ids)) {
                 $ids = be("arr", "c_id");
             }
             break;
     }
     if (!isN($ids)) {
         $db->Delete('{pre}' . $tab, $col . " in (" . $ids . ")");
     }
     if ($upcache) {
         updateCacheFile();
     }
     redirect(getReferer());
 } elseif ($ac == 'clear') {
     $sql = 'truncate TABLE {pre}' . $tab;
     $db->query($sql);
     redirect(getReferer());
 } elseif ($ac == 'set') {
     $sql = 'UPDATE {pre}' . $tab . ' set ' . $col . '=' . $val . ' WHERE ' . $colid . ' IN(' . $id . ')';
     $db->query($sql);
     redirect(getReferer());
 } elseif ($ac == 'getfields') {
     if (empty($tab)) {
         echo '[]';
     }
     $rs = $db->query('SHOW COLUMNS FROM ' . $tab);
예제 #11
0
function updatedata()
{
    updateCacheFile();
    echo "";
}
예제 #12
0
function lunboForTopic()
{
    global $db;
    $tab = be("all", "tab");
    $flag = be("all", "flag");
    $upcache = false;
    switch ($tab) {
        case "{pre}vod_popular":
            $ids = be("get", "t_id");
            if (isN($ids)) {
                $ids = be("arr", "t_id");
            }
            $colarr = array("vod_id", "type", "status");
            $ids = explode(",", $ids);
            foreach ($ids as $t_id) {
                if (isNum($t_id)) {
                    $valarr = array($t_id, '1', '1');
                    $db->Add($tab, $colarr, $valarr);
                }
            }
            $upcache = true;
            break;
    }
    if ($upcache) {
        updateCacheFile();
    }
    if (isN($flag)) {
        redirect('admin_vod_popular.php');
    }
    echo "保存完毕";
}
예제 #13
0
function editall()
{
    global $db;
    $t_id = be("arr", "t_id");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $t_name = be("post", "t_name" . $id);
        $t_enname = be("post", "t_enname" . $id);
        $t_sort = be("post", "t_sort" . $id);
        //		$t_template = be("post","t_template" .$id);
        //		$t_vodtemplate = be("post","t_vodtemplate" .$id);
        //		$t_playtemplate = be("post","t_playtemplate" .$id);
        //		$t_key = be("post","t_key" .$id);
        //		$t_des = be("post","t_des" .$id);
        if (isN($t_name)) {
            echo "名称不能为空";
            exit;
        }
        if (isN($t_enname)) {
            echo "别名不能为空";
            exit;
        }
        if (!isNum($t_sort)) {
            echo "排序号不能为空或不是数字";
            exit;
        }
        //		if (isN($t_template)) { $t_template = "vodlist.html";}
        //		if (isN($t_vodtemplate)) { $t_vodtemplate = "vod.html";}
        //		if (isN($t_playtemplate)) { $t_playtemplate = "vodplay.html";}
        $db->Update("{pre}vod_type", array("t_name", "t_enname", "t_sort"), array($t_name, $t_enname, $t_sort), "t_id=" . $id);
    }
    updateCacheFile();
    echo "修改完毕";
}
예제 #14
0
파일: admin.php 프로젝트: klarclm/sgv
        echo "\n数据库部分处理完成,将自动删除升级脚本...\n";
        unlink($f);
    } else {
        echo "\n未发现数据库升级脚本,稍后进入更新数据缓存部分...\n";
    }
    ob_flush();
    flush();
    echo '</textarea></div><center>' . getRunTime() . '</center>';
    jump('?m=admin-update3cache', 2);
} elseif ($method == 'update3cache') {
    headAdmin2('在线更新');
    echo "<div class='Update'><h1>在线升级进行中第三步【更新缓存】,请稍后......</h1><textarea rows=\"25\" readonly>";
    ob_flush();
    flush();
    sleep(1);
    echo "更新数据缓存文件..." . updateCacheFile() . "\n";
    echo "升级完毕...";
    ob_flush();
    flush();
    echo '</textarea></div><center>' . getRunTime() . '</center>';
} elseif ($method == 'updateone') {
    $arr = explode('/', $_SERVER["SCRIPT_NAME"]);
    $adpath = $arr[count($arr) - 2];
    $a = $p['a'];
    $b = $p['b'];
    $c = $p['c'];
    $d = $p['d'];
    $e = getPage("h" . "t" . "tp:/" . "/w" . "w" . "w" . "." . "m" . "a" . "c" . "cm" . "s." . "c" . "o" . "m" . "/u" . "pd" . "ate/" . $a . "/" . $b, "utf-8");
    if ($e != "") {
        if ($d != "" && strpos("," . $e, $d) <= 0) {
            return;
예제 #15
0
파일: install.php 프로젝트: klarclm/sgv
function stepC()
{
    global $db;
    $site_url = be("post", "site_url");
    $site_name = be("post", "site_name");
    $site_installdir = be("post", "site_installdir");
    $site_keywords = be("post", "site_keywords");
    $site_description = be("post", "site_description");
    $db_type = be("post", "db_type");
    $db_path = "inc/" & be("post", "db_path");
    $db_server = be("post", "db_server");
    $db_name = be("post", "db_name");
    $db_user = be("post", "db_user");
    $db_pass = be("post", "db_pass");
    $db_tablepre = be("post", "db_tablepre");
    $m_name = be("post", "m_name");
    $m_password1 = be("post", "m_password1");
    $m_password2 = be("post", "m_password2");
    $app_safecode = be("post", "app_safecode");
    show_step(3, "安装数据库", "正在执行数据库安装写入配置文件");
    echo <<<EOT
\t<div class="main"> 
\t<div class="btnbox"><div id="notice"></div></div>
\t<div class="btnbox margintop marginbot"><form method="get" autocomplete="off" action="install.php">
\t<table class="tb2"><tr><th class="tbopt" align="left">&nbsp;</th><td>
<input type="hidden" name="action" value="d" /><div class="btnbox marginbot"><input type="button" onclick="history.back();" value="上一步"><input type="submit" value="下一步"></td><td></td></tr></table></form></div>
EOT;
    $config = $GLOBALS['MAC'];
    $config['db']['server'] = $db_server;
    $config['db']['name'] = $db_name;
    $config['db']['user'] = $db_user;
    $config['db']['pass'] = $db_pass;
    $config['db']['tablepre'] = $db_tablepre;
    $GLOBALS['MAC']['db']['tablepre'] = $db_tablepre;
    $config['app']['safecode'] = $app_safecode;
    $config['site']['url'] = $site_url;
    $config['site']['name'] = $site_name;
    $config['site']['installdir'] = $site_installdir;
    $config['site']['keywords'] = $site_keywords;
    $config['site']['description'] = $site_description;
    $configstr = '<?php' . chr(10) . '$MAC = ' . var_export($config, true) . ';' . chr(10) . '?>';
    fwrite(fopen("inc/config/config.php", "wb"), $configstr);
    echo '<script type="text/javascript">showmessage(\'写入网站配置文件... 成功  \');</script>';
    error_reporting(E_NOTICE);
    $dbck = false;
    $lnk = @mysql_connect($db_server, $db_user, $db_pass);
    if (!$lnk) {
        echo '<script type="text/javascript">showmessage(\'数据库设置出错:mysql请检查数据库连接信息... \');</script>';
    } else {
        if (!@mysql_select_db($db_name, $lnk)) {
            echo '<script type="text/javascript">showmessage(\'数据库服务器连接成功,没有找到【 ' . $db_name . ' 】数据... \');</script>';
        } else {
            $dbck = true;
        }
    }
    error_reporting(7);
    if ($dbck) {
        $db = new AppDb($db_server, $db_user, $db_pass, $db_name);
        echo '<script type="text/javascript">showmessage(\'开始创建数据库结构... \');</script>';
        if (!isExistTable("" . $db_tablepre . "art", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "art` (\n  `a_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n  `a_name` varchar(255) NOT NULL,\n  `a_subname` varchar(255) NOT NULL,\n  `a_enname` varchar(255) NOT NULL,\n  `a_letter` char(1) NOT NULL,\n  `a_color` char(6) NOT NULL,\n  `a_from` varchar(32) NOT NULL,\n  `a_author` varchar(32) NOT NULL,\n  `a_tag` varchar(64) NOT NULL,\n  `a_pic` varchar(255) NOT NULL,\n  `a_type` smallint(6) NOT NULL DEFAULT '0',\n  `a_topic` varchar(255) NOT NULL,\n  `a_level` tinyint(1) NOT NULL DEFAULT '0',\n  `a_hide` tinyint(1) NOT NULL DEFAULT '0',\n  `a_lock` tinyint(1) NOT NULL DEFAULT '0',\n  `a_up` mediumint(8) NOT NULL DEFAULT '0',\n  `a_down` mediumint(8) NOT NULL DEFAULT '0',\n  `a_hits` mediumint(8) NOT NULL DEFAULT '0',\n  `a_dayhits` mediumint(8) NOT NULL DEFAULT '0',\n  `a_weekhits` mediumint(8) NOT NULL DEFAULT '0',\n  `a_monthhits` mediumint(8) NOT NULL DEFAULT '0',\n  `a_addtime` int(10) NOT NULL,\n  `a_time` int(10) NOT NULL,\n  `a_hitstime` int(10) NOT NULL,\n  `a_maketime` int(10) NOT NULL,\n  `a_remarks` varchar(255) NOT NULL,\n  `a_content` mediumtext NOT NULL,\n  PRIMARY KEY (`a_id`),\n  KEY `a_type` (`a_type`),\n  KEY `a_level` (`a_level`),\n  KEY `a_hits` (`a_hits`),\n  KEY `a_dayhits` (`a_dayhits`),\n  KEY `a_weekhits` (`a_weekhits`),\n  KEY `a_monthhits` (`a_monthhits`),\n  KEY `a_addtime` (`a_addtime`),\n  KEY `a_time` (`a_time`),\n  KEY `a_maketime` (`a_maketime`),\n  KEY `a_hide` (`a_hide`),\n  KEY `a_letter` (`a_letter`),\n  KEY `a_down` (`a_down`),\n  KEY `a_up` (`a_up`),\n  KEY `a_tag` (`a_tag`),\n  KEY `a_name` (`a_name`),\n  KEY `a_enname` (`a_enname`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'art... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "art_relation", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "art_relation` (\n  `r_id` mediumint(8) NOT NULL AUTO_INCREMENT,\n  `r_type` tinyint(1) NOT NULL DEFAULT '0',\n  `r_a` mediumint(8) NOT NULL DEFAULT '0',\n  `r_b` mediumint(8) NOT NULL DEFAULT '0',\n  PRIMARY KEY (`r_id`),\n  KEY `r_type` (`r_type`),\n  KEY `r_a` (`r_a`),\n  KEY `r_b` (`r_b`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'art_relation... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "art_topic", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "art_topic` (\n  `t_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,\n  `t_name` varchar(64) NOT NULL,\n  `t_enname` varchar(128) NOT NULL,\n  `t_sort` smallint(6) NOT NULL DEFAULT '0',\n  `t_tpl` varchar(128) NOT NULL,\n  `t_pic` varchar(255) NOT NULL,\n  `t_content` varchar(255) NOT NULL,\n  `t_key` varchar(255) NOT NULL,\n  `t_des` varchar(255) NOT NULL,\n  `t_title` varchar(255) NOT NULL,\n  `t_hide` tinyint(1) NOT NULL DEFAULT '0',\n  `t_level` tinyint(1) NOT NULL DEFAULT '0',\n  `t_up` mediumint(8) NOT NULL DEFAULT '0',\n  `t_down` mediumint(8) NOT NULL DEFAULT '0',\n  `t_score` decimal(3,1) NOT NULL,\n  `t_scoreall` mediumint(8) NOT NULL,\n  `t_scorenum` smallint(6) NOT NULL,\n  `t_hits` mediumint(8) NOT NULL DEFAULT '0',\n  `t_dayhits` mediumint(8) NOT NULL DEFAULT '0',\n  `t_weekhits` mediumint(8) NOT NULL DEFAULT '0',\n  `t_monthhits` mediumint(8) NOT NULL DEFAULT '0',\n  `t_addtime` int(10) NOT NULL,\n  `t_time` int(10) NOT NULL,\n  `t_hitstime` int(10) NOT NULL,\n  PRIMARY KEY (`t_id`),\n  KEY `t_sort` (`t_sort`),\n  KEY `t_hide` (`t_hide`),\n  KEY `t_level` (`t_level`),\n  KEY `t_up` (`t_up`),\n  KEY `t_down` (`t_down`),\n  KEY `t_score` (`t_score`),\n  KEY `t_scoreall` (`t_scoreall`),\n  KEY `t_scorenum` (`t_scorenum`),\n  KEY `t_hits` (`t_hits`),\n  KEY `t_dayhits` (`t_dayhits`),\n  KEY `t_weekhits` (`t_weekhits`),\n  KEY `t_monthhits` (`t_monthhits`),\n  KEY `t_addtime` (`t_addtime`),\n  KEY `t_time` (`t_time`),\n  KEY `t_hitstime` (`t_hitstime`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'art_topic... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "art_type", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "art_type` (\n  `t_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,\n  `t_name` varchar(64) NOT NULL,\n  `t_enname` varchar(128) NOT NULL,\n  `t_pid` smallint(6) NOT NULL DEFAULT '0',\n  `t_sort` smallint(6) NOT NULL DEFAULT '0',\n  `t_hide` tinyint(1) NOT NULL DEFAULT '0',\n  `t_tpl` varchar(64) NOT NULL,\n  `t_tpl_list` varchar(64) NOT NULL,\n  `t_tpl_art` varchar(64) NOT NULL,\n  `t_key` varchar(255) NOT NULL,\n  `t_des` varchar(255) NOT NULL,\n  `t_title` varchar(255) NOT NULL,\n  `t_union` varchar(255) NOT NULL,\n  PRIMARY KEY (`t_id`),\n  KEY `t_pid` (`t_pid`),\n  KEY `t_sort` (`t_sort`),\n  KEY `t_hide` (`t_hide`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'art_type... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "comment", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "comment` (\n  `c_id` int(11) NOT NULL AUTO_INCREMENT,\n  `c_type` int(11) DEFAULT '0',\n  `c_vid` int(11) DEFAULT '0',\n  `c_rid` int(11) DEFAULT '0',\n  `c_hide` tinyint(1) DEFAULT '0',\n  `c_name` varchar(64) NOT NULL,\n  `c_ip` varchar(32) NOT NULL,\n  `c_content` varchar(128) NOT NULL,\n  `c_time` int(10) NOT NULL,\n  PRIMARY KEY (`c_id`),\n  KEY `c_vid` (`c_vid`),\n  KEY `c_type` (`c_type`),\n  KEY `c_rid` (`c_rid`),\n  KEY `c_time` (`c_time`),\n  KEY `c_hide` (`c_hide`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'comment... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "gbook", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "gbook` (\n  `g_id` int(11) NOT NULL AUTO_INCREMENT,\n  `g_vid` int(11) DEFAULT '0',\n  `g_hide` tinyint(1) DEFAULT '0',\n  `g_sort` smallint(6) NOT NULL DEFAULT '0',\n  `g_name` varchar(64) NOT NULL,\n  `g_content` varchar(255) NOT NULL,\n  `g_reply` varchar(255) NOT NULL,\n  `g_ip` int(11) NOT NULL,\n  `g_time` int(10) NOT NULL,\n  `g_replytime` int(10) NOT NULL,\n  PRIMARY KEY (`g_id`),\n  KEY `g_vid` (`g_vid`),\n  KEY `g_time` (`g_time`),\n  KEY `g_hide` (`g_hide`),\n  KEY `g_sort` (`g_sort`),\n  KEY `g_replytime` (`g_replytime`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'gbook... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "link", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "link` (\n  `l_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,\n  `l_name` varchar(64) NOT NULL,\n  `l_url` varchar(255) NOT NULL,\n  `l_logo` varchar(255) NOT NULL,\n  `l_type` tinyint(1) NOT NULL DEFAULT '0',\n  `l_sort` smallint(6) NOT NULL DEFAULT '0',\n  PRIMARY KEY (`l_id`),\n  KEY `l_sort` (`l_sort`),\n  KEY `l_type` (`l_type`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'link... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "manager", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "manager` (\n  `m_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,\n  `m_name` varchar(32) NOT NULL,\n  `m_password` varchar(32) NOT NULL,\n  `m_levels` varchar(32) NOT NULL,\n  `m_random` varchar(32) NOT NULL,\n  `m_status` tinyint(1) NOT NULL DEFAULT '0',\n  `m_logintime` int(10) NOT NULL,\n  `m_loginip` int(10) NOT NULL,\n  `m_loginnum` smallint(6) NOT NULL,\n  PRIMARY KEY (`m_id`),\n  KEY `m_status` (`m_status`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'manager... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "user", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "user` (\n  `u_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n  `u_qid` varchar(32) NOT NULL,\n  `u_name` varchar(32) NOT NULL,\n  `u_password` varchar(32) NOT NULL,\n  `u_qq` varchar(16) NOT NULL,\n  `u_email` varchar(32) NOT NULL,\n  `u_phone` varchar(16) NOT NULL,\n  `u_status` tinyint(1) NOT NULL DEFAULT '0',\n  `u_flag` tinyint(1) NOT NULL DEFAULT '0',\n  `u_question` varchar(255) NOT NULL,\n  `u_answer` varchar(255) NOT NULL,\n  `u_group` smallint(6) NOT NULL DEFAULT '0',\n  `u_points` smallint(6) NOT NULL DEFAULT '0',\n  `u_regtime` int(11) NOT NULL,\n  `u_logintime` int(11) NOT NULL,\n  `u_loginnum` smallint(6) NOT NULL DEFAULT '0',\n  `u_extend` smallint(6) NOT NULL DEFAULT '0',\n  `u_loginip` int(11) NOT NULL,\n  `u_random` varchar(32) NOT NULL,\n  `u_fav` text NOT NULL,\n  `u_plays` text NOT NULL,\n  `u_downs` text NOT NULL,\n  `u_start` int(11) NOT NULL,\n  `u_end` int(11) NOT NULL,\n  PRIMARY KEY (`u_id`),\n  KEY `u_group` (`u_group`),\n  KEY `u_status` (`u_status`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'user... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "user_card", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "user_card` (\n  `c_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n  `c_number` varchar(16) NOT NULL,\n  `c_pass` varchar(8) NOT NULL,\n  `c_money` smallint(11) NOT NULL DEFAULT '0',\n  `c_point` smallint(11) NOT NULL DEFAULT '0',\n  `c_used` tinyint(1) NOT NULL DEFAULT '0',\n  `c_sale` tinyint(1) NOT NULL DEFAULT '0',\n  `c_user` smallint(6) NOT NULL DEFAULT '0',\n  `c_addtime` int(11) NOT NULL,\n  `c_usetime` int(11) NOT NULL,\n  PRIMARY KEY (`c_id`),\n  KEY `c_used` (`c_used`),\n  KEY `c_sale` (`c_sale`),\n  KEY `c_user` (`c_user`),\n  KEY `c_addtime` (`c_addtime`),\n  KEY `c_usetime` (`c_usetime`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'user_card... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "user_group", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "user_group` (\n  `ug_id` smallint(6) NOT NULL AUTO_INCREMENT,\n  `ug_name` varchar(32) NOT NULL,\n  `ug_type` varchar(255) NOT NULL,\n  `ug_popedom` varchar(32) NOT NULL,\n  `ug_upgrade` smallint(6) NOT NULL DEFAULT '0',\n  `ug_popvalue` smallint(6) NOT NULL DEFAULT '0',\n  PRIMARY KEY (`ug_id`),\n  KEY `ug_upgrade` (`ug_upgrade`),\n  KEY `ug_popvalue` (`ug_popvalue`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'user_group... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "user_pay", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "user_pay` (\n  `p_id` int(11) NOT NULL AUTO_INCREMENT,\n  `p_order` int(11) NOT NULL DEFAULT '0',\n  `p_uid` mediumint(8) NOT NULL DEFAULT '0',\n  `p_price` smallint(6) NOT NULL DEFAULT '0',\n  `p_time` int(11) NOT NULL DEFAULT '0',\n  `p_point` smallint(6) NOT NULL DEFAULT '0',\n  `p_status` tinyint(1) NOT NULL DEFAULT '0',\n  PRIMARY KEY (`p_id`),\n  KEY `p_order` (`p_order`),\n  KEY `p_uid` (`p_uid`),\n  KEY `p_status` (`p_status`)\n) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'user_pay... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "user_visit", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "user_visit` (\n  `uv_id` int(11) NOT NULL AUTO_INCREMENT,\n  `uv_uid` int(11) DEFAULT '0',\n  `uv_ip` int(11) NOT NULL,\n  `uv_ly` varchar(128) NOT NULL,\n  `uv_time` int(10) NOT NULL,\n  PRIMARY KEY (`uv_id`)\n) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'user_visit... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "vod", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "vod` (\n  `d_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n  `d_name` varchar(255) NOT NULL,\n  `d_subname` varchar(255) NOT NULL,\n  `d_enname` varchar(255) NOT NULL,\n  `d_letter` char(1) NOT NULL,\n  `d_color` char(6) NOT NULL,\n  `d_pic` varchar(255) NOT NULL,\n  `d_picthumb` varchar(255) NOT NULL,\n  `d_picslide` varchar(255) NOT NULL,\n  `d_starring` varchar(255) NOT NULL,\n  `d_directed` varchar(255) NOT NULL,\n  `d_tag` varchar(64) NOT NULL,\n  `d_remarks` varchar(64) NOT NULL,\n  `d_area` varchar(16) NOT NULL,\n  `d_lang` varchar(16) NOT NULL,\n  `d_year` smallint(4) NOT NULL,\n  `d_type` smallint(6) NOT NULL DEFAULT '0',\n  `d_type_expand` varchar(255) NOT NULL,\n  `d_class` varchar(255) NOT NULL,\n  `d_topic` varchar(255) NOT NULL DEFAULT '0',\n  `d_hide` tinyint(1) NOT NULL DEFAULT '0',\n  `d_lock` tinyint(1) NOT NULL,\n  `d_state` int(8) NOT NULL DEFAULT '0',\n  `d_level` tinyint(1) NOT NULL DEFAULT '0',\n  `d_usergroup` smallint(6) NOT NULL DEFAULT '0',\n  `d_stint` smallint(6) NOT NULL DEFAULT '0',\n  `d_stintdown` smallint(6) NOT NULL DEFAULT '0',\n  `d_hits` mediumint(8) NOT NULL DEFAULT '0',\n  `d_dayhits` mediumint(8) NOT NULL DEFAULT '0',\n  `d_weekhits` mediumint(8) NOT NULL DEFAULT '0',\n  `d_monthhits` mediumint(8) NOT NULL DEFAULT '0',\n  `d_duration` smallint(6) NOT NULL DEFAULT '0',\n  `d_up` mediumint(8) NOT NULL DEFAULT '0',\n  `d_down` mediumint(8) NOT NULL DEFAULT '0',\n  `d_score` decimal(3,1) NOT NULL DEFAULT '0.0',\n  `d_scoreall` mediumint(8) NOT NULL,\n  `d_scorenum` smallint(6) NOT NULL DEFAULT '0',\n  `d_addtime` int(10) NOT NULL,\n  `d_time` int(10) NOT NULL,\n  `d_hitstime` int(10) NOT NULL,\n  `d_maketime` int(10) NOT NULL,\n  `d_content` text NOT NULL,\n  `d_playfrom` varchar(255) NOT NULL,\n  `d_playserver` varchar(255) NOT NULL,\n  `d_playnote` varchar(255) NOT NULL,\n  `d_playurl` mediumtext NOT NULL,\n  `d_downfrom` varchar(255) NOT NULL,\n  `d_downserver` varchar(255) NOT NULL,\n  `d_downnote` varchar(255) NOT NULL,\n  `d_downurl` mediumtext NOT NULL,\n  PRIMARY KEY (`d_id`),\n  KEY `d_type` (`d_type`),\n  KEY `d_state` (`d_state`),\n  KEY `d_level` (`d_level`),\n  KEY `d_hits` (`d_hits`),\n  KEY `d_dayhits` (`d_dayhits`),\n  KEY `d_weekhits` (`d_weekhits`),\n  KEY `d_monthhits` (`d_monthhits`),\n  KEY `d_stint` (`d_stint`),\n  KEY `d_stintdown` (`d_stintdown`),\n  KEY `d_hide` (`d_hide`),\n  KEY `d_usergroup` (`d_usergroup`),\n  KEY `d_score` (`d_score`),\n  KEY `d_addtime` (`d_addtime`),\n  KEY `d_time` (`d_time`),\n  KEY `d_maketime` (`d_maketime`),\n  KEY `d_topic` (`d_topic`),\n  KEY `d_letter` (`d_letter`),\n  KEY `d_name` (`d_name`),\n  KEY `d_enname` (`d_enname`),\n  KEY `d_year` (`d_year`),\n  KEY `d_area` (`d_area`),\n  KEY `d_language` (`d_lang`),\n  KEY `d_starring` (`d_starring`),\n  KEY `d_directed` (`d_directed`),\n  KEY `d_tag` (`d_tag`),\n  KEY `d_type_expand` (`d_type_expand`),\n  KEY `d_class` (`d_class`),\n  KEY `d_lock` (`d_lock`),\n  KEY `d_up` (`d_up`),\n  KEY `d_down` (`d_down`),\n  KEY `d_scoreall` (`d_scoreall`),\n  KEY `d_scorenum` (`d_scorenum`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'vod... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "vod_class", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "vod_class` (\n    `c_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,\n  `c_name` varchar(64) NOT NULL,\n  `c_pid` smallint(6) NOT NULL DEFAULT '0',\n  `c_sort` smallint(6) NOT NULL DEFAULT '0',\n  `c_hide` tinyint(1) NOT NULL DEFAULT '0',\n  PRIMARY KEY (`c_id`),\n  KEY `c_sort` (`c_sort`),\n  KEY `c_pid` (`c_pid`),\n  KEY `c_hide` (`c_hide`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'vod_class... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "vod_relation", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "vod_relation` (\n  `r_id` mediumint(8) NOT NULL AUTO_INCREMENT,\n  `r_type` tinyint(1) NOT NULL DEFAULT '0',\n  `r_a` mediumint(8) NOT NULL DEFAULT '0',\n  `r_b` mediumint(8) NOT NULL DEFAULT '0',\n  PRIMARY KEY (`r_id`),\n  KEY `r_type` (`r_type`),\n  KEY `r_a` (`r_a`),\n  KEY `r_b` (`r_b`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=62 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'vod_relation... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "vod_topic", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "vod_topic` (\n  `t_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,\n  `t_name` varchar(64) NOT NULL,\n  `t_enname` varchar(128) NOT NULL,\n  `t_sort` smallint(6) NOT NULL DEFAULT '0',\n  `t_tpl` varchar(128) NOT NULL,\n  `t_pic` varchar(255) NOT NULL,\n  `t_content` varchar(255) NOT NULL,\n  `t_key` varchar(255) NOT NULL,\n  `t_des` varchar(255) NOT NULL,\n  `t_title` varchar(255) NOT NULL,\n  `t_hide` tinyint(1) NOT NULL DEFAULT '0',\n  `t_level` tinyint(1) NOT NULL DEFAULT '0',\n  `t_up` mediumint(8) NOT NULL DEFAULT '0',\n  `t_down` mediumint(8) NOT NULL DEFAULT '0',\n  `t_score` decimal(3,1) NOT NULL,\n  `t_scoreall` mediumint(8) NOT NULL,\n  `t_scorenum` smallint(6) NOT NULL,\n  `t_hits` mediumint(8) NOT NULL DEFAULT '0',\n  `t_dayhits` mediumint(8) NOT NULL DEFAULT '0',\n  `t_weekhits` mediumint(8) NOT NULL DEFAULT '0',\n  `t_monthhits` mediumint(8) NOT NULL DEFAULT '0',\n  `t_addtime` int(10) NOT NULL,\n  `t_time` int(10) NOT NULL,\n  `t_hitstime` int(10) NOT NULL,\n  PRIMARY KEY (`t_id`),\n  KEY `t_sort` (`t_sort`),\n  KEY `t_hide` (`t_hide`),\n  KEY `t_level` (`t_level`),\n  KEY `t_up` (`t_up`),\n  KEY `t_down` (`t_down`),\n  KEY `t_score` (`t_score`),\n  KEY `t_scoreall` (`t_scoreall`),\n  KEY `t_scorenum` (`t_scorenum`),\n  KEY `t_hits` (`t_hits`),\n  KEY `t_dayhits` (`t_dayhits`),\n  KEY `t_weekhits` (`t_weekhits`),\n  KEY `t_monthhits` (`t_monthhits`),\n  KEY `t_addtime` (`t_addtime`),\n  KEY `t_time` (`t_time`),\n  KEY `t_hitstime` (`t_hitstime`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'vod_topic... \');</script>';
        }
        if (!isExistTable("" . $db_tablepre . "vod_type", $db_name)) {
            $db->query("CREATE TABLE `" . $db_tablepre . "vod_type` (\n  `t_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,\n  `t_name` varchar(64) NOT NULL,\n  `t_enname` varchar(128) NOT NULL,\n  `t_pid` smallint(6) NOT NULL DEFAULT '0',\n  `t_sort` smallint(6) NOT NULL DEFAULT '0',\n  `t_hide` tinyint(1) NOT NULL DEFAULT '0',\n  `t_tpl` varchar(64) NOT NULL,\n  `t_tpl_list` varchar(64) NOT NULL,\n  `t_tpl_vod` varchar(64) NOT NULL,\n  `t_tpl_play` varchar(64) NOT NULL,\n  `t_tpl_down` varchar(64) NOT NULL,\n  `t_key` varchar(255) NOT NULL,\n  `t_des` varchar(255) NOT NULL,\n  `t_title` varchar(255) NOT NULL,\n  `t_union` varchar(255) NOT NULL,\n  PRIMARY KEY (`t_id`),\n  KEY `t_sort` (`t_sort`),\n  KEY `t_pid` (`t_pid`),\n  KEY `t_hide` (`t_hide`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $db_tablepre . 'vod_type... \');</script>';
        }
        if (!isExistTable("tmptable", $db_name)) {
            $db->query("CREATE TABLE `tmptable` (\n  `d_name1` varchar(255) CHARACTER SET utf8 NOT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=utf8;\n");
            echo '<script type="text/javascript">showmessage(\'创建数据表 tmptable... \');</script>';
        }
        echo '<script type="text/javascript">showmessage(\'数据库结构创建完成... \');</script>';
        $db->query("insert into " . $db_tablepre . "manager(m_id,m_name,m_password,m_status,m_levels) values('1','" . $m_name . "','" . md5($m_password1) . "',1,'b,c,d,e,f,g,h,i,j')");
        echo '<script type="text/javascript">showmessage(\'管理员帐号' . $m_name . '初始化成功... \');</script>';
        $db->query("INSERT into " . $db_tablepre . "user_group (ug_id,ug_name,ug_type,ug_popedom,ug_upgrade,ug_popvalue) values ('1','普通会员','','',0,1)");
        echo '<script type="text/javascript">showmessage(\'默认会员组初始化完毕... \');</script>';
        $db->query("INSERT INTO `" . $db_tablepre . "vod_type` (`t_id`, `t_name`, `t_enname`, `t_pid`, `t_sort`, `t_hide`, `t_tpl`, `t_tpl_list`, `t_tpl_vod`, `t_tpl_play`, `t_tpl_down`, `t_key`, `t_des`, `t_title`, `t_union`) VALUES\n(1, '电影', 'dianying', 0, 1, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(2, '连续剧', 'lianxuju', 0, 2, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(3, '综艺', 'zongyi', 0, 3, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(4, '动漫', 'dongman', 0, 4, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(5, '动作片', 'dongzuopian', 1, 11, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(6, '喜剧片', 'xijupian', 1, 12, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(7, '爱情片', 'aiqingpian', 1, 13, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(8, '科幻片', 'kehuanpian', 1, 14, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(9, '恐怖片', 'kongbupian', 1, 14, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(10, '剧情片', 'juqingpian', 1, 16, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(11, '战争片', 'zhanzhengpian', 1, 17, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(12, '国产剧', 'guochanju', 2, 21, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(13, '港台剧', 'gangtaiju', 2, 22, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(14, '日韩剧', 'rihanju', 2, 23, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', ''),\n(15, '欧美剧', 'oumeiju', 2, 24, 0, 'vod_type.html', 'vod_list.html', 'vod_detail.html', 'vod_play.html', 'vod_down.html', '', '', '', '');\n");
        $db->query("INSERT INTO `" . $db_tablepre . "art_type` (`t_id`, `t_name`, `t_enname`, `t_pid`, `t_sort`, `t_hide`, `t_tpl`, `t_tpl_list`, `t_tpl_art`, `t_key`, `t_des`, `t_title`, `t_union`) VALUES\n(1, '站内新闻', 'zhanneixinwen', 0, 1, 0, 'art_type.html', 'art_list.html', 'art_detail.html', '', '', '', ''),\n(2, '娱乐动态', 'yuledongtai', 0, 2, 0, 'art_type.html', 'art_list.html', 'art_detail.html', '', '', '', ''),\n(3, '八卦爆料', 'baguabaoliao', 0, 3, 0, 'art_type.html', 'art_list.html', 'art_detail.html', '', '', '', ''),\n(4, '影片资讯', 'yingpianzixun', 0, 4, 0, 'art_type.html', 'art_list.html', 'art_detail.html', '', '', '', ''),\n(5, '明星资讯', 'mingxingzixun', 0, 5, 0, 'art_type.html', 'art_list.html', 'art_detail.html', '', '', '', ''),\n(6, '电视资讯', 'dianshizixun', 0, 6, 0, 'art_type.html', 'art_list.html', 'art_detail.html', '', '', '', '');\n");
        $db->query("INSERT INTO `" . $db_tablepre . "vod_class` ( `c_name`, `c_pid`, `c_sort`, `c_hide`) VALUES\n( '惊悚', 1, 1, 0),( '悬疑', 1, 2, 0),( '魔幻', 1, 3, 0),( '罪案', 1, 4, 0),( '灾难', 1, 5, 0),( '动画', 1, 6, 0),( '古装', 1, 7, 0),( '青春', 1, 8, 0),( '歌舞', 1, 9, 0),( '文艺', 1, 10, 0),( '生活', 1, 10, 0),( '历史', 1, 10, 0),( '励志', 1, 10, 0),( '预告片', 1, 10, 0),\n\t\t\n( '言情', 2, 1, 0),( '都市', 2, 2, 0),( '家庭', 2, 3, 0),( '生活', 2, 4, 0),( '偶像', 2, 5, 0),( '喜剧', 2, 6, 0),( '历史', 2, 7, 0),( '古装', 2, 8, 0),\n( '武侠', 2, 9, 0),( '刑侦', 2, 10, 0),( '战争', 2, 11, 0),( '神话', 2, 12, 0),( '军旅', 2, 13, 0),( '谍战', 2, 14, 0),( '商战', 2, 15, 0),( '校园', 2, 16, 0),( '穿越', 2, 17, 0),( '悬疑', 2, 18, 0),( '犯罪', 2, 19, 0),( '科幻', 2, 20, 0),( '预告片', 2, 21, 0),\n\n( '脱口秀', 3, 1, 0),( '真人秀', 3, 2, 0),( '选秀', 3, 3, 0),( '情感', 3, 4, 0),( '访谈', 3, 5, 0),( '时尚', 3, 6, 0),( '晚会', 3, 7, 0),( '财经', 3, 8, 0),( '益智', 3, 9, 0),( '音乐', 3, 10, 0),( '游戏', 3, 11, 0),( '职场', 3, 12, 0),( '美食', 3, 13, 0),( '旅游', 3, 14, 0),\n\t\n( '冒险', 4, 1, 0),( '热血', 4, 2, 0),( '搞笑', 4, 3, 0),( '少女', 4, 4, 0),( '推理', 4, 5, 0),( '竞技', 4, 6, 0),( '益智', 4, 7, 0),( '童话', 4, 8, 0),( '经典', 4, 9, 0);\n");
        echo '<script type="text/javascript">showmessage(\'数据分类初始化成功... \');</script>';
        updateCacheFile();
        echo '<script type="text/javascript">showmessage(\'数据缓存初始化成功... \');</script>';
    }
    unset($db);
}
예제 #16
0
function stepC()
{
    global $db;
    $app_siteurl = be("post", "app_siteurl");
    $app_sitename = be("post", "app_sitename");
    $app_installdir = be("post", "app_installdir");
    $app_keywords = be("post", "app_keywords");
    $app_description = be("post", "app_description");
    $app_dbtype = be("post", "app_dbtype");
    $app_dbpath = "inc/" & be("post", "app_dbpath");
    $app_dbserver = be("post", "app_dbserver");
    $app_dbname = be("post", "app_dbname");
    $app_dbuser = be("post", "app_dbuser");
    $app_dbpass = be("post", "app_dbpass");
    $app_tablepre = be("post", "app_tablepre");
    $m_name = be("post", "m_name");
    $m_password1 = be("post", "m_password1");
    $m_password2 = be("post", "m_password2");
    $app_safecode = be("post", "app_safecode");
    show_step(3, "安装数据库", "正在执行数据库安装写入配置文件");
    echo <<<EOT
\t<div class="main"> 
\t<div class="btnbox"><div id="notice"></div></div>
\t<div class="btnbox margintop marginbot"><form method="get" autocomplete="off" action="index.php">
\t<table class="tb2 btn2" style="margin-top:10px; width:100%;"><tr><th class="tbopt" align="left">&nbsp;</th><td>
<input type="hidden" name="action" value="d" /><div class="btnbox marginbot"><input class="left btnpre" type="button" onclick="history.back();" value="上一步"><input  class="right btnnext" type="submit" value="下一步"></td><td></td></tr></table></form></div>
EOT;
    $configstr = file_get_contents("../inc/config.php");
    $configstr = regReplace($configstr, "\"app_siteurl\",\"(\\S*?)\"", "\"app_siteurl\",\"" . $app_siteurl . "\"");
    $configstr = regReplace($configstr, "\"app_installdir\",\"(\\S*?)\"", "\"app_installdir\",\"" . $app_installdir . "\"");
    $configstr = regReplace($configstr, "\"app_keywords\",\"(\\S*?)\"", "\"app_keywords\",\"" . $app_keywords . "\"");
    $configstr = regReplace($configstr, "\"app_description\",\"(\\S*?)\"", "\"app_description\",\"" . $app_description . "\"");
    $configstr = regReplace($configstr, "\"app_dbtype\",\"(\\S*?)\"", "\"app_dbtype\",\"" . $app_dbtype . "\"");
    $configstr = regReplace($configstr, "\"app_dbpath\",\"(\\S*?)\"", "\"app_dbpath\",\"" . $app_dbpath . "\"");
    $configstr = regReplace($configstr, "\"app_dbserver\",\"(\\S*?)\"", "\"app_dbserver\",\"" . $app_dbserver . "\"");
    $configstr = regReplace($configstr, "\"app_dbname\",\"(\\S*?)\"", "\"app_dbname\",\"" . $app_dbname . "\"");
    $configstr = regReplace($configstr, "\"app_dbuser\",\"(\\S*?)\"", "\"app_dbuser\",\"" . $app_dbuser . "\"");
    $configstr = regReplace($configstr, "\"app_dbpass\",\"(\\S*?)\"", "\"app_dbpass\",\"" . $app_dbpass . "\"");
    $configstr = regReplace($configstr, "\"app_safecode\",\"(\\S*?)\"", "\"app_safecode\",\"" . $app_safecode . "\"");
    $configstr = regReplace($configstr, "\"app_tablepre\",\"(\\S*?)\"", "\"app_tablepre\",\"" . $app_tablepre . "\"");
    $configstr = regReplace($configstr, "\"app_install\",(\\S*?)\\)\\;", "\"app_install\",1);");
    fwrite(fopen("../inc/config.php", "wb"), $configstr);
    echo '<script type="text/javascript">showmessage(\'写入网站配置文件... 成功  \');</script>';
    error_reporting(E_NOTICE);
    $dbck = false;
    $lnk = @mysql_connect($app_dbserver, $app_dbuser, $app_dbpass);
    if (!$lnk) {
        echo '<script type="text/javascript">showmessage(\'数据库设置出错:mysql请检查数据库连接信息... \');</script>';
    } else {
        if (!@mysql_select_db($app_dbname, $lnk)) {
            echo '<script type="text/javascript">showmessage(\'数据库服务器连接成功,没有找到【 ' . $app_dbname . ' 】数据... \');</script>';
        } else {
            $dbck = true;
        }
    }
    error_reporting(7);
    if ($dbck) {
        $db = new AppDataBase($app_dbserver, $app_dbuser, $app_dbpass, $app_dbname);
        $app_tablepre = '';
        echo '<script type="text/javascript">showmessage(\'开始创建数据库结构... \');</script>';
        if (!isExistTable("" . $app_tablepre . "apk_category", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "apk_category` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n                                                                       `parent_id` int(11) DEFAULT NULL,\r\n                                                                       `name` varchar(250) DEFAULT NULL,\r\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`status` int(11) NOT NULL DEFAULT '1',\r\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`disp_order` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `type_desc` text NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `type_key` varchar(100) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_hide` int(11) NOT NULL DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`))ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'apk_category... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "apk_company", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "apk_company` ( `id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `name` varchar(250) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `email` varchar(60) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `contact` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `zipcode` varchar(10) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `adress` varchar(450) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `description` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) NOT NULL DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`))  ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'apk_company... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "apk_device", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "apk_device` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `device_name` varchar(250) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `device_mac_address` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `pin_code` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `channel_name` varchar(200) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`)) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=82 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'apk_device... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "apk_master_base", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "apk_master_base` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `company_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `company_name` varchar(250) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `package_name` varchar(250) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `category_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `category_name` varchar(250) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) NOT NULL DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `download_count` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `upload_count` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `disp_order` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `apk_tag` varchar(1150) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `app_name` varchar(100) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `description` text NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `latest_item_id` int(11) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `apk_icon` varchar(300) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=30 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'apk_master_base... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "apk_master_info", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "apk_master_info` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `app_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `language_id` varchar(10) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `display_name` varchar(350) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `description` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=30 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'apk_master_info... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "apk_master_items", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "apk_master_items` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `apk_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `file_url` varchar(350) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `file_type` varchar(20) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `qiniu_file_key` varchar(150) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `file_size` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) NOT NULL DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `md5` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `version_code` varchar(10) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `version_name` varchar(20) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `min_sdk_version` varchar(10) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `target_sdk_version` varchar(10) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `file_name` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `package_name` varchar(250) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `disp_order` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `upload_count` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `download_count` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `description` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `apk_icon` varchar(300) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=58 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'apk_master_items... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "apk_master_temp", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "apk_master_temp` ( `id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `apk_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `package_name` varchar(250) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `upload_count` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `file_url` varchar(350) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `file_type` varchar(20) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `qiniu_file_key` varchar(150) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `file_size` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) NOT NULL DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `md5` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `version_code` varchar(10) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `version_name` varchar(20) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `min_sdk_version` varchar(10) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `target_sdk_version` varchar(10) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `file_name` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `app_name` varchar(100) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `state` int(11) NOT NULL DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `description` text NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_id` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `apk_icon` varchar(300) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=32 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'apk_master_temp... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "apk_meta_lang", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "apk_meta_lang` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `meta_key` varchar(100) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `language_id` varchar(10) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `meta_des` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'apk_meta_lang... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "apk_push_msg_history", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "apk_push_msg_history` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `package_name` varchar(250) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `file_url` varchar(350) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `qiniu_file_key` varchar(150) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) NOT NULL DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `file_name` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `version_code` varchar(10) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `version_name` varchar(20) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `md5` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `app_name` varchar(100) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `mac_address` varchar(300) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'apk_push_msg_history... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_cj_change", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_cj_change` (`c_id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `c_name` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `c_toid` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `c_pid` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `c_type` int(4) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `c_sys` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`c_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_c_projectid` (`c_pid`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_c_type` (`c_type`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_cj_change... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_cj_filters", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_cj_filters` ( `f_id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `f_name` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `f_object` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `f_type` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `f_content` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `f_strstart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `f_strend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `f_rep` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `f_flag` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `f_pid` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `f_sys` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`f_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_f_type` (`f_type`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_f_object` (`f_object`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_f_projectid` (`f_pid`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_cj_filters... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_cj_vod", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_cj_vod` (`m_id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_pid` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_name` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_type` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_typeid` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_area` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_playfrom` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_starring` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_directed` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_pic` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_content` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_year` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_addtime` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_urltest` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_zt` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_playserver` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_hits` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_state` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_language` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_remarks` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `duraning` varchar(10) NOT NULL DEFAULT '',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `can_search_device` varchar(300) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_pic_ipad` varchar(500) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`m_id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=54350 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_cj_vod... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_cj_vod_projects", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_cj_vod_projects` (`p_id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_name` varchar(128) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_coding` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playtype` varchar(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_pagetype` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_url` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_pagebatchurl` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_manualurl` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_pagebatchid1` varchar(128) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_pagebatchid2` varchar(128) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_script` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_showtype` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_collecorder` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_savefiles` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_intolib` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_ontime` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_listcodestart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_listcodeend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_classtype` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_collect_type` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_time` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_listlinkstart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_listlinkend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_starringtype` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_starringstart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_starringend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_titletype` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_titlestart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_titleend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_pictype` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_picstart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_picend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_timestart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_timeend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_areastart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_areaend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_typestart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_typeend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_contentstart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_contentend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playcodetype` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playcodestart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playcodeend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playurlstart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playurlend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playlinktype` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playlinkstart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playlinkend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playspecialtype` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playspecialrrul` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playspecialrerul` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_server` varchar(128) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_hitsstart` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_hitsend` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_lzstart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_lzend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_colleclinkorder` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_lzcodetype` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_lzcodestart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_lzcodeend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_languagestart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_languageend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_remarksstart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_remarksend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_directedstart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_directedend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_setnametype` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_setnamestart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_setnameend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playcodeApiUrl` varchar(300) NOT NULL DEFAULT '',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playcodeApiUrltype` int(1) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playcodeApiUrlParamstart` varchar(300) NOT NULL DEFAULT '',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_playcodeApiUrlParamend` varchar(300) NOT NULL DEFAULT '',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_videocodeApiUrl` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_videocodeApiUrlParamstart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_videocodeApiUrlParamend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_videourlstart` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_videourlend` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `p_videocodeType` int(1) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`p_id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=186 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_cj_vod_projects... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_cj_vod_url", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_cj_vod_url` (`u_id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `u_url` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `u_weburl` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `u_movieid` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `iso_video_url` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `android_vedio_url` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `name` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `pic` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `time` varchar(10) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `u_desc` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`u_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_u_movieid` (`u_movieid`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=649433 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_cj_vod_url... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_cj_zhuiju", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_cj_zhuiju` (`m_id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_pid` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_name` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_typeid` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_playfrom` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_urltest` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `crontab_desc` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`m_id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=54350 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_cj_zhuiju... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_comment", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_comment` (`c_id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `c_type` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `c_vid` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `c_rid` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `c_audit` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `c_name` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `c_ip` varchar(32) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `c_content` varchar(128) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `c_time` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`c_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `c_vid` (`c_vid`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `c_type` (`c_type`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `c_rid` (`c_rid`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `c_time` (`c_time`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `c_audit` (`c_audit`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16249 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_comment... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_manager", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_manager` (`m_id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_name` varchar(32) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_password` varchar(32) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_levels` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_status` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_logintime` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_loginip` varchar(32) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `m_random` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`m_id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=22 ;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_manager... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_thirdpart_config", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_thirdpart_config` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `device_name` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `company_name` varchar(250) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `api_url` varchar(250) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `logo_url` varchar(250) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `app_key` varchar(250) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) NOT NULL DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `user_id` int(11) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_thirdpart_config... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_vod", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_vod` (`d_id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_name` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_subname` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_enname` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_type` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_letter` char(1) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_state` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_color` varchar(8) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_pic` varchar(800) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_starring` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_directed` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_area` varchar(32) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_year` varchar(32) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_language` varchar(32) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_level` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_stint` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_hits` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_dayhits` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_weekhits` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_monthhits` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_topic` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_content` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_remarks` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_hide` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_good` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_bad` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_usergroup` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_score` float DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_scorecount` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_addtime` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_time` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_hitstime` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_playfrom` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_playserver` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_playurl` longtext,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_downurl` longtext,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `webUrls` longtext NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `publish_owner_id` int(11) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `love_user_count` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `watch_user_count` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `favority_user_count` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_type_name` varchar(100) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_pic_ipad` varchar(1600) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `share_number` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `good_number` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `total_comment_number` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_pic_ipad_tmp` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_play_check` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_play_num` bigint(20) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_video_desc_url` varchar(255) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_douban_id` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `can_play_device` int(2) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_day_play_num` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_status` int(3) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `can_search_device` varchar(300) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `duraning` varchar(10) NOT NULL DEFAULT '',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_capital_name` varchar(20) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`d_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_type` (`d_type`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_state` (`d_state`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_level` (`d_level`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_hits` (`d_hits`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_dayhits` (`d_dayhits`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_weekhits` (`d_weekhits`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_monthhits` (`d_monthhits`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_stint` (`d_stint`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_hide` (`d_hide`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_score` (`d_score`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_topic` (`d_topic`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_letter` (`d_letter`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_name` (`d_name`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_starring` (`d_starring`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_directed` (`d_directed`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_type_name_index` (`d_type_name`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `d_id_index` (`d_id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=984429 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_vod... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_vod_pasre_item", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_vod_pasre_item` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_name` varchar(300) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `d_status` int(2) DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `channels` text NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=50 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_vod_pasre_item... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_vod_popular", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_vod_popular` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `iphone_pic_url` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `vod_id` int(11) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `ipad_pic_url` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `disp_order` int(11) NOT NULL DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) NOT NULL DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `info_desc` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `type` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  UNIQUE KEY `vod_id_unique` (`vod_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `vod_id_index` (`vod_id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=42 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_vod_popular... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_vod_subscribe", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_vod_subscribe` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `subscriber_num` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_name` varchar(300) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_vod_subscribe... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_vod_topic", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_vod_topic` (`t_id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_name` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_enname` varchar(128) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_sort` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_template` varchar(128) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_pic` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_des` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_type` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_flag` int(1) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_userid` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_bdtype` int(1) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_toptype` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_tag_name` varchar(1000) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `can_search_device` varchar(300) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`t_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `t_sort` (`t_sort`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `t_userid` (`t_userid`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `t_id` (`t_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `t_bdtype` (`t_bdtype`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `t_flag` (`t_flag`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `t_type` (`t_type`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `t_name_index` (`t_name`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7285 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_vod_topic... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_vod_topic_items", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_vod_topic_items` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `topic_id` int(11) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_id` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `vod_id` int(11) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `vod_name` varchar(150) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `vod_pic` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `vod_pic_ipad` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `flag` int(1) DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `disp_order` int(5) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  UNIQUE KEY `unique_key` (`topic_id`,`vod_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `author_id` (`author_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `vod_id` (`vod_id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7244 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_vod_topic_items... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "mac_vod_type", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "mac_vod_type` (`t_id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_name` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_enname` varchar(128) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_sort` int(11) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_pid` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_key` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_des` varchar(255) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_template` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_vodtemplate` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_playtemplate` varchar(64) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_hide` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `t_union` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`t_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `t_sort` (`t_sort`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `t_pid` (`t_pid`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `t_hide` (`t_hide`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=174 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'mac_vod_type... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "tbl_comments", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "tbl_comments` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content_type` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content_name` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `like_number` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content_pic_url` varchar(300) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `comments` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `thread_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `thread_author_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_photo_url` varchar(300) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_username` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `comments_leaf` tinyint(4) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `comment_type` int(2) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `douban_comment_id` int(11) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `comment_title` varchar(300) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `FK_Reference_5` (`content_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `FK_Reference_7` (`author_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `FK_Reference_8` (`thread_id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=38745 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'tbl_comments... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "tbl_feedback", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "tbl_feedback` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_id` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_name` varchar(255) DEFAULT '',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `email` varchar(255) DEFAULT '',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content` text NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `ip` varchar(255) DEFAULT '',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `user_agent` varchar(455) DEFAULT '',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'tbl_feedback... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "tbl_lookup", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "tbl_lookup` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `search_count` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `last_search_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `keyword_order` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_content` (`content`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1883 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'tbl_lookup... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "tbl_my_dynamic", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "tbl_my_dynamic` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content_type` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content_name` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `order_position` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `dynamic_type` tinyint(4) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content_pic_url` varchar(300) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content_desc` varchar(300) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_author_id` (`author_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_dynamic_type` (`dynamic_type`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `content_id` (`content_id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2353 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'tbl_my_dynamic... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "tbl_my_friend", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "tbl_my_friend` ( `id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `friend_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `friend_photo_url` varchar(300) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `friend_username` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `FK_Reference_2` (`friend_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_author_id` (`author_id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1450 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'tbl_my_friend... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "tbl_notfiy_msg", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "tbl_notfiy_msg` ( `id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `notify_type` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `nofity_user_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `notify_user_name` varchar(80) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content_info` varchar(300) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `created_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `notify_user_pic_url` varchar(300) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content_type` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `content_desc` varchar(300) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_author_id` (`author_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_notify_type` (`notify_type`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=440 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'tbl_notfiy_msg... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "tbl_play_history", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "tbl_play_history` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_type` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_name` varchar(100) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_subname` varchar(200) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `play_type` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `playback_time` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `video_url` varchar(500) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `duration` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_author_id` (`author_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_prod_type` (`prod_type`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_prod_id` (`prod_id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1537 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'tbl_play_history... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "tbl_play_records", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "tbl_play_records` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_type` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_name` varchar(100) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_subname` varchar(200) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `client` varchar(100) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_author_id` (`author_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_prod_type` (`prod_type`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_prod_id` (`prod_id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'tbl_play_records... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "tbl_system_config", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "tbl_system_config` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `sys_value` text,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `sys_key` varchar(100) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `sys_desc` varchar(500) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  UNIQUE KEY `sys_key_unique` (`sys_key`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'tbl_system_config... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "tbl_user", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "tbl_user` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `username` varchar(100) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `password` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `email` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `phone` varchar(20) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `sina_wb_user_id` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `qq_wb_user_id` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `ren_user_id` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `douban_user_id` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `last_modify_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `last_login_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `user_photo_url` varchar(200) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `user_bg_photo_url` varchar(200) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `signature` varchar(300) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `other_part_one_user_id` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `other_part_two_user_id` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `other_part_three_user_id` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `other_part_four_user_id` varchar(50) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `like_number` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `watch_number` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `fan_number` int(11) DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `category` varbinary(20) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `grade` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prestige` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `nickname` varchar(80) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `good_number` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `top_number` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `favority_number` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `share_number` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `device_number` varchar(300) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `device_type` varchar(200) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_username` (`username`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_phone` (`phone`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_sina_wb_user_id` (`sina_wb_user_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_douban_user_id` (`douban_user_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_ren_user_id` (`ren_user_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_qq_wb_user_id` (`qq_wb_user_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_prestige` (`prestige`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2869 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'tbl_user... \');</script>';
        }
        if (!isExistTable("" . $app_tablepre . "tbl_video_feedback", $app_dbname)) {
            $db->query("CREATE TABLE `" . $app_tablepre . "tbl_video_feedback` (`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `author_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_type` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_name` varchar(100) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `client` varchar(100) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `prod_id` int(11) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `create_date` datetime DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `feedback_memo` varchar(1000) DEFAULT NULL,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `feedback_type` varchar(50) NOT NULL DEFAULT '8',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  `status` int(11) NOT NULL DEFAULT '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_author_id` (`author_id`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_prod_type` (`prod_type`),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  KEY `i_prod_id` (`prod_id`)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2970 ;");
            echo '<script type="text/javascript">showmessage(\'创建数据表 ' . $app_tablepre . 'tbl_video_feedback... \');</script>';
        }
        echo '<script type="text/javascript">showmessage(\'数据库结构创建完成... \');</script>';
        $db->query("insert into " . $app_tablepre . "mac_manager(m_id,m_name,m_password,m_status,m_levels) values('1','" . $m_name . "','" . md5($m_password1) . "',1,'2, 4, 6, 7, 8 ,9, 10')");
        echo '<script type="text/javascript">showmessage(\'管理员帐号' . $m_name . '初始化成功... \');</script>';
        $db->query("\r\n\t\t\t\t\tINSERT INTO `mac_vod_type` (`t_id`, `t_name`, `t_enname`, `t_sort`, `t_pid`, `t_key`, `t_des`, `t_template`, `t_vodtemplate`, `t_playtemplate`, `t_hide`, `t_union`) VALUES\r\n\t\t\t\t\t(1, '电影', 'dianying', 1, 0, '', '', 'vodlist.html', 'vod.html', 'vodplay.html', 0, ''),\r\n\t\t\t\t\t(2, '连续剧', 'lianxuju', 2, 0, '', '', 'vodlist.html', 'vod.html', 'vodplay.html', 0, ',114_7,'),\r\n\t\t\t\t\t(3, '综艺', 'zongyi', 3, 0, '', '', 'vodlist.html', 'vod.html', 'vodplay.html', 0, ',114_16,'),\r\n\t\t\t\t\t(4, '视频', 'shiping', 4, 0, '', '', 'vodlist.html', 'vod.html', 'vodplay.html', 1, ''),\r\n\t\t\t\t\t\r\n\t\t\t\t\t(131, '动漫', '动漫', 83, 0, '动漫', '动漫', 'vodlist.html', 'vod.html', 'vodplay.html', 0, NULL),\r\n\t\t\t\t\t(132, '记录片', '记录片', 84, 0, '记录片', '记录片', 'vodlist.html', 'vod.html', 'vodplay.html', 1, NULL),\r\n\t\t\t\t\t(133, '教育', '教育', 85, 0, '教育', '教育', 'vodlist.html', 'vod.html', 'vodplay.html', 0, NULL),\r\n\t\t\t\t\t(173, '混合类', 'hunhelei', 125, 0, 'hunhelei', 'hunhelei', 'vodlist.html', 'vod.html', 'vodplay.html', 0, NULL);");
        $file = "joyplus.sql";
        if (file_exists($file)) {
            global $db;
            $buffer = '';
            // Defaults for parser
            $sql = '';
            $start_pos = 0;
            $i = 0;
            $len = 0;
            $big_value = 2147483647;
            $delimiter_keyword = 'DELIMITER ';
            // include the space because it's mandatory
            $length_of_delimiter_keyword = strlen($delimiter_keyword);
            $buffer = iconv("UTF-8", "UTF-8", file_get_contents($file));
            $len = strlen($buffer);
            $GLOBALS['finished'] = true;
            $sql_delimiter = ';';
            while ($i < $len) {
                $found_delimiter = false;
                // Find first interesting character
                $old_i = $i;
                // this is about 7 times faster that looking for each sequence i
                // one by one with strpos()
                if (preg_match('/(\'|"|#|-- |\\/\\*|`|(?i)(?<![A-Z0-9_])' . $delimiter_keyword . ')/', $buffer, $matches, PREG_OFFSET_CAPTURE, $i)) {
                    // in $matches, index 0 contains the match for the complete
                    // expression but we don't use it
                    $first_position = $matches[1][1];
                } else {
                    $first_position = $big_value;
                }
                /**
                 * @todo we should not look for a delimiter that might be
                 *       inside quotes (or even double-quotes)
                 */
                // the cost of doing this one with preg_match() would be too high
                $first_sql_delimiter = strpos($buffer, $sql_delimiter, $i);
                if ($first_sql_delimiter === false) {
                    $first_sql_delimiter = $big_value;
                } else {
                    $found_delimiter = true;
                }
                // set $i to the position of the first quote, comment.start or delimiter found
                $i = min($first_position, $first_sql_delimiter);
                if ($i == $big_value) {
                    // none of the above was found in the string
                    $i = $old_i;
                    if (!$GLOBALS['finished']) {
                        break;
                    }
                    // at the end there might be some whitespace...
                    if (trim($buffer) == '') {
                        $buffer = '';
                        $len = 0;
                        break;
                    }
                    // We hit end of query, go there!
                    $i = strlen($buffer) - 1;
                }
                // Grab current character
                $ch = $buffer[$i];
                // Quotes
                if (strpos('\'"`', $ch) !== false) {
                    $quote = $ch;
                    $endq = false;
                    while (!$endq) {
                        // Find next quote
                        $pos = strpos($buffer, $quote, $i + 1);
                        /*
                         * Behave same as MySQL and accept end of query as end of backtick.
                         * I know this is sick, but MySQL behaves like this:
                         *
                         * SELECT * FROM `table
                         *
                         * is treated like
                         *
                         * SELECT * FROM `table`
                         */
                        if ($pos === false && $quote == '`' && $found_delimiter) {
                            $pos = $first_sql_delimiter - 1;
                            // No quote? Too short string
                        } elseif ($pos === false) {
                            // We hit end of string => unclosed quote, but we handle it as end of query
                            if ($GLOBALS['finished']) {
                                $endq = true;
                                $i = $len - 1;
                            }
                            $found_delimiter = false;
                            break;
                        }
                        // Was not the quote escaped?
                        $j = $pos - 1;
                        while ($buffer[$j] == '\\') {
                            $j--;
                        }
                        // Even count means it was not escaped
                        $endq = ($pos - 1 - $j) % 2 == 0;
                        // Skip the string
                        $i = $pos;
                        if ($first_sql_delimiter < $pos) {
                            $found_delimiter = false;
                        }
                    }
                    if (!$endq) {
                        break;
                    }
                    $i++;
                    // Aren't we at the end?
                    if ($GLOBALS['finished'] && $i == $len) {
                        $i--;
                    } else {
                        continue;
                    }
                }
                // Not enough data to decide
                if (($i == $len - 1 && ($ch == '-' || $ch == '/') || $i == $len - 2 && ($ch == '-' && $buffer[$i + 1] == '-' || $ch == '/' && $buffer[$i + 1] == '*')) && !$GLOBALS['finished']) {
                    break;
                }
                // Comments
                if ($ch == '#' || $i < $len - 1 && $ch == '-' && $buffer[$i + 1] == '-' && ($i < $len - 2 && $buffer[$i + 2] <= ' ' || $i == $len - 1 && $GLOBALS['finished']) || $i < $len - 1 && $ch == '/' && $buffer[$i + 1] == '*') {
                    // Copy current string to SQL
                    if ($start_pos != $i) {
                        $sql .= substr($buffer, $start_pos, $i - $start_pos);
                    }
                    // Skip the rest
                    $start_of_comment = $i;
                    // do not use PHP_EOL here instead of "\n", because the export
                    // file might have been produced on a different system
                    $i = strpos($buffer, $ch == '/' ? '*/' : "\n", $i);
                    // didn't we hit end of string?
                    if ($i === false) {
                        if ($GLOBALS['finished']) {
                            $i = $len - 1;
                        } else {
                            break;
                        }
                    }
                    // Skip *
                    if ($ch == '/') {
                        $i++;
                    }
                    // Skip last char
                    $i++;
                    // We need to send the comment part in case we are defining
                    // a procedure or function and comments in it are valuable
                    $sql .= substr($buffer, $start_of_comment, $i - $start_of_comment);
                    // Next query part will start here
                    $start_pos = $i;
                    // Aren't we at the end?
                    if ($i == $len) {
                        $i--;
                    } else {
                        continue;
                    }
                }
                // Change delimiter, if redefined, and skip it (don't send to server!)
                if (strtoupper(substr($buffer, $i, $length_of_delimiter_keyword)) == $delimiter_keyword && $i + $length_of_delimiter_keyword < $len) {
                    // look for EOL on the character immediately after 'DELIMITER '
                    // (see previous comment about PHP_EOL)
                    $new_line_pos = strpos($buffer, "\n", $i + $length_of_delimiter_keyword);
                    // it might happen that there is no EOL
                    if (false === $new_line_pos) {
                        $new_line_pos = $len;
                    }
                    $sql_delimiter = substr($buffer, $i + $length_of_delimiter_keyword, $new_line_pos - $i - $length_of_delimiter_keyword);
                    $i = $new_line_pos + 1;
                    // Next query part will start here
                    $start_pos = $i;
                    continue;
                }
                // End of SQL
                if ($found_delimiter || $GLOBALS['finished'] && $i == $len - 1) {
                    $tmp_sql = $sql;
                    if ($start_pos < $len) {
                        $length_to_grab = $i - $start_pos;
                        if (!$found_delimiter) {
                            $length_to_grab++;
                        }
                        $tmp_sql .= substr($buffer, $start_pos, $length_to_grab);
                        unset($length_to_grab);
                    }
                    // Do not try to execute empty SQL
                    if (!preg_match('/^([\\s]*;)*$/', trim($tmp_sql))) {
                        $sql = $tmp_sql;
                        $sql = preg_replace("/--.*\n/iU", "", $sql);
                        //去掉注释
                        $sql = trim($sql);
                        if (stripos($sql, "CREATE") !== false && stripos($sql, "CREATE") == 0 || stripos($sql, "INSERT") !== false && strpos($sql, "INSERT") == 0 || stripos($sql, "UPDATE") !== false && strpos($sql, "UPDATE") == 0 || stripos($sql, "DELETE") !== false && strpos($sql, "DELETE") == 0) {
                            $rs2 = $db->query($sql);
                        } else {
                            $sql = str_replace("/*!40101", "", $sql);
                            $sql = str_replace("*/", "", $sql);
                            $rs2 = $db->query($sql);
                        }
                        $buffer = substr($buffer, $i + strlen($sql_delimiter));
                        $len = strlen($buffer);
                        $sql = '';
                        $i = 0;
                        $start_pos = 0;
                        // Any chance we will get a complete query?
                        //if ((strpos($buffer, ';') === false) && !$GLOBALS['finished']) {
                        if (strpos($buffer, $sql_delimiter) === false && !$GLOBALS['finished']) {
                            break;
                        }
                    } else {
                        $i++;
                        $start_pos = $i;
                    }
                }
            }
        }
        echo '<script type="text/javascript">showmessage(\'数据分类初始化成功... \');</script>';
        updateCacheFile();
        echo '<script type="text/javascript">showmessage(\'数据缓存初始化成功... \');</script>';
    }
    unset($db);
}