Skip to main content
Topic: Constants (Read 6573 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Constants

While I'm here... MessageIndex has a bug in board descriptions, more precisely in the 'Sort by...' popup. It's cut off by an overflow. Ouch.

If you're following my development over at Wedge, I'm currently rewriting the codebase to get rid, once and for all, of themes. Because, well, my skin code is just less f*cked up (if you'll ask me), and I suspect it will make things simpler, here and there.
One of the added benefits is that I'll be able to load theme paths earlier in the code flow, and thus maybe turn them into constants. (Which, I'm afraid aren't as fast as globals, but I'm all for making things faster, and anyway I haven't decided yet, I'll probably eventually go for we::$theme_url or something, don't get me started on this!)

So, I had a look at the Elk codebase because I remembered you guys had turned $boarddir to BOARDDIR and so on.
And then I look at the code flow.
- index.php:58, var is turned to constant.
- later in the file, loadTheme() is called.
- in loadTheme(), Elk tests the current URL, and determines if it needs to update $boarddir with the new, modified URL.
- as such, it then resets $boarddir... But, obviously, NOT the BOARDDIR constant.

I haven't looked where BOARDDIR and other constants are being used, and if it's of any use really, but I've had a feeling that I should point this out to you guys. Dunno if it can't be considered a bug, but you may want to go through the loadTheme code, and see if it's all right!

Re: Constants

Reply #1

loadTheme tries to fix $boardurl, not $boarddir. ;)

Though I found one wrong $boarddir around in the code...

 emanuele fixes that!
Bugs creator.
Features destroyer.
Template killer.

Re: Constants

Reply #2

Quote from: Nao – While I'm here... MessageIndex has a bug in board descriptions, more precisely in the 'Sort by...' popup. It's cut off by an overflow. Ouch.
thanks for the report, bug has been fixed some days ago .. the site isn't up to date.
Thorsten "TE" Eurich
------------------------

Re: Constants

Reply #3

Sorry ema, I missed that one lol.

Still. I remember about a conversation on this particular issue, but can't fins it anymore. Bugger. I still need to make a decision. I don't like making multiple commits that show me change my mind over and over again. ;)

Re: Constants

Reply #4

I remember some comment from Arantor (I think) about the fact that we were still using variables in Settings.php and not constants directly from the beginning, but no idea where and when... lol
Bugs creator.
Features destroyer.
Template killer.

Re: Constants

Reply #5

Well it's not possible to store a constant from the start if you want to be able to fix the value later, anyway...

Personally, I'm thinking of not allowing for source folders and other root sub-folders to be modified. I don't see a reason why one would want to put them somewhere else. Security? Seriously...