1. Tired of not being able to see links? Want to chat with other members? Need help?

How to: Adding FindRetros voting to your hotel

Discussion in 'Habbo Tutorials' started by iGlenn, Oct 26, 2016.

  1. iGlenn

    iGlenn :)

    I realize there are a ton of tutorials on this but for some reason people still seem to struggle and make threads about it so today I will show you how to guarentee get the voting system setup on your hotel.

    What you will need:
    - FindRetros account to setup an ad page
    - Banner
    - Common sense

    1. Register on FindRetros and create an ad for your hotel (If you already have then skip to step 2.)

    2. Make a file in your skin folder called forcevote.php and add this code
    PHP:
    <?php
    if(isset($_GET['voted'])) {
    }
    else {
    $userip "{$_SERVER['REMOTE_ADDR']}";
    $current_url substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
    $url 'http://votingapi.com/validate.php?user=habbo&ip=' $userip;
    $context stream_context_create(array('http' => array('timeout' => 1)));
    $data = @file_get_contents($url1$context);
    if(!
    $data || !is_numeric($data)) {
    return 
    "Error";
    }
    else if (
    $data == || $data == 2) {
    }
    else {
    header ("Location: http://votingapi.com/vote.php?username=habbo&api=http:!!habbo.com!index?novote");
    exit;
    }
    }
    ?>
    We're not done so don't save the file yet! Now where it says...
    PHP:
    $url 'http://votingapi.com/validate.php?user=habbo&ip=' $userip;
    Replace the word habbo with your FindRetros voting page username (NOT YOUR LOGIN USER)
    Also where it says...
    PHP:
    header ("Location: http://votingapi.com/vote.php?username=habbo&api=http:!!habbo.com!index?novote");
    Replace habbo with your FindRetros voting page username and lastly where it says habbo.com change just that to your hotel url (Don't mess with the code or your voting wont work!)

    3. Now whatever page you want users to be prompt to vote add this at the very top of that file (Usually above <!DOCTYPE html>)
    PHP:
    <?php include_once ("forcevote.php");
    ?>
    Client.php, Index.php, or Me.php is usually where most hotels decide to put theirs but its up to you where you want yours! I don't recommend on the index as apparently findretros is against it but i see a whole bunch of hotels who still do it so do at your own risk.

    4.
    Refresh and if you did it right you now have voting :)

    NOTE: Some people may get a voting loop or some other silly problem and if so then i'm sorry. By the time you see this I probably quit devbest so will not be providing support!
     
    Last edited: Oct 31, 2016
    Poizone and AusNGrant like this.
  2. AusNGrant

    AusNGrant Member

    Decent tutorial for the new ones out there, much easier than other tutorials where you go into cloudflare and create page rules etc etc.
     
    iGlenn likes this.
  3. iGlenn

    iGlenn :)

    thanks :)
     
  4. JMG

    JMG wut wut Staff Member

    I've used this a few times but noticed some people run into a redirect loop, not sure what triggered it though!
     
    Brought and iGlenn like this.
  5. JynX

    JynX Depression is merely anger without enthusiasm.

    Has to do with certain ISP's blocking the way it works.
     
  6. JMG

    JMG wut wut Staff Member

    I thought that, I noticed BT blocked this.
     
    JynX likes this.
  7. Poizone

    Poizone Member

    Not bad.
     
    iGlenn likes this.
  8. iGlenn

    iGlenn :)

    I realize this may not work for everyone and if so then I'm sorry. It worked for me so I thought id share. If it doesn't work for you then just remove it :p
     
    Poizone likes this.
  9. Sly

    Sly Owner of Robbo

    This is old and it doesnt work, well it works but some users may not be able to connect. Use the API thats given on Findretros.
     
  10. Meap

    Meap Don't need glasses if you C#

    or just use this
    Code:
    <?php
    $ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
    $url = 'http://votingapi.com/validate.php?user=George&ip=' . $ip;
    $hasvoted = @file_get_contents($url);
    if($hasvoted != '1' && $hasvoted != '2'){
     header ("Location: https://findretros.com/vote/George");
     exit;
    }
    ?>
     

Share This Page

Loading...