Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vB Global Translator - Multiply your indexed pages & put search traffic on autopilot Details »»
vB Global Translator - Multiply your indexed pages & put search traffic on autopilot
Version: 2.5, by Dave Hybrid Dave Hybrid is offline
Developer Last Online: Dec 2013 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.8.4 Rating:
Released: 10-27-2009 Last Update: 10-27-2009 Installs: 31
Uses Plugins Template Edits
Additional Files  
No support by the author.

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. :up:



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.

LIVE DEMO

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;
Next open translate.php, we need to change a few variables to make this work, they are all at the top of the file.

Add your new database details in the relevant fields.

Code:
$dbusername = "dbusername";
$dbpassword = "dbpassword";
$mysqlserver = "localhost";
$dbname = "dbname";
Now change $originalEncoding variable to match your forum base encoding. The default is English (iso-8859-1). You can find your default by viewing the source of one of your forum pages, it is at the top.

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"
Next save translate.php and open translateflags.php.

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("&nbsp;", "<&nbsp;>", $output);
require_once("translate.php");
$output=callback($output);
$output = str_replace("<&nbsp;>", "&nbsp;", $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);
}
Next, edit the en part of 'lang="en"' code on line 3 above to also match your forum base language. The default again is english (en). If different swap to the relevant code from the language table above.

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();
Save and activate.

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 -->
To test the system translate a few pages and make sure your database tables are filling with data. View them in phpmyadmin.

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; https://vborg.vbsupport.ru/showpost....09&postcount=2

v2.4

* More DB optimization, fastest ever read/write cache speed

Upgrade Info; https://vborg.vbsupport.ru/showpost....&postcount=294

v2.3b

* Small change to database optimization

Upgrade info; https://vborg.vbsupport.ru/showpost....&postcount=267

v2.3a

* Small fix to avoid translation of non braking spaces to normal spaces

Upgrade info; https://vborg.vbsupport.ru/showpost....&postcount=218

v2.3

* More change to database optimization.

Upgrade info; https://vborg.vbsupport.ru/showpost....&postcount=198

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; https://vborg.vbsupport.ru/showpost....&postcount=151

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; https://vborg.vbsupport.ru/showpost....&postcount=133

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; https://vborg.vbsupport.ru/showpost....30&postcount=2

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 Now

File Type: zip vBGT v2.4.zip (26.5 KB, 33 views)
File Type: zip vBGT v2.5.zip (26.1 KB, 210 views)

Screenshots

File Type: gif graph.gif (18.7 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 12-03-2009, 08:44 PM
Dave Hybrid's Avatar
Dave Hybrid Dave Hybrid is offline
 
Join Date: Mar 2007
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bouncer222 View Post
I get a datase error emailed to me after I translated couple pages...
Hi there, this is because mysql got bored while waiting for Google to translate the page, it is a false error but the emails are annoying. They go away as you forum pages get translated and saved to the cache database.
Reply With Quote
  #43  
Old 12-03-2009, 08:48 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any plans on a 4.0 release? You might have already posted but I've been all over here today lol. Sorry if you have otherwise let me know

Mike
Reply With Quote
  #44  
Old 12-03-2009, 08:54 PM
Dave Hybrid's Avatar
Dave Hybrid Dave Hybrid is offline
 
Join Date: Mar 2007
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It will happen, just need to get round to it. I need it personally for my sites so it will happen soon. Thanks.
Reply With Quote
  #45  
Old 12-03-2009, 08:56 PM
Bouncer222 Bouncer222 is offline
 
Join Date: Oct 2009
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, appreciate the instant response, sorry for the multiple questions, just wanted to make sure I learn everything clearly about this system. So how exactly would I add analytics to my site? Need detailed instructions and suggested ways.
Reply With Quote
  #46  
Old 12-03-2009, 09:03 PM
Dave Hybrid's Avatar
Dave Hybrid Dave Hybrid is offline
 
Join Date: Mar 2007
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Google analytics? Instructions are on their site.

This thread is for my Translation MOD.
Reply With Quote
  #47  
Old 12-03-2009, 09:07 PM
Bouncer222 Bouncer222 is offline
 
Join Date: Oct 2009
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes it said in the <body> part of the code, I read a whole bunch of tutorials, yet can't figure it out, mind just telling me where your code is pasted?

And should I be translating as much as I can myself in order to increase traffic? Or would it otherwise if I do not translate it myself cause the SEO of my site to only slowly go up or barley go up because other countries won't automatically translate my site?

Thanks.
Reply With Quote
  #48  
Old 12-04-2009, 12:30 AM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave Hybrid View Post
It will happen, just need to get round to it. I need it personally for my sites so it will happen soon. Thanks.

No, thanks to you for the prompt reply.. I'll be waiting on this one (patiently of course )

Mike
Reply With Quote
  #49  
Old 12-04-2009, 03:45 AM
vBB-vietnam vBB-vietnam is offline
 
Join Date: Apr 2006
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it blank page with my translate page
i F5 4-5 times to translate 1 page
can you help me
Reply With Quote
  #50  
Old 12-05-2009, 10:55 PM
Bouncer222 Bouncer222 is offline
 
Join Date: Oct 2009
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a couple good suggestions for 3.8 version meanwhile and 4.0 in future.

Have the translations flags scroll with the browser. So as the viewer scrolls the page down, the translation flags scroll on the bottom middle of browser with the user if you get what I mean.

Have the option so that if for example index.php is translated into russian but no other page for example is translated into russian, or a couple are, and a russian person views index.php, then if he clicks on another page, it will right away translate that page into his language, instead of giving him it as a default language of the forums, makes it easier and faster to translate all pages, and satisfies the viewer.

What you think?

I think that the translation flags to scroll with the browser is very important for it to be noticed. I currently have it at the footer.
Reply With Quote
  #51  
Old 12-06-2009, 08:05 AM
spmatrix spmatrix is offline
 
Join Date: Jul 2009
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, very good, but I have a problem, (I do not know how much it is).

When I select a language, when I change page, puts me again the default language, and I should again select the language.

Is there way to keep the language in each change of page, and not need to select it each time?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:03 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05047 seconds
  • Memory Usage 2,365KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete