View Full Version : Code Questions: Is [hpurl] a good syntax for Home Page URL?
NashChristian
06-05-2008, 04:09 AM
Hello,
Does [hpurl] = [homeurl]?
If not, what is the difference?
It seems to work in some applications that I'm using it in, but not in others. Should I avoid it and just use [homeurl]?
Also, what is the difference between '$vboptions' and '{$vbulletin->options}' ?
Thanks.
Jeff
Dismounted
06-05-2008, 07:31 AM
It's your choice - it's your BB code.
You should use $vboptions in templates as using the brackets looks messy and is probably slower.
NashChristian
06-05-2008, 08:10 AM
Hello Dismounted,
Thanks for the reply.
I'm still a little confused.
First, is [hpurl] a pre-defined BB code by vB, which stands for home page url? I just guessed at the code, based on the bburl, and it seems to work in some applications, but I want to make sure that it is good code.
Is there a diffinitive list of BB codes somewhere, which vB uses, so that I can learn more about this?
Second, can I use the $vboptions in ALL applications if I prefer, or are there situations where I must use the brackets? I don't understand if it's just a preference, or serves a function.
Thanks.
Jeff
Dismounted
06-05-2008, 09:18 AM
You should always use variables instead of a class in curly braces if available. Curly braces are used when you need to access class methods, class variables, multi-dimensional arrays, or when the boundries of a variable name can not be determined.
[hpurl] is not a default BB code.
Opserty
06-05-2008, 09:43 AM
is [B]not a BBCode. The bburl bit is the key which is associated with the value for that setting. $vboptions is an array of options, you can read about arrays on the PHP site (See here (http://php.net/types.array)).
I think if you hover over the input box for a setting (in the AdminCP) it will tell you the key name. Otherwise you can run a plugin with var_dump() (http://php.net/var_dump) on $vbulletin->options to see a full list of it's contents.
NashChristian
06-05-2008, 04:26 PM
is [B]not a BBCode. The bburl bit is the key which is associated with the value for that setting.
Thanks for the clarrification. So is [hpurl] a key associated with home page url? Or did I make that up somehow?
Thanks.
Jeff
Opserty
06-05-2008, 05:29 PM
I don't know if hpurl exists... you'll have to try it and see. Check the link in my first paragraph it explains about arrays and what they are.
NashChristian
06-05-2008, 07:17 PM
Hello.
I tried the URL, but it looks to be a little over my head.
Thanks for the feedback.
Jeff
Opserty
06-05-2008, 08:51 PM
I think $vbulletin->options[homeurl] is what you want. [hpurl] doesn't exist, unless you have modifications installed or something.
NashChristian
06-05-2008, 09:09 PM
I think $vbulletin->options[homeurl] is what you want. [hpurl] doesn't exist, unless you have modifications installed or something.
Or $vboptions[homeurl] right? It's the exact same thing isn't it?
Boofo
06-05-2008, 09:19 PM
There is no [hurl] and never has been.
Opserty
06-05-2008, 09:21 PM
Or $vboptions[homeurl] right? It's the exact same thing isn't it?
Yes, in templates you use $vboptions.
NashChristian
06-05-2008, 09:21 PM
There is no [hurl] and never has been.
Boofo,
I was talking about [hpurl]. Does that exist?
--------------- Added 1212704565 at 1212704565 ---------------
Yes, in templates you use $vboptions.
Thanks for the help!
:)
Boofo
06-05-2008, 09:22 PM
Not that either. Unless they snuck it in when I wasn't looking. ;)
NashChristian
06-05-2008, 09:36 PM
Not that either. Unless they snuck it in when I wasn't looking. ;)
That's wierd. I wonder why it is working on my vBa navigation module! I've had problems with the code in other places, which is why I ask, but it seems to work fine on my navigation module.
Wierd!
Thanks for the help.
:) Jeff
King Kovifor
06-05-2008, 09:38 PM
That's wierd. I wonder why it is working on my vBa navigation module! I've had problems with the code in other places, which is why I ask, but it seems to work fine on my navigation module.
Wierd!
Thanks for the help.
:) Jeff
I would assume that vBAdvanced CMPS adds that syntax on their home page specifically. As it does not come with vBulletin.
NashChristian
06-05-2008, 09:44 PM
I would assume that vBAdvanced CMPS adds that syntax on their home page specifically. As it does not come with vBulletin.
Maybe it's a spoof. I just guessed at the code, based on the bburl code, but for some reason it seems to be working on my CMPS navigation module.
Thanks.
Dismounted
06-06-2008, 07:10 AM
As said, vBA probably adds that variable, hence it does not work anywhere else.
Marco van Herwaarden
06-06-2008, 10:26 AM
And if the issue you have is with vBAdvanced, then the best place to ask i their website.
NashChristian
06-06-2008, 12:10 PM
And if the issue you have is with vBAdvanced, then the best place to ask i their website.
I was just wanting to find out for sure whether the code was stock vB or not. Otherwise I would have posted it at vBa. I understand now, that it's not.
I'm all set. Thanks!
Jeff
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.