汉化好难哦

找到一个WAP源码,文件共享源码,支持备份,昨天汉化好久,整个源码汉化了一半,我就没有汉化,直接传到空间,安装的那页居然变成了空白也页……,打开首页提示Warning : mysql_pconnect() [ function.mysql-pconnect ]: Access denied for user 'root'@'localhost' (using password: NO) in /home/u758720007/public_html/ce/558/common.php on line 9
Could not connect MySQ
回复列表(9|隐藏机器人聊天)
  • @Ta / 2012-12-21 / /
    。。。。。。。。。。。。。
  • @Ta / 2012-12-21 / /
    程序什么名字
  • @Ta / 2012-12-21 / /
    数据库连接信息。。conn
  • @Ta / 2012-12-21 / /
    @淡然 空白页……
  • @Ta / 2012-12-21 / /
    把common发上来看看
  • @Ta / 2012-12-21 / /
    五楼…没有连接到数据库!
  • @Ta / 2012-12-21 / /
    @#14484 @淡然 @11051 这是common.php文件,打开这个文件是空白页 <?php
    /* code by DQH - DDVIET.VN */
    ob_start();
    session_start();
    require_once ('config.php');
    if(!defined('IN_DDU')) exit;

    /* Begin connect database */
    mysql_pconnect(DBHOST,DBUSER,DBPASS) or die ('Could not connect MySQL');
    mysql_select_db(DBNAME)  or die ('Could not select database from MySQL');

    /* setup & assign */
    date_default_timezone_set('Asia/Ho_Chi_Minh');
    $querySetup = mysql_query('SELECT name,value FROM settings');
    $set = array();
    while($setup=mysql_fetch_assoc($querySetup)) $set[$setup['name']] = $setup['value'];
    mysql_free_result($querySetup);

    if(isset($_SESSION['userid'])){
        $userid = $_SESSION['userid'];
        $userlv = $_SESSION['userlv'];
    }

    $time = time();
    $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
    $id = intval($_GET['id']);
    $j = ($page-1)*10;

    /* function */

    ## text ##
    function input($text){
        return trim(addslashes($text));
    }
    function output($text,$html=false){
        if($html){
            return trim(stripslashes($text));
        } else {
            return trim(htmlspecialchars(stripslashes($text)));
        }
    }

    function lvuser($id){
    if($id == 0){
    return '<s><b>Banner</b></s>';
    }
    elseif($id == 1){
    return '<b><font color="blue">User</font></b>';
    }
    elseif($id == 2){
    return '<b><font color="red">Administor</font></b>';
    }
    }


    function bytetomb($byte){
    return round($byte/1048576, 2);
    }

    function size($a_bytes){
    if ($a_bytes<1024) {
    return $a_bytes.' bytes';
    } elseif ($a_bytes<
    1048576) {
    return round($a_bytes/1024, 2) .' KB';
    } elseif ($a_bytes<1073741824) {
    return round($a_bytes/1048576, 2) . ' MB';
    } elseif ($a_bytes<
    1099511627776) {
    return round($a_bytes/1073741824, 2) . ' GB';
    } elseif ($a_bytes<
    1125899906842624) {
    return round($a_bytes/1099511627776, 2) .' TB';
    } elseif ($a_bytes<
    1152921504606846976) {
    return round($a_bytes/1125899906842624, 2) .' PB';
    } elseif ($a_bytes<
    1180591620717411303424){
    return round($a_bytes/1152921504606846976, 2) .' EB';
    } elseif ($a_bytes<1208925819614629174706176) {
    returnround($a_bytes/1180591620717411303424,2) .' ZB';
    } else {
    return round($a_bytes/1208925819614629174706176, 2) .' YB';
    }}

    function getWithoutPath($filename) {
    return end(explode("/",$filename));}

    function getExt($name) {
    return end(explode('.', $name));
    }
    function imgExt($name) {
    $exts[] = 'gif';
    $exts[] = 'jpg';
    $exts[] = 'png';
    $exts[] = 'jpeg';
    $found = false;
    foreach($exts as $key=>$value) {
    if(getExt($name) == $value) {
    $found = true;
    break;
    }
    }

    if($found) return true;
    else return false;
    }

    function rm20($fn) {
    return str_replace('%20', ' ', $fn);
    }

    function paging($all,$page,$num,$url) {
    $total = ceil($all/$num);
    if ($page != 1) $pervpage = ' <a href= "'.$url.'page='. ($page - 1) .'">&lt;&lt;</a> ';
    if ($page != $total) $nextpage = ' <a href="'.$url.'page='. ($page + 1) .'">&gt;&gt;</a>';
    if ($page - 4 > 0) $first = '<a href="'.$url.'page=1">1</a>...';
    if ($page + 4 <= $total) $last = '...<a href="'.$url.'page='.$total.'">'.$total.'</a>';
    if($page - 2 > 0) $page2left = ' <a href= "'.$url.'page='. ($page - 2) .'">'. ($page - 2) .'</a> ';
    if($page - 1 > 0) $page1left = '<a href= "'.$url.'page='. ($page - 1) .'">'. ($page - 1) .'</a> ';
    if($page + 2 <= $total) $page2right = ' <a href= "'.$url.'page='. ($page + 2) .'">'. ($page + 2) .'</a>';
    if($page + 1 <= $total) $page1right = ' <a href="'.$url.'page='. ($page + 1) .'">'. ($page + 1) .'</a>';
    echo '<div class="nav">'.$pervpage.$first.$page2left.$page1left.'['.$page.']'.$page1right.$page2right.$last.$nextpage.'</div>';
    }
    function check_email($email) {
        if (strlen($email) == 0) return false;
        if (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)) return true;
        return false;
    }

    ## template ##

    function headerpg($set){
    global $userid;
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
    echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"
    \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
    echo"<head>\n<title>{$set['title']} {$set['name']}</title>\n<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" media=\"all,handheld\"/>\n<!-- Script by DinhQuocHan -->\n</head>\n";
    echo "<body>\n<div class=\"content\">\n<div class=\"header\">".output($set['header'],true)."</div>\n";
    If($userid){
        echo '<div class="box"><b>You are signed !</b></div>';
     }
    echo '<div class="box"><img src="'.URL.'/images/home.gif" > <a href="'.URL.'" title="home">Home</a> '.$set['br'].'</div>';
    }

    function footerpg($set){
    echo '<div class="footer"><img src="'.URL.'/usersonline.php" alt="usersonline"/><br/>&copy; 2012, <a href="http://siekuti.com">DinhQuocHan</a> Production.<br/>Powered by '.$set['name'].'</div></div></body></html>';
    }

    ## Global ##
    function go($url){
    header('Location: '.$url);
    exit;
    }
    function rrmdir($dir) {
        foreach(glob($dir . '/*') as $file) {
            if(is_dir($file))
                rrmdir($file);
            else
                unlink($file);
        }
        rmdir($dir);
    }

    ## database ##
    function insert($name){
        $qr = mysql_query("select max(id) from $name");
        $max = mysql_fetch_array($qr);
        return $max['max(id)']+1;
        mysql_free_result($qr);
    }
    function update($name,$value){
        mysql_query("UPDATE `settings` SET  `value` =  '$value' WHERE  `name` = '$name';");
        return TRUE;
    }

    function nameu($name){
        $qr = mysql_query("select mail from users where id = '$name'");
        $max = mysql_fetch_array($qr);
        return $max['mail'];
        mysql_free_result($qr);
    }
    ?>
  • @Ta / 2012-12-21 / /
    不难
  • @Ta / 2012-12-22 / /
    没安装!建议你测试原版能否安装之后再汉化
添加新回复
回复需要登录