New mini poll question with error

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

New mini poll question with error

Post 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
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: New mini poll question with error

Post 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
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: New mini poll question with error

Post 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.
Post Reply

Return to “CMSMS Core”