Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-10-2013, 04:47 AM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default how to hide some forums when a language is selected by user

Hi mates,

I was wondering if it is possible to hide some forums when a user select a language from the language chooser or insert the language id in the address bar.

I was trying to do this:

Code:
<if condition="$langid=1">
hide forumid=1,2,3,4
</if>
I'm not really sure how the code have to look like....

However, the idea is as I mentioned above is to hide some forums when a user select different language and show them when he change back to the main language...

I hope it is clear.

your help is always appreciated.

Thanks,

--------------- Added [DATE]1365604847[/DATE] at [TIME]1365604847[/TIME] ---------------

is it possible no body knows how to do this?? I thought it is a lot simpler than what it looks!!!
Reply With Quote
  #2  
Old 04-10-2013, 04:34 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use a hook at the top of the pages you want to do this on:

PHP Code:
if ($vbulletin->userinfo['languageid'] == yy$vbulletin->forumcache["xx"] = 0
where xx is the forumid and yy is the languageid.
Reply With Quote
  #3  
Old 04-10-2013, 07:36 PM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Use a hook at the top of the pages you want to do this on:

PHP Code:
if ($vbulletin->userinfo['languageid'] == yy$vbulletin->forumcache["xx"] = 0
where xx is the forumid and yy is the languageid.
Thank you very much, Lynee.

That was a great solution. I will try it out and see how things go.

Cheers

--------------- Added [DATE]1365626743[/DATE] at [TIME]1365626743[/TIME] ---------------

Thanks again. I just tried and it works perfect 100%

Great job, Lynee.

Cheers


--------------- Added [DATE]1365635799[/DATE] at [TIME]1365635799[/TIME] ---------------

By the way, when you say use a hook on top of the pages I want, Did you mean to create a plugin at global_start so it goes whenever a page load starts??

any idea?
Reply With Quote
  #4  
Old 04-10-2013, 10:36 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

global_start is deprecated, so you certainly don't want to use it. I didn't know what page you wanted to use it on which is why I said use a hook at the top of the page. If you only need it on the forum home page, there is no sense in using a global hook.
Reply With Quote
  #5  
Old 04-10-2013, 10:38 PM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, great to know. I will try that and see if things go well

Thanks so much, Lyenne
Reply With Quote
  #6  
Old 04-11-2013, 03:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For example, if you want it to only happen on the main forum.php page, then enter the code into a plugin using the hook location forumhome_start.
Reply With Quote
  #7  
Old 04-11-2013, 03:22 PM
SilverBoy SilverBoy is offline
 
Join Date: Feb 2002
Location: Libya
Posts: 497
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is this idea can applied to cms sections too?
Reply With Quote
  #8  
Old 04-11-2013, 04:41 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Uh, well, kinda.... there are no forums in the cms section so I'm not sure how you would use it there.
Reply With Quote
  #9  
Old 04-11-2013, 10:51 PM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the great reply, Lynne.

Will try it and see how it goes.

your help is appreciated. Thanks
Reply With Quote
  #10  
Old 04-12-2013, 03:07 PM
SilverBoy SilverBoy is offline
 
Join Date: Feb 2002
Location: Libya
Posts: 497
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks Lynne, I'm talking about the idea (hide section regarding the language selected), and of course I didn't mean use the same code.
I asked because I wish I could have a multilingual site using my vbsuite.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:01 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.04156 seconds
  • Memory Usage 2,258KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete