Example #1
0
function PollNewest($id = '')
{
    global $NPDS_Prefix;
    // snipe : multi-poll evolution
    if ($id != 0) {
        settype($id, "integer");
        list($ibid, $pollClose) = pollSecur($id);
        if ($ibid) {
            pollMain($ibid, $pollClose);
        }
    } elseif ($result = sql_query("SELECT pollID FROM " . $NPDS_Prefix . "poll_data ORDER BY pollID DESC LIMIT 1")) {
        list($pollID) = sql_fetch_row($result);
        list($ibid, $pollClose) = pollSecur($pollID);
        if ($ibid) {
            pollMain($ibid, $pollClose);
        }
    }
}
Example #2
0
function blocks_poll_block($row)
{
    // for MSSQL that always have an space
    $row['content'] = trim($row['content']);
    if (!empty($row['content'])) {
        $pollID = $row['content'];
    } else {
        $pollID = pollLatest();
    }
    return pollMain($pollID, $row);
}
Example #3
0
        CloseTable();
        echo '<br /><br /><table border="0" style="margin:auto;"><tr><td>';
        if (pollVoted($poll_id)) {
            pollResults($poll_id);
        } else {
            pollMain($poll_id);
        }
        echo '</td></tr></table>';
    } else {
        echo '<div style="text:align:center;" class="option">' . _CURRENTSURVEY . '</div>';
        CloseTable();
        echo '<br /><br /><table border="0" style="margin:auto;"><tr><td>';
        if (pollVoted($poll_id)) {
            pollResults(pollLatest());
        } else {
            pollMain(pollLatest());
        }
        echo '</td></tr></table>';
    }
}
/*********************************************************/
/* Functions											 */
/*********************************************************/
function pollMain($poll_id)
{
    global $prefix, $db, $MAIN_CFG, $Blocks;
    if (!isset($poll_id)) {
        $poll_id = 1;
    }
    $boxContent = "<form action=\"" . URL::index() . "\" method=\"post\" enctype=\"multipart/form-data\" accept-charset=\"utf-8\">";
    $boxContent .= "<input type=\"hidden\" name=\"pollid\" value=\"{$poll_id}\" />";
Example #4
0
function pollNewest()
{
    $pollID = pollLatest();
    pollMain($pollID);
}