Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
"Home" tab
lament
✭
Looked in the extensions but didn't see it.
I'm sure it's easy: is there an extension to simply pop in a "Home" tab up top to go to the front of a website?
I'm sure it's easy: is there an extension to simply pop in a "Home" tab up top to go to the front of a website?
0
This discussion has been closed.
Comments
/*if (in_array($Context->SelfUrl, array("index.php", "categories.php", "comments.php", "search.php", "post.php", "account.php", "settings.php"))) { $Menu->AddTab("Home", "Home", "../index.php", "HomeTab", $Attributes = "", $Position = "0", $ForcePosition = "1"); }
got it.. setting it to position 0 puts it before Discussion.
I would rather it was kept in a flat file. It is far quicker to include a PHP file with a list of variables and values in it, than it is to access your database for every single page hit.
Unless I misunderstood you of course...
The absolute BIGGEST performance hit any web application takes is when it connects to the database. Lech is correct that part of the reason for keeping all of those settings in flat files is for portability, but more than that I wanted to have as few queries to the database as possible.
Let me give you an example of a time when I saw a massive slowdown with the code of Vanilla - and required me to make a big change:
I wanted to set up custom user preferences for extension authors. Originally I had each of the preferences on the user table - one column per preference. But I wanted extension authors to be able to add new extensions without altering the user table.
So, my idea was that there would be a separate LUM_UserPreference table that contained Name & Value pairs where the Name is the name of the preference, and the value is the value of the preference.
I actually set up the application to work this way, and I made it so that on every single page load when I would query the database for information about the current user, I would also query the database for these preferences. This was ONE extra query that returned multiple records that were then transformed into an associative array on the user object.
When I implemented the change, I noticed an INSTANT slowdown. As a test, I set up a script and ran it against the site watching for slowdown and failures. The application practically ground to a halt under this stress testing.
I was pretty pissed for a few minutes. Then I thought of the method that I ended up using: just serializing the associative preference array and saving to a single field in the user table. Which was great because I only have to run a single query as I was before. I ran *that* under stress testing and it flew.
But yeah - all of those extra queries are just awful for speed of an application. If ever possible you should keep it to flat files and include them with php's include statement. That's one of the big reasons why Vanilla is so fast.