<?php

session_start();
include './dataAcces/dataAcces.php';
if (!isset($_SESSION['usrid'])) {
    echo 'nolog';
} else {
    if (isset($_POST['video']) && isset($_POST['action'])) {
        $checkok = false;
        $check = checkvote($_POST['video'], $_SESSION['usrid']);
        if ($row = pg_fetch_array($check)) {
            $checkok = true;
            $prevvote = $row['vote'] == 't' ? true : false;
            $idprevvote = $row['idvotexuser'];
        }
        if ($_POST['action'] == "up") {
            if ($checkok) {
                if ($prevvote) {
                    echo 'nothing';
                    //if he already voted for good
                } else {
                    changevote($_POST['video'], $_SESSION['usrid']);
                    echo 'changedu';
                }
            } else {
                if (upvote($_POST['video'])) {
                    newvote($_POST['video'], $_SESSION['usrid'], "true");
                    echo 'yes';
                } else {
                    echo 'no';
                }
Exemple #2
0
function showsoflash()
{
    global $_G, $poll_setting;
    $check = checkvote('check');
    if ($check['so']) {
        return "\n\t\t\t<div id=\"soflash\">\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\$('soflash').innerHTML = AC_FL_RunContent(\n\t\t\t\t\t\t'width', '1', 'height', '1',\n\t\t\t\t\t\t'src', '" . STATICURL . "image/common/soflash.swf?site={$_G['siteurl']}misc.php%3fmod=so%26&module=poll&pollid={$poll_setting['itemid']}&operation=config&random=" . random(4) . "',\n\t\t\t\t\t\t'quality', 'high',\n\t\t\t\t\t\t'id', 'soflash_swf',\n\t\t\t\t\t\t'menu', 'false',\n\t\t\t\t\t\t'allowScriptAccess', 'always',\n\t\t\t\t\t\t'wmode', 'transparent'\n\t\t\t\t\t);\n\t\t\t\t</script>\n\t\t\t</div>\n\t\t";
    } else {
        return '';
    }
}