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.

Fix former "Panelhider" extension to work with new vanilla versions?

edited June 2008 in Vanilla 1.0 Help
Don't know if this has been asked before, but couldn't find anything 'bout it when searching the forum. If I remember correctly, earlier versions of vanilla offered a possibility to hide/unhide the panel on the left side by clicking on a button. What happend to this?

Comments

  • It was an extension, and I don't believe it's been updated for 1.0.x

    I can't imagine it was terribly complicated though.
  • I guess these would be the steps:
    Add a toggle-switch button to your theme, or via an add-on where you want to have it, and use it to switch the status of #Panel between visible and hidden. There's probably the JS function in prototype (bundled) for that already.

    You'll also need to adjust css for #Content as follows, either in the vanilla.css of your theme or via the add-on:
    #Content { margin:0px 18px 0px 18px; }
  • It's a shame that I don't know anything about JS. Additionally I can't make any changes to the theme as I'm not the admin of the vanilla board. I'm just a normal user there. All I did was making changes to the vanilla stylesheet and creating a new style. :) And that's all I know about CSS. Making some changes within an already existing stylesheet. Changing some background colors, adding an image, ... I hope someone is able to convert the old extension (if it actually can be found) to version 1.0
  • i think mark or whoever should take care of this feature ... its definitely a unique and a very effective feature to get a clean "view" of a forum with only a single klick
  • edited December 2006
    Just for the fun of it, I obtained all necessary files from the "PanelHider" extension (via Google Search) and uploaded it to a new folder
    inside /extensions on our Vanilla 1.0.3.

    As far as I can see it, the extension consists of these files:
    • btn.hidepanel.gif
    • btn.revealpanel.gif
    • PanelHider.php
    • panelhider.handheld.css
    • panelhider.hidden.css
    • panelhider.js
    • panelhider.visible.css
    I renamed 'Panelhider.php' to 'default.php' and put all files inside /extensions/Panelhider. Afterwards I tried to activate the extension to see what happens. And guess what? I got an error. ;) Call to undefined function 'Setting' inside Panelhider.php on line 35.
    if ($Context->Session->User->Setting("HidePanel")) {

    This is the complete code of Panelhider.php (I removed the comments, so that the code didn't get too long)
    <?php if (in_array($Context->SelfUrl, array("account.php", "categories.php", "comments.php", "index.php", "post.php", "search.php", "settings.php")) && $Context->Session->UserID > 0) { class PanelHider extends Control { function PanelHider(&$Context) { $this->Context = &$Context; } function Render() { $this->Context->Writer->Write("<div id=\"HiddenPanel\"><a href=\"javascript:RevealPanel();\">&nbsp;</a></div> <div id=\"HidePanel\"><a href=\"javascript:HidePanel();\">&nbsp;</a></div>"); } } if (@$Head) { $Head->AddScript($Context->StyleUrl."panelhider.js"); if ($Context->Session->User->Setting("HidePanel")) { $Head->AddStyleSheet($Context->StyleUrl."panelhider.hidden.css", "screen"); } else { $Head->AddStyleSheet($Context->StyleUrl."panelhider.visible.css", "screen"); } $Head->AddStyleSheet($Context->StyleUrl."panelhider.handheld.css", "handheld"); $PanelHider = $Context->ObjectFactory->NewContextObject($Context, "PanelHider"); $Page->AddControl("Panel_Render", $PanelHider); } } ?>

    Anyone here who can fix it to work in newer vanilla versions?
  • Will this be fixed? I would love to have this extenison :-)
  • Almost: http://lussumo.com/addons/?PostBackAction=AddOn&AddOnID=222
  • Right now it is not working with the default vanilla theme / style.
  • TomTesterTomTester New
    edited March 2007
    To hide the panel on non-vanilla-pages that I create in PageManager I simply insert this code at the top of the page HTML field:
    <style type="text/css"> Body {background-image: none;} #Panel {display:none;} #Content {margin:0px 18px;} </style>
    Note: briefly tested, but it seems to work fine in Opera 9.10, FF 2.0.0.2 and IE 7.0.57)

    Tried the following on themes in FF2 (with positive results):
    vanilla default, black and white, europeaftertherain, vaneablack, YHbeta, Scene 1.0
  • has anyone got the panelhider to work with vanilla 1.1.4 default theme? I get a 'javascript alert 404 error' after i click hide, and again when i click on reveal. i traced it to the following function in extensions/HidePanel/panelhider.js if you look in function HidePanel() and function RevealPanel() you will see; var dm = new DataManager(); dm.RequestCompleteEvent = PanelHide_Success; dm.RequestFailedEvent = HandleFailure; dm.LoadData("/ajax/switch.php?Type=HidePanel&Switch=1"); the line "dm.LoadData("/ajax/switch.php?Type=HidePanel&Switch=1");" saves the current state of the panel so when you refresh the page it keeps it as is. if i comment this line, the panel will hide and show fine - but won't keep its state on page refresh. my question is: does 'PanelHide_Success' need to exist somewhere else, and do i need to make any changes to ajax/switch.php code? please advise, thanks! -starscream
This discussion has been closed.