vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Miscellaneous Hacks - vB Global Translator - Multiply your indexed pages & put search traffic on autopilot (https://vborg.vbsupport.ru/showthread.php?t=217329)

Sweeks 07-03-2009 11:39 AM

Quote:

Originally Posted by Dave Hybrid (Post 1841905)
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;


Is this update including NLP's update? :up: seems a bit faster now too! thank you :)

Dave Hybrid 07-03-2009 11:42 AM

Quote:

Originally Posted by Sweeks (Post 1841973)
Is this update including NLP's update? :up: seems a bit faster now too! thank you :)

Yep, NLP-er tends to do the DB optimization as MySQL isn't my thing, I'm more features on other bugs.

Yeah, seems even better than before.

Dave Hybrid 07-03-2009 11:43 AM

Also; as you can see 717 pages indexed. site:www.teenforumz.com inurl:?hl=

If you want to see how many translated pages you have indexed goto google and type;

site:domain.com inurl:?hl=

Thanks.

Sweeks 07-03-2009 01:47 PM

Nice one, thanks for the query Dave :up: hope more gain indexing too :)

GoTTi 07-03-2009 02:00 PM

Quote:

Originally Posted by merkaz (Post 1841968)
This maybe becuase :

Firewall blocked google IP .

Curl functions disable on " disable_functions " On PHP ..
This functions must be enabled : curl_exec and curl_init

curl is enabled. im thinking google blocked the site. i cant show adsense ads, thats where it started long time ago...but in earlier post i think on page 4 someone posted the translator dropdown menu thing to add to sites, and i put it on the site and it worked fine....just this mod here wont work with the site. i dunno..

motorola 07-03-2009 02:55 PM

What I supposed to do to,, run the following query's to import the tables. '' in PhP My admin? I'm a noob I dont understand,can someone explain :)

LE: Dont need hely anymore regarding this matter

Now I dont understand this.. :(


Quote:

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 relevent code from the table below.

CThiessen 07-03-2009 03:50 PM

Hi,
@ 2TX will you do an Update of your code for the current version 2.3?
I try to merge that on my own but I had no success.

The chages with:

<!--nttart-->
Do not translate this text
<!--ntend-->
and with the API Key.

What I did:
I put in: <if condition="(THIS_SCRIPT == 'showthread')"> for the flags

The I go to the showthread Template an add on top <!--nttart--> and at the end <!--ntend-->
The I edit the Postbit/Postbit Lagacy Template an ad before the content <!--ntend--> an after the content <!--nttart-->.

So only the "real" Content will be translated. This works very fast.
Show some strange Letters in the not translated parts but I don't care, I i thing Google don't care becuse most of the not translatetd words are not importet for the Content.

As I work with the marcoH1 Add on, I do the same tere so the Headlines will bo alsos transtated.

But this stops working with the Update 2.2

If you may post the code for the current version I realy apriciate.

Thanks
Christian

NLP-er 07-03-2009 03:50 PM

Quote:

Originally Posted by motorola (Post 1842102)
What I supposed to do to,, run the following query's to import the tables. '' in PhP My admin? I'm a noob I dont understand,can someone explain :)

LE: Dont need hely anymore regarding this matter

Now I dont understand this.. :(

Just open any page on your forum, on any browser go to page source and find:

<meta http-equiv="Content-Type" content="text/html; charset=THIS-IS-YOUR-ORIGINALENCODING" />

GamerPerfection 07-03-2009 04:11 PM

Updated.

site:galaxyofstars.co.uk inurl:?hl=
^^ 533 indexed. :)

Dave Hybrid 07-03-2009 04:36 PM

Quote:

Originally Posted by clarkey25 (Post 1842150)
Updated.

site:galaxyofstars.co.uk inurl:?hl=
^^ 533 indexed. :)

Nice one, it's always worked pretty well on your site but now as it grows it will continue to be fast. :up:

NLP-er 07-03-2009 05:13 PM

Quote:

Originally Posted by NLP-er (Post 1841391)
Hello right now google translates non braking spaces to normal spaces what can damage some layouts. To change this behaviour edit vb Global Translator hook

and replace:
Code:

require_once("translate.php");
$output=callback($output);

to:
Code:

$output = str_replace("&nbsp;", "<&nbsp;>", $output);
require_once("translate.php");
$output=callback($output);
$output = str_replace("<&nbsp;>", "&nbsp;", $output);

Thanks :)

Because it was not included in official release once again I strongly reccomend to made this change and also execute those queries on DB:
Code:

delete from wt_cache_short where originaltext like '%&nbsp;%';
delete from wt_cache_medium where originaltext like '%&nbsp;%';
delete from wt_cache where originaltext like '%&nbsp;%';

Other wise it is possible that your cache will be populated by data like
&nbsp;X
&nbsp;&nbsp;X
&nbsp;&nbsp;&nbsp;X

So for same X translation you can have many data in DB. Making mentioned change makes it works faster, and DB is smaller. Also executing those queries on DB will remove all data like listed above and bellow, X will be translated again and after that work without dummy DB filling, and unnecessary querying google for translations. Also indexes should be smaller and faster because there is less common prefixes in originaltext.

Also in my forum many sites have translations like:
Posts: X &nbsp;Y

So now you have translations like i.e.
Posts: 1 &nbsp;213
Posts: 1 &nbsp;6
Posts: 2 &nbsp;213
Posts: 2 &nbsp;6
Posts: 1 &nbsp;100
Posts: 2 &nbsp;100
Posts: 3 &nbsp;100
Posts: 3 &nbsp;213
Posts: 3 &nbsp;6

After my changes you will have less translations. For mentioned examples it will be only:
Posts: 1
Posts: 2
Posts: 3
213
100
6

Once again - I advice those changes

CThiessen 07-03-2009 06:51 PM

Hi;
works pretty good:
Googel.de
Quote:

Ergebnisse 1 - 10 von ungef?hr 7.530 aus brasil-web.de f?r inurl:?hl=
Googel.com
Quote:

Ergebnisse 1 - 10 von ungef?hr 8.070 aus brasil-web.de f?r inurl:?hl=
And most of them are from the time before I add sitemap and "<if condition="(THIS_SCRIPT == 'showthread')">" to the page so Google follow the Links on its own.

Christian

motorola 07-03-2009 07:57 PM

Quote:

Originally Posted by NLP-er (Post 1842138)
Just open any page on your forum, on any browser go to page source and find:

<meta http-equiv="Content-Type" content="text/html; charset=THIS-IS-YOUR-ORIGINALENCODING" />

Ok,thanks.

And what I should add here.. from here,I dont understand,I know,noob question maybe

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 -->

<a rel="novbseo"href="<?php echo (strstr($_SERVER["VBSEO_URI"],'?hl='.@$_GET['hl'])) ? str_replace('?hl='.@$_GET['hl'], '', $_SERVER["VBSEO_URI"]) . '?hl=en' : str_replace('?hl='.@$_GET['hl'], '', $_SERVER["VBSEO_URI"]) . "?hl=en"; ?>"><img src="/flags/United States.gif" alt="English" border="0" /></a>

NLP-er 07-03-2009 08:08 PM

I notice that for some data cache is not used, translation is made again and again cache is populated. So there can be data duplication in DB. It is rare and didn't find out why yet (1 clue - working on that).

If you would like to check do you have data duplication in your cache execute those queries. Execute one by one - each one works on other cache table and tells you how many times and which data is duplicated (1st column duplication counter, 2nd for which originaltext, 3rd for which language):
Code:

select count(*) counter, originaltext, tl from wt_cache_short group by originaltext, tl having count(*) > 1 order by counter desc;

select count(*) counter, originaltext, tl from wt_cache_medium group by originaltext, tl having count(*) > 1 order by counter desc;

select count(*) counter, originaltext, tl from wt_cache group by originaltext, tl having count(*) > 1 order by counter desc;

If someone will find out some rule in those duplicated data it would be great :)


So till it will be solved you can just clear data duplications. I can share my queries to do that, but be aware that those can evaluating for some time and I had to connect by some mysql client on my comp, because by www client server was passing away before query finished it's job.

So if you want to delete data duplication first need to create 2 tables for temporary data:
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;

And when you have those you can execute clearing quereies - note those will leave first translation in your database and only remove next translatioss for same text and language:
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 id from wt_cache_short where (originaltext, tl) in (SELECT originaltext, tl from saver) and id not in (SELECT id from saver));
DELETE FROM wt_cache_short USING wt_cache_short INNER JOIN cleaner ON wt_cache_short.id = cleaner.id;

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 id from wt_cache_medium where (originaltext, tl) in (SELECT originaltext, tl from saver) and id not in (SELECT id from saver));
DELETE FROM wt_cache_medium USING wt_cache_medium INNER JOIN cleaner ON wt_cache_medium.id = cleaner.id;

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 id from wt_cache where (originaltext, tl) in (SELECT originaltext, tl from saver) and id not in (SELECT id from saver));
DELETE FROM wt_cache USING wt_cache INNER JOIN cleaner ON wt_cache.id = cleaner.id;


NLP-er 07-03-2009 08:12 PM

Quote:

Originally Posted by motorola (Post 1842311)
Ok,thanks.

And what I should add here.. from here,I dont understand,I know,noob question maybe

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 -->

<a rel="novbseo"href="<?php echo (strstr($_SERVER["VBSEO_URI"],'?hl='.@$_GET['hl'])) ? str_replace('?hl='.@$_GET['hl'], '', $_SERVER["VBSEO_URI"]) . '?hl=en' : str_replace('?hl='.@$_GET['hl'], '', $_SERVER["VBSEO_URI"]) . "?hl=en"; ?>"><img src="/flags/United States.gif" alt="English" border="0" /></a>

Just remove whole line with your language flag. Same result.

motorola 07-03-2009 08:40 PM

My forum dont load now,I see just a blank page,what happens?

LE: I found if I upload file translateflags.php forum doesnt load anymore,if I delete the file from the server it works.

TheLastSuperman 07-04-2009 12:14 AM

Quote:

Originally Posted by Dave Hybrid (Post 1840265)
Exactly, would you delete normal posts because your DB got a big big?

No, you'd keep them and upgrade the server if needed, so what's the difference... lol.

People worried about gaining too much content, that's a new one he he.

Not really, I help so many you would be surprised now think about all the ways this can sneak up on someone besides a post saying be careful of what might happen never hurts and is always rather helpful to those who are not even as far along in regards to vB as you are ;). You don't have to like what I say or agree with it based on your knowledge of vB but I have ran into many occasions where this would have made a difference and not for the positive so as long as others are aware IF they don't take the time to know then they might learn soon enough you see why I posted now?

Thanks!

S-MAN

Dave Hybrid 07-04-2009 10:44 AM

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);

replace:
Code:

$output = str_replace("&nbsp;", "<&nbsp;>", $output);
require_once("translate.php");
$output=callback($output);
$output = str_replace("<&nbsp;>", "&nbsp;", $output);

Run this DB query:

Code:

delete from wt_cache_short where originaltext like '%&nbsp;%';
delete from wt_cache_medium where originaltext like '%&nbsp;%';
delete from wt_cache where originaltext like '%&nbsp;%';

Then optimize all 3 tables to remove overhead.

LI_Pets 07-04-2009 12:23 PM

Been watching this develop, so just one tweak is needed for vBseo?

How many languages will be used all 28?

Or do I chose them?

da_judge 07-04-2009 01:06 PM

Great addition, but im getting this problem

Installed yesterday... and i understand its got loads pages to translate...

If i translate home page... works fine... but if i try a forum or forum page all i get is

(French One)

Forum spécifié non valide. Si vous avez suivi un lien valide, s'il vous plaît aviser le administrateur

Translates into

Not valid specified forum. If you followed a link validates, please to notify the administrator

Is it a case of just waiting or is there a problem.... its been installed near 20 hours so far

Cheers

Dave Hybrid 07-04-2009 01:11 PM

Quote:

Originally Posted by da_judge (Post 1842653)
Great addition, but im getting this problem

Installed yesterday... and i understand its got loads pages to translate...

If i translate home page... works fine... but if i try a forum or forum page all i get is

(French One)

Forum sp?cifi? non valide. Si vous avez suivi un lien valide, s'il vous pla?t aviser le administrateur

Translates into

Not valid specified forum. If you followed a link validates, please to notify the administrator


Is it a case of just waiting or is there a problem.... its been installed near 20 hours so far

Cheers

Sounds like a problem, what is your URL?

da_judge 07-04-2009 01:24 PM

I will PM you m8.... with test account

CThiessen 07-04-2009 01:39 PM

Hi,
Users don?t like to wait for an translation and I don?t know how long Google will wait for the translated page. Maybe if Google followed the first time a link an ever get the same timestamp in the sitemap it will take a while until Google crawl this site again.
So the best thing might be to put all the old sites in the database.
I used XLink to check my links but it doesn?t work with not translated pages if its nessary to wait for the Translation. The result is a time out.
So I check some other Link Checkers an I am satisfied with CyberSpyder Link Test.

So how to put all old pages in the databse.

You need:
  • a old computer, that you don?t need for a day or a week (belongs to the number of pages your form has)
  • CyberSpyder Link Test
In the Link Tester you are able to set up:
  • Max. Request per minute
  • Max parallel Test
  • waiting time ? set this up 120sec to wait for the translated page
Try out the best values for ?Max. Request per minute? and ?Max. Parallel Test? to not overload your Server.

Be passion and enjoy the result.
Christian

jaryx 07-04-2009 01:44 PM

Maybe I'd overlooked..., but I have not translated Relevant Replacements set in vBseo (H1, H2)
Any solution?

ps.
vbSEO 1.0 style

da_judge 07-04-2009 01:50 PM

Quote:

Originally Posted by Dave Hybrid (Post 1842660)
Sounds like a problem, what is your URL?

All sort now thanks Dave.... i was using wrong files... VBSEO ones are for the paid version... not the free indexer on here

Great work Dave and Thanks

Dave Hybrid 07-04-2009 01:55 PM

Quote:

Originally Posted by da_judge (Post 1842679)
All sort now thanks Dave.... i was using wrong files... VBSEO ones are for the paid version... not the free indexer on here

Great work Dave and Thanks

No, the files are for if you run standard urls or vbseo style urls.

You have vbseo but are still running the standard vbulleting url type.

Dave Hybrid 07-04-2009 02:00 PM

Quote:

Originally Posted by CThiessen (Post 1842670)
Hi,
Users don?t like to wait for an translation and I don?t know how long Google will wait for the translated page. Maybe if Google followed the first time a link an ever get the same timestamp in the sitemap it will take a while until Google crawl this site again.
So the best thing might be to put all the old sites in the database.
I used XLink to check my links but it doesn?t work with not translated pages if its nessary to wait for the Translation. The result is a time out.
So I check some other Link Checkers an I am satisfied with CyberSpyder Link Test.

So how to put all old pages in the databse.

You need:
  • a old computer, that you don?t need for a day or a week (belongs to the number of pages your form has)
  • CyberSpyder Link Test
In the Link Tester you are able to set up:
  • Max. Request per minute
  • Max parallel Test
  • waiting time ? set this up 120sec to wait for the translated page
Try out the best values for ?Max. Request per minute? and ?Max. Parallel Test? to not overload your Server.

Be passion and enjoy the result.
Christian

Google and the other search engines crawl and index the pages just fine, after the initial translation the pages load as fast as regular pages. On one site I have nearly a 100k of these pages indexed and bringing traffic. That said this could speed up the indexing a bit by pre-translating them so the load instant the first time Google visits, which isn't a bad thing. Thanks.

valendono 07-04-2009 03:22 PM

if we are upgrading from the old version.. can u give us the steps or u want us to remove everything then start from 0 ?

Dave Hybrid 07-04-2009 03:34 PM

Quote:

Originally Posted by valendono (Post 1842744)
if we are upgrading from the old version.. can u give us the steps or u want us to remove everything then start from 0 ?

What version are you upgrading from?

The second post here details from v1 to v2

Then the various v2 upgrades are scattered in the thread.

NLP-er 07-04-2009 06:46 PM

Quote:

Originally Posted by Dave Hybrid (Post 1842750)
What version are you upgrading from?

The second post here details from v1 to v2

Then the various v2 upgrades are scattered in the thread.

Could be good idea to put links to those posts in mod description... This is really long conversaiton here and will be even longer :)

Megatr0n 07-04-2009 07:35 PM

Hi,

I got it working on my site but check out what it looks like when I translate to Japanese?

www.gupshupp.com

Dave Hybrid 07-04-2009 07:41 PM

Quote:

Originally Posted by Megatr0n (Post 1842833)
Hi,

I got it working on my site but check out what it looks like when I translate to Japanese?

www.gupshupp.com

http://www.gupshupp.com/forums/?hl=ja

Looks perfectly fine to me.

Dave Hybrid 07-04-2009 07:42 PM

Quote:

Originally Posted by CThiessen (Post 1842670)
Hi,
Users don?t like to wait for an translation and I don?t know how long Google will wait for the translated page. Maybe if Google followed the first time a link an ever get the same timestamp in the sitemap it will take a while until Google crawl this site again.
So the best thing might be to put all the old sites in the database.
I used XLink to check my links but it doesn?t work with not translated pages if its nessary to wait for the Translation. The result is a time out.
So I check some other Link Checkers an I am satisfied with CyberSpyder Link Test.

So how to put all old pages in the databse.

You need:
  • a old computer, that you don?t need for a day or a week (belongs to the number of pages your form has)
  • CyberSpyder Link Test
In the Link Tester you are able to set up:
  • Max. Request per minute
  • Max parallel Test
  • waiting time ? set this up 120sec to wait for the translated page
Try out the best values for ?Max. Request per minute? and ?Max. Parallel Test? to not overload your Server.

Be passion and enjoy the result.
Christian

Is it me or is that software really slow, It take ages to crawl normal pages too.

merkaz 07-04-2009 08:10 PM

Quote:

Originally Posted by Megatr0n (Post 1842845)
Please see screenprint:

i think you must have JP language in your PC ..
I think it works fine with google and people how has JP language .

merkaz 07-04-2009 08:14 PM

Hello Dave ,

" $enablesession " Not work with me now ..
Can you check on it ?

Dave Hybrid 07-04-2009 08:22 PM

Quote:

Originally Posted by merkaz (Post 1842851)
Hello Dave ,

" $enablesession " Not work with me now ..
Can you check on it ?

Why are you editing that, it did not say to do so in the instructions.

merkaz 07-04-2009 09:22 PM

Quote:

Originally Posted by Dave Hybrid (Post 1842855)
Why are you editing that, it did not say to do so in the instructions.

If someone translate the page then went to another one it back to original language ..

" $enablesession " save the session in the visitor language . isn't ?

NLP-er 07-04-2009 10:47 PM

Quote:

Originally Posted by NLP-er (Post 1842327)
I notice that for some data cache is not used, translation is made again and again cache is populated. So there can be data duplication in DB. It is rare and didn't find out why yet (1 clue - working on that).

So ok - my clue is - hazard. When 2 pages with same not translated text are generating in same time it is possible that booth will find in cache nothing, booth will translate and booth will put it to cache. It can be easily resolved just by changing INDEX to UNIQUE. It will resolve data duplication, but...

I don't want to do this because afraid of errors when 2nd translation will be inserted. Because I cannot reproduce it in browser, I don't know how it will behave. Possible behavior is that 2nd translation just get error during insertion and just go further and everything is fine for end user (spider). But other possibility is that during that error 2nd page generation will fail (i.e. white screen). Note that even in this situation it can happen only once per page, and only when we have this hazard situation.

So does someone knows what really will happen (white page, error on page, or just silent mysql error and normal generation)? :)

NLP-er 07-04-2009 11:04 PM

Ok - already found good solution for that :) So I will give you better solution today :)

Sweeks 07-05-2009 12:32 AM

It seems to have ceased working for me, I may try a reinstall, what is best Dave? Thanks :up:


All times are GMT. The time now is 10:26 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.07133 seconds
  • Memory Usage 1,906KB
  • 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
  • (10)bbcode_code_printable
  • (24)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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