Ejemplo n.º 1
0
    public static function loadVotingLinks()
    {
        connect::selectDB('webdb');
        $result = mysql_query("SELECT * FROM votingsites ORDER BY id DESC");
        if (mysql_num_rows($result) == 0) {
            buildError("Couldnt fetch any voting links from the database. " . mysql_error());
        } else {
            while ($row = mysql_fetch_assoc($result)) {
                ?>
            <div class='votelink'>
            <table width="100%">
                <tr>
                    <td width="20%"><img src="<?php 
                echo $row['image'];
                ?>
" /></td>
                    <td width="50%"><strong><?php 
                echo $row['title'];
                ?>
</strong> (<?php 
                echo $row['points'];
                ?>
 Vote Points)<td>
                    <td width="40%">
					<?php 
                if (website::checkIfVoted($row['id']) == FALSE) {
                    ?>
                    		<input type='submit' value='Vote'  onclick="vote('<?php 
                    echo $row['id'];
                    ?>
',this)">
					<?php 
                } else {
                    $getNext = mysql_query("SELECT next_vote FROM " . $GLOBALS['connection']['webdb'] . ".votelog\n\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE userid='" . account::getAccountID($_SESSION['cw_user']) . "'\n\t\t\t\t\t\t\t\t\t\t\t\t\t AND siteid='" . $row['id'] . "' ORDER BY id DESC LIMIT 1");
                    $row = mysql_fetch_assoc($getNext);
                    $time = $row['next_vote'] - time();
                    echo 'Time until reset: ' . convTime($time);
                }
                ?>
                         </td>
                     </tr>
              </table>
              </div>
			  <?php 
            }
        }
    }
Ejemplo n.º 2
0
            if (file_exists('plugins/' . $folderName . '/config.php')) {
                include_once 'plugins/' . $folderName . '/config.php';
            }
        }
    }
}
$account = new account();
$account->getRemember();
//Remember thingy.
//This is to prevent the error "Undefined index: p"
if (!isset($_GET['p'])) {
    $_GET['p'] = 'home';
}
###VOTING SYSTEM####
if (isset($_SESSION['votingUrlID']) && $_SESSION['votingUrlID'] != 0 && $GLOBALS['vote']['type'] == 'confirm') {
    if (website::checkIfVoted((int) $_SESSION['votingUrlID'], $GLOBALS['connection']['webdb']) == TRUE) {
        die("?p=vote");
    }
    $acct_id = account::getAccountID($_SESSION['cw_user']);
    $next_vote = time() + $GLOBALS['vote']['timer'];
    connect::selectDB('webdb');
    mysql_query("INSERT INTO votelog VALUES('','" . (int) $_SESSION['votingUrlID'] . "',\n\t'" . $acct_id . "','" . time() . "','" . $next_vote . "','" . $_SERVER['REMOTE_ADDR'] . "')");
    $getSiteData = mysql_query("SELECT points,url FROM votingsites WHERE id='" . (int) $_SESSION['votingUrlID'] . "'");
    $row = mysql_fetch_assoc($getSiteData);
    if (mysql_num_rows($getSiteData) == 0) {
        header('Location: index.php');
        unset($_SESSION['votingUrlID']);
        exit;
    }
    //Update the points table.
    $add = $row['points'] * $GLOBALS['vote']['multiplier'];
Ejemplo n.º 3
0
<?php

/*
            _____           ____
           |   __|_____ _ _|    \ ___ _ _ ___
           |   __|     | | |  |  | -_| | |_ -|
           |_____|_|_|_|___|____/|___|\_/|___|
    Copyright (C) 2013 EmuDevs <http://www.emudevs.com/>
*/
require '../ext_scripts_class_loader.php';
if (isset($_POST['siteid'])) {
    $siteid = (int) $_POST['siteid'];
    connect::selectDB('webdb');
    if (website::checkIfVoted($siteid, $GLOBALS['connection']['webdb']) == TRUE) {
        die("?p=vote");
    }
    connect::selectDB('webdb');
    $check = mysql_query("SELECT COUNT(*) FROM votingsites WHERE id='" . $siteid . "'");
    if (mysql_result($check, 0) == 0) {
        die("?p=vote");
    }
    if ($GLOBALS['vote']['type'] == 'instant') {
        $acct_id = account::getAccountID($_SESSION['cw_user']);
        if (empty($acct_id)) {
            exit;
        }
        $next_vote = time() + $GLOBALS['vote']['timer'];
        connect::selectDB('webdb');
        mysql_query("INSERT INTO votelog (siteid,userid,timestamp,next_vote,ip)\n\t\tVALUES('" . $siteid . "','" . $acct_id . "','" . time() . "','" . $next_vote . "','" . $_SERVER['REMOTE_ADDR'] . "')");
        $getSiteData = mysql_query("SELECT points,url FROM votingsites WHERE id='" . $siteid . "'");
        $row = mysql_fetch_assoc($getSiteData);