1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

PHPizabi 0.848b C1(开源交友系统)中文支持 下载 安装/语言包无法加载的问题

本帖由 toll2007-02-10 发布。版面名称:源码讨论

  1. toll

    toll New Member

    注册:
    2005-09-06
    帖子:
    304
    赞:
    4
    下载地址
    http://demo.cms8.com/
    /CodeDown/PhpDown/OpenSource/PHPizabi_0.848b_C1.zip

    http://www.phpizabi.net/?L=downloads.downloadcore

    中文语言包单独提供





    PHPizabi 0.848b C1(开源交友系统)安装过程中的注意事项


    PHPizabi在安装的光程中如果你的数据库字符集使用的是GBK或者GB2312,可能会在第六步的Database Structure Creation数据库创建导入过程中出现too long for column的情况,这个时候,你需要将字符集修改为UTF8,操作方法如下:


    打开你的数据库(物理路径,比如我的D:\MySQL\MySQL Server 5.0\data\toll),使用记事本编辑db.opt,内容为:

    default-character-set=utf8
    default-collation=utf8_general_ci

    重新启动MYSQL,重新安装即可.





    另外一个注意事项就是,Admin Account Creation 创建管理员帐户.

    Administrative account creation results:
    There has been an error trying to create your administrative account. Server replied: Field act_history doesnt have a default value
    添加用户的时候,默认每个用户有很多字段需要填写,而创建管理员用户的时候,我们只写入了:(`username`,`password`,`email`,`email_verified`,`active`,`is_administrator`,`is_superadministrator`)

    act_history值为空,没有默认值.不光是act_history,其它还有很多是空值.

    三种解决方法:

    第一种,需要你修改PHPizabi 0.848b C1\install\includes\database\admincreate.php程序,把空余字段的值全部赋予.

    一下是我写的admincreate.php,你可以直接复制另存覆盖原文件:

    代码:
    <script type="text/javascript">
      var label = document.getElementById('createresult');
    </script>
    <?php
    
    	if ($conection = @mysql_connect($_SESSION["DB"]["dbhost"], $_SESSION["DB"]["dbun"], $_SESSION["DB"]["dbpw"])) {
    		@mysql_select_db($_SESSION["DB"]["dbname"]);
    	}
    		
    	if (@mysql_query("
    		INSERT INTO `{$_SESSION["DB"]["dbpre"]}users` 
    		(`id`, `token`, `last_load`, `act_history`, `last_login`, `username`, `password`, `email`, `email_verified`, `city`, `state`, `country`, `zipcode`, `latitude`, `longitude`, `timezone`, `birthdate`, `astrologic_sign`, `horoscope`, `horoscope_date`, `age`, `gender`, `language`, `use_theme`, `description`, `quote`, `header`, `notepad_body`, `profile_data`, `mailboxes`, `pictures`, `mainpicture`, `contacts`, `relationship_requests`, `block`, `profile_views`, `profile_votes`, `pictures_votes`, `favorites`, `nudges`, `settings`, `spam_reports`, `abuse_reports`, `account_type`, `account_expire`, `registration_date`, `registration_reference`, `active`, `disable_until`, `is_administrator`, `is_superadministrator`)
    		VALUES
    		(
    			NULL, '', '0', '', '0', '{$_POST["adminun"]}', '".md5($_POST["adminpass"])."', '{$_POST["adminem"]}', '1', '', '', '', '', '0', '0', '', '', '', '', '0', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0', '0', '0', '', '1', '0', '1', '1'
    		)
    	")) {
    		
    		echo "
    			<script type=\"text/javascript\">
    				label.innerHTML = 'Success ... Please press Continue';
    				document.getElementById('submit').disabled = false;
    				document.getElementById('submit').className = 'submit';
    			</script>"
    		;
    			
    	} 
    			
    	else {
    		echo "
    			<script type=\"text/javascript\">
    				label.innerHTML = 'There has been an error trying to create your administrative account. Server replied: ".str_replace("'", "", mysql_error())."';
    			</script>"
    			;
    	}
    ?>


    第二种,使用phpmyadmin直接运行sql添加管理员帐户.

    代码:
    INSERT INTO `phpizabi_users` (`id`, `token`, `last_load`, `act_history`, `last_login`, `username`, `password`, `email`, `email_verified`, `city`, `state`, `country`, `zipcode`, `latitude`, `longitude`, `timezone`, `birthdate`, `astrologic_sign`, `horoscope`, `horoscope_date`, `age`, `gender`, `language`, `use_theme`, `description`, `quote`, `header`, `notepad_body`, `profile_data`, `mailboxes`, `pictures`, `mainpicture`, `contacts`, `relationship_requests`, `block`, `profile_views`, `profile_votes`, `pictures_votes`, `favorites`, `nudges`, `settings`, `spam_reports`, `abuse_reports`, `account_type`, `account_expire`, `registration_date`, `registration_reference`, `active`, `disable_until`, `is_administrator`, `is_superadministrator`) VALUES (NULL, '', '0', '', '0', 'admin', '21232f297a57a5a743894a0e4a801fc3', '[email protected]', '1', '', '', '', '', '0', '0', '', '', '', '', '0', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0', '0', '0', '', '1', '0', '1', '1');
    
     
    使用admin/admin登录即可

    第三种,就是修改database.txt,同理设计.


    如果你使用的是php5
    会遇到语言包无法加载的问题,具体症状如下:
    网页上出现大量的[My Contacts {345}] , [Manage Contacts Groups {6010}] ,[Create Groups {6050}] 等内容。


    这个时候,这是因为程序本身的问题

    可以尝试使用一下方法解决:

    打开 /system/functions/classes/template.class.php
    大约在251行左右,找到

    代码:
    '/\[((?:.(?(?<=\\\\\[)|(?<!\[)))+) \{(\d+)\}\]/USie', 

    使用一下代码替换:




    代码:
    '/\[([^\]\[\{\}]+) ?\{(\d+)\}\]/Usie',
     
  2. sluke

    sluke New Member

    注册:
    2005-09-04
    帖子:
    4,550
    赞:
    13
    .....好久不见这个东西了,现在是谁在翻译?
     
  3. toll

    toll New Member

    注册:
    2005-09-06
    帖子:
    304
    赞:
    4
    8000多句
    一口气翻译了1/5

    累了
     
  4. swsw007

    swsw007 New Member

    注册:
    2006-07-04
    帖子:
    2,228
    赞:
    1
    这个东西评价怎么样啊?
     
  5. sluke

    sluke New Member

    注册:
    2005-09-04
    帖子:
    4,550
    赞:
    13
    toll在翻译?天啊~这是个大项目。
     
  6. mojo

    mojo New Member

    注册:
    2007-02-24
    帖子:
    1
    赞:
    0
    我搜遍全网页找不到语言包,请问楼主可以发给我一份吗?万分感谢!!
     
  7. 死鬼

    死鬼 New Member

    注册:
    2005-09-10
    帖子:
    344
    赞:
    1
    :angry:
     
  8. 死鬼

    死鬼 New Member

    注册:
    2005-09-10
    帖子:
    344
    赞:
    1