Client Voting API.

Status
Not open for further replies.

jayk

Retired Habbotard.
Sep 4, 2013
517
94
I have it set up prefectly I believe, when we enter client it takes us to votingAPI, when we click it to vote, it takes us to client!! Doesn't make us vote at all! D:

My API config.php:
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. :(');
}

/* FEEL FREE TO EDIT ANYTHING BELOW */

$CONFIG['Username'] = 'Lostt'; //thehabbos topsites username
$CONFIG['URL']      = 'http://habnut.co.uk/client'; //the location to the file api.php on your website (i.e. http://example.com/api.php)
$CONFIG['Type']    = 'client'; //current options: other or client (thehabbos_api/types)
$CONFIG['Style']    = 'Habbo Sleek'; //don't change this unless you have created your own style (thehabbos_api/styles)
$CONFIG['Credits']  = '1000'; //you can use this if you are using a specific type above - your users will be rewarded this many credits for voting

/* ADVANCED OPTIONS */

$CONFIG['Timeout']      = 2; //max amount of seconds before the api stops trying to connect to votingapi.com
$CONFIG['Curl_Enabled'] = 0; //mark this 0 if cURL isn't installed/enabled on your server, although cURL is recommended

/* DO NOT EDIT ANYTHING BELOW */

$votingValidation = new Validate();
$CONFIG['Status'] = $votingValidation->validateVote();
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Put this in client.php at the very top:

PHP:
<?php 
define('IN_CLIENT', 1);
global $CONFIG;
require_once 'thehabbos_api/force.client.php';
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Make sure it links up to the actual folder, try this:

PHP:
<?php
define('IN_CLIENT', 1);
global $CONFIG;
require_once '/thehabbos_api/force.client.php';
 

jayk

Retired Habbotard.
Sep 4, 2013
517
94
I have fixed a part, I made it now it just stays on the voting API, doesn't let you vote or anything.
How do I fix?
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
I have fixed a part, I made it now it just stays on the voting API, doesn't let you vote or anything.
How do I fix?

This is probably because of CoudFlare. Add this to the config.php of TheHabbos API:

PHP:
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; }

At the top.
 

jayk

Retired Habbotard.
Sep 4, 2013
517
94
This is probably because of CoudFlare. Add this to the config.php of TheHabbos API:

PHP:
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; }

At the top.

Yes, thanks for your help. It worked, we had something wrong with my config bahaha!
Thanks, !
 
Status
Not open for further replies.

Users who are viewing this thread

Top