PDA

View Full Version : Solved Only links in navbar (homepahe and forum) links are only English related



ctrenks
23-07-15, 19:15
I have an issue with the home (allfreechips) and fourm buttons on my navbar, these are not getting the site.com/lang/ added. All other links appear to work as expected with the /lang/ sections.

Thanks
Chris

Marcin Kalak
24-07-15, 09:15
Quick fix for this issue:

Open file includes/vbenterprisetranslator_functions.php
Find code:

$output = preg_replace_callback('#action="([^"]*)#s', 'vbet_createURLForAddressNoReplaceAction', $output);
$output = preg_replace_callback('#href="([^"]*)#s', 'vbet_createURLForAddressNoReplaceHref', $output);
Replace it to code:


$output = preg_replace_callback('#action=["\']([^"\']*)["\']#s', 'vbet_createURLForAddressNoReplaceAction', $output);
$output = preg_replace_callback('#href=["\']([^"\']*)["\']#s', 'vbet_createURLForAddressNoReplaceHref', $output);

Find code:

function vbet_createURLForAddressNoReplaceAction($what) {
return 'action="'.vbet_createURLForAddressNoReplace($_REQUEST['language'], $what[1]);
}
function vbet_createURLForAddressNoReplaceHref($what) {
return 'href="'.vbet_createURLForAddressNoReplace($_REQUEST['language'], $what[1]);
}
Replace it to code:


function vbet_createURLForAddressNoReplaceAction($what) {
return 'action="'.vbet_createURLForAddressNoReplace($_REQUEST['language'], $what[1]).'"';
}
function vbet_createURLForAddressNoReplaceHref($what) {
return 'href="'.vbet_createURLForAddressNoReplace($_REQUEST['language'], $what[1]).'"';
}


This issue will be fixed in the next release.

ctrenks
24-07-15, 14:22
Text on the first section was a bit off, but replacing this is correcting the issue.



$output = preg_replace_callback('#action="([^"]*)#', 'vbet_createURLForAddressNoReplaceAction', $output);
$output = preg_replace_callback('#href="([^"]*)#', 'vbet_createURLForAddressNoReplaceHref', $output);

ctrenks
24-07-15, 14:41
Not sure if this is caused by the change or somthing I have not noticed

if I am on a review page such as


http://www.allfreechips.com/no/casino_review/646/loco-panda-casino.html

the links to other languages are incorrect.


http://www.allfreechips.com/phpBB2/no/nl/casino_review/646/loco-panda-casino.html

See for dutch it is adding phpBB2/ and /nl and keeping the no
This is way off of course adding the forum path and another lang

Marcin Kalak
24-07-15, 16:01
This is another issue that occurred after correcting a previous issue.
Quick fix for this issue:

Open file includes/vbenterprisetranslator_functions_url_tracking.php
Find code:


if ($vbulletin->options['vbenterprisetranslator_translationlinkstype']) {
return vbet_createURLForAddressNoReplaceSEO($language, $address) ;
}
$bookmark = strpos($address, '#');

Replace it to code:


if ($vbulletin->options['vbenterprisetranslator_translationlinkstype']) {
if (preg_match('/\/('.VBET_LANGUAGESMATCH.')\//', $address)) {
return $address;
}
return vbet_createURLForAddressNoReplaceSEO($language, $address) ;
}
$bookmark = strpos($address, '#');


This issue will be fixed in the next release. Sorry for the confusion.

ctrenks
25-07-15, 15:00
Corrected, thanks

Marcin Kalak
25-07-15, 18:06
I'm glad I could help you.

AfrikaansAlbanianArabicBelarusianBulgarianCatalanChineseCroatianCzechDanishDutchEnglishEstonianFilipinoFinnishFrenchGalicianGermanGreekHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKoreanLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishTaiwaneseThaiTurkishUkrainianVietnameseWelshYiddish
Translations supported by vB Enterprise Translator 4.10.1