Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #256  
Old 16 Oct 2012, 13:15
soulz2003 soulz2003 is offline
 
Join Date: Nov 2009
The thing I am not understanding at this point is. If I am trying to preregister a variable for use with a stock template, in this case header. Where am I putting my code?

Is there a stock location to add this to or am I having to jump from adding a simple variable used on sites since vb 3.x into learning the basics of plugin writing? GLOBALS.permissions.pmquota isn't working for me in a new situation so I am trying to learn how to register permissions with the header template.

I believe the code is going to look like this?

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

If so or even once correct where is this going? I mean were talking about a stock item for a stock template not a 3rd party plugin so I am confused.

Also is the above enough or do I need to add more like:

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

Reply With Quote
  #257  
Old 16 Oct 2012, 22:03
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
I answered in your other thread, but I'll answer more generally here: for the header, navbar, and footer templates I would recommend the hook parse_templates, since that's always executed just before those templates are rendered.

But the variable you want to use has to be available at that hook, and the timing of the call to the parse_templates hook can change. In the case of $permissions, that is set just after the global_start hook is called, so if some plugin using the global_start hook renders a template, parse_templates will be called but $permissions won't have been set yet so preRegistering it to a template won't work. (That's also why GLOBALS.permissions.pmquota stopped working - using preRegister() instead won't make any difference). But as I mentioned in the other thread, $permission is just a copy of $vbulletin->userinfo['permissions'], so if you use {vb:raw bbuserinfo.permissions.pmquota} in the template, that may work without any preRegistering.
Reply With Quote
  #258  
Old 17 Oct 2012, 04:17
TheSupportForum TheSupportForum is offline
 
Join Date: Jan 2007
is this possible


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

i need to be able to use and array for 2 or more options, how can this be done
__________________
http://www.multihunters.co.uk - all your coding needs
Reply With Quote
  #259  
Old 21 Oct 2012, 23:22
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
As you wrote it, it is not going to work, you can't just put an "or" in the middle of any code.

I'm not really sure what your goal is or I'd give you an idea where to go... Maybe..


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

That creates new array...

Assuming list1 always exists array[0] gets its value

Then If list2 exists the next element in array (array[1] in this case) gets the value of list2
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #260  
Old 26 Dec 2012, 13:57
acast acast is offline
 
Join Date: Aug 2008
Smile

Hi, i am trying to learn how to adjust the plugins for v3 to v4.

Can anybody guide me and tell me what it's wrong?

Code working in 3.6.6.


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

My modified code:

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

It doesn't work, and i don't know why. I tried with several plugins but no one works. Thanks for your help.
Reply With Quote
  #261  
Old 26 Dec 2012, 17:51
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
What error are you getting?
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #262  
Old 26 Dec 2012, 18:12
acast acast is offline
 
Join Date: Aug 2008
Smile

Originally Posted by BirdOPrey5 View Post
What error are you getting?
I don't know what exactly is the problem, in this case, is like the things aren't well connected. When i put hangman.php in 3.6, automatically add to the direction "?n=1" and if i clikc in the letters the program run well, but in 4 didn't do it. Also, in other plugin i have a button, but if i click it doesn't go to anywhere.

My question is: if you register a variable that doesn't have to be register, the php makes an error? I did this in the plugin:

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

but i don't know if all these variables must to be put it like this.

Sorry for my english, and thanks for your help. Also, the plugin, if you want to see it something more of the code is here:
http://www.vbulletin.org/forum/showt...hlight=hangman
Reply With Quote
  #263  
Old 26 Dec 2012, 18:25
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Can you post your hangman template code?
__________________
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
  #264  
Old 26 Dec 2012, 18:34
acast acast is offline
 
Join Date: Aug 2008
Originally Posted by Lynne View Post
Can you post your hangman template code?
Hi Lynne

The original template hangman:

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

My modified template:

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

Thanks for your help too. This plugin is not important for me, but i want to learn so i can do it in other ones more important
Reply With Quote
  #265  
Old 27 Dec 2012, 01:04
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
The template looks OK.... I don't see a link to the page so we can see exactly what is happening. Something can "not work" in so many different ways, so it would be good to see exactly what is going on with this one.
__________________
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
  #266  
Old 27 Dec 2012, 08:16
acast acast is offline
 
Join Date: Aug 2008
Smile

Originally Posted by Lynne View Post
The template looks OK.... I don't see a link to the page so we can see exactly what is happening. Something can "not work" in so many different ways, so it would be good to see exactly what is going on with this one.
Ok, i'll send you now a private message with the login to my forum. If somebody wants it too, tell me.


This is another plugin where i have, apparently, the same problem:
The code is in the attached txt.


Thank you for your help again. I reall apreciate always your help Lynne.
Attached Files
File Type: txt code.txt (52.7 KB, 2 views)
Reply With Quote
  #267  
Old 27 Dec 2012, 16:28
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Registering a variable that doesn't need to be registered or is empty will NOT cause an error.

Are you just getting a blank white page when you try to view it? In that case look for your php error log (your host may be able to tell you how to view it) and see what errors are coming up after trying to view the blank page.
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #268  
Old 27 Dec 2012, 16:38
acast acast is offline
 
Join Date: Aug 2008
Originally Posted by BirdOPrey5 View Post
Registering a variable that doesn't need to be registered or is empty will NOT cause an error.

Are you just getting a blank white page when you try to view it? In that case look for your php error log (your host may be able to tell you how to view it) and see what errors are coming up after trying to view the blank page.
Thank you for the answer. I sent you also the links for if you want to take a look.

Also i have another question of the use in the templates. For example, in the code that i put, in the old one appears like this:

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

That is right for the templates?

--------------- Added 27 Dec 2012 at 21:05 ---------------

I solve the problem of the hangman. It seems like the PHP_SELF doesn't work in v4. Thanks to Lynne for the help.

But i am working in the other one. My previous question to BirdOprey5 is about it.

Lynne suspect that perhaps the problem is about javascript/ajax. żIs different to v3 to v4?

This is the code, if somebody knows that it is right or wrong:


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

Thanks if anybody can take a look to it and verify that it is right.

Last edited by acast; 27 Dec 2012 at 21:05.
Reply With Quote
  #269  
Old 29 Dec 2012, 20:43
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.

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

That looks allowed in VB4 template, of course it need an ending </vb:if> somewhere.

I'm sorry I don't know anything about AJAX differences between VB3 and VB4.
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #270  
Old 30 Dec 2012, 09:22
acast acast is offline
 
Join Date: Aug 2008
Originally Posted by BirdOPrey5 View Post
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That looks allowed in VB4 template, of course it need an ending </vb:if> somewhere.

I'm sorry I don't know anything about AJAX differences between VB3 and VB4.
Thanks, it doesn't seem to be anything about ajax. I put it the problem here:
http://www.vbulletin.org/forum/showt...=242454&page=7

That variable "stocktable" must be registered in a plugin, but if i do it the forum dissapears.
Reply With Quote
Reply



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

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 11:50.

Layout Options | Width: Wide Color: