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

Reply
 
Thread Tools Display Modes
  #11  
Old 02-14-2016, 03:13 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could use something like:

PHP Code:
switch ($foruminfo['forumid'])
{
    case 
XX:
        
$vbphrase['post_new_thread'] = 'text for forum XX';
        break;
    case 
YY:
        
$vbphrase['post_new_thread'] = 'text for forum YY';
        break;
    case 
ZZ:
        
$vbphrase['post_new_thread'] = 'text for forum ZZ';
        break;

Reply With Quote
Благодарность от:
RichieBoy67
  #12  
Old 02-14-2016, 03:37 PM
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Posts: 738
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes Mark, this works as I asked.
But I cannot include more than one forum ID in each case.

Suppose this needs to have an array or how?

Thanks
Reply With Quote
  #13  
Old 02-14-2016, 04:20 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then you could use something like:

PHP Code:
switch ($foruminfo['forumid'])
{
    case 
XX:
        
$vbphrase['post_new_thread'] = 'text for forum XX';
        break;
    case 
YY1:
    case 
YY2:
        
$vbphrase['post_new_thread'] = 'text for forum YY1 and YY2';
        break;
    case 
ZZ1:
    case 
ZZ2:
    case 
ZZ3:
        
$vbphrase['post_new_thread'] = 'text for forum ZZ1 and ZZ2 and ZZ3';
        break;

Reply With Quote
  #14  
Old 02-14-2016, 04:53 PM
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Posts: 738
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am confused. Sorry for not understanding easily.

That's take the first code in post #11
PHP Code:
switch ($foruminfo['forumid'])
{
    case 
XX:
        
$vbphrase['post_new_thread'] = 'Submit Ticket';
        break;
    case 
YY:
        
$vbphrase['post_new_thread'] = 'New Help Thread';
        break;
    case 
ZZ:
        
$vbphrase['post_new_thread'] = 'New Question Thread';
        break;

How I put more than 1 forum id? in
case XX:
case YY:
case ZZ:

Thanks
Reply With Quote
  #15  
Old 02-14-2016, 05:24 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To better understand posts #11 and #13, I suggest reading:

PHP: switch - Manual
Reply With Quote
Благодарность от:
Stratis
  #16  
Old 02-14-2016, 06:56 PM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Stratis View Post
I am confused. Sorry for not understanding easily.

That's take the first code in post #11
PHP Code:
switch ($foruminfo['forumid'])
{
    case 
XX:
        
$vbphrase['post_new_thread'] = 'Submit Ticket';
        break;
    case 
YY:
        
$vbphrase['post_new_thread'] = 'New Help Thread';
        break;
    case 
ZZ:
        
$vbphrase['post_new_thread'] = 'New Question Thread';
        break;

How I put more than 1 forum id? in
case XX:
case YY:
case ZZ:

Thanks
I think what you would need to dois replace the XX, YY, ZZ with the actual forum ids for those particular buttons. So you would put....

PHP Code:
switch ($foruminfo['forumid'])
{
    case 
1:
        
$vbphrase['post_new_thread'] = 'Submit Ticket';
        break;
    case 
2:
        
$vbphrase['post_new_thread'] = 'New Help Thread';
        break;
    case 
3:
        
$vbphrase['post_new_thread'] = 'New Question Thread';
        break;

where the numbers after the word case are the actual numbers of the forums corresponding to the buttons you want.
Reply With Quote
3 благодарности(ей) от:
MarkFL, RichieBoy67, Stratis
  #17  
Old 02-14-2016, 06:57 PM
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Posts: 738
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry Mark I could not understand at start, that I can put as many case χχχ: i want.
I have read PHP Manual, but unfortunately i don't understand. You see many things that are easy for some people are very difficult for others. I try very hard but how forward can some one can go.

Thanks for your help, and by making a lot of tests-combinations than I realized.
Yes now its easy when is there a way to understand.

For some dummies like me.
PHP Code:
switch ($foruminfo['forumid'])
{
    case 
xxx:
    case 
xxx:
    case 
xxx:
    case 
xxx:
    case 
xxx:
    case 
xxx:
        
$vbphrase['post_new_thread'] = 'Submit Ticket';
        break;
    case 
xxx:
    case 
xxx:
        
$vbphrase['post_new_thread'] = 'New Help Thread';
        break;
    case 
xxx:
        
$vbphrase['post_new_thread'] = 'What else name;
        break;

Where xxx is forum id

Hope if we put many forums id there is no problem to forum or else?



EDIT: Len, we posted same time, did not see it first
Reply With Quote
Благодарность от:
HM666
  #18  
Old 02-14-2016, 07:01 PM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LOL that is ok at least the info is there now for someone else if they get lost.
Reply With Quote
  #19  
Old 02-14-2016, 07:04 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Suppose I have a forum with forumid 2 and I wish for the button to read "Submit Ticket", and I have 2 forums with forumids 3 and 4, and I wish for the button to read "Add to Tutorial" and I have 3 forums with forumids 5, 6 and 7 and I wish for the button to read "Ask the Expert."

Then my PHP Code should be:

PHP Code:
switch ($foruminfo['forumid'])
{
    case 
2:
        
$vbphrase['post_new_thread'] = 'Submit Ticket';
        break;
    case 
3:
    case 
4:
        
$vbphrase['post_new_thread'] = 'Add to Tutorial';
        break;
    case 
5:
    case 
6:
    case 
7:
        
$vbphrase['post_new_thread'] = 'Ask the Expert';
        break;

Does that make sense?

edit: If not, then I will be glad to whip up a simple mod that will let you define the text for the button based on forumid, and use phrasing so you can translate them.
Reply With Quote
  #20  
Old 02-17-2016, 07:17 AM
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Posts: 738
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its ok for me as it is, the only thing, if there is a problem when we put many forum ids.
As i see no problem with it to.
Thanks guys for help.
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 05:31 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.21890 seconds
  • Memory Usage 2,302KB
  • 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
  • (7)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
  • (6)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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