vB Global Translator - Multiply your indexed pages & put search traffic on autopilot
vB Global Translator - 100% FREE! Accept no substitutes, the ORIGINAL and BEST translation MOD. Below is a graph showing visits from search engines to new generated translated pages ONLY over a 4 month period straight after MOD install. Yes, that's right, 9000 EXTRA visits per day, and growing. Nearly 3/4 of a MILLION uniques EXTRA in total. So what does this do? vB Global Translator automatically translates your forum into 31 other languages via the Google translate API, stores those translations in a MySQL database then rewrites new URLs so you end up with 31 new pages in 31 new languages for every current page. So, if you have 10,000 pages, this MOD will translate those pages into 31 languages making a total of 310,000 pages in 31 languages. This results in a flood of international traffic and referrals from the search engines. If you are getting 1,000 visits a day from your 10,000 pages imagine how many referrals you will get from 310,000 pages! The current languages this MOD works with are all supported and allowed by AdSense so you can expect your income to rise accordingly without issue. I have this running on a 20,000 thread forum and after a few months I have more than quadrupled my search engine traffic. Note - This script runs off a database. The 1st time a translated page is loaded by a user or search bot the words need to be sent to the Google Translation service, the words are then saved into the database, this can take a varying amount of seconds depending on how heavy your pages are with content. The next time the page is requested it loads from cache and speed is instant. Over time, users and bots will cache your entire site automatically and all translated pages will load the same as normal pages. Please be patient, this is a long term MOD, Google doesn't index normal pages overnight and these translated pages are no different. http://www.blogboost.org/ How do I Install? Note - This script uses cURL, make sure it is installed and enabled on your server. If in doubt ask your host. Download the zip and open it, if you are using standard vBulletin URLs (like vbulletin.org) use that folder for your base files. If you are using mod-rewrite vBSEO URLs (like vbseo.com) then use that folders files. You need to add a new MySQL database to your domain to store the translated pages. Setup the database in your domain control panel. Open the database in phpmyadmin or similar and run the following query's to import the tables. First you need to add a new MySQL database to your domain to store the translated pages. Setup the database in your domain control panel. Open the database in phpmyadmin or similar and run the following query's to import the tables. Code:
CREATE TABLE wt_cache ( id INT AUTO_INCREMENT NOT NULL PRIMARY KEY, tl VARCHAR(10), originaltext VARCHAR(65000), translated TEXT, INDEX(originaltext(323), tl) ) ENGINE = MYISAM, CHARACTER SET utf8 COLLATE utf8_bin; CREATE TABLE wt_cache_medium ( id INT AUTO_INCREMENT NOT NULL PRIMARY KEY, tl VARCHAR(10), originaltext VARCHAR(255), translated VARCHAR(1000), UNIQUE (originaltext, tl) ) ENGINE = MYISAM, CHARACTER SET utf8 COLLATE utf8_bin; CREATE TABLE wt_cache_short ( id INT AUTO_INCREMENT NOT NULL PRIMARY KEY, tl VARCHAR(10), originaltext VARCHAR(50), translated VARCHAR(255), UNIQUE (originaltext, tl) ) ENGINE = MYISAM, CHARACTER SET utf8 COLLATE utf8_bin; Add your new database details in the relevant fields. Code:
$dbusername = "dbusername"; $dbpassword = "dbpassword"; $mysqlserver = "localhost"; $dbname = "dbname"; Next, change the $fl setting to also match your forum base language. The default again is english (en). If different swap with the relevant code from the table below. Code:
"ar"=>"Arabic", "bg"=>"Bulgarian", "zh-CN"=>"Chinese (Simplified", "zh-TW"=>"Chinese (Traditional)", "hr"=>"Croatian", "cs"=>"Czech", "da"=>"Danish", "nl"=>"Dutch", "en"=>"English", "fi"=>"Finnish", "fr"=>"French", "de"=>"German", "el"=>"Greek", "iw"=>"Hebrew", "hu"=>"Hungarian", "it"=>"Italian", "ja"=>"Japanese", "ko"=>"Korean", "lv"=>"Latvian", "lt"=>"Lithuanian", "no"=>"Norwegian", "pl"=>"Polish", "pt"=>"Portuguese", "ro"=>"Romanian", "ru"=>"Russian", "sr"=>"Serbian", "sk"=>"Slovak", "es"=>"Spanish", "sv"=>"Swedish", "th"=>"Thai", "tr"=>"Turkish", "uk"=>"Ukrainian" You need to comment out (remove the code) the flag for your base language otherwise you can cause duplicate URLs for those pages and this can be bad for SEO. All the flags are on separate lines in alpha order, find your language and add <!-- to the start and --> to the end of the line. eg; <!-- language flag code --> Upload both php files to your forum root, if your forums are in a /forums/ folder, subdomain or similar upload the files there. Upload the /flags/ folder to your domain root, thats the domain root. In your vBulletin admin panel add a new plugin with the following settings. Hook Location: global_complete Title: vB Global Translator Execution Order: 50 Plugin PHP Code: Code:
// Enable UTF-8 characters if(isset($_GET['hl'])) { $output = str_replace('lang="en"', 'lang="'.$_GET['hl'].'"', $output); header ('Content-type: text/html; charset=utf-8'); // Keep remainders of <style and <script tags! $time = time(); // Unique Tag Identifier! preg_match_all('|<script[^>]*>(.*?)</script>|si', $output,$scripttags, PREG_SET_ORDER); for($i=0;$i<count($scripttags);$i++) { $output = str_replace($scripttags[$i][0], "<a name=\"$i\"></a>",$output); } //preg_match_all("<style[^>]*>.*</style>",$buffer,$styletags); preg_match_all('|<style[^>]*>(.*?)</style>|si',$output,$styletags); for($i=0;$i<count($styletags);$i++) { $output = str_replace($styletags[1][$i], "<a name=\"s$i\"></a>",$output); } $output = str_replace(" ", "< >", $output); require_once("translate.php"); $output=callback($output); $output = str_replace("< >", " ", $output); // Place back remainders of <style and <script tags! for($i=0;$i<count($styletags);$i++) { $output = str_replace("<a name=\"s$i\"></a>", $styletags[1][$i], $output); } for($i=0;$i<count($scripttags);$i++) { $output = str_replace("<a name=\"$i\"></a>",$scripttags[$i][0] ,$output); } // Translate META tags. preg_match_all("|<meta[^>]+name=\"([^\"]*)\"[^>]" . "+content=\"([^\"]*)\"[^>]+>|i",$output, $out,PREG_PATTERN_ORDER); $meta = array(); for ($i=0;$i < count($out[1]);$i++) { if (strtolower($out[1][$i]) == "keywords") $meta['keywords'] = $out[2][$i]; if (strtolower($out[1][$i]) == "description") $meta['description'] = $out[2][$i]; } // Start replacing the original META tags with translated tags. $output=str_replace("<meta name=\"description\" content=\"".$meta['description']."\" />","<meta name=\"description\" content=\"".html_entity_decode(callback($meta['description']))."\" />",$output); $output=str_replace("<meta name=\"keywords\" content=\"".$meta['keywords']."\" />","<meta name=\"keywords\" content=\"".html_entity_decode(callback($meta['keywords']))."\" />",$output); } Save the plugin and activate. In your vBulletin admin panel add another new plugin with the following settings. Hook Location: global_start Title: vB Global Translator Flags Execution Order: 5 Plugin PHP Code: Code:
ob_start(); include('translateflags.php'); $translateflags = ob_get_contents(); ob_end_clean(); Finally add the code below to your template so the flags to select languages appear. This is typically the header, navbar or footer so that they display on every page. You can wrap the in an if condition if you want to just show them on just thread pages or certain forums. Code:
<!-- vBGT Code Start--> <div align="center"> <!-- google_ad_section_start(weight=ignore) --> $translateflags <!-- google_ad_section_end --> </div> <!-- vBGT Code End --> That's it. Please rate and click install to receive updates. THANK YOU! Version History: v2.5 * Updated to include more adsense supported languages - Lithuanian, Ukrainian, and Latvian. Upgrade Info; Spoiler (click to open)
Version 2.5 release.
* Updated to include more adsense supported languages - Lithuanian, Ukrainian, and Latvian. To upgrade upload the latest flag images and translateflags.php Close
v2.4 * More DB optimization, fastest ever read/write cache speed Upgrade Info; Spoiler (click to open)
v2.4 Official Release
* More DB optimization, fastest ever read/write cache speed Upgrade Info; Open new translate.php file, add settings as detailed in install and disable cache, so $enablecache=false Run the following MySQL querys one by one. Code:
Alter table wt_cache_short collate utf8_bin; ALTER TABLE wt_cache_short CHANGE tl tl VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL; ALTER TABLE wt_cache_short CHANGE originaltext originaltext VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL; ALTER TABLE wt_cache_short CHANGE translated translated VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL; Code:
Alter table wt_cache_medium collate utf8_bin; ALTER TABLE wt_cache_medium CHANGE tl tl VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL; ALTER TABLE wt_cache_medium CHANGE originaltext originaltext VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL; ALTER TABLE wt_cache_medium CHANGE translated translated VARCHAR( 1000 ) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL; Code:
Alter table wt_cache collate utf8_bin; ALTER TABLE wt_cache CHANGE tl tl VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL; ALTER TABLE wt_cache CHANGE translated translated TEXT CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL; ALTER TABLE wt_cache CHANGE translated translated VARCHAR( 65000 ) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL; Code:
CREATE TABLE saver ( id INT, tl VARCHAR(10), originaltext VARCHAR(65000) ) ENGINE = MYISAM, CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE TABLE cleaner ( id INT ) ENGINE = MYISAM, CHARACTER SET utf8 COLLATE utf8_general_ci; Code:
delete from cleaner; delete from saver; insert into saver (SELECT min(id) as id, tl, originaltext from wt_cache group by originaltext,tl having count(*) > 1); insert into cleaner (SELECT cache.id from saver, wt_cache cache where saver.originaltext=cache.originaltext and saver.tl=cache.tl and saver.id<>cache.id); DELETE FROM wt_cache USING wt_cache INNER JOIN cleaner ON wt_cache.id = cleaner.id; Code:
delete from cleaner; delete from saver; insert into saver (SELECT min(id) as id, tl, originaltext from wt_cache_short group by originaltext,tl having count(*) > 1); insert into cleaner (SELECT cache.id from saver, wt_cache_short cache where saver.originaltext=cache.originaltext and saver.tl=cache.tl and saver.id<>cache.id); DELETE FROM wt_cache_short USING wt_cache_short INNER JOIN cleaner ON wt_cache_short.id = cleaner.id; Code:
delete from cleaner; delete from saver; insert into saver (SELECT min(id) as id, tl, originaltext from wt_cache_medium group by originaltext,tl having count(*) > 1); insert into cleaner (SELECT cache.id from saver, wt_cache_medium cache where saver.originaltext=cache.originaltext and saver.tl=cache.tl and saver.id<>cache.id); DELETE FROM wt_cache_medium USING wt_cache_medium INNER JOIN cleaner ON wt_cache_medium.id = cleaner.id; Code:
OPTIMIZE TABLE wt_cache, wt_cache_medium, wt_cache_short; Code:
alter table wt_cache_short drop index originaltext; create UNIQUE INDEX originaltext on wt_cache_short (originaltext, tl); alter table wt_cache_medium drop index originaltext; create UNIQUE INDEX originaltext on wt_cache_medium (originaltext, tl); The set $enablecache=true; in translate.php and upload that file one last time. Close
v2.3b * Small change to database optimization Upgrade info; Spoiler (click to open)
v2.3b
* Small change to database optimization To upgrade; Run this MySQL query. Code:
alter table wt_cache drop index originaltext; create INDEX originaltext on wt_cache(originaltext(323), tl); Close
v2.3a * Small fix to avoid translation of non braking spaces to normal spaces Upgrade info; Spoiler (click to open)
v2.3a Official Release
* Small fix to avoid translation of non braking spaces to normal spaces To upgrade; find in Global Translator Plugin: Code:
require_once("translate.php"); $output=callback($output); Code:
$output = str_replace(" ", "< >", $output); require_once("translate.php"); $output=callback($output); $output = str_replace("< >", " ", $output); Code:
delete from wt_cache_short where originaltext like '% %'; delete from wt_cache_medium where originaltext like '% %'; delete from wt_cache where originaltext like '% %'; Close
v2.3 * More change to database optimization. Upgrade info; Spoiler (click to open)
v2.3 Official Release
* More change to database optimization. To Upgrade Upload the new translate.php and run the following MySQL query on your DB. Code:
delete from wt_cache where translated='' or translated is null; delete from wt_cache_medium where translated='' or translated is null; delete from wt_cache_short where translated='' or translated is null; Close
v2.2 * More improvements to database code, better speed and lower data size * Flag files combined size reduced from 40kb to 3kb for faster page load speed Upgrade info; Spoiler (click to open)
v2.2
* More improvements to database code, better speed and lower data size * Flag files combined size reduced from 40kb to 3kb for faster page load speed To upgrade download new package, upload new translate.php and /flags/ folder. Run the following MySQL query on your DB via phpmyadmin. Code:
alter table wt_cache_short drop index tl; create index originaltext on wt_cache_short (originaltext, tl); alter table wt_cache_medium drop index tl; create index originaltext on wt_cache_medium (originaltext, tl); alter table wt_cache drop index tl; create index originaltext on wt_cache (originaltext(50), tl); Close
v2.1 * Meta description and meta keywords now translated in the output source code, better for SEO and search engine indexing * Note no change to files so download v2.0 below is v2.1 Upgrade info; Spoiler (click to open)
v2.1
* Meta description and meta keywords now translated in the output source code, better for SEO and search engine indexing * Note no change to files To update just replace your vB Global Translator plugin code with what is below. Also change the Execution Order: to 50 Code:
// Enable UTF-8 characters if(isset($_GET['hl'])) { $output = str_replace('lang="en"', 'lang="'.$_GET['hl'].'"', $output); header ('Content-type: text/html; charset=utf-8'); // Keep remainders of <style and <script tags! $time = time(); // Unique Tag Identifier! preg_match_all('|<script[^>]*>(.*?)</script>|si', $output,$scripttags, PREG_SET_ORDER); for($i=0;$i<count($scripttags);$i++) { $output = str_replace($scripttags[$i][0], "<a name=\"$i\"></a>",$output); } //preg_match_all("<style[^>]*>.*</style>",$buffer,$styletags); preg_match_all('|<style[^>]*>(.*?)</style>|si',$output,$styletags); for($i=0;$i<count($styletags);$i++) { $output = str_replace($styletags[1][$i], "<a name=\"s$i\"></a>",$output); } require_once("translate.php"); $output=callback($output); // Place back remainders of <style and <script tags! for($i=0;$i<count($styletags);$i++) { $output = str_replace("<a name=\"s$i\"></a>", $styletags[1][$i], $output); } for($i=0;$i<count($scripttags);$i++) { $output = str_replace("<a name=\"$i\"></a>",$scripttags[$i][0] ,$output); } // Translate META tags. preg_match_all("|<meta[^>]+name=\"([^\"]*)\"[^>]" . "+content=\"([^\"]*)\"[^>]+>|i",$output, $out,PREG_PATTERN_ORDER); $meta = array(); for ($i=0;$i < count($out[1]);$i++) { if (strtolower($out[1][$i]) == "keywords") $meta['keywords'] = $out[2][$i]; if (strtolower($out[1][$i]) == "description") $meta['description'] = $out[2][$i]; } // Start replacing the original META tags with translated tags. $output=str_replace("<meta name=\"description\" content=\"".$meta['description']."\" />","<meta name=\"description\" content=\"".html_entity_decode(callback($meta['description']))."\" />",$output); $output=str_replace("<meta name=\"keywords\" content=\"".$meta['keywords']."\" />","<meta name=\"keywords\" content=\"".html_entity_decode(callback($meta['keywords']))."\" />",$output); } Close
v2.0 New database system * Pages now cache very fast and cached pages load instant * No added server load whatsoever, none * No false database errors, test sites got 1 or 2 in 24hrs * Fixed lang="en" meta issue, now matches language of translation * Fixed issues with encoding not working 100% * Fixed issue with duplicate URLs of base language Upgrade info; Spoiler (click to open)
v1.x Upgrade instructions:
Delete your old translate database Delete translate.php, translateflags.php and overloadcache.txt Delete both translate plugins Delete code added to header, footer or navbar template Delete /flags/ folder Follow the install instructions above This version requires a fresh install. Features coming in next version: * Meta description and meta keywords will be translated in the output source code, better for SEO and search engine indexing Close
v1.7 * Removed ioncube encryption to bring script inline with vBulletin.org rules v1.6 * Fixed nofollow block on flag links for users with vbseo sites * Fixed adsense ads showing for translation services etc. by adding section targeting ignore tags v1.5 * Fixed database speed issues by using InnoDB instead of MyISAM * Code encrypted with ioncube v1.0 * Script base version Donations received from: Sweeks puertoblack2003 tpearl5 45wheelgun imported_silkroad cyc Thank you! Download
vBGT v2.4.zip (26.5 KB, 35 downloads) Screenshots |
Similar Mods
Miscellaneous Hacks vB Global Translator - Multiply your indexed pages & put search traffic on autopilot | Modification Graveyard |
Miscellaneous Hacks vB Global Translator - Multiply your indexed pages & put search traffic on autopilot | Modification Graveyard |