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.

How to build entire new pages...

2»

Comments

  • Yeah, cheers for that fix. Be sure to add that extension to the wiki if it isnt already, looks like a pretty nice job front-end to me though i havent checked the back side of it yet. The permissions thing does seem worth avoiding if possible though. It'd need a warning about that if you do put it on the wiki.
  • BenBen
    edited October 2005
    I get the following errors when I try to use it.

    Warning: fopen(extensions/CustomPages.txt): failed to open stream: Permission denied in /vanilla/extensions/tabmanager.php on line 62 Warning: Variable passed to each() is not an array or object in /vanilla/extensions/tabmanager.php on line 46 Warning: reset(): Passed variable is not an array or object in /vanilla/extensions/tabmanager.php on line 55
  • NickENickE New
    edited October 2005
    That's because the directory in which CustomPages.txt will be located has to have read/write permissions on it. Correction, PageMng.php (or whatever you named it as) needs to be able to read and write to the directory in which CustomPages.txt resides. If you guys wanted I could make it use a MySQL table. Just seemed a bit overkill for this one extension, especially since it probably won't be very widely used and the information it needs to store is very minimal. EDIT: By the way, if you downloaded that extension more than 5 minutes ago or so, I'd redownload it. There was a bug in it which didn't allow other extensions included after it to run when you clicked a custom page.
  • Ahh, not the root vanilla directory, my mistake...

    Is there any way to include PHP on the pages? Or can only HTML be used?
  • You should now be able to embed PHP within the HTML file, the beginning tag just has to be <?php, not the shortened version. This might be buggy, so bear with me if it dosn't work fully as planned.
  • With the new rev of vanilla I believe there will be a extensions table. Usefull for things like this.
  • Yeah krak - but worth avoiding if it is set data and fairly minimal. Perhaps the best thing to do would be to move the writeable directory below web level as i think mark is planning for some other folders for the next rev after security discussions.
  • edited October 2005
    I'd like to be able to refer to the user name or his favorite color or whatever variable (taken from the user's profile) within the text of a page created using SirNot's extension. Is that possible? Example: echo "Hello ".$username; Where and how can I define $username to be the session's user real name?
  • NickENickE New
    edited October 2005
    You'd want this:
    
    <?php
    global $Context;
    
    echo('Hello '.(!$Context->Session->User->RoleID ? 
    	$Context->GetDefinition('Guest') : 
    	$Context->Session->User->Name));
    
    ?>
    
    Treat any code you enter in that like a function; any variables you want to use that are in the global scope you have to include like that, as it's going to be parsed within the CustomPage->Render() function.
  • Thanks a bunch SirNot! :) This brings Vanilla to a whole new level...
  • Something odd with 1.4 - 1.1 works just fine, but I cant get 1.4 to work. The panel link is there, the links work, I can edit, change, etc the pages, but the tabs dont show up. I tried all disabling extensions and nothing worked. Something off with the tabs.
  • NickENickE New
    edited October 2005
    That's because your CustomPages.txt file is a different format. Versions 1.3+ use a different array structure, as they allow you to change to roles which can see it. Try clicking the Resync Tabs link then editing all your custom tabs (making sure that all the roles you want it to display to are checked), as that should add that last array element which says which user roles can see which tabs. I'm afraid you'll also have to delete any system tabs which you edited, as there's a bug in the earlier versions of the extension which dosn't edit those properly.
This discussion has been closed.