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

Did this Tutorial Help you

  • Yes

    Votes: 0 0.0%
  • No

    Votes: 0 0.0%

  • Total voters
    0
Status
Not open for further replies.

addam12

New Member
May 23, 2011
4
1
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
 

Logic

Bobby Billionaire
Feb 8, 2012
748
207
Hasn't this been posted by ? Anyways.. thanks.
 

addam12

New Member
May 23, 2011
4
1
Hasn't this been posted by ? Anyways.. thanks.
As i said i don't know if anyone else has posted this tutorial i never use devbest anyway so i wouldnt no
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Hasn't this been posted by ? Anyways.. thanks.

Nah man. - It's similar, but I use the full potentonial of the API, (which you should, but this is also a good way). - However this is very similar to ( ) release.

So, nice release. But closed due to already released, the code is similar no point in two threads for the exact same thing. (Also closed to spam).
 
Status
Not open for further replies.

Users who are viewing this thread

Top