Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
CMS Releases
[CMS] Vote Plugin
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Elo" data-source="post: 174627" data-attributes="member: 4705"><p>Since this got bumped yesterday and people still seems to use this I've edited the function slightly, removed some useless variables and code. I also replaced the form with a header (votingapi.com required a form to be sent before).</p><p> </p><p>Haven't tested it, let me know if it does not work.</p><p> </p><p>[PHP] </p><p> </p><p> final public function CheckIfVoted($ip) {</p><p> global $_CONFIG;</p><p> $context = stream_context_create(array('http' => array('timeout' => 2)));</p><p> $data = file_get_contents('http://votingapi.com/validate.php?user=' . $_CONFIG["thehabbos"]["username"] . '&ip=' . $_SERVER["REMOTE_ADDR"], 0, $context);</p><p> if(!$data || !is_numeric($data)) {</p><p> echo "<!--[ERROR] System failure in voting system.-->";</p><p> return false;</p><p> } elseif($data == 3) {</p><p> $return = str_replace('/', '!', 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);</p><p> header("Location: http://votingapi.com/vote.php?username=" . $_CONFIG["thehabbos"]["username"] . "&api=" . $return);</p><p> exit;</p><p> }</p><p> }</p><p> </p><p>[/PHP]</p></blockquote><p></p>
[QUOTE="Elo, post: 174627, member: 4705"] Since this got bumped yesterday and people still seems to use this I've edited the function slightly, removed some useless variables and code. I also replaced the form with a header (votingapi.com required a form to be sent before). Haven't tested it, let me know if it does not work. [PHP] final public function CheckIfVoted($ip) { global $_CONFIG; $context = stream_context_create(array('http' => array('timeout' => 2))); $data = file_get_contents('http://votingapi.com/validate.php?user=' . $_CONFIG["thehabbos"]["username"] . '&ip=' . $_SERVER["REMOTE_ADDR"], 0, $context); if(!$data || !is_numeric($data)) { echo "<!--[ERROR] System failure in voting system.-->"; return false; } elseif($data == 3) { $return = str_replace('/', '!', 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]); header("Location: http://votingapi.com/vote.php?username=" . $_CONFIG["thehabbos"]["username"] . "&api=" . $return); exit; } } [/PHP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
CMS Releases
[CMS] Vote Plugin
Top