Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 24 Dec 2010, 15:22
Yonatan Yonatan is offline
 
Join Date: Jun 2008
Get CMS Section via Plugin

Hello!

I had some issue at version 4.0.3 that I can't get the section ID.
It's been discussed already:
http://www.vbulletin.com/forum/showt...in-plugin-code
http://www.vbulletin.org/forum/showp...&postcount=238
(and the next replies..)

and vBulletin developers also said that they will provide fix in 4.0.4+ version:
http://www.vbulletin.com/forum/showt...=1#post1967245

But now I'm using in version 4.1.0 PL2 in the code:

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

and it's not working!

Anyone have some solution to that issue?

Thanks!

Last edited by Yonatan; 11 Jun 2011 at 15:10.
Reply With Quote
  #2  
Old 24 Dec 2010, 17:44
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
What hook location? Also, why not just use $_GET['r']?
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #3  
Old 24 Dec 2010, 18:39
Yonatan Yonatan is offline
 
Join Date: Jun 2008
Originally Posted by Lynne View Post
What hook location? Also, why not just use $_GET['r']?
1) process_templates_complete.
2) Because those 2 issue's:
Reply With Quote
  #4  
Old 24 Dec 2010, 19:27
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
What are you expecting to happen from your plugin? All you've done is set some variables.... what are you going to do with them? That isn't going to make a navtab at all. So what is the expected result?

Getting the parentid works just fine if you use the hook location vbcms_content_populate_end. If you use vbcms_section_populate_end, then you will get the parentid of that section which is probably 1. But again, exactly what are you trying to do?
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #5  
Old 25 Dec 2010, 11:06
Yonatan Yonatan is offline
 
Join Date: Jun 2008
Originally Posted by Lynne View Post
What are you expecting to happen from your plugin? All you've done is set some variables.... what are you going to do with them? That isn't going to make a navtab at all. So what is the expected result?

Getting the parentid works just fine if you use the hook location vbcms_content_populate_end. If you use vbcms_section_populate_end, then you will get the parentid of that section which is probably 1. But again, exactly what are you trying to do?
I'm expecting from this plugin to behavior like any other default tabs - so if I'm on this tab, the Home tab will unselected and if I'm viewing in some article that related to this section id, this tab will highlighted.
Reply With Quote
  #6  
Old 25 Dec 2010, 20:27
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
You've done nothing in that plugin to insert a navtab into your navbar. You need to use a template_hook to insert it. Something like:


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

You probably need to make $template_hook global also. And, you'll have to do something to the Home navtab plugin to not make it selected also since it is currently set to be the active tab is you are on a content page (you'll have to change the condition to be "on content page except these content pages....").
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #7  
Old 25 Dec 2010, 21:57
Yonatan Yonatan is offline
 
Join Date: Jun 2008
Originally Posted by Lynne View Post
You've done nothing in that plugin to insert a navtab into your navbar. You need to use a template_hook to insert it. Something like:


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

You probably need to make $template_hook global also. And, you'll have to do something to the Home navtab plugin to not make it selected also since it is currently set to be the active tab is you are on a content page (you'll have to change the condition to be "on content page except these content pages....").
Of course I have more lines in that plug in(I just put the ones who related to this issue).

This is my whole code:

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

And I didn't actually understood what you meant after that, can you explain me that again with some examples?

Thanks!
Reply With Quote
  #8  
Old 25 Dec 2010, 22:53
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
The variable, $template_hook, probably needs to be globalized (it did when I put the code into a plugin using the hook location vbcms_content_populate_end), or you will get no output.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #9  
Old 30 May 2011, 23:44
Yonatan Yonatan is offline
 
Join Date: Jun 2008
Originally Posted by Lynne View Post
The variable, $template_hook, probably needs to be globalized (it did when I put the code into a plugin using the hook location vbcms_content_populate_end), or you will get no output.
Sorry for jumping this thread.

I've been searching for working code but I didn't find anything.

Can anyone give me some example for working code?

Thanks!
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 02:03.

Layout Options | Width: Wide Color: