vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Miscellaneous Hacks - vB Global Translator - Multiply your indexed pages & put search traffic on autopilot (https://vborg.vbsupport.ru/showthread.php?t=226969)

Dave Hybrid 10-27-2009 10:00 PM

vB Global Translator - Multiply your indexed pages & put search traffic on autopilot
 
1 Attachment(s)
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:

https://vborg.vbsupport.ru/external/2009/10/8.jpg

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!

Dave Hybrid 10-28-2009 06:44 PM

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

COBRAws 10-28-2009 06:46 PM

Great theory, but these translation services wont translate properly.

mbc100 10-28-2009 08:51 PM

do think it will make truble with forum has a big MySQL database

Dave Hybrid 10-28-2009 09:03 PM

Quote:

Originally Posted by mbc100 (Post 1907560)
do think it will make truble with forum has a big MySQL database

Hi, this runs off a separate mysql database so will not interfere at all with your current DB.

Dave Hybrid 10-28-2009 09:04 PM

Quote:

Originally Posted by COBRAws (Post 1907510)
Great theory, but these translation services wont translate properly.

I agree they are not perfect, it is machine translation. The key point is the new pages do pull traffic and you can then convert that traffic via adsense, affiliate offers or into signing up in your forums native language. Thanks.

TheLastSuperman 10-28-2009 09:12 PM

Hmm nice to see this one released and separate DB used too ;)

Marked as Installed, I'll test this out on my private forum later most likely tomorrow or Friday any problems I'll let you know otherwise thanks!

abdobasha2004 10-29-2009 01:54 PM

I think i t is no good for SEO
For a website to rank high, it should target certain language for certain country also ...
I did not see any multilingual sit rank high in search results
I thought to install this mod a lot but I think it is just duplicating content - translated content is considered duplicate too ! ....
however it will be really handfull for a forum that have world wide visitors

Dave Hybrid 10-29-2009 02:18 PM

Quote:

Originally Posted by abdobasha2004 (Post 1907795)
I did not see any multilingual sit rank high in search results

Mine rank just fine. So do many others using this and similar MODs. See the graph below.
Quote:

Originally Posted by abdobasha2004 (Post 1907795)
I thought to install this mod a lot but I think it is just duplicating content - translated content is considered duplicate too

That is not true, the content is a different language so it is not duplicate, it is 100% different. Again, see the analytics graph below.

Graph showing visits from search engines to translated pages ONLY over 4 months.

Yes, that's right, 9000 EXTRA visits per day, and growing. Nearly 3/4 of a MILLION uniques EXTRA in total. :up:

https://vborg.vbsupport.ru/attachmen...1&d=1256829603

gwerzal 10-30-2009 05:14 PM

if i have the other mod installed will this change the urls or am i ok to change

Dave Hybrid 10-30-2009 05:21 PM

Quote:

Originally Posted by gwerzal (Post 1908395)
if i have the other mod installed will this change the urls or am i ok to change

I'm not sure how you have the other MOD setup. You can view the demo site (at the top of the MOD description) and see if the URLs match.

How long have you been running the other MOD?

Thanks.

ShawneyJ 10-31-2009 02:40 AM

hi Dave, i uninstalled this about 3 - 4 months ago, as you closed it down or something happened.
but its good to see it back and i hope you will keep supporting this.
after i uninstall ages ago, i got errors from google pages not found, i didnt realize how good this mod worked till then :D i like this mod as it doesnt get installed on my forum database.
i will for sure install this tomorrow. thanks, good to see it back ;)

Marco van Herwaarden 10-31-2009 06:29 AM

Thread cleaned from flaming & trolling. Do not fight disputes in public but take them in private. The issue is already reported to staff and is being investigated. There is no need to start a public flame war and any further posting like this will be infracted.

dacho 10-31-2009 07:00 AM

Is there a possibility to change design various languages?
For example, in Arabic and Hebrew direction is from left to right

Dave Hybrid 10-31-2009 09:37 AM

Quote:

Originally Posted by dacho (Post 1908611)
Is there a possibility to change design various languages?
For example, in Arabic and Hebrew direction is from left to right

Sure, it's on the list, will be in next update. Thanks for the suggestion.

StarBuG 10-31-2009 10:43 AM

For anyone who is using this mod.

I think it sounds very interesting, however I run a German only forum.

My only concern is that foreign users register at my forum and post in their foreign language,
which would confuse my forum users because it is a german forum.

Does anyone have experience with this mod and how many foreign users register and
try to post in their native language instead of the native language of the forum itself?

And here is an idea that came up during browsing your demo forum:

I think it would be good for users/guest who view translated pages to have a notice show up:

Quote:

This page was translated from "original language" to "foreign language". This is a service that we offer. The gramer may be not correct due to the process of computer translation. Please be aware that this forum is in "original language". If you register only "original language" is supported.
StarBuG

Dave Hybrid 11-02-2009 09:05 AM

Quote:

Originally Posted by StarBuG (Post 1908649)
For anyone who is using this mod.

I think it sounds very interesting, however I run a German only forum.

My only concern is that foreign users register at my forum and post in their foreign language,
which would confuse my forum users because it is a german forum.

Does anyone have experience with this mod and how many foreign users register and
try to post in their native language instead of the native language of the forum itself?

And here is an idea that came up during browsing your demo forum:

I think it would be good for users/guest who view translated pages to have a notice show up:

StarBuG

I have found people dont post in the foreign languages. When they try to register and post the language reverts back to your native language so they either post in that or leave. Many have been using this for months and no such problem exists. Also, yes, feel free to add a notice that it is machine translation, although most can tell anyway and know it is offered as a machine service only and is not perfect. Thanks.

cgway.net 11-03-2009 09:22 PM

how can i include the translated pages to my sitemap

i have used vbseo

Dave Hybrid 11-03-2009 09:28 PM

Quote:

Originally Posted by cgway.net (Post 1909965)
how can i include the translated pages to my sitemap

i have used vbseo

http://www.vbseo.com/f66/adding-some...sitemap-34734/

cgway.net 11-03-2009 10:09 PM

see this post

http://www.vbseo.com/f66/adding-some...tml#post227097

i don't need any problem in my google webmaster

cgway.net 11-03-2009 10:12 PM

i wait your replay

Dave Hybrid 11-03-2009 10:17 PM

Quote:

Originally Posted by cgway.net (Post 1909974)
see this post

http://www.vbseo.com/f66/adding-some...tml#post227097

i don't need any problem in my google webmaster

I believe that was a problem with Google, the errors went away and no one ever reported it to me. I do not get any errors and neither do my friends.

cgway.net 11-03-2009 10:34 PM

thanks for your fast replay

i have install your product and i will test it

thanks for you

Dave Hybrid 11-05-2009 01:02 PM

^^ - You're welcome!

FYI everyone, I am currently having this MOD coded into a proper plugin and admincp options and many new features, watch this space.

Delita 11-05-2009 01:05 PM

Nice ^^

Kolbi 11-05-2009 02:44 PM

Your screen looks nice, but why decreases it so extremly at the end?

Dave Hybrid 11-05-2009 02:55 PM

Quote:

Originally Posted by Kolbi (Post 1910593)
Your screen looks nice, but why decreases it so extremly at the end?

That day had only just started, the day not fully run/stats not updated for that day in analytics.

Kolbi 11-05-2009 03:05 PM

Will there be a negative thing if I will uninstall this mod after a couple of weeks?

Dave Hybrid 11-05-2009 03:59 PM

Quote:

Originally Posted by Kolbi (Post 1910601)
Will there be a negative thing if I will uninstall this mod after a couple of weeks?

You can simply 301 redirect any translated pages back to their native language and they will be dropped by the search engines and everything will revert. To be honest I would never dream of doing that on my sites, the traffic is too good.

mhackl 11-05-2009 06:26 PM

How does this compare to vB Enterprise Translator

Kolbi 11-05-2009 07:24 PM

Quote:

Originally Posted by Dave Hybrid (Post 1910618)
You can simply 301 redirect any translated pages back to their native language and they will be dropped by the search engines and everything will revert. To be honest I would never dream of doing that on my sites, the traffic is too good.

Okay :)
But will it be updated to vb 4.0?

CThiessen 11-06-2009 06:21 PM

Quote:

Originally Posted by mhackl (Post 1910667)
How does this compare to vB Enterprise Translator

see: https://vborg.vbsupport.ru/showpost....&postcount=833
Christian

GTX2 11-07-2009 10:31 PM

could this be working with 3.6.x ?

Dave Hybrid 11-09-2009 12:16 PM

Quote:

Originally Posted by GTX2 (Post 1911443)
could this be working with 3.6.x ?

Yes, should work fine.

Dave Hybrid 11-09-2009 12:16 PM

Quote:

Originally Posted by Kolbi (Post 1910691)
Okay :)
But will it be updated to vb 4.0?

110%. I need it working for my forums, and the new vb suite. Thanks.

GTX2 11-10-2009 03:30 PM

hello,

I've installed this, all seems to be working fine but i don't see any URL rewrite...
Translation is doing fine but all i can see is the default url added with "?hl=en" or "?hl=es", etc at the end....

google has indexed already my main site in all languages, just like www.mysite.net/?hl=en
or www.mysite.net/?hl=it but nothing more....


PS- i'm using vbseo...

Dave Hybrid 11-10-2009 03:53 PM

Quote:

Originally Posted by GTX2 (Post 1912431)
hello,

I've installed this, all seems to be working fine but i don't see any URL rewrite...
Translation is doing fine but all i can see is the default url added with "?hl=en" or "?hl=es", etc at the end....

google has indexed already my main site in all languages, just like www.mysite.net/?hl=en
or www.mysite.net/?hl=it but nothing more....


PS- i'm using vbseo...

If you PM a URL I can take a look.

Bouncer222 12-03-2009 02:26 AM

Do you have to use analytics for this? if not, is there another statistics tool to use? cause im having issues adding analytics html--not sure where to add it to track stats.

thanks.

EDIT:

Where do you add the analytics html code to, so that it grabs site statistics? I got confused on this, it said <BODY> but I have no clue where that is, detailed instructions would be good if anyone can please help! And do I add it to every template or which template(S) do you suggest?

Bouncer222 12-03-2009 02:27 AM

also, how is your site traffic doing now since that image was taken? just curious, mind showing an updated pic with statistics/counters?

EDIT:

Do I or should I tranlate EACH page on my site along with EACH THREAD on my site? because then that will be alot of work, what do you suggest?

I get errors for pages that I customely made when I try to translate them, like my server trackers page, leadership page, and other pages. Here is an example: http://www.brotherhoodofgamers.com/i...eid=leadership

Translate that page to any language (languages are at the footer) and it will show you invalid page specified, why is this?

Bouncer222 12-03-2009 08:30 PM

I get a datase error emailed to me after I translated couple pages...

Quote:

Database error in vBulletin 3.8.4:

Invalid SQL:

UPDATE session
SET lastactivity = 1259879022, location = '/showthread.php?p=327&hl=ru', inforum = 2, inthread = 85, incalendar = 1, badlocation = 0
WHERE sessionhash = '4dd4fa282c89c81f60995a2352360a33';

MySQL Error : MySQL server has gone away
Error Number : 2006
Request Date : Thursday, December 3rd 2009 @ 04:23:42 PM
Error Date : Thursday, December 3rd 2009 @ 04:24:57 PM
Script : http://www.brotherhoodofgamers.com/s...hp?p=327&hl=ru
Referrer : http://www.brotherhoodofgamers.com/showthread.php?p=327
IP Address : 96.250.233.178
Username : Bouncer
Classname : vB_Database
MySQL Version :


All times are GMT. The time now is 04:54 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01542 seconds
  • Memory Usage 1,889KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete