Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[NOOB-FRIENDLY] How to add index voting to revcms [NOOB-FRIENDLY]

Status
Not open for further replies.
Initiate Mage
Joined
Jul 2, 2009
Messages
59
Reaction score
15
How to add index voting to revcms

Hello Everyone,

My friend was looking around for a tutorial on how to add voting to your login page and all that
and he couldn't find anything. I don't know if there is any out there that actually help people
or that is done my way but i am going to make a very short and simple tutorial for you all.

Ok this is only for RevCMS and i will not be offering support to you as i'm never on the forums anyway but ill try make it very easy

-------------------------------------------------------------------------------------------------------------

Ok lets start.

1. Open app/class.template.php and add ths code:

Code:
$this->setParams('votecheck', $core->CheckIfVoted($_SERVER['REMOTE_ADDR']));

Just add it uder the Mysql port or something i dont think it really matters aslong as its with the other ones like that.

2. Now open app/class.core.php and under this code

Code:
<?php 

namespace Revolution;
if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }
class core implements iCore
{

Add this code:
Code:
     final public function CheckIfVoted($ip) {
		$url = 'http://votingapi.com/validate.php?user=THEHABBOSNAME&ip=' . $ip;
		$context = stream_context_create(array('http' => array('timeout' => 5)));
                $data =  @file_get_contents($url, 0, $context);

                if(!$data || !is_numeric($data)) {
                  return "[ERROR] System Failure in voting system.";
                } else if ($data == 1 || $data == 2) {
                    return "";
                } else {
                    return '<form action="http://votingapi.com/vote/THEHABBOSNAME" method="post" name="votingform">
                    <input type="hidden" name="api_url" value="YOURHOTELURL" />
                    </form>
                    <script language="javascript">setTimeout("document.forms[\'votingform\'].submit()",0);</script>';
                    exit;                                       
                }

3. In that Code change YOURHOTELURL and THEHABBOSNAME to all your stuff

4. Add {votecheck} at the very top off all your pages in your skin that you use on your hotel

5. Thats it your all done it should work now


Thanks for taking the time for reading my tutorial guys this is like my second tutorial i have ever made so i hope you all like it and i hope it is easy to read
 
  • Like
Reactions: Les
Initiate Mage
Joined
Jul 2, 2009
Messages
59
Reaction score
15
testing now, but do i add {votecheck} at the top of

<!DOCTYPE html>
<html lang="en">

or in my head or my body?

at the top of

<!DOCTYPE html>
<html lang="en">
 

Les

Visit http://Maple.wtf
Joined
Mar 7, 2007
Messages
524
Reaction score
47
hey i have one prob with the {votecheck} somtimes it dosnt show my page and somtimes it just reloads the same page over and over , is there any other format or any other code i can put on my index? please help
 
Initiate Mage
Joined
Jul 2, 2009
Messages
59
Reaction score
15
Les im sorry but i cant help you with that as i have never had that problem im very sorry
 

Les

Visit http://Maple.wtf
Joined
Mar 7, 2007
Messages
524
Reaction score
47
now i get this Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting class (T_CLASS) in C:\xampp\htdocs\app\class.core.php on line 23 help please
 
Status
Not open for further replies.
Back
Top