Някой може ли да ми едитне vote reward-a вместо кредити да дава зен ?
<?php
if($links[$_GET['vote_id']][3])
{
if(isset($_POST['doVote']))
{
$data = array();
$data['accountName'] = $_POST['uss'];
$data['password'] = $_POST['pass'];
$data['character'] = $_POST['character'];
$data['Money'] = $links[$_GET['vote_id']][1];
$data['voteLink'] = $links[$_GET['vote_id']][2];
if(empty($data['accountName']) || empty($data['password']) || empty($data['character']))
{
echo "Please fill all fields .";
}
else
{
//Checks start :)
$check['account'] = mssql_fetch_array(mssql_query("SELECT AccountID FROM Character Where Name='".$data['character']."'"));
if($check['account']['AccountID'] == $data['accountName'])
{
$check['password'] = mssql_num_rows(mssql_query("select * from MEMB_INFO where memb___id='".$data['accountName']."'"));
if($check['password'] > 0)
{
$check['vote']['accChar'] = mssql_query("select * from votes where accName='".$data['accountName']."' and voteLink='".$_GET['vote_id']."'");
if(mssql_num_rows($check['vote']['accChar']) > 0)
{
header("Location:".$data['voteLink']);
}
else
{
$lastVoteDate = time()+(12*60*60);
$query['getData'] = mssql_fetch_array(mssql_query("select * from memb_info where memb___id='".$data['accountName']."'"));
$query['insertAcc'] = mssql_query("insert into votes(accName, lastVoteDate, voteLink) values('".$data['accountName']."','".$lastVoteDate."', '".$_GET['vote_id']."')");
//Reward Zen
$query['checkmoney'] = mssql_query("select * from Character where AccountID='".$data['accountName']."'");
if(mssql_num_rows($query['checkmoney']) < 1)
{
$query['addmoney'] = mssql_query("insert into Character(AccountID, Money) values('".$data['accountName']."', '".$data['Money']."')");
}
else
{
$query['credFetch'] = mssql_fetch_array($query['checkmoney']);
$query['addmoney'] = mssql_query("update Character set Money='".($query['credFetch']['checkmoney']+$data['Money'])."' where AccountID='".$data['accountName']."'");
}
$query['insertVotes'] = mssql_query("update memb_info set votes='".($query['getData']['votes']+1)."' where memb___id='".$data['accountName']."'");
header("Location:".$data['voteLink']);
}
}
}
else
{
echo "Incorect account / character .";
}
}
}
?>
<form action="" method="post">
<table cellpadding="0" cellspacing="4" border="0" style="border: 1px outset #000000;" width="250">
<tr>
<td align="left" width="100">Username:</td>
<td align="left"><input type="text" name="uss" length="20">
</tr>
<tr>
<td align="left">Password:</td>
<td align="left"><input type="password" name="pass" length="20">
</tr>
<tr>
<td align="left">Character:</td>
<td align="left"><input type="text" name="character" length="20">
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="doVote" value="Vote Now!"></td>
</tr>
<tr>
<td colspan="2" align="left"><a href="javascript:history.go(-1)">Go back to vote list</a></td>
</tr>
</table>
</form>
<?php
}
?>
Как да го направя на 24 часа да се гласува е не 12 както е сега ?
$lastVoteDate = time()+(12*60*60);
дам готова е ето тия
PHP:<?php if($links[$_GET['vote_id']][3]) { if(isset($_POST['doVote'])) { $data = array(); $data['accountName'] = $_POST['uss']; $data['password'] = $_POST['pass']; $data['character'] = $_POST['character']; $data['Money'] = $links[$_GET['vote_id']][1]; $data['voteLink'] = $links[$_GET['vote_id']][2]; if(empty($data['accountName']) || empty($data['password']) || empty($data['character'])) { echo "Please fill all fields ."; } else { //Checks start :) $check['account'] = mssql_fetch_array(mssql_query("SELECT AccountID FROM Character Where Name='".$data['character']."'")); if($check['account']['AccountID'] == $data['accountName']) { $check['password'] = mssql_num_rows(mssql_query("select * from MEMB_INFO where memb___id='".$data['accountName']."'")); if($check['password'] > 0) { $check['vote']['accChar'] = mssql_query("select * from votes where accName='".$data['accountName']."' and voteLink='".$_GET['vote_id']."'"); if(mssql_num_rows($check['vote']['accChar']) > 0) { header("Location:".$data['voteLink']); } else { $lastVoteDate = time()+(12*60*60); $query['getData'] = mssql_fetch_array(mssql_query("select * from memb_info where memb___id='".$data['accountName']."'")); $query['insertAcc'] = mssql_query("insert into votes(accName, lastVoteDate, voteLink) values('".$data['accountName']."','".$lastVoteDate."', '".$_GET['vote_id']."')"); //Reward Zen $query['checkmoney'] = mssql_query("select * from Character where AccountID='".$data['accountName']."'"); if(mssql_num_rows($query['checkmoney']) < 1) { $query['addmoney'] = mssql_query("insert into Character(AccountID, Money) values('".$data['accountName']."', '".$data['Money']."')"); } else { $query['credFetch'] = mssql_fetch_array($query['checkmoney']); $query['addmoney'] = mssql_query("update Character set Money='".($query['credFetch']['checkmoney']+$data['Money'])."' where AccountID='".$data['accountName']."'"); } $query['insertVotes'] = mssql_query("update memb_info set votes='".($query['getData']['votes']+1)."' where memb___id='".$data['accountName']."'"); header("Location:".$data['voteLink']); } } } else { echo "Incorect account / character ."; } } } ?> <form action="" method="post"> <table cellpadding="0" cellspacing="4" border="0" style="border: 1px outset #000000;" width="250"> <tr> <td align="left" width="100">Username:</td> <td align="left"><input type="text" name="uss" length="20"> </tr> <tr> <td align="left">Password:</td> <td align="left"><input type="password" name="pass" length="20"> </tr> <tr> <td align="left">Character:</td> <td align="left"><input type="text" name="character" length="20"> </tr> <tr> <td colspan="2" align="right"><input type="submit" name="doVote" value="Vote Now!"></td> </tr> <tr> <td colspan="2" align="left"><a href="javascript:history.go(-1)">Go back to vote list</a></td> </tr> </table> </form> <?php } ?>
Запазиго като Vote.php Файл и го замести с този който е в момента и вече ще дава Зен
А на мене някой ще може ли да ми помогне или никoй си няма представа как става ?
$lastVoteDate = time()+(12*60*60);
$lastVoteDate = time()+(24*60*60);
брат, не че нещо, ама коментара му е от 21-05-2010, също така тъй както си го променил в момента ще добави зен на всички герой в акаунта, говоря за ето това:
$query['addmoney'] = mssql_query("update Character set Money='".($query['credFetch']['checkmoney']+$data['Money'])."' where AccountID='".$data['accountName']."'");
<?php
ob_start();
include('database.php');
include('links.php');
include('security.php');
$lastVoteDate = time()+(12*60*60);
?>
<html>
<head>
<title>Vote for credits</title>
<style type="text/css">
body,tr,td,th
{
font-family:Arial, Helvetica, sans-serif;
font-size: 11px;
color:#375264;
}
.even
{
background: #E6E6E6;
}
</style>
</head>
<body>
<div align="center" style="margin-top: 40px;">
<?php
if(!isset($_GET['vote_id']))
{
echo 'Vote List';
echo '<table cellpadding="0" cellspacing="4" border="0" style="border: 1px outset #000000;" width="550">';
for($i=0; $i < count($links); $i++)
{
if($links[$i][3])
{
echo '<tr>';
echo '<td align="left" width="40%"><b>'.$links[$i][0].'</b></td>';
echo '<td align="left">Credits Issued: <b>'.$links[$i][1].'</b></td>';
echo '<td align="right"><a href="?vote_id='.$i.'">Vote Now!</a></td>';
echo '</tr>';
}
}
echo '</table>';
}
else
{
include('vote.php');
}
?>
</div>
</body>
</html>