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.
Options

Flash header

edited February 2006 in Vanilla 1.0 Help
We just launched our forums using Vanilla, and they are great, but I would like the forums to match the rest of our site and use the Flash navigation the rest of the site uses. How can I add it and also control the width of the forum. Here are examples of the site and forum Forum http://mygreenworld.org/forums/ Our Site with the flash header http://greenchefs.tv/ Also our wiki with the flash header http://gknowledge.org/
«1

Comments

  • Options
    edited December 2005
    On 0.9.2, the only way I can think of to do it (short of editing control files) would be to put the flash code in the Banner Title setting, and style the site around that. Not very easy, but theoretically doable. EDIT: Scratch that, there seems to be some kind of HTML filter on that field that causes it not to work.
  • Options
    I did it on my site. there was an extension to do it called menu.php
  • Options
    how do you use that extension?
  • Options
    you're almost certainly going to have to edit controls/Common.Controls.php because the tabs sit inside the header div, but it's a very simple to move the tags around a bit. And doesn't seem to cause any scalability problems.
  • Options
    Navitron, where is your site, and can you give me some more details how to do it. The forum is one of the last items I need to change to have a universal navigation on the site.
  • Options
    MarkMark Vanilla Staff
    edited January 2006
    Sorry I missed this one - I can't seem to catch every help request any more.

    I caught your post about this on the blog, and I figured I'd show you that even with vanilla 0.9.2.x it can be very easy to accomplish this.

    Here is a quick extension I wrote that inserts an html file at the top of the page:

    <?php /* Extension Name: Banner Insertion Extension Url: N/A Description: Inserts a banner at the top of the page Version: 1.0 Author: Mark O'Sullivan Author Url: http://markosullivan.ca/ Copyright 2003 - 2005 Mark O'Sullivan This file is part of Vanilla. Vanilla is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Vanilla is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA The latest source code for Vanilla is available at www.lussumo.com Contact Mark O'Sullivan at mark [at] lussumo [dot] com */ if (in_array($Context->SelfUrl, array("index.php","comments.php", "account.php", "settings.php", "search.php", "post.php"))) { class BannerInsertion extends Control { function BannerInsertion(&$Context) { $this->Control($Context); } function Render() { include("./extensions/BannerInsertion/your_banner.html"); } } $BannerInsertion = new BannerInsertion($Context); $Head->AddStyleSheet("./extensions/BannerInsertion/style.css"); $Page->AddControl("Menu_Render", $BannerInsertion); } ?>

    Obviously, you'd need to place this code in a file within your extensions folder called "BannerInsertion.php". Then you'd need to create a folder called "BannerInsertion" and within that folder create a "your_banner.html" file with your custom banner in there.

    You will also probably need to customize the CSS a bit to suit your needs, so I threw in another line there for a custom css file in your "BannerInsertion" folder called "style.css".

    Good Luck!
  • Options
    Mark, Thank you for quick response and solution. I will try this out.
  • Options
    Mark, I activated the extension and I get the following error which took down the forum. Parse error: parse error, unexpected '{' in /home/greenzon/public_html/community/forums/extensions/BannerInsertion.php on line 19
  • Options
    MarkMark Vanilla Staff
    Woops. I forgot a parentheses.

    But you seriously shouldn't be applying a test extension on a live server. You should test it on a local machine first. Don't you have a local copy of your site on your home machine?

    Anyway, re-copy that code and it should work - but you'll still have some css issues to deal with - which is why I still say you should test it out somewhere else first.
  • Options
    I don't have a working server here, I am building the site on my powerbook. But I only take the forum down for a second. I have a back up extension file, which I just quickly upload. Again, thank you for your help. I used the new code, and received this error: Fatal error: Cannot instantiate non-existent class: bannerinsertion in /home/greenzon/public_html/community/forums/extensions/BannerInsertion.php on line 29
  • Options
    Should I upgrade the forum to 0.9.3? Or would that disable all the extensions I have working on the forum?
  • Options
    MarkMark Vanilla Staff
    Wow. I'm really sorry. Another typo - I had named the class "BlockInsertion" instead of "BannerInsertion"

    It should work now. Sorry again.
  • Options
    I'm totally new to php, so bare with me... The site I plan to use Vanilla with has a flash menu. I found this thread to mighty helpful and got this extension working, cheers. The only thing I'd like to see is the ability to add the flash file, in my case the flash menu, to the sign-in and sign-out pages. Is this possible? Thanks, GD
  • Options
    edited January 2006
    Perhaps to include it on the sign in and the sign out you'd just add -

    , "signin.php", "leave.php"

    to the

    if (in_array($Context->SelfUrl, array("index.php","comments.php", "account.php", "settings.php", "search.php", "post.php"))) {

    So that whole line would become

    if (in_array($Context->SelfUrl, array("index.php","comments.php", "account.php", "settings.php", "search.php", "post.php", "signin.php", "leave.php"))) {

    ^^the above is prolly wrong.
  • Options
    This worked great. Thanks!
  • Options
    I've found a problem. This works properly with FireFox and Safari, but Windows IE doesn't render the file. It's there, as you can drag over the space and the html box becomes selected, but without being able to see it and use it, it's just another table cell. Is anyone else having this problem? Anyone know how to fix it? Thanks, Gerad-
  • Options
    *bump*
  • Options
    You using Flash Satay or FlashObjects?
  • Options
    Oh snap! I never thought to publish the file as a .html through Flash. I was outputting it as a .swf and then embedding it into a .html file via Dreamweaver. It works now. Thanks for your help!
  • Options
    lechlech Chicagoland
    I'd recommend http://blog.deconcept.com/flashobject/ if you want to keep things standardized and validated.
This discussion has been closed.