Connecting my retro to thehabbos.org

Results 1 to 2 of 2
  1. #1
    Account Upgraded | Title Enabled! QuixFounder is offline
    MemberRank
    Aug 2012 Join Date
    United KingdomLocation
    284Posts

    Connecting my retro to thehabbos.org

    Hye guys! i have got my account sorted on thehabbos.org but im having some trouble connecting it to my reto, i get this error:


    Heres the class.validate.php:

    <?php
    ////////////////////////////////////////////////////////
    // # TheHabbos Topsites API Script - Release 1.0.3 //
    // # Ā© Copyright TheHabbos 2011. All rights reserved. //
    ////////////////////////////////////////////////////////

    if(!defined('IN_THEHABBOS_API')) {
    die('Sorry, but you can not access this file directly. :(');
    }

    class Validate {

    public function validateVote() {
    global $CONFIG;
    if($this->checkCookie()) {
    return 2;
    }else{
    $data = $this->getData('http://votingapi.com/validate.php?user='.$CONFIG['Username'].'&ip='.$_SERVER['REMOTE_ADDR']);
    if(!$data || !is_numeric($data)) {
    return 6;
    }else{
    if($data == 1 || $data == 2) {
    $this->setCookie();
    }
    return $data;
    }
    }
    }

    private function getData($url) {
    global $CONFIG;
    if($CONFIG['Curl_Enabled']) {
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, $CONFIG['Timeout']);
    return curl_exec($ch);
    }else{
    $context = stream_context_create(array('http' => array('timeout' => $CONFIG['Timeout'])));
    return @file_get_contents($url, 0, $context);
    }
    }

    public function setCookie() {
    $resetTime = $this->getResetTime();
    setcookie('voting_stamp', $resetTime, $resetTime);
    }

    private function checkCookie() {
    $resetTime = $this->getResetTime();
    if(isset($_COOKIE['voting_stamp'])) {
    if($_COOKIE['voting_stamp'] == $resetTime) {
    return true;
    }else{
    setcookie('voting_stamp', '');
    return false;
    }
    }else{
    return false;
    }
    }

    private function getResetTime() {
    $defaultTime = date_default_timezone_get();
    date_default_timezone_set('America/Chicago');
    $resetTime = mktime(0, 0, 0, date('n'), date('j') + 1);
    date_default_timezone_set($defaultTime);
    return $resetTime;
    }


  2. #2
    Developer Eronisch is offline
    MemberRank
    Jul 2009 Join Date
    The NetherlandsLocation
    1,328Posts

    Re: Connecting my retro to thehabbos.org

    I'm going to safe you a lot of time, the best thing you can do is create a cloudflare rule to let people vote for your hotel.

    [TUT] RevCMS Index Voting [TUT] | DevBest.com - Community of Developers



Advertisement