Page 1 of 1

New mini poll question with error

Posted: Fri Feb 16, 2007 7:31 am
by Gregor
Hello,

I created a user defined tag ( {enquete_admin} ) with the following code

Code: Select all

// plaats dit in enquete admin
include_once ("includes/miniPollAdmin.class.php");

$test = new miniPollAdmin;

$test->newPollForm();

if (isset($_GET['opt'])) {
    $opt = $_GET['opt'];
    $pollid = $_GET['pollid'];
    if ($opt == 'activate') {
        $test->activatePoll($pollid);
    }
    if ($opt == 'delete') {
        $test->deletePoll($pollid);
    }

}

echo "<br />";
if (isset($_GET['q'])) {
    $pollname = $_GET['pollname'];
    $q = $_GET['q'];
    $test->createPoll($pollname, $q);
}
$test->listPolls();
I inserted the tag in a new page, and while running, I get this error:
Fatal error: Cannot instantiate non-existent class: minipolladmin in /home/wsvherking/domains/wsv-herkingen.nl/public_html/lib/content.functions.php(669) : eval()'d code on line 4
Could some explain to me what this error means and how I can solve it?

Many thanks,
G

Re: New mini poll question with error

Posted: Fri Feb 16, 2007 11:14 pm
by Elijah Lofgren
Try changing:

Code: Select all

include_once ("includes/miniPollAdmin.class.php");
to:

Code: Select all

require_once ("includes/miniPollAdmin.class.php");
and see if you get an error. It could not be including and failing silently.

Hope this helps,

Elijah

Re: New mini poll question with error

Posted: Fri Feb 16, 2007 11:22 pm
by Gregor
Thanks Elijah!

I've changed it and also corrected a typo I made. Now it works. The hard part is to get it integrated in cmsms, because it opens new pages when displaying results. Perhaps something in de css, but have not figured out how that one works.