Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 28 Jul 2015, 03:33
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
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


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.





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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

what is the right if conditional? or this cant be done because its using global_complete hook?
please help guys
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #2  
Old 28 Jul 2015, 04:12
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Try the hook location "forum_display_start" and the plugin PHP code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #3  
Old 28 Jul 2015, 06:49
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
its not only for forumdisplay, but for showthread too

it is better using forum_display_start hook or global_complete?
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #4  
Old 28 Jul 2015, 07:23
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
You have a "Post New Thread" button on your "showthread" pages?
Reply With Quote
  #5  
Old 28 Jul 2015, 07:32
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Originally Posted by MarkFL View Post
You have a "Post New Thread" button on your "showthread" pages?
its just example text, i use for some text
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #6  
Old 28 Jul 2015, 08:52
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Ah okay, your initial post led me to believe you were trying to change the text that displays in the "Post New Thread" button.
Reply With Quote
  #7  
Old 28 Jul 2015, 09:36
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Originally Posted by MarkFL View Post
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?
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #8  
Old 28 Jul 2015, 10:08
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
The forumid data does not appear to be available at that hook.
Reply With Quote
  #9  
Old 28 Jul 2015, 13:03
Easy5s.net Easy5s.net is offline
 
Join Date: Jun 2011
try $GLOBAL['forumid']
Reply With Quote
  #10  
Old 28 Jul 2015, 16:17
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Originally Posted by Easy5s.net View Post
try $GLOBAL['forumid']
thank you for reply, tried this


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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



Originally Posted by MarkFL View Post
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
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #11  
Old 28 Jul 2015, 18:56
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
global_complete is one of the last things called. I think what you want is something like global_setup_complete.

I was looking at code a little, and while I'm sure in th past I've suggested that people use $forumid or $GLOBALS['forumid'] (it has an 'S' at the end), it looks like that's a bad one to use unless you're using a hook that's only called on forum.php. It looks like most of the time, $foruminfo['forumid'] is what you'd want (unless you know you're interested in $threadinfo or $post).
Reply With Quote
  #12  
Old 29 Jul 2015, 02:51
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Originally Posted by kh99 View Post
global_complete is one of the last things called. I think what you want is something like global_setup_complete.

I was looking at code a little, and while I'm sure in th past I've suggested that people use $forumid or $GLOBALS['forumid'] (it has an 'S' at the end), it looks like that's a bad one to use unless you're using a hook that's only called on forum.php. It looks like most of the time, $foruminfo['forumid'] is what you'd want (unless you know you're interested in $threadinfo or $post).
$GLOBALS['forumid'] with global_complete hook is works

global_setup_complete hook not works


thank you kh99, MarkFL & Easy5s.net
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #13  
Old 29 Jul 2015, 11:06
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by basketmen View Post
$GLOBALS['forumid'] with global_complete hook is works

global_setup_complete hook not works


thank you kh99, MarkFL & Easy5s.net
Oh, right, I see now that you're doing str_replace() on $output. That would have to be done at the end using global_complete. I'm still kind of surprised that $GLOBALS['forumid'] works, but I can't argue with success.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 00:08.

Layout Options | Width: Wide Color: