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

Extension troubles: Who's Online & Homemade

edited March 2006 in Vanilla 1.0 Help
A couple of extension problems:

1.
I've been having trouble getting the 'who's online' extension to work. I have checked past posts and found nothing to aid me. Basically after I install the extension (v 1.1) I get these error messages:
Warning: Missing argument 5 for update() in /home/content/d/a/n/danrourke/html/forum/library/Utility.Database.class.php on line 130

Fatal error: Call to a member function on a non-object in /home/content/d/a/n/danrourke/html/forum/library/Utility.Database.class.php on line 132
I then have to delete the extension and manually remove from extension list.

Am I missing something important? Is there a file I haven't opened access to or something? I am stumped...

2.
I tried making my own, very simple, panel link list (based on this control panel page in the docs).

The PHP I made is here: http://www.huge-entity.com/forum/extensions/Siteindex.php

And as you can see if you run it i get this error:
Parse error: parse error, unexpected T_IF in /home/content/d/a/n/danrourke/html/forum/extensions/Siteindex.php on line 12
My knowledge of PHP is very very minimal (going on about 4 days experience so far). What have I missed?

Thanks

Comments

  • Options
    >What have I missed?
    The actual source might help a bit.
  • Options
    edited March 2006
    Here's the source for my failed siteindex.php
    <?php

    if ($Context->SelfUrl == "index.php") {

    $Siteindex = $Context->GetDefinition("Index");
    $Panel->AddList($Siteindex);

    $Panel->AddListItem($Siteindex,
    $Context->GetDefinition("Home"),
    "http://www.huge-entity.com");

    $Panel->AddListItem($Siteindex,
    $Context->GetDefinition("Popular"),
    "http://del.icio.us/0bvious/popular-posts?settagview=cloud"};

    $Panel->AddListItem($Siteindex,
    $Context->GetDefinition("Contact"),
    "http://www.huge-entity.com/2005/03/contact-form.html"};
    }
    ?>
  • Options
    Well, one obvious problem. These lines should have parentheses at the end, not curly braces.
    $Panel->AddListItem($Siteindex, $Context->GetDefinition("Popular"), "http://del.icio.us/0bvious/popular-posts?settagview=cloud"}; $Panel->AddListItem($Siteindex, $Context->GetDefinition("Contact"), "http://www.huge-entity.com/2005/03/contact-form.html"};
  • Options
    edited March 2006
    Thanks...

    But what it is about line 12 (if ($Context->SelfUrl == "index.php") { ) that brings back that error?

    Also, anyhelp with the who's online extension would be greatly appreciated.

    I think one of the functions involved in updating the guest's info in mySQL is not set up properly. Do I have to open access to these files manually? I'm lost
  • Options
    The error I keep getting for the whosonline extension (mentioned above) leads me to line 30 + 32 of the utility.database.class.php file. Here's the code from that position
    function Update(&$Context, $SqlBuilder, $SenderObject, $SenderMethod, $ErrorMessage, $KillOnFail = "1") {
    $KillOnFail = ForceBool($KillOnFail, 0);
    if (!mysql_query($SqlBuilder->GetUpdate(), $this->Connection)) {
    I am sure there is something simple I have not done to my database... Please help ;-)
  • Options
    lechlech Chicagoland
    curly braces {} shouldn't even be in there last time I looked at this source.
  • Options
    THIS IS WHY GOD INVENTED ALLMAN-STYLE BRACKETS.
  • Options
    I'm guessing no one can help me with this then? I'm still stumped
  • Options
    Well version 1.1 of Who's Online looks like it's for 0.9.3, not .2, so if you're running the current stable version of Vanilla you're going to have to downgrade the extension for it to work.

    Then your own extension should look something along the lines of this, although I haven't actually tested it yet:
    <?php
    
    if ($Context->SelfUrl == 'index.php')
    {
    	$Siteindex = $Context->GetDefinition('Index');
    	$Panel->AddList($Siteindex);
    	
    	$Panel->AddListItem($Siteindex, 
    		$Context->GetDefinition('Home'), 
    		'http://www.huge-entity.com');
    	
    	$Panel->AddListItem($Siteindex, 
    		$Context->GetDefinition('Popular'), 
    		'http://del.icio.us/0bvious/popular-posts?settagview=cloud');
    	
    	$Panel->AddListItem($Siteindex, 
    		$Context->GetDefinition('Contact'), 
    		'http://www.huge-entity.com/2005/03/contact-form.html');
    }
    
    ?>
  • Options
    Thanks a lot... i knew it would be something simple. Still can't get the site index php to work. I will keep beavering away. Thanks again
  • Options
    lechlech Chicagoland
    notice that there are no curly braces anywhere in there!
  • Options
    Um, there are two curly braces in there.
  • Options
    lechlech Chicagoland
    ok, so I lied.
This discussion has been closed.