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

vCharset Converter - enjoy the AJAX & UTF-8

本帖由 laogui2007-05-09 发布。版面名称:前端开发

  1. laogui

    laogui Administrator
    管理成员

    注册:
    2005-08-30
    帖子:
    15,216
    赞:
    35
    Please correct me if you see any grammar error, or any misspelling.

    Description:
    This script converts the database of vBulletin forums (from and to) any of the charsets that are supported by iconv. also it has the ability to convert the tables of hacks that you had installed.

    Caution: This is BETA PRODUCT, provided "As Is" without warranties, Test it using a copy of your vBulletin database not using your live vBulletin database, Since this is a BETA PRODUCT use it for testing only.

    Why this product?
    My forums encoding was windows-1256, so I wasn't able to get full advantages of AJAX functions (like the quick reply and the quick edit) without some encoding problems.

    I had decided to convert my encoding and built this script.

    I converted to utf-8 since beta 2 of this product.

    But don't ever convert your 3.6 vBulletin before testing it multiple times on a copy of your database (not the actual live one), and giving me your repeated feedback about any error you may face.

    This product won't be developed without your trials and feedback, because I'm developing it for you, I'm already done.

    Requirements:
    • vBulletin 3.6.4+
    • iconv PHP extension is installed on your system, or your PHP version is PHP5 and above.
    Supported Encodings:
    See libiconv - GNU Project - Free Software Foundation (FSF)

    Installation:
    1. Upload files to their respective locations.
    2. Import the file product product-charset_converter.xml (Choose Yes when Upgrade)
    3. Refresh your admincp.
    How to use?
    1. Go to vCharset Converter->Settings, set (the Source Charset Encoding & the Destination Charset Encoding) and save.
    2. Go to vBulletin Options -> Censorship Options -> Blank Character Stripper, empty its value and save.
    3. Close your forum.
    4. Backup your database.
    5. Add a new language and call it ex: English, set its HTML charset as your Destination Charset Encoding.
    6. Set your username options (profile.php?do=editoptions) to use the created language as a default language.
    7. Change your old languages charsets into the Destination Charset Encoding.
    8. Go to vCharset Converter -> Manage tables.
      if you see a message like:
      Trích:
      The iconv PHP module is not presented, please contact your system administrator to enable/install it.
      then it means that you need to install iconv.
    9. This product recognizes the Default vBulletin Tables, and mentions their status. of course we will convert tables that added by miscellaneous other products if they need.
      Ask in this thread for information about your installed products, or share your products information.
      The next post will be reserved for this purpose.
    10. Edit the userfield table and add the custom fields to it (there are 4 custom fields by default (field1, field2, field3 and field4), you may added more, check them at User Profile Fields -> User Profile Field Manager).
    11. Go to vCharset Converter -> vCharset Converter.
    12. You will see a drop-down menu. select the table you want to convert, set the number of items to convert per cycle (default 1000) and press submit.
    13. Redo this for each table in the drop-down menu.
    14. Once a table get Converted, it won't be displayed again in the drop-down menu.
    15. Go to Maintenance -> Update Counters, then Rebuild Post Cache (you won't see this option if you don't use The Post Cache System, if so go on) and Empty Signature Cache.
    16. Test your forum.
    17. search for Non-English words, if you don't get the expected results, read the "Search Problems".
    18. Open your forum.
    19. After finishing tell me what are your impression, ideas and faced problems.
    Search Problems
    What is the problem?
    After converting you may get not expected (or even no) results when performing searches, I had faced this problem after converting to UTF-8.

    What is my circumstances?
    Mysql 4.1.x, Full-Text search and I converted to utf-8.

    What is the reason?
    Full-Text search has Restrictions that say: "all columns in a FULLTEXT index must use the same character set and collation.".

    Solution
    So if you use fulltext search with MySQL 4.1.x and convert to utf-8, then perform these queries: (after converting post and thread tables)
    Code:
    ALTER TABLE post MODIFY pagetext mediumtext COLLATE utf8_unicode_ciALTER TABLE post MODIFY title VARCHAR(250) COLLATE utf8_unicode_ciALTER TABLE thread MODIFY title VARCHAR(250) COLLATE utf8_unicode_ci Dont forget to add your table prefix if you have one
    - If you use vBulletin built-in search engine (with any MySQL version), then consider to Rebuild Search Index (Maintenance -> Update Counters -> Rebuild Search Index)
    You may read this thread fulltext search stopped!!! - vBulletin Community Forum

    Email Problems
    After the conversion, my users had reported that they couldn't read the notification emails. the emails are sent with utf-8 encoding.
    Not all users do know how to change the encoding of a page. you may learn them, this is the only solution.
    Problem had been faced with Hotmail (confirmed by me) and Yahoo (not confirmed).
    No problem with Gmail (confirmed by me).
    UPDATE: YOU CAN SOLVE THESE PROBLEMS BY USING THIS HACK vMail Converter


    Known issues:
    1. Users titles disappear after converting. (Still exists in beta 4)
    Versions
    • 1.0.0 BETA 1 (initial release). (11 Jun 2006)
    • 1.0.0 BETA 2 new features: (4 Aug 2006)
      • Manage Tables: Now you can add or edit your tables, this will make converting of additional tables very easy.
      • New built-in images to mark the tables:
      • Now you can see all the tables in your database, with their statues, also you have the ability to change this status to "no need" or you can add/edit the fields and the primaryid field of any table before you go on converting it.
    • 1.0.0 BETA 3 (mainly to support vBulletin 3.6.x): (9 Feb 2007)
    • 1.0.0 BETA 4 (Fix XML error in the product file.): (10 Feb 2007)
    • 1.0.0 BETA 5 (Fix some bugs): (19 Feb 2007)
    Offer: You can ask me to convert your database for certain price, it depends on your database this.