vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Code to change button link in one forum (https://vborg.vbsupport.ru/showthread.php?t=321789)

HM666 02-12-2016 07:28 AM

Code to change button link in one forum
 
I need to know what plugin code I would use to change the "+Post New Thread" button to say "+Submit Ticket" in just one forum only.

MarkFL 02-12-2016 08:27 AM

You could use the following PHP Plugin Code (Hook Location: forumdisplay_complete):

PHP Code:

if ($foruminfo['forumid'] == XX)
{
    
$vbphrase['post_new_thread'] = 'Submit Ticket';


where "XX" is the forumid of the forum in which you want to make the change. :)

HM666 02-12-2016 09:48 AM

Perfect! Worked great, thanks.

Stratis 02-14-2016 01:24 PM

Good idea Len, thanks Mark for this, I will use it some how.

Edit: How include more forum id?

RichieBoy67 02-14-2016 01:38 PM

Quote:

Originally Posted by Stratis (Post 2564857)
Good idea Len, thanks Mark for this, I will use it some how.

Edit: How include more forum id?

With an array. Like this I believe:

PHP Code:

if ($foruminfo['forumid'] = array(##,##,##))
{
    
$vbphrase['post_new_thread'] = 'Submit Ticket';



Stratis 02-14-2016 01:47 PM

Thanks Richie, I will try this.

mokujin 02-14-2016 02:00 PM

Quote:

Originally Posted by RichieBoy67 (Post 2564858)
With an array. Like this I believe:

PHP Code:

if ($foruminfo['forumid'] = array(##,##,##))
{
    
$vbphrase['post_new_thread'] = 'Submit Ticket';



Should it be?
PHP Code:

if (in_array($foruminfo['forumid'], array(##,##,##)))
{
    
$vbphrase['post_new_thread'] = 'Submit Ticket';



Stratis 02-14-2016 02:03 PM

Ok I found it how

This
PHP Code:

if (in_array($foruminfo['forumid'], array(xx,xxx,xx,xxx)))

{
    
$vbphrase['post_new_thread'] = 'Submit Ticket';



And this is opposite
PHP Code:

 if (!in_array($foruminfo['forumid'], array(xx,xxx,xx,xxx)))

{
    
$vbphrase['post_new_thread'] = 'Submit Ticket';


EDIT: Thanks Đạt, I did not make a refresh, and did not see your answer.

RichieBoy67 02-14-2016 02:14 PM

Quote:

Originally Posted by mokujin (Post 2564863)
Should it be?
PHP Code:

if (in_array($foruminfo['forumid'], array(##,##,##)))
{
    
$vbphrase['post_new_thread'] = 'Submit Ticket';




Thanks for the correction. I should not have missed that!:erm:

Stratis 02-14-2016 02:22 PM

Ok now, how make this more complicated :)

Make 2 or 3 buttons.

1st 'Submit Ticket' as it is.
2nd 'New Help Thread' or what else.

Do I have to make another plugin or I can include it in the first one
If so include, how?

Thanks...


All times are GMT. The time now is 08: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.01158 seconds
  • Memory Usage 1,746KB
  • 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
  • (7)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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