vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   detect forum/language to change language (https://vborg.vbsupport.ru/showthread.php?t=279481)

bhon 03-03-2012 10:48 AM

detect forum/language to change language
 
My forum is mainly targeted for arabic speakers which is a RTL language therefore the default language and interface is Arabic but recently we are thinking of creating subforums in different languages the current one will be in English.

The problem is threads in that forum would not have a good presentation for visitors unless the language is changed to English and the oriantation of writing to be changed from Arabic to English.

I want to place something similar in the template to check which forum this thread or the visitor in and check the language if it saticfies that certain condation the language will be automatically changed.

How can I do that?

Code:

<vb:if condition="$langid=='1'" AND forumid='32'>
$langid=1
</vb:if>


BirdOPrey5 03-05-2012 11:35 AM

Good luck... I spent many an hour trying to get this to work once- but languages don't behave like styles (which can be easily changed) in my experience. I never got it working.

First it needs to be a plugin, not a template conditional, so <vb:if...> is the wrong type of code;

I would have thought something like this on global_bootstrap_init_start would work:

PHP Code:

global $vbulletin;

if (
$GLOBALS['forumid'] == 32)
{
   
$vbulletin->userinfo['languageid'] = 1;



and a bunch of variations on that, but never got it right.


All times are GMT. The time now is 05:15 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.01193 seconds
  • Memory Usage 1,711KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete