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)
-   -   End-User Options - Language Driven Forums (https://vborg.vbsupport.ru/showthread.php?t=230899)

Enlightning Man 04-30-2010 05:40 PM

Ok, I just noticed, that there is a little more to adjust to make it fully working in vB4...

The use of the vB template system of this plugin is deprecated. This results in PHP warnings which are thrown on the profile page under general settings (where you are supposed to be able to select if the forum should only show forums configured for your own language or all forums that are available).

The warning came from a deprecated use of vBulletin's template system in the language plugin hook: profile_complete.

In the plugin manager select 'Lang Driven Forum - Show Form in Edit Options' and replace the deprecated code:

PHP Code:

//not working
if($show['languageoption'])
{
    
$langforced = ($vbulletin->userinfo['languagecode_forced']) ? 'selected="selected"':'';
    eval(
'$nex_lang_driven_forced = "' fetch_template('nex_lang_driven_forced') . '";');
    
$template_hook['usercp_options_other'] = $nex_lang_driven_forced $template_hook['usercp_options_other'];


with this code:

PHP Code:

//working
if($show['languageoption'])
{
    
$vbphrase['nexia_forum_languageforce_selected'] = ($vbulletin->userinfo['languagecode_forced']) ? 'selected="selected"':'';
    
$nex_lang_driven_template vB_Template::create('nex_lang_driven_forced');    
    
$page_templater->register('nex_lang_driven_forced'$nex_lang_driven_template->render());


This code uses the new vB_Template class used for rendering templates in vB4. The template hook usercp_options_other is not available in vB4 anymore, but we can register ourselves for inclusion in the profile page template by accessing the $page_templater object directly which takes care of the template rendering process in profile.php.
Since local variables are not visible in the context of that new vB_Template class we also have to apply the little hack of registering the option select boxes value as a $vbphrase to make it accessible in the template. This is what this code change performs. (So for you it should only be copy & paste).

The last step for making the select box (which can be found on "Settings" -> "General Settings") visible and properly working is to adjust the templates a bit:
  1. search for the template nex_lang_driven_forced and replace it with this content
    HTML Code:

    <label for="sel_languagecode_forced">$vbphrase[nexia_forum_languagecode_title]</label>
    <select class="primary" name="languagecode_forced" id="sel_languagecode_forced" tabindex="1">
            <option value="0">$vbphrase[nexia_forum_languagecode_seeall]</option>
            <option value="1" $vbphrase[nexia_forum_languageforce_selected]>$vbphrase[nexia_forum_languagecode_mylang]</option>
    </select>
    <p class="description">$vbphrase[nexia_forum_languagecode_text]</p>

    This will use our $vbphrase hack to select the proper option and furthermore adjust the design of the select option to the current default template.

  2. We have to include this template which we registered as 'nex_lang_driven_forced' on the profile page in the profile page's template.
    So search for the template named 'modifyoptions' and alter the section for 'languageoption' at the very end:

    HTML Code:

    <vb:if condition="$show['languageoption']">
            <div class="blockrow">
                    <label for="sel_languageid">{vb:rawphrase board_language}</label>
                    <select class="primary" name="languageid" id="sel_languageid" tabindex="1">
                            <option value="0">{vb:rawphrase use_forum_default}</option>
                            {vb:raw languagelist}
                    </select>
                    <p class="description">{vb:rawphrase board_can_be_shown_any_language}</p>
            </div>
    </vb:if>

    Add an additional 'div' element which will contain the language display option:

    HTML Code:

    <vb:if condition="$show['languageoption']">
            <div class="blockrow">
                    <label for="sel_languageid">{vb:rawphrase board_language}</label>
                    <select class="primary" name="languageid" id="sel_languageid" tabindex="1">
                            <option value="0">{vb:rawphrase use_forum_default}</option>
                            {vb:raw languagelist}
                    </select>
                    <p class="description">{vb:rawphrase board_can_be_shown_any_language}</p>
            </div>
            <div class="blockrow">
                    {vb:raw nex_lang_driven_forced}
            </div>
    </vb:if>


Save and now it should work. Well it did for me anyway :)

Nephalim 04-30-2010 06:32 PM

Quote:

Originally Posted by Enlightning Man (Post 2029149)
Well I see only german and english.
I guess it depends on what you have installed as front end language packs in your system.

Wow, well if you have the German language pack,can you send it to me? I have the French.:D

Enlightning Man 04-30-2010 07:18 PM

Sorry Nephalim but I think you're totally in the wrong thread. This is a plugin which will allow you to have forums in your board were people post in different languages. So you can show all your german boards to your german users and all your french boards to your french users while hiding those of the other language.

It has nothing to do with the language of the vBulletin interface.

If you are looking for language packs, just google them or search on the forum at vbulletin.com. They are really easy to find.

LloydApter 06-08-2010 05:52 PM

Just what I was looking for also - many thanks!

Two important questions for me please:

1. Can this feature work on articles, blogs, projects as well as forums?
2. Is there a language select feature for the VB header

Thanks again

mostafa10601 05-14-2011 02:12 PM

dont work correctly ...


All times are GMT. The time now is 03:09 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.01114 seconds
  • Memory Usage 1,755KB
  • 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
  • (3)bbcode_html_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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