News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

variable for board directory

Started by mohaakilla51, August 17, 2007, 12:01:16 AM

Previous topic - Next topic

mohaakilla51

is there a variable that is pretty much the URL for the board directory? or do I have to make one?

mohaakilla51

Another quick question: is it possible to overload functions in PHP? AKA: Create another template_main_above function, except make this one take parameters?

codenaught

Quote from: mohaakilla51 on August 17, 2007, 12:01:16 AM
is there a variable that is pretty much the URL for the board directory? or do I have to make one?
Well $boardurl holds the URL of your forum (without the index.php).

$boarddir is the path to your forum (where the root files such as Settings.php and the main index.php are located).

Is that what you are after?

Quote from: mohaakilla51 on August 17, 2007, 12:31:57 AM
Another quick question: is it possible to overload functions in PHP? AKA: Create another template_main_above function, except make this one take parameters?
No, at least certainly not that I know of! When you try to use the same function twice even with different parameters you will get a cannot redeclare function error. And I know what you are talking about as I've used overloaded methods in Java before. It can be quite handy in my opinion, but PHP is pretty loose and you can even get away with calling none of a function's parameters without an error as long as you specify in the parameter what the default value of it should be.
Dev Consultant
Former SMF Doc Coordinator

mohaakilla51

OK, thank you. THat answered both of my questions.

Advertisement: