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

Integrate an external page

edited May 2006 in Vanilla 1.0 Help
Hi, i need some help. I'm not very good in scripting so thats my problem: I want to integrate an external page into my vanilla community. It sould work like this - the user clicks the menu button (like categories) and where normally the discussions start, sould be an iframe or the script of the external page. How does this work?? could you help me in figuring it out! thanks Etzl

Comments

  • Options
    NickENickE New
    edited April 2006
    If you've got php5 then you could give the page manager extension a shot, but if not then you could rewrite a little of this to work with vanilla 0.9.2. If you wait a little until vanilla 1 comes out there should be more options.
  • Options
    page manager doesnt work, i have already tried this extension. And when i want to enable your script an error appears.

    Fatal error: Call to undefined function: addtodelegate() in /home/szenografie/public_html/extensions/custompage.php on line 13

    when does vanilla 1 comes out? do you know?

    thanks again
    Etzl
  • Options
    That's why I mentioned 'rewrite'; it's for 0.9.3/1 at the moment, but it wouldn't take a whole lot of work to get it to work for 0.9.2. As for the ETA of vanilla 1, I don't think there's a set date for it, but I think it should be released in a couple of weeks at max.
  • Options
    edited April 2006
    and to edit a file like categories.php would not work?? where is the vanilla design set? I was able to create a button next to the Account button, but i want to integrate the link now into my vanilla, with its side panel ...

    edit:: and where can i get the 0.9.3 version?
  • Options
    NickENickE New
    edited April 2006
    Haven't tested it yet, but here's the code/extension to render a custom page for vanilla. Make sure to not use the tab name but the tab value in the place where needed.
    <?php
    /*
    Extension Name: Custom Page
    Extension Url: mailto:sirnot@gmail.com
    Description: Bla
    Version: 1.0
    Author: SirNot
    Author Url: mailto:sirnot@gmail.com
    */
    
    class CustomPage
    {
    	function CustomPage(&$Context)
    	{
    		$this->Context = &$Context;
    	}
    	
    	function Render()
    	{
    		echo('your content here');
    	}
    }
    
    //include the other extensions before we exit
    $CurFile = basename(__FILE__);
    $ExtensionFile = implode('', file('appg/extensions.php'));
    if(strstr($ExtensionFile, 'include(agEXTENSIONS."'.$CurFile.'");') != FALSE)
    {
    	$ExtensionFile = explode('include(agEXTENSIONS."'.$CurFile.'");', $ExtensionFile);
    	eval($ExtensionFile[1]);
    }
    
    $Page->AddControl('Foot_Render', $Foot);
    $Page->AddControl('Page_Unload', $PageEnd);
    
    $Context->Session->Check(agSAFE_REDIRECT);
    $CustomPage = $Context->ObjectFactory->NewContextObject($Context, 'CustomPage');
    
    $Context->PageTitle = 'page title here';
    $Menu->CurrentTab = 'tab value here';
    $Panel->CssClass = 'DiscussionPanel';
    $Body->CssClass = 'Discussions';
    
    AddTextModeToPanel($Context, $Panel);
    AddGuestInfoToPanel($Context, $Panel);
    
    $Page->AddControl('Head_Render', $Head);
    $Page->AddControl('Menu_Render', $Menu);
    $Page->AddControl('Panel_Render', $Panel);
    $Page->AddControl('Body_Render', $CustomPage);
    
    $Page->FireEvents();
    exit();
    
    ?>
    And you can find the latest version of vanilla on the SVN repository.
  • Options
    Etzl - I was just working on something similar to what you're trying to do this afternoon. I haven't gotten in deep enough to write things as extensions yet, but I can hack at the code alright. If you want my little 'cheat sheet', you can take a look at it here: http://emmalynsdad.com/how_to_add_new_pages_to_vanilla.txt Just remember, this is working with 0.9.3 from svn, so if you have .9.2 it will be different. And I wouldn't recommend hacking up the code in this manner by any means!! This is just the system I worked out for adding new tabs/pages/anything to a standard vanilla install. But if it works out for ya, go for it. It's unsupported and could horribly destroy your install. You've been warned. :P At the moment, I'm actually trying to work out a way to turn a vanilla install into a full site. Once the changes are complete and 1.0 is released, I plan on making myself a php script to automatically generate the framework for a new tab/section that I can then add whatever code I need to.
  • Options
    ok, thanks,
    i will install the latest version and then thy your things.

    thx
  • Options
    I'm really interested in this idea, as I would like to integrate my entire site into Vanilla with the ability to use the login feature, theme, etc.

    However, since I'm very new to Vanilla script architechture, I'm having some problems understanding your notes, DigitaLink.Where can I find some more info on how to hardwire my own pages into Vanilla's tabs with user authentication, file download ability, form submission, etc, etc?

    Also I've created a tab using DigitalLink's change in appg/init_vanilla.php that links to a current CategoryID=5, but whenever you click the new tab, it does load the correct page, but the tab selected is now Discussions...is it possible to change this?

    I apologize for all the questions, I just so stoked about all this!

    p.s. Will there ever be a creation of manuals? Similar to Perl or PHP for reference to all the classes, variables, etc, etc?

    SkyBlueshoes
This discussion has been closed.