<?php

if ( ! @include_once( './mainfile.php' ) ) { exit( '!! INCLUDE ERROR. ACCESS DENIED !!' ); }
error_reporting( _E_VALUE );


/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | myPHPNuke Version 188_8 RC2                                          |
// +----------------------------------------------------------------------+
// | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html              |
// +----------------------------------------------------------------------+
// | Support: http://myphpnuke.com/                                       |
// +----------------------------------------------------------------------+
// | Author: myPHPNuke Dev Team                                           |
// +----------------------------------------------------------------------+
// | Copyright: © 2001-2004 myPHPNuke Dev Team                            |
// +----------------------------------------------------------------------+
// $Id: pollBooth.php,v 1.7.2.3 2004/04/18 12:45:44 ajvwaay Exp $




/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2001 by Francisco Burzi (fburzi@ncc.org.ve)            */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

//if(!isset($mainfile)) { include("mainfile.php"); }

include_once './pollFunctions.php';

if(!isset($pollID))
{
    include ('header.php');

    echo"<h1>" . translate( 'Poll Archive' ) . "</h1>";

    echo "<br /><br />\n";

    OpenTable();

        pollList();

    CloseTable();

    include ('footer.php');
}
else if( isset( $forwarder ) )
{
    pollCollector($pollID, $voteID, $forwarder);
}
else if( isset( $_REQUEST['op'] ) && $_REQUEST['op'] == "results" && $pollID > 0)
{
    include ("header.php");

    echo"<h1>" . translate( 'Poll Results' ) . "</h1>";

    echo "<br /><br />\n";

    OpenTable();

    //echo "<center><table cellpadding=0 cellspacing=2 border=0 bgcolor=\"$bgcolor2\"><tr><td colspan=2>";
    //echo "<table cellpadding=5 cellspacing=2 border=0 bgcolor=\"$bgcolor1\"><tr><td><center>";

    pollResults($pollID);

    //echo "</td></tr></table></td></tr></table></center><br><br>";

    CloseTable();

    $cookie = cookiedecode();

//    if (($pollcomm) AND ($mode != "nocomments")) {

    if (isset($pollcomm) && $pollcomm == 1)
    {

        echo "<br /><br /><br />\n";

        if ( $anonpost == 1 || _MPN_USER || _MPN_ADMIN )
        {
            echo "<a class='bare' href='./pollcomments.$phpEx&#063;op&#061;Reply&amp;pid&#061;0&amp;pollID&#061;$pollID'>\n";

                echo "<span class='button'>\n";

                     echo translate( 'Post A Comment' );

                echo "</span>\n";

            echo "</a>\n";

            echo "<br /><br /><br />\n";
        }

        include("pollcomments.php");
    }

    include ("footer.php");
}
else if ( isset($voteID) && $voteID > 0 )
{
    pollCollector($pollID, $voteID);
}
else if ( $pollID != pollLatest() )
{
  include ('header.php');

  echo"<h1>".translate("Previous Poll/Survey")."</h1>";

  echo "<br /><br />\n";

  OpenTable();

  //echo"<div align=\"center\"><B>".translate("Previous Poll/Survey")."</B></div><P>";
  //echo "<center><table border=0 width=200><tr><td align=\"center\">";

  pollMain($pollID);

  //echo "</td></tr></table></center>";

  CloseTable();

  include ('footer.php');
} else {
  include ('header.php');

  echo"<h1>".translate("Current Poll/Survey")."</h1>";

  echo "<br /><br />\n";

  //OpenTable();

  //echo "<center><table border=0 width=160><tr><td align=\"center\">";

    echo "<div class='center w40'>\n";

        build_box(BLOCK_TYPE_POLL, 0, '', '', 0);

    echo "</div>\n";

  //echo "</td></tr></table><br>";

 // CloseTable();
  include ('footer.php');
}

?>
