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)
-   -   Forum Display Enhancements - vB Enterprise Translator (https://vborg.vbsupport.ru/showthread.php?t=220886)

imported_silkroad 08-19-2009 04:39 PM

Quote:

Originally Posted by T2x (Post 1870528)
Ss far as imported_silkroad, I went over the code he sent me back and it turns out when he was modifying it he made a small typo that ended up causing the crash.

Stupid me :mad:

Sorry about that :o

(Thanks!)

NLP-er 08-19-2009 04:52 PM

Quote:

Originally Posted by TheLastSuperman (Post 1870262)
Ok, table gone new one up and settings are correct:

URL tracking
If on then to URL's from your forum domain will be added language param. In other words with this option when you translate to some language, then going to other page will keep translation. = YES

It still won't carry over :(

Still nice they can simply click but it would be nice :erm: but if you think of anything else let me know & thanks regardless for the help.

S-MAN

ALREADY RELEASED

I will made today new minor release with some bugs fixed - also for tracking. If in new version you sill will have trouble PM me - describe situation and give link to your forum.

NLP-er 08-19-2009 04:54 PM

Quote:

Originally Posted by T2x (Post 1870306)
Okay I have updated my vBSEO url formatting code ONE MORE TIME :D

And hopefully this is the final time that it will be necessary.

I had come to the realization that I was using an old version of the vBSEO htaccess and that although the code worked okay for some people, anybody with the latest version would have problems.

The code is updated now to take both situations into account so it will work with the latest version and be backwards compatible for a few versions back :D

You can find the post here:

https://vborg.vbsupport.ru/showpost....&postcount=181


Sorry man - still have same problem I will PM you all my $_SERVER parameters for main page and for thread page.

NLP-er 08-19-2009 05:05 PM

Quote:

Originally Posted by chick (Post 1870403)
Donated, thank you, MOTM vote. This is a great tool.

Great thanks :):up: Still working on new features which will made it even better :D

NLP-er 08-19-2009 05:45 PM

1.1.1 RELEASED

What's changed:
- Re-encode not translated parts, so there is no strange signs in scripts, images title etc.
- Corrected flag for Sweden
- Few harmless bug fixed in translation tracking and cache disabling
- Respecting Google conditions, default flags title have link to Google (configurable)

About last one - if you made update then it will not change your settings. So for those who like to respect Google wish this is example for flags title with Google link:
Code:

Automatic Translations made by <a target="_blank" href="http://www.google.com">Google</a>:

Megatr0n 08-19-2009 06:00 PM

NLP-er, do we have to update all the files and import the product file for this update to take affect?

NLP-er 08-19-2009 06:03 PM

Quote:

Originally Posted by Megatr0n (Post 1870605)
NLP-er, do we have to update all the files and import the product file for this update to take affect?

Upload + import product file with overwrite :) Upload everything - one flag was changed.

NLP-er 08-19-2009 06:10 PM

Quote:

Originally Posted by T2x (Post 1870306)
Okay I have updated my vBSEO url formatting code ONE MORE TIME :D

And hopefully this is the final time that it will be necessary.

I had come to the realization that I was using an old version of the vBSEO htaccess and that although the code worked okay for some people, anybody with the latest version would have problems.

The code is updated now to take both situations into account so it will work with the latest version and be backwards compatible for a few versions back :D

You can find the post here:

https://vborg.vbsupport.ru/showpost....&postcount=181

Ok - It works without redirection, but still not working for main page - for all otker it's working.

When it will be ready and working also for frums which are not in main directory (http://domain/forum) then I will start working on new release where links by default will be in new format.

Do you agree if I use your code to change vbSEO? I will set your code between coments which give you credit for that and also write thanks in mod description :)

T2x 08-19-2009 06:40 PM

Quote:

Originally Posted by NLP-er (Post 1870616)
Ok - It works without redirection, but still not working for main page - for all otker it's working.

When it will be ready and working also for frums which are not in main directory (http://domain/forum) then I will start working on new release where links by default will be in new format.

Do you agree if I use your code to change vbSEO? I will set your code between coments which give you credit for that and also write thanks in mod description :)


Yeah that sounds good.

Alright I have fixed it now for the main page:

https://vborg.vbsupport.ru/showpost....&postcount=181

If you are having any issues now, check your htaccess for any kind of rewrite rules on your main page.

Ill start working on making it compatiable with the www.website.com/forums/lang format

imported_silkroad 08-19-2009 07:01 PM

Quote:

Originally Posted by NLP-er (Post 1870616)
OWhen it will be ready and working also for frums which are not in main directory (http://domain/forum) then I will start working on new release where links by default will be in new format.

Hey NLP-er,

When you include this in a release, I recommend the following:

(1) Put the code T2x is working on in it's own file, for example "./includes/t2x_vbseo.php"

(2) Then, simply add one line in vbseo.php, something like:

Code:

include_once('includes/t2x_vbseo.php');
This will be much easier for folks to install and maintain, and easier for you as well.

Plus, if anyone has a problem, they can simply comment out one line.

Or, even better, you can add a configuration flag and make it so users can turn it on and off in the configuration CP. :D

Code:

if (T2X_VBSEO_ENABLED) include_once('includes/t2x_vbseo.php');
.... something like that

NLP-er 08-19-2009 07:23 PM

Quote:

Originally Posted by T2x (Post 1870623)
Yeah that sounds good.

Alright I have fixed it now for the main page:

https://vborg.vbsupport.ru/showpost....&postcount=181

If you are having any issues now, check your htaccess for any kind of rewrite rules on your main page.

Ill start working on making it compatiable with the www.website.com/forums/lang format

Still have redirect on main page

NLP-er 08-19-2009 07:25 PM

Quote:

Originally Posted by imported_silkroad (Post 1870630)
Hey NLP-er,

When you include this in a release, I recommend the following:

(1) Put the code T2x is working on in it's own file, for example "./includes/t2x_vbseo.php"

(2) Then, simply add one line in vbseo.php, something like:

Code:

include_once('includes/t2x_vbseo.php');
This will be much easier for folks to install and maintain, and easier for you as well.

Plus, if anyone has a problem, they can simply comment out one line.

Or, even better, you can add a configuration flag and make it so users can turn it on and off in the configuration CP. :D

Code:

if (T2X_VBSEO_ENABLED) include_once('includes/t2x_vbseo.php');
.... something like that

Thanks for advice :) I was already thinking about this and have in mind solution without any editing of vbseo.php (made not finishing rule in .htaccess) hope it will work :)

Will start working on this when new link format will work also for forums in sub directory :)

imported_silkroad 08-20-2009 05:11 AM

Quote:

Originally Posted by NLP-er (Post 1870639)
Still have redirect on main page

We installed the latest t2x_vbseo.php code.

It seems to be OK now (great job!), except on the main page, same as NLP-er.

Cheers and Thanks!

imported_silkroad 08-20-2009 06:46 AM

FYI, for those of you who install the t2x_vbseo.php code, note that you can easily 301 your original language back to the original site (to avoid possible duplicate content issues).

For example, for English create a directory in your forum root called 'en'.... then you can create a .htaccess file as follows, in that directory:

Code:

RewriteEngine on
RewriteRule (.*) http://www.YOURSITE.com/$1  [L,R=301]

Make sure you change YOURSITE to your site :D

imported_silkroad 08-20-2009 09:15 AM

Dear NLP-er and T2x,

This rewrite rule:

Code:

RewriteCond %{QUERY_STRING} (hl=|language=)(..|zh-TW|zh-CN)
RewriteRule ^(.*)$ http://%{HTTP_HOST}/%2/$1? [L,R=301]

Needs to be changed to:

Code:

RewriteCond %{QUERY_STRING} (hl=|language=)(zh-TW|zh-CN|..)
RewriteRule ^(.*)$ http://%{HTTP_HOST}/%2/$1? [L,R=301]

If you don't put the ".." match on the end, it will match zh before zh-TW and zh-CN.

T2x 08-20-2009 09:33 AM

Okay I have updated my code on page 13 to the latest after all of the fixes for the various bugs :D

Still a few to sort out but its looking very nice

imported_silkroad 08-20-2009 09:36 AM

Quote:

Originally Posted by T2x (Post 1870919)
Okay I have updated my code on page 13 to the latest after all of the fixes for the various bugs :D

Still a few to sort out but its looking very nice

Request: Can you put some version numbers on your code on page 13 when you make changes? Thanks!

Konstantinos 08-20-2009 10:18 AM

how can we make this to work for addons like photopost gallery ?

Megatr0n 08-20-2009 12:06 PM

NLP-er, you said this will translate in 42 different languages but I do not see 42 flags?

Do you if Urdu will ever be available?

imported_silkroad 08-20-2009 12:14 PM

Quote:

Originally Posted by Megatr0n (Post 1870991)
NLP-er, you said this will translate in 42 different languages but I do not see 42 flags?

Do you if Urdu will ever be available?

Here you can see the languages supported by Google Translate:

http://translate.google.com/translate_tools?hl=en

Note: Urdu is not in the list.

Here is another view of the same list:

http://translate.google.com/?hl=en#

Code:

Languages available for translation (Google's List)

Albanian
Arabic
Bulgarian
Catalan
Chinese
Croatian
Czech
Danish
Dutch
English
Estonian
Filipino
Finnish
French
Galician
German
Greek
Hebrew
Hindi
Hungarian
Indonesian
Italian
Japanese
Korean
Latvian
Lithuanian
Maltese
Norwegian
Persian
Polish
Portuguese
Romanian
Russian
Serbian
Slovak
Slovenian
Spanish
Swedish
Thai
Turkish
Ukrainian
Vietnamese


imported_silkroad 08-20-2009 12:21 PM

OBTW,

If you want to see a pretty good "the lay of the land" regarding Machine Translation Applications:

Visit this link:

http://en.wikipedia.org/wiki/Compari...n_applications

imported_silkroad 08-20-2009 12:57 PM

OBTW, I just wanted to say (it again)......

This mod is really making great strides toward a first class mod, especially considering it was released on Aug 14th.

The features that have been added insure that the mod is fully configurable in compliance with the Google Terms of Service (TOS).

Also, the new code under development by T2x that gets rid of the language attribute parameter and rewrites it to a very SEO friendly structure, is a leap ahead for this mod.

We installed the new t2x_vbseo.php code and it is running live quite well.

More interesting, is that I have noticed a difference in how GoogleBot crawls the site, and the crawling seems better with the new t2x_vbseo code.

For those of you who don't know. T2x also created the original code to use the Google AJAX Search API key, which is an included option in NLP-ers version.

So, if anyone has any spare change or bucks, you might also consider sending a PM to T2x and getting his PayPal account details. We certainly plan to PP some "cheese" over to him when this is all tested and running in the maze.

Thanks to NLP-er and T2x for all the very hard work.

When the dust settles and much of the current debugging and testing efforts cool down, we also need to look into adding at least one more optional translation service API, so the mod is not 100% dependent on one service provider.

imported_silkroad 08-20-2009 01:13 PM

1 Attachment(s)
Also, I wanted to add that if anyone has any ideas how to improve the issues that this mod seems to perform (2) a lot of joins without indexes and (2) write a lot of tmp tables to disk (see screen shots), that would be great :-)

NLP-er 08-20-2009 02:59 PM

Quote:

Originally Posted by imported_silkroad (Post 1870872)
FYI, for those of you who install the t2x_vbseo.php code, note that you can easily 301 your original language back to the original site (to avoid possible duplicate content issues).

For example, for English create a directory in your forum root called 'en'.... then you can create a .htaccess file as follows, in that directory:

Code:

RewriteEngine on
RewriteRule (.*) http://www.YOURSITE.com/$1  [L,R=301]

Make sure you change YOURSITE to your site :D

I think it is not necessary - for default language this mod creates flag with no language, so there is on any different link pointing at same content :)

NLP-er 08-20-2009 03:05 PM

Quote:

Originally Posted by Konstantinos (Post 1870931)
how can we make this to work for addons like photopost gallery ?

Give me link to this gallery and tell which version of mod you are using? :)

NLP-er 08-20-2009 03:09 PM

Quote:

Originally Posted by Megatr0n (Post 1870991)
NLP-er, you said this will translate in 42 different languages but I do not see 42 flags?

Do you if Urdu will ever be available?

Yeap - 42 languages supported and will be 43 in next release (Persian added). If you see less flags - go to configuration and turn on other flags :)

About Urdu - ask Google :) Whatever they will support I will support :)

NLP-er 08-20-2009 03:11 PM

Quote:

Originally Posted by imported_silkroad (Post 1870995)
OBTW,

If you want to see a pretty good "the lay of the land" regarding Machine Translation Applications:

Visit this link:

http://en.wikipedia.org/wiki/Compari...n_applications

Great thanks - will be helpful in the future :) right now I have to much new features to handle new engines - but will look at it :)

NLP-er 08-20-2009 03:17 PM

Quote:

Originally Posted by imported_silkroad (Post 1871021)
For those of you who don't know. T2x also created the original code to use the Google AJAX Search API key, which is an included option in NLP-ers version.

So, if anyone has any spare change or bucks, you might also consider sending a PM to T2x and getting his PayPal account details. We certainly plan to PP some "cheese" over to him when this is all tested and running in the maze.

Thanks to NLP-er and T2x for all the very hard work.

Agree - send thanks and support to T2x for his work :)

But - code to add API key is mine ;)

imported_silkroad 08-20-2009 03:18 PM

Quote:

Originally Posted by NLP-er (Post 1871083)
I think it is not necessary - for default language this mod creates flag with no language, so there is on any different link pointing at same content :)

That's great! I look forward to porting over from hl= to language= :D

imported_silkroad 08-20-2009 03:23 PM

Quote:

Originally Posted by NLP-er (Post 1871093)
Agree - send thanks and support to T2x for his work :)

But - code to add API key is mine ;)

Sorry! I thought you used the idea from the code he posted before on the topic, in the hl mod.

Anyway, I recall T2x had a post with that code a while back and suggested we use the API. (I am using still using that code until I finally port to your mod).

Great job both of you!

NLP-er 08-20-2009 03:35 PM

Quote:

Originally Posted by imported_silkroad (Post 1871034)
Also, I wanted to add that if anyone has any ideas how to improve the issues that this mod seems to perform (2) a lot of joins without indexes and (2) write a lot of tmp tables to disk (see screen shots), that would be great :-)

Actually joins are made only if you use selecting by serie (which is configurable) and are joining by serie which is indexed and is a number (so it is very fast to compare).

I see your screen shots and I'm very surprised - you are sure that this is about this mod ;)

Look yourself to product file - each table has index for serie, and look in to vbenterprisetranslator_functions.php on SELECT queries - all 3 which joins tables are using serie to join... Maybe I miss something but I'm still sure that all joins in my mod are made with indexes. So - unless you show me exactly which query causes it I assume that the reason can be in other mod or vB.

About BLOBS. DB is optimized to handle long textes - it means what don't need be in BLOB isn't. Short texts are put into small and medium cache. Long - must be in blob and there is no other way. In SQL you will find VARCHAR(65000) but mySQL will change it to some BLOB or TEXT field. Medium cache is as long as it is possible to be possible to create unique indexes - one char more and unique will not be possible. Also VARCHAR(328) in medium cache statys as varchar. It appears that in older version of mySQL like 4.1.1 it is changed VARCHAR(328) to BLOB, but if someone choose to use old soft which is slower - for me means that he don't need speed, so I optimized it for those who use higher versions :)

Still - if someone have idea to improve - I will gladly read what solution will make it faster :)

NLP-er 08-20-2009 03:38 PM

Quote:

Originally Posted by imported_silkroad (Post 1871096)
Sorry! I thought you used the idea from the code he posted before on the topic, in the hl mod.

Nope :) Didn't know about this post. Just look in Google documentation, found key param and changed very few lines of code :)

imported_silkroad 08-20-2009 03:45 PM

Quote:

Originally Posted by NLP-er (Post 1871104)
AI see your screen shots and I'm very surprised - you are sure that this is about this mod ;)

Ah! That is from the old hl mod (or maybe another mod) .... !! But the issue only started with we installed the "old hl mod" cause I monitor DB performance rather carefully.....

I look forward to seeing the new performance after porting!

Thanks.

FYI, here is part of the T2x Google API code from "before" :

Code:

@curl_setopt($ch, CURLOPT_URL, "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&key=blahbalhjfkljfdlkjfdlkjfdkjfdkjfkdjfkdfjdkpNbYUjebhSesaThcIIYMEFOUC-VHLBB1KJQkw&langpair=".urlencode($fl.'|'.$tl)."&q=".urlencode($text));

NLP-er 08-20-2009 03:47 PM

Quote:

Originally Posted by T2x (Post 1870919)
Okay I have updated my code on page 13 to the latest after all of the fixes for the various bugs :D

Still a few to sort out but its looking very nice

I works on main page now, but all images dissapear. Only on main page - in other places images are ok.

NLP-er 08-20-2009 05:00 PM

Just want to all let you know that I'm ready to make 2.0.0 release :)

I changed code and now links will be generated according to SEO consensus (/en/address) - configurable. Also added some other requeste features :)

Just waiting till T2x fix his code to work appropriatelly in main page and in forums in subdirectories :) Great work T2x :D:up:

Also new release will not require any vbseo.php changes :)

imported_silkroad 08-20-2009 05:12 PM

Quote:

Originally Posted by NLP-er (Post 1871146)
Just want to all let you know that I'm ready to make 2.0.0 release :)

Amazing! :D

This will be MOTY (Mod of the Year!) :cool:

wolfstream 08-20-2009 05:22 PM

Quote:

Originally Posted by NLP-er (Post 1867874)
What is wrong with the paths? :)

Judging by your own base install, everything.
Use one of your own translation links, on the base install, you will see massive image problems and what appear to be script problems (stats loading, etc). This is because of how you have set this up, the paths are pointing to /en/images instead of /images/ , etc.

Sure, this could be just an install thing, but when you provide a demo, it should work, otherwise, people won't install the product.

yahoooh 08-20-2009 05:23 PM

Quote:

Originally Posted by T2x (Post 1869296)
Hey guys, I decided to do some work and make this mod comply with vBSEO's link consensus idea.

What this will do is change all of the translation likes like so:

For example if a page.html is translated into danish, the url will normally be:

www.website.com/page.html?language=da

This will change the format to

www.website.com/da/page.html

This is much better for SEO so I am sure all of you with vBSEO will like this.

WARNING: this will only work properly if your forum is installed at the BASE of your domain, so something like www.website.com/index.php, if your forums are installed at www.website.com/forums/index.php some parts of my code will not work properly for you!!

All you need to do is open up your vbseo.php and add this code right BELOW error_reporting(0);

Make sure it is ABOVE the includes

Code:

if(isset($_GET['vbseourl']))
{
        $processuri = 0;
        if(preg_match('/^..(\/|$)/',$_GET['vbseourl']))
        {
                $processuri = 1;
                $_GET['language'] = substr($_GET['vbseourl'],0,2);
                $_GET['vbseourl'] = substr($_GET['vbseourl'],3);
        }
        else if(preg_match('/^\/..(\/|$)/',$_GET['vbseourl']))
        {
                $processuri = 1;
                $_GET['language'] = substr($_GET['vbseourl'],1,2);
                $_GET['vbseourl'] = substr($_GET['vbseourl'],3);
        }
        else if(substr($_GET['vbseourl'],0,5) == "zh-CN" || substr($_GET['vbseourl'],0,5) == "zh-TW")
        {
                $processuri = 1;
                $_GET['language'] = substr($_GET['vbseourl'],0,5);
                $_GET['vbseourl'] = substr($_GET['vbseourl'],6);
        }
        else if(substr($_GET['vbseourl'],1,5) == "zh-CN" || substr($_GET['vbseourl'],1,5) == "zh-TW")
        {
                $processuri = 1;
                $_GET['language'] = substr($_GET['vbseourl'],1,5);
                $_GET['vbseourl'] = substr($_GET['vbseourl'],6);
        }

        if($processuri == 1)
        {
                if(substr($_SERVER['REQUEST_URI'],0,2)=='//')
                        $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],1);
                $tempuri = isset($_SERVER['HTTP_X_REWRITE_URL']) ? $_SERVER['HTTP_X_REWRITE_URL'] :
                (isset($_SERVER['HTTP_X_ORIGINAL_URL']) ? $_SERVER['HTTP_X_ORIGINAL_URL'] :
                (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] :
                (isset($_ENV['REQUEST_URI']) ? $_ENV['REQUEST_URI'] : $_SERVER['SCRIPT_NAME']))
                );
                if (strstr($tempuri, 'vbseo.php') && $_GET['vbseourl'])
                        $tempuri = preg_replace('#vbseo\.php.*#', $_GET['vbseourl'] . ($_SERVER['QUERY_STRING']?'?'.$_SERVER['QUERY_STRING']:''), $tempuri);
                $tempuri = preg_replace('#\#.*$#', '', $tempuri);
                $_SERVER['REQUEST_URI'] = $tempuri;
                if(preg_match('/^\/..(\/|$)/',$_SERVER['REQUEST_URI']))
                        $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],3);
                else if(substr($_SERVER['REQUEST_URI'],1,5) == "zh-CN" || substr($_SERVER['REQUEST_URI'],1,5) == "zh-TW")
                        $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],6);
                $_SERVER['HTTP_X_REWRITE_URL'] = $_SERVER['REQUEST_URI'];
        }
}
else
{
        $processuri = 0;
        if(substr($_SERVER['REQUEST_URI'],0,2)=='//')
                $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],1);
        $tempuri = isset($_SERVER['HTTP_X_REWRITE_URL']) ? $_SERVER['HTTP_X_REWRITE_URL'] :
        (isset($_SERVER['HTTP_X_ORIGINAL_URL']) ? $_SERVER['HTTP_X_ORIGINAL_URL'] :
        (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] :
        (isset($_ENV['REQUEST_URI']) ? $_ENV['REQUEST_URI'] : $_SERVER['SCRIPT_NAME']))
        );
        $tempuri = preg_replace('#\#.*$#', '', $tempuri);

        if(preg_match('/^..(\/|$)/',$tempuri))
        {
                $processuri = 1;
                $_GET['language'] = substr($tempuri,0,2);
        }
        else if(preg_match('/^\/..(\/|$)/',$tempuri))
        {
                $processuri = 1;
                $_GET['language'] = substr($tempuri,1,2);
        }
        else if(substr($tempuri,0,5) == "zh-CN" || substr($tempuri,0,5) == "zh-TW")
        {
                $processuri = 1;
                $_GET['language'] = substr($tempuri,0,5);
        }
        else if(substr($tempuri,1,5) == "zh-CN" || substr($tempuri,1,5) == "zh-TW")
        {
                $processuri = 1;
                $_GET['language'] = substr($tempuri,1,5);
        }

        if($processuri == 1)
        {
                $_SERVER['REQUEST_URI'] = $tempuri;
                if(preg_match('/^\/..(\/|$)/',$_SERVER['REQUEST_URI']))
                        $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],3);
                else if(substr($_SERVER['REQUEST_URI'],1,5) == "zh-CN" || substr($_SERVER['REQUEST_URI'],1,5) == "zh-TW")
                        $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],6);
                $_SERVER['HTTP_X_REWRITE_URL'] = $_SERVER['REQUEST_URI'];
        }
}


If you want to 301 all of your old pages to the new link format, you can put this in your .htaccess above all of your existing rules

Code:

RewriteCond %{QUERY_STRING} (hl=|language=)(zh-TW|zh-CN|..)
RewriteRule ^(.*)$ http://%{HTTP_HOST}/%2/$1? [L,R=301]

Please note that this code assumes you are running vBSEO.

This code will fix translation for the base of your website if you want the following format. www.website.com/de or www.website.com/de/ . this only applies to your main page.

Code:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?((zh-CN|zh-TW|..))/?$ vbseo.php?vbseourl=$1/index.php [L,QSA]

If you want to generate proper sitemaps with all of your new language urls, all you need to do is open up your vbseo_sitemap_functions.php in your vbseo_sitemap directory then:

find this code

Code:

}else
                                $freq = $vboptions['vbseo_sm_freq_t'];
                                   
                    vbseo_log_entry("[showthread] forum_id: $forumid, thread_id: $threadrow[threadid], total posts: $totalposts, pages: $totalpages, views: $threadrow[views] $prior");

                            for($p=1; $p<=$totalpages; $p++)
                            {

Add this code right after it:

Code:

$alanguages = array('ar', 'bg', 'zh-CN', 'zh-TW', 'hr', 'cs', 'da', 'nl', 'fi', 'fr', 'de', 'el', 'iw', 'hu', 'it', 'ja', 'ko', 'no', 'pl', 'pt', 'ro', 'ru', 'sr', 'sk', 'es', 'sv', 'th', 'tr');
                                        if(!$archived)
                                        foreach($alanguages as $hl) {
                                        $vbseo_stat['t']++;
                                        $currentthreadurl = vbseo_url_thread($threadrow, $p, $archived);
                                        $strlenhost = strlen($vbseo_vars['bburl']."/");
                                        vbseo_add_url(substr($currentthreadurl,0,$strlenhost).$hl."/".substr($currentthreadurl,$strlenhost), 0.3, $threadrow['lastpost'], $freq);
                                        }

make sure its before:

Code:

$vbseo_stat[$archived?'at':'t'] += vbseo_add_2urls(
                                    vbseo_url_thread($threadrow, $p, $archived),
                                    vbseo_url_thread($threadrow, $p, $archived, true),
                                    $prior,
                                    $threadrow['lastpost'],
                                        $freq
                            );
                               
                                }

                            if($showpost)
                            {

                    $getposts = $db->query("

If you notice there is an array in the code that looks like this
Code:

$alanguages = array('ar', 'bg', 'zh-CN', 'zh-TW', 'hr', 'cs', 'da', 'nl', 'fi', 'fr', 'de', 'el', 'iw', 'hu', 'it', 'ja', 'ko', 'no', 'pl', 'pt', 'ro', 'ru', 'sr', 'sk', 'es', 'sv', 'th', 'tr');
You should put the code of every language that you want added to your sitemap file in this array. Mine may differ from the languages you support so make sure you check it against your installation.


Just a note of caution: My fixes assume you are running a standard installation of apache with vBSEO. They may not work properly on some systems due to differences in the way that vBSEO handles some server variables. I recommend that you back up any files before editting them that way if you encounter problems you can restore your old versions.

I will be working on this code more so if any of you have issues please let me know and I will work on them.

If NLP-er would like he can provide a modified version of his flags in order to work with the new format or I will write up the code later today. This is necessary so that the flags show the proper links.

Anyway enjoy guys :D

how to make it work with addon not depend on vbseo like vba links and vba dyna which be only show flags when the requist_url is the setting

yahoooh 08-20-2009 05:25 PM

i hope Nlp can fix the issue related what i talk with him about vbseo_url and requist_url for pages in vba links and vba dyna

any solution to make it work in requist_url and make vbseo as requist_url by some change in vbseo files
it is eazy then to make all the site work

imported_silkroad 08-20-2009 05:38 PM

Quote:

Originally Posted by yahoooh (Post 1871163)
i hope Nlp can fix the issue related what i talk with him about vbseo_url and requist_url for pages in vba links and vba dyna

any solution to make it work in requist_url and make vbseo as requist_url by some change in vbseo files
it is eazy then to make all the site work

FWIW, we run vBa Links and everything works fine (with the old hl mod) and the new t2x_vbseo.php code.

Seems it should be OK with the new language= mod (this mod), since it is better :-)


All times are GMT. The time now is 08:24 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.05068 seconds
  • Memory Usage 1,927KB
  • 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
  • (18)bbcode_code_printable
  • (28)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