How to: Adding FindRetros voting to your hotel

Status
Not open for further replies.

iGlenn

:)
Jul 21, 2015
618
92
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($url, 1, $context);
if(!$data || !is_numeric($data)) {
return "Error";
}
else if ($data == 1 || $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:

AusNGrant

Member
Jun 21, 2015
74
9
Decent tutorial for the new ones out there, much easier than other tutorials where you go into cloudflare and create page rules etc etc.
 

JynX

Posting Freak
Feb 6, 2016
710
438
I've used this a few times but noticed some people run into a redirect loop, not sure what triggered it though!
Has to do with certain ISP's blocking the way it works.
 

iGlenn

:)
Jul 21, 2015
618
92
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
 

Sly

I don't break the rules I bend them.
Oct 28, 2016
246
38
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.
 

Meap

Don't need glasses if you C#
Nov 7, 2010
1,045
296
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;
}
?>
 

Detox

Member
Jul 24, 2010
365
24
I know this old!! But I added to my hotel. But it's not redirecting to client after voting. just says to wait 23 hours. What am I doing wrong?
 

Kak

Posting Freak
Apr 21, 2017
951
165
I know this old!! But I added to my hotel. But it's not redirecting to client after voting. just says to wait 23 hours. What am I doing wrong?
this is really old. i wouldnt use it. you could just make the client redirect to your voting page when you click the enter hotel button.
 
  • Like
Reactions: Joe
Status
Not open for further replies.

Users who are viewing this thread

Top