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)

vbenhancer 12-22-2009 10:00 PM

Language Driven Forums
 
1 Attachment(s)
With this engine, you have a full control over a Multi-Language forum. If you have a population of english, french, spanish and other languages, you may have a need for this if you have specific forums for each languages...

When you want to enforce the users to only see the forums they can post in, or the ones they can read in their own language, you can edit each of your forums to fit your needs

This is for the Admincp where you edit your forums.

Now you can give your users the ability to choose what kind of forum they can see. On registration or when they edit their Profile options, they have these choices:

Here is when the user is registering: (optional entry)

As an admin, you will continue to see all the forums, but you will see an indication of the language each forum is using, because the languageid for each modified forum will show in the forumlist...
A note coming from Jelsoft, regarding the possibility that a multiple licenses would be required if you use this addon...
Quote:

Originally Posted by Ashley Busby, Jun 12th '08 12:05pm
This is one forum and it can be navigated from any area to any area.

I concur, only one license is required and I am of the opinion that the license agreement is not contravened.

Source: https://www.vbulletin.com/issue.php?...hcode=b44157f3
note: on jan. 2nd, 2010, a query_read was replaced by a query_first... to avoid inconsistancy with mysqli... simply re-import the product...

tafreeh 12-23-2009 01:01 AM

woow... exactly wat i was looking for... but too bad.. i m going live with vb4 tomorrow.. so cant use it else this amazing author can make it compatible with 4.0 :)

vbenhancer 12-23-2009 01:09 AM

amazing author?... thanks... rofl

like i received more than 150 requests to update my stuff to 4.0 in the last 3 days, i suppose i will have to reconsider it... btw as i have to make a living of my spare time, i do not know the best formula to make it so yet... i'll see!

GameFrame 12-27-2009 07:34 PM

Yes, this is also exactly what I need, please update this for vb4.

xorex 12-27-2009 10:33 PM

nice hack ! but error for reg users ((

if set Language Forced on category

Quote:

Fatal error: Cannot break/continue 1 level in includes\functions_forumlist.php(54) : eval()'d code on line 4

saadessa 12-27-2009 10:33 PM

thanks alot for this good job installed

vbenhancer 12-28-2009 11:06 AM

Quote:

Originally Posted by xorex (Post 1939789)
nice hack ! but error for reg users ((

if set Language Forced on category

can you indicate me the place where you get this error?... when you set the language, or when you visit the forum?

EDIT: forget the question, i see the problem... i'll have to change the installation and forget about the hook... vBulletin use eval for the hooks, and it break loops.... the change will be simple, i come back with the solution.

vbenhancer 12-29-2009 03:31 PM

Version changed for 1.5.1, the error in the hook, called xorex is now corrected. Re-upload the product and follow the instructions back in the HowTo.txt file *(remove the hook stuff and place the block of code instead)

xorex 12-30-2009 02:54 PM

Now work fine.

Thanks !

RWerksman 01-02-2010 12:51 AM

I have a very significant issue here:

When new users are attempting to register, they can't as the system (post install) throws the following error:

Code:

Fatal error: Cannot use object of type mysqli_result as array in /xxx/public_html/forum/register.php(385) : eval()'d code on line 39
I attempted to disable the registration pluging with no success. I've now disabled the entire project as folks have to be able to register for the forum. :(

vbenhancer 01-02-2010 12:43 PM

thanks for the report... query_read is making problem with mysqli when not used properly... i had a code error, thanks, it is now corrected, you simply have to re-import the product.

imedic 01-02-2010 04:37 PM

Nice mod. If you click new messages it will display only messages from forums in your language (if you select to see only them) ?
Interesting mod to cope with multilanguage.

Selection of language forums should be in a more prominent position (like on each page or at least forum home) given the fact that you install this only if you have multilanguage users.
Or the en* and en should be links to control panel where you can change settings.

I see very useful this mode if you can exclude from New Messages search the forums not in your language.

swsche 01-02-2010 05:56 PM

It's a very nice and usefull script. But i have a little problem.

When i switch the language in the usercp and i go to the forumhome, logged in as administrator, i can see all forums (english and german). Only the mods and the useres are able to see the forums fit to the choosen language.

vbenhancer 01-02-2010 07:14 PM

Quote:

Originally Posted by swsche (Post 1945164)
It's a very nice and usefull script. But i have a little problem.

When i switch the language in the usercp and i go to the forumhome, logged in as administrator, i can see all forums (english and german). Only the mods and the useres are able to see the forums fit to the choosen language.

This is not a problem, this is by purpose... as admin, you also have access to all passworded forums, all closed and locked forums... being an admin is to be in charge of everything... so things do not change...

My engine is not giving more filtering on usergroups, this is a per user setting. As admin, you see the " *en " indicator, to show if your forum is set properly...

vbenhancer 01-02-2010 07:15 PM

Quote:

Originally Posted by imedic (Post 1945105)
I see very useful this mode if you can exclude from New Messages search the forums not in your language.

I'm all with you on that, i need to refine the search engine filtering... i know where to add it, but did not look at this since i coded the engine first (4 years ago)... if i have time, i'll code this option.

Fraxter 01-23-2010 11:03 PM

For the future of this modification would be an update to vb4 the best. Thanks for this addon.

regards Pander23

Enlightning Man 04-13-2010 02:41 PM

Are there any news on vb 4 support for this?

We'd be very interested!

Regards,
Christopher

Enlightning Man 04-29-2010 03:45 PM

For everyone who's interested: I got this extension working on vb 4.0.3

The HowTo.txt file in the zip tells you to modify functions_forumlist.php with this code:

PHP Code:

//not working:
if($forum['languagecode'] AND !($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])) 
{
    if(
$forum['languagecode_forced'] AND ($forum['languagecode'] != $vbulletin->userinfo['languagecode'])) continue;
    if(
$vbulletin->userinfo['languagecode_forced'] AND ($forum['languagecode'] != $vbulletin->userinfo['languagecode'])) continue;


instead of that code, simply use this snippet:
PHP Code:

//working solution:
if($forum['languagecode'] AND !($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']))
{
    if(
$forum['languagecode_forced'] AND ($forum['languagecode'] != $vbulletin->userinfo['lang_code'])) continue;
    if(
$vbulletin->userinfo['languagecode_forced'] AND ($forum['languagecode'] != $vbulletin->userinfo['lang_code'])) continue;


So you simply have to exchange the userinfo['languagecode'] with userinfo['lang_code']...

A user who selects a different fourm interface language in the backend will afterwards see no forums which are forced to be displayed in a different language.

Up to now, this is the only problem that I have seen with this plugin.

Nephalim 04-29-2010 05:20 PM

where can you get spanish or german language?i see only french

thank you

Enlightning Man 04-29-2010 06:21 PM

Well I see only german and english.
I guess it depends on what you have installed as front end language packs in your system.

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 05:25 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.02909 seconds
  • Memory Usage 1,832KB
  • 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
  • (3)bbcode_html_printable
  • (4)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (25)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