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!

Vote Reward System

Newbie Spellweaver
Joined
Nov 7, 2010
Messages
40
Reaction score
30
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.
 

Attachments

You must be registered for see attachments list
Joined
Apr 12, 2007
Messages
426
Reaction score
251
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 ----------

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:
include ('../config.php');
and
PHP:
include ('../includes/adodb5/adodb.inc.php');
change to:
PHP:
include ('config.php');
and
PHP:
include ('includes/adodb5/adodb.inc.php');
*Only change if you use my modified files
**For me works but the echos doesnt shows up...
 
Newbie Spellweaver
Joined
Nov 7, 2010
Messages
40
Reaction score
30
It works for me.
If you want you can contact me from MSN.

That would mean that $q1 query is returning false instead of an array. Weird.
 
Banned
Banned
Joined
Oct 20, 2006
Messages
3,245
Reaction score
1,652
Please try to resolve the issue here instead of on MSN. That way, anyone that has problems in the future can use this thread as a reference. Thank you.
 
Newbie Spellweaver
Joined
Nov 7, 2010
Messages
40
Reaction score
30
Please try to resolve the issue here instead of on MSN. That way, anyone that has problems in the future can use this thread as a reference. Thank you.

The problem is not with the script. Problem is with something else. That is why I want to solve the problem with MSN.
 
Joined
Oct 14, 2008
Messages
1,277
Reaction score
249
My server was hacked when i have used this script :)
And when i have removed the script , the server was not hacked anymore.


EDIT:AND I CAN'T GIVE THE PROOF BECAUSE THE "HACKERS" WILL SEE HOW TO HACK THAT SCRIPT.

If you can add the IP CHECK,it will be awesome, and oh , this script is hackable,you can find the password of mssql.

I apologize for what i said a little earlier, i did and now i realize that it was because i had Cabal Toolz 4.0, who was stealing from me because i have someone i had met my scripts here on ragezone , so they can make a skin for my website, but he vanished and after a little while i saw the release of the ct 4.0 on ragezone with my all template(TRANSILVANIAGAMES) .
So i keep saying that this script runs perfect on Cabal Toolz 3.0 and 3.1 platform.
Good Job With That.
But if you add the ip restriction on this script , that will be the best vote reward sawed ever.
 
Last edited by a moderator:
Newbie Spellweaver
Joined
Jan 10, 2011
Messages
55
Reaction score
24
You mean the one that vanished and hacked the script and released it in here is the one who hack your CabalToolz 4.0?????
 
Joined
Oct 14, 2008
Messages
1,277
Reaction score
249
You mean the one that vanished and hacked the script and released it in here is the one who hack your CabalToolz 4.0?????

I don't know who did that,but who released here cabal toolz 4.0 it was a big lier,because when i give my cabal toolz 4.0 script to him , i give that only to create a skin for me,but they just released the CT 4.0 on RZ.
Anyway,lets stop the off topic.
 
Newbie Spellweaver
Joined
Nov 7, 2010
Messages
40
Reaction score
30
For much request on it, I did a version which has an IP check.
To use this version, you must run this query on your CabalCash database:

Code:
ALTER TABLE VoteReward
ADD UserIP VARCHAR(20)

You can download the version from attachments.
 

Attachments

You must be registered for see attachments list
Joined
Jun 27, 2010
Messages
409
Reaction score
240
Well I can imagine how this script is hackable, SQLi, anyone?

PHP:
$u=$_GET["u"];
/*...*/
$q2=mssql_query('SELECT * FROM CashAccount WHERE UserID="' . $u . '"');

Sanitize it. For example using regex:
PHP:
/*ATTN: This is untested code, hacked together in notepad*/
if (ereg('[^A-Za-z0-9]', $u)) {
  die "; DROP DATABASE my butt!";
}
else {
  $q2=mssql_query('SELECT * FROM CashAccount WHERE UserID="' . $u . '"');
}

And why are you using ADOdb for such a trivial task?
 
Last edited:
Newbie Spellweaver
Joined
Nov 7, 2010
Messages
40
Reaction score
30
Just use mssql_real_escape_string() there. Not complicated. No need for ereg.
 
Joined
Oct 14, 2008
Messages
1,277
Reaction score
249
For much request on it, I did a version which has an IP check.
To use this version, you must run this query on your CabalCash database:

Code:
ALTER TABLE VoteReward
ADD UserIP VARCHAR(20)

You can download the version from attachments.

I haved use that , but they shows me alway the vote reward is closed.
Please add only this ip check to my script :
Code:
<?php

include ('includes/adodb5/adodb.inc.php');

$server="xxxx";
$user="xxxx";
$pass="xxxx";

$db1=ADONewConnection('mssql');
$db1->Connect($server, $user, $pass, 'CabalCash') or die("Unable to connect cash!");

$db2=ADONewConnection('mssql');
$db2->Connect($server, $user, $pass, 'ACCOUNT') or die("Unable to connect account!");

$u=$_GET["u"];
$p=$_GET["p"];

$q1=$db2->Execute('SELECT * FROM cabal_auth_table WHERE ID=?', array($u));
$rc1=$q1->RecordCount();
$r1=$q1->FetchRow();

if ($rc1>=1)
{

	$pwd=md5($p);
	
	if ($r1[2]==$pwd)
	{
		$con=mssql_connect($server, $user, $pass);
		mssql_select_db('CabalCash', $con);
		$q2=mssql_query('SELECT * FROM CashAccount WHERE UserID="' . $u . '"');
		$rc2=mssql_num_rows($q2);
		$r2=mssql_fetch_array($q2);
		if (mssql_num_rows($q2)>=1)
		{
			
			if (isset($_COOKIE['voted']))
			{
				$q3=$db1->Execute('SELECT * FROM VoteReward WHERE UserID=?', array($u));
				$rc3=$q3->RecordCount();
				$r3=$q3->FetchRow();
				if ($rc3>=1)
				{
				$verify=$r3[1]+60*60*12;
				$time=time();
					if ($time>=$verify)
					{
						$db1->Execute('UPDATE VoteReward SET VoteDate=? WHERE UserID=?', array($time, $u));
						$newcash=$r2[4]+1;
						$newcashbon=$r2[3]+1;
						mssql_query('UPDATE CashAccount SET Cash="'.$newcash.'" WHERE UserID="'.$u.'"');
						echo "<a href='http://cabal.transilvaniagames.ro/votereward.html'>Your reward has been added successfully. Click here to go back!</a>";
					}
					else
					{
						echo "<a href='http://cabal.transilvaniagames.ro/votereward.html'>You already voted! Please wait 12 hours to vote again! Click here to go back!</a>";
					}
				}
				else
				{
					$time=time();;
					$db1->Execute('INSERT INTO VoteReward (UserID, VoteDate) VALUES (?,?)', array($u, $time)) or die(mssql_error());
					$newcash=$r2[4]+1;
					$newcashbon=$r2[3]+1;
					mssql_query('UPDATE CashAccount SET Cash="'.$newcash.'" WHERE UserID="'.$u.'"');

					echo "<a href='http://cabal.transilvaniagames.ro/votereward.html'>Your reward has been added successfully. Click here to go back!</a>";
				}
			}
			else
			{
				echo "<a href='http://cabal.transilvaniagames.ro/votereward.html'>You did not vote in the last 12 hours! Click here to go back!</a>";
			}
		}
		else
		{
			if (isset($_COOKIE['voted']))
			{
				$time=time();
				
				mssql_query('INSERT INTO CashAccount (UserID, Cash, CashBonus) VALUES ("'.$u.'",1,0)');
				$db1->Execute('INSERT INTO VoteReward (UserID, VoteDate) VALUES (?,?)', array($u, $time));
				echo "<a href='http://cabal.transilvaniagames.ro/votereward.html'>Your reward has been added successfully. Click here to go back!</a>";
			}
			else
			{
				echo "<a href='http://cabal.transilvaniagames.ro/votereward.html'>You did not vote in the last 12 hours! Click here to go back!</a>";
			}
		}
	}
	else
	{
		echo "<a href='http://cabal.transilvaniagames.ro/votereward.html'>You have entered a wrong Password! Click here to go back!</a>";
	}
}
else
{
	echo "<a href='http://cabal.transilvaniagames.ro/votereward.html'>You have entered a wrong ID! Click here to go back!</a>";
}

?>
 
Newbie Spellweaver
Joined
Nov 7, 2010
Messages
40
Reaction score
30
Code:
$_config['vote_status']=true;

Add this line to anywhere in your config.php.
It will fix the problem.
 
Back
Top