vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Plugin using global_complete hook, cant exclude from a forum using if conditional (https://vborg.vbsupport.ru/showthread.php?t=319644)

basketmen 07-28-2015 12:33 AM

Plugin using global_complete hook, cant exclude from a forum using if conditional
 
This is replacement code from kh99, using global_complete hook, its works good

Code:

$find = 'Post New Thread';
$replace = 'Create a Listing'; 

$output = str_replace($find, $replace, $output);





but now i want to exclude a forum
already tried wrap it using below if conditional, but its not works
Code:

if ($foruminfo['forumid'] != 123)
{
}

Code:

if ($thread['forumid'] != 123)
{
}

Code:

if ($post['forumid'] != 123)
{
}

what is the right if conditional? or this cant be done because its using global_complete hook? :confused:
please help guys

MarkFL 07-28-2015 01:12 AM

Try the hook location "forum_display_start" and the plugin PHP code:

PHP Code:

if ($foruminfo['forumid'] != 123)
{
    
$vbphrase['post_new_thread'] = 'Create a Listing';



basketmen 07-28-2015 03:49 AM

its not only for forumdisplay, but for showthread too

it is better using forum_display_start hook or global_complete?

MarkFL 07-28-2015 04:23 AM

You have a "Post New Thread" button on your "showthread" pages?

basketmen 07-28-2015 04:32 AM

Quote:

Originally Posted by MarkFL (Post 2551543)
You have a "Post New Thread" button on your "showthread" pages?

its just example text, i use for some text

MarkFL 07-28-2015 05:52 AM

Ah okay, your initial post led me to believe you were trying to change the text that displays in the "Post New Thread" button. :)

basketmen 07-28-2015 06:36 AM

Quote:

Originally Posted by MarkFL (Post 2551547)
Ah okay, your initial post led me to believe you were trying to change the text that displays in the "Post New Thread" button. :)

thank you for the alternative way using forum_display_start hook


so what is the right if conditional to exclude a forum with global_complete hook?

MarkFL 07-28-2015 07:08 AM

The forumid data does not appear to be available at that hook.

Easy5s.net 07-28-2015 10:03 AM

try $GLOBAL['forumid']

basketmen 07-28-2015 01:17 PM

Quote:

Originally Posted by Easy5s.net (Post 2551564)
try $GLOBAL['forumid']

thank you for reply, tried this

Code:

if ($GLOBAL['forumid'] != 123)
{
}

but looks like not working, still same like not using it
any other code?



Quote:

Originally Posted by MarkFL (Post 2551554)
The forumid data does not appear to be available at that hook.

hmm if its true, the only way is using forum_display_start hook and one more plugin for shothread_start


All times are GMT. The time now is 04:57 AM.

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.01144 seconds
  • Memory Usage 1,737KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)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