Vote Reward System

Page 1 of 2 12 LastLast
Results 1 to 25 of 48
  1. #1
    Enthusiast Millenial is offline
    MemberRank
    Nov 2010 Join Date
    44Posts

    Vote Reward System

    First of all, execute this query in your "CabalCash" database:
    Code:
    CREATE TABLE VoteReward(
    UserID VARCHAR(50) NULL,
    VoteDate INT NULL
    )
    Then, download the "votereward.rar" in the attachments.

    Place the files in the "modules" directory of your website (that is for it can include the adodb5 files properly. If you know php a little you can change the adodb5 include path in the vote_do.php file, but in cabaltoolz the path is correct when the files are put into the backend site "modules" directory)

    Open vote_do.php and edit "$server, $user, $pass" variables accordingly to your db server, db username and db password.

    Open "votereward.php" and modify the window.open link in the function 'vote()' to your xtremetop link, and modify the index page link as well.

    Open "votereward.php" in your browser and enjoy!

    Note: If someone can make a better design for votereward.php, I would appreciate it.

    Usage

    1. Click the link "Vote for us from here." and vote for the server.
    2. Enter your CABAL Account Username and Password, and press "Receive Reward."

    Everyone can receive reward once in every 12 Hours, and the reward is 1 CC.

    If you find any bugs, post them here, I will do my best to fix them.
    System works perfect on Microsoft Server 2003, and XAMPP WebServer.(PHP 5)
    Attached Files Attached Files
    Last edited by Millenial; 16-01-11 at 09:22 AM.


  2. #2
    <NULL> Acnathon is offline
    MemberRank
    Apr 2007 Join Date
    RaGEZONELocation
    463Posts

    Re: Vote Reward System

    WoW man such a great share!!!! :) im gonna test and report! :)

    ---------- Post added at 10:10 AM ---------- Previous post was at 09:29 AM ----------

    Well tried to put in CabalToolz UserCP but it gives syntax error for this:
    PHP Code:
    function vote()
    {
        
    createCookie('voted''yes'720);
        
    window.open('http://xtremetoplink.com');

    ideas?

  3. #3
    Apprentice Billybob32456 is offline
    MemberRank
    Mar 2009 Join Date
    EnglandLocation
    12Posts

    Re: Vote Reward System

    Thanks, Remember screenshot :)

  4. #4
    Enthusiast Millenial is offline
    MemberRank
    Nov 2010 Join Date
    44Posts

    Re: Vote Reward System

    Quote Originally Posted by Acnathon View Post
    WoW man such a great share!!!! :) im gonna test and report! :)

    ---------- Post added at 10:10 AM ---------- Previous post was at 09:29 AM ----------

    Well tried to put in CabalToolz UserCP but it gives syntax error for this:
    PHP Code:
    function vote()
    {
        
    createCookie('voted''yes'720);
        
    window.open('http://xtremetoplink.com');

    ideas?
    Well it should not have any syntax errors, can you post the exact error here? (Do not try to put it in the user cp, put it in a seperate page, same function may already be in use)

    The section of javascript should be like this:
    Code:
    <script type="text/javascript">
    function createCookie(name,value,min) {
    	if (min) {
    		var date = new Date();
    		date.setTime(date.getTime()+(min*60*1000));
    		var expires = "; expires="+date.toGMTString();
    	}
    	else var expires = "";
    	document.cookie = name+"="+value+expires+"; path=/";
    }
    function reward()
    {
    var id=document.forms["vote"].elements[0].value;
    var pwd=document.forms["vote"].elements[1].value;
    
    if (window.XMLHttpRequest)
    {
    	xmlhttp=new XMLHttpRequest();
    }
    else
    {
    	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function ()
    {
    	if (xmlhttp.readyState==4 && xmlhttp.status==200)
    	{
    		document.getElementById("vote").innerHTML=xmlhttp.responseText;
    	}
    }
    xmlhttp.open("GET", "vote_do.php?u="+id+"&p="+pwd, true);
    xmlhttp.send();
    }
    function vote()
    {
    	createCookie('voted', 'yes', 720);
    	window.open('http://xtremetoplink.com');
    }
    </script>
    This gives no errors.

  5. #5
    <NULL> Acnathon is offline
    MemberRank
    Apr 2007 Join Date
    RaGEZONELocation
    463Posts

    Re: Vote Reward System

    Quote Originally Posted by Millenial View Post
    Well it should not have any syntax errors, can you post the exact error here? (Do not try to put it in the user cp, put it in a seperate page, same function may already be in use)

    The section of javascript should be like this:
    Code:
    <script type="text/javascript">
    function createCookie(name,value,min) {
        if (min) {
            var date = new Date();
            date.setTime(date.getTime()+(min*60*1000));
            var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
    }
    function reward()
    {
    var id=document.forms["vote"].elements[0].value;
    var pwd=document.forms["vote"].elements[1].value;
    
    if (window.XMLHttpRequest)
    {
        xmlhttp=new XMLHttpRequest();
    }
    else
    {
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function ()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            document.getElementById("vote").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET", "vote_do.php?u="+id+"&p="+pwd, true);
    xmlhttp.send();
    }
    function vote()
    {
        createCookie('voted', 'yes', 720);
        window.open('http://xtremetoplink.com');
    }
    </script>
    This gives no errors.
    Well im not that good in php... but heres my code (i use the donation page from usercp for it)

    PHP Code:
    <?PHP

    $script 
    .='<script type="text/javascript">
    function createCookie(name,value,min) {
        if (min) {
            var date = new Date();
            date.setTime(date.getTime()+(min*60*1000));
            var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
    }
    function reward()
    {
    var id=document.forms["vote"].elements[0].value;
    var pwd=document.forms["vote"].elements[1].value;

    if (window.XMLHttpRequest)
    {
        xmlhttp=new XMLHttpRequest();
    }
    else
    {
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function ()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            document.getElementById("vote").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET", "vote_do.php?u="+id+"&p="+pwd, true);
    xmlhttp.send();
    }
    function vote()
    {
        createCookie('
    voted', 'yes', 720);
        window.open('
    http://xtremetoplink.com');
    }
    </script>';

    $form .='<form id="vote">
    In order to receive rewards, you must provide your Username and Password.<br />
    Username: <input type="text" name="user" /><br />
    Password: <input type="password" name="pass" /><br />
    <input type="button" value="Receive Reward" onclick="reward()" />
    </form>';

    ?>

  6. #6
    Enthusiast Millenial is offline
    MemberRank
    Nov 2010 Join Date
    44Posts

    Re: Vote Reward System

    Apparently you are not that good. Place backslashes (\) before the ' s in the script. Example:

    Code:
    function vote()
    {
        createCookie(\'voted\', \'yes\', 720);
        window.open(\'http://xtremetoplink.com\');
    }
    Note: $script .='....the script.....';

    The ' s around the script variable is equal to will not have backslashes before them.

  7. #7
    <NULL> Acnathon is offline
    MemberRank
    Apr 2007 Join Date
    RaGEZONELocation
    463Posts

    Re: Vote Reward System

    Quote Originally Posted by Millenial View Post
    Apparently you are not that good. Place backslashes (\) before the ' s in the script. Example:

    Code:
    function vote()
    {
        createCookie(\'voted\', \'yes\', 720);
        window.open(\'http://xtremetoplink.com\');
    }
    Note: $script .='....the script.....';

    The ' s around the script variable is equal to will not have backslashes before them.
    Thanks for this!
    How do we modify the reward? i mean to give more CC?

  8. #8
    Enthusiast Millenial is offline
    MemberRank
    Nov 2010 Join Date
    44Posts

    Re: Vote Reward System

    I did not add that option, but if you know PHP, find:
    Code:
    $newcash=$r2[4]+1;
    in vote_do.php, (there are 2 of them) and make each one
    Code:
    $newcash=$r2[4]+(the cash number you want to add);
    Edit: Oh, and search this query in vote_do.php (for new cash accounts):

    Code:
    mssql_query('INSERT INTO CashAccount (UserID, Cash, CashBonus) VALUES ("'.$u.'",1,0)');
    Make it:

    Code:
    mssql_query('INSERT INTO CashAccount (UserID, Cash, CashBonus) VALUES ("'.$u.'",(the cash number you want to add),0)');
    Last edited by Millenial; 16-01-11 at 11:40 AM.

  9. #9
    <NULL> Acnathon is offline
    MemberRank
    Apr 2007 Join Date
    RaGEZONELocation
    463Posts

    Re: Vote Reward System

    Thanks! Already up and working! now testing for bugs :D

  10. #10
    Enthusiast Finland is offline
    MemberRank
    Dec 2010 Join Date
    42Posts

    Re: Vote Reward System

    I try using cabaltoolz
    I put the "vote_do.php" in Backend/modules folder
    and the "votereward.php" in frontend/modules folder.

    when I login my account nothing happens when I click the "receive reward" button.
    Is my procedure correct or not? I did already edited the IP, User and password of my database in vote_do.php, I also already created the VoteReward table in cabalcash

  11. #11
    Enthusiast Millenial is offline
    MemberRank
    Nov 2010 Join Date
    44Posts

    Re: Vote Reward System

    It does not work because you need to place both to the backend/modules folder xD

  12. #12
    <NULL> Acnathon is offline
    MemberRank
    Apr 2007 Join Date
    RaGEZONELocation
    463Posts

    cool Re: Vote Reward System

    Quote Originally Posted by Millenial View Post
    Note: If someone can make a better design for votereward.php, I would appreciate it.
    Well its not that xtra thing but hope you guys like it!

    You need to use both files to get fully working!
    Extra's: I added the function to go back to Form if already voted or Wrong ID....etc...
    Modified Reward to give 10 CC.
    Receive Credits Button modified---> You dont need to vote and to receive credits 1 by 1... If you click Receive Credits you get the credits+it navigates to vote page(votelink)
    Hey Millenial maybe you can ceck if everything is Ok with this!

    Hope you like it!

    Edit: Fixed version added :)
    Attached Thumbnails Attached Thumbnails voterew.jpg   voterew2.jpg  
    Attached Files Attached Files
    Last edited by Acnathon; 16-01-11 at 10:18 PM. Reason: Added second screen.

  13. #13
    Enthusiast Millenial is offline
    MemberRank
    Nov 2010 Join Date
    44Posts

    Re: Vote Reward System

    If you can fix the button and add the "vote" function elsewhere (because that is the function which should be issued when the user votes, not receives reward) it will be perfect. ;)

    Edit:

    1st Step: Find

    Code:
    Acnathon- Ragezone
    Replace with

    Code:
    Achnaton- Ragezone<br />
    You can vote for us from <a href="javascript:vote()">here</a>.
    2nd Step: Find

    Code:
    onclick="reward();javascript:vote()"
    Replace with

    Code:
    onclick="reward()"
    Now all should be fine! :P
    Last edited by Millenial; 16-01-11 at 10:09 PM.

  14. #14
    <NULL> Acnathon is offline
    MemberRank
    Apr 2007 Join Date
    RaGEZONELocation
    463Posts

    Re: Vote Reward System

    Ok But if you write your username and password the button makes both functions isnt that better?

    BTW sure i can change it no prob :)

    ---------- Post added at 10:09 PM ---------- Previous post was at 10:05 PM ----------

    Added function like this:
    PHP Code:
    onclick="reward();javascript:vote()" 
    Ok I change them...

    ---------- Post added at 10:19 PM ---------- Previous post was at 10:09 PM ----------

    Fixed Version added!

    ---------- Post added at 10:30 PM ---------- Previous post was at 10:19 PM ----------

    BTW the idea to use 2 function (onclick) its because that way the user no need to hit 2 times... :D and it works same as this but only with one Button
    Last edited by Acnathon; 16-01-11 at 10:12 PM.

  15. #15
    Enthusiast Millenial is offline
    MemberRank
    Nov 2010 Join Date
    44Posts

    Re: Vote Reward System

    This is a Vote Reward System, not a Cash Giving System, so users must click the voting link and vote to receive the reward, allright? ^^

  16. #16
    wWw.F403.OrG S37uP!Update is offline
    MemberRank
    Oct 2008 Join Date
    F403.ORGLocation
    1,304Posts

    Re: Vote Reward System

    With this,you can vote how many times you want without removing the cookies from your browser...

  17. #17
    Enthusiast Millenial is offline
    MemberRank
    Nov 2010 Join Date
    44Posts

    Re: Vote Reward System

    No you can't ;)
    The Vote Reward time info is stored inside the VoteReward table. Now the system has Log Support, with IP and Username display.

    I will upload it asap.

    The only way to vote more times is to use different ID s, and it appears on the logs with the IP addresses, so you can ban them easily.
    I did not add a check for it because it is so easy to change the IP address, and the check is unnecessary.
    Last edited by Millenial; 07-02-11 at 10:19 AM.

  18. #18
    wWw.F403.OrG S37uP!Update is offline
    MemberRank
    Oct 2008 Join Date
    F403.ORGLocation
    1,304Posts

    Re: Vote Reward System

    Quote Originally Posted by Millenial View Post
    No you can't ;)
    The Vote Reward time info is stored inside the VoteReward table. Now the system has Log Support, with IP and Username display.

    I will upload it asap.

    The only way to vote more times is to use different ID s, and it appears on the logs with the IP addresses, so you can ban them easily.
    I did not add a check for it because it is so easy to change the IP address, and the check is unnecessary.
    Well,how can i see the logs with the IP?

  19. #19
    Enthusiast Millenial is offline
    MemberRank
    Nov 2010 Join Date
    44Posts

    Re: Vote Reward System

    I am uploading the system with the logs now.
    You can find the logs in the backend dir/modules/voteLogs directory.
    Each day has its specific log.

    Edit: New system added to this post, not to the main post.

    If you will use this system, you need to add a boolean variable ($_config["vote_status"]) to your config.php file and set the variable to true. So add this line to config.php:

    PHP Code:
    $_config["vote_status"]=true
    This variable allows you to turn on/off the vote reward system. For example, if XtremeTop100 is inaccessible, you can turn off your reward system by setting the boolean to false.

    You can just use the vote_do.php to add log support, but I added votereward.php because it shows the user directly that the system is disabled. Otherwise, user types in the username and password, and then sees the system is disabled.
    Attached Files Attached Files
    Last edited by Millenial; 09-02-11 at 08:24 AM.

  20. #20
    wWw.F403.OrG S37uP!Update is offline
    MemberRank
    Oct 2008 Join Date
    F403.ORGLocation
    1,304Posts

    Re: Vote Reward System

    Quote Originally Posted by Millenial View Post
    I am uploading the system with the logs now.
    You can find the logs in the backend dir/modules/voteLogs directory.
    Each day has its specific log.

    Edit: New system added to this post, not to the main post.

    If you will use this system, you need to add a boolean variable ($_config["vote_status"]) to your config.php file and set the variable to true. So add this line to config.php:

    PHP Code:
    $_config["vote_status"]=true
    This variable allows you to turn on/off the vote reward system. For example, if XtremeTop100 is inaccessible, you can turn off your reward system by setting the boolean to false.

    You can just use the vote_do.php to add log support, but I added votereward.php because it shows the user directly that the system is disabled. Otherwise, user types in the username and password, and then sees the system is disabled.
    How can i add this to this scripts?
    Because they are modified...
    Quote Originally Posted by Acnathon View Post
    Well its not that xtra thing but hope you guys like it!

    You need to use both files to get fully working!
    Extra's: I added the function to go back to Form if already voted or Wrong ID....etc...
    Modified Reward to give 10 CC.
    Receive Credits Button modified---> You dont need to vote and to receive credits 1 by 1... If you click Receive Credits you get the credits+it navigates to vote page(votelink)
    Hey Millenial maybe you can ceck if everything is Ok with this!

    Hope you like it!

    Edit: Fixed version added :)

  21. #21
    Enthusiast Millenial is offline
    MemberRank
    Nov 2010 Join Date
    44Posts

    Re: Vote Reward System

    Use the vote_do.php in the attachment .rar file. I also added a variable at the beginning of the file where you can control the amount of the reward.
    Attached Files Attached Files

  22. #22
    wWw.F403.OrG S37uP!Update is offline
    MemberRank
    Oct 2008 Join Date
    F403.ORGLocation
    1,304Posts

    Re: Vote Reward System

    Fatal error: Call to a member function RecordCount() on a non-object in C:\Xampp\htdocs\backend\vote_do.php on line 43

  23. #23
    <NULL> Acnathon is offline
    MemberRank
    Apr 2007 Join Date
    RaGEZONELocation
    463Posts

    Re: Vote Reward System

    well... working fine but the echo messages doesnt shows up anymore... i mean with the new files... wierd

    ---------- Post added at 11:44 AM ---------- Previous post was at 11:33 AM ----------

    Quote Originally Posted by S37uP!Update View Post
    Fatal error: Call to a member function RecordCount() on a non-object in C:\Xampp\htdocs\backend\vote_do.php on line 43
    If you use The new vote_do.php with my modified files then open vote_do.php and change these:
    PHP Code:
    include ('../config.php'); 
    and
    PHP Code:
    include ('../includes/adodb5/adodb.inc.php'); 
    change to:
    PHP Code:
    include ('config.php'); 
    and
    PHP Code:
    include ('includes/adodb5/adodb.inc.php'); 
    *Only change if you use my modified files
    **For me works but the echos doesnt shows up...

  24. #24
    Enthusiast Millenial is offline
    MemberRank
    Nov 2010 Join Date
    44Posts

    Re: Vote Reward System

    What does "echos doesnt show up" means?

  25. #25
    wWw.F403.OrG S37uP!Update is offline
    MemberRank
    Oct 2008 Join Date
    F403.ORGLocation
    1,304Posts

    Re: Vote Reward System

    Not working...
    Still got same error.



Page 1 of 2 12 LastLast

Advertisement