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.

applying extensions to multiple custom pages with ease!

edited November 2006 in Vanilla 1.0 Help
EDITED on 11/22/06

Ok so if there's anyone else out there like me that is trying to make their vanilla forum into a website/forum combo and in doing so has to make a lot of custom pages that the extensions need to be applied to then you should read this quick fix. I have a few extensions on my sidepanel that I have to manually add to the list of pages that can load it in the default.php file for each extension. This can be very tedious and annoying if you have 50+ custom pages like me. So I decided I better find a way to fix this so I don't have to do all this extra work. Thanks to Minisweeper for giving me the solution after I botched an attempt to fix it on my own lol. Here's the instructions:

ok in your default.php file you should see a block of code that looks like this:
if(in_array($Context->SelfUrl, array("index.php", "categories.php", "discussions.php", "comments.php", "search.php", "post.php", "account.php", "settings.php"))) {

replace that block of code and there with this
if ($Context->SelfUrl != 'people.php') {

and that's it! See how easy was that? Now you don't have to worry about adding new custom pages to a list it automatically shows the extensions on your custom page. Enjoy ^.^


  • Options
    Whats the reason behind the $Configuration['SELF_URL'] thing? If you take out the if statement it will display on every page anyway wont it?
  • Options
    I've used this thread as a jump-off for a bigger picture discussion on add-on management within Vanilla, comments welcome:
  • Options
    oh doh.. I guesss I dont need the $Configuration['SELF_URL'] = 'default.php'; in there, it worked when I added it while taking out that if statement... lol guess you just need to take out the if statement. ><
  • Options
    The if statement merely limits the pages the add-on can 'attach' itself to, so I guess by default it attaches to all pages.
  • Options
    AHHHH CRAP! :( *cries* Taking out the if statement messes up the login and logout precedure. >< I got an error when logging in and logging out so I guess I have to stick with the annoying way. Unless there is someone that can figure out how to edit that if statement to make it so it doesn't only apply to just the pages that are in that if statement.
  • Options
    You could just use a negative if statement... if ($Context->Selfurl != 'people.php') {
  • Options
    hmmm i'll be trying that when I get home from class, if it works then I love you Minisweeper lol.
  • Options
    hmm I got this error when I tried replacing the if statement with if ($Context->Selfurl != 'people.php') {

    Notice: Undefined property: Selfurl in /mounted-storage/home4/sub002/sc11923-BRUP/oga/Vanilla.1.0.1/extensions/SidePanelImproved/default.php on line 40
    Fatal error: Call to a member function on a non-object in /mounted-storage/home4/sub002/sc11923-BRUP/oga/Vanilla.1.0.1/extensions/SidePanelImproved/default.php on line 43
  • Options
    $Context->SelfUrl sorry. Missed the capital U.
  • Options
    omg that was it? lol

    Awsome that worked! Thanks a lot :) I'll update the original post at the top to have the correct way of doing this.
This discussion has been closed.