Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mv_vote_times() {
- global $mvdb;
- // WHERE (`user` = '%1:s' OR `ip` = '%2:s')
- $data = $mvdb->escapedAllResultsAssoc("SELECT `".DBPRE."votes`.`id`,
- `".DBPRE."votes`.`site`,
- `".DBPRE."sites`.`waittime`,
- `".DBPRE."votes`.`callbackdate`,
- `".DBPRE."votes`.`fulfilled`,
- (`callbackdate` > UTC_TIMESTAMP() - INTERVAL `waittime` HOUR) `outoftime`
- FROM `".DBPRE."votes`
- INNER JOIN
- (SELECT max(`id`) AS `id`, `site` FROM `".DBPRE."votes`
- WHERE (`user` = '%1:s' OR `ip` = '%2:s')
- GROUP BY `site` ORDER BY `callbackdate` DESC) `dest`
- ON `dest`.`id` = `".DBPRE."votes`.`id`
- INNER JOIN `".DBPRE."sites` ON `".DBPRE."sites`.`id` = `".DBPRE."votes`.`site`
- WHERE `callbackdate` IS NOT NULL AND ((`callbackdate` > UTC_TIMESTAMP() - INTERVAL `waittime` HOUR) OR `fulfilled` = 0) AND (`user` = '%3:s' OR `ip` = '%4:s')",
- $_SESSION['user'], $_SERVER['REMOTE_ADDR'], $_SESSION['user'], $_SERVER['REMOTE_ADDR']);
- return $data;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement