[Req] Vote Script

Status
Not open for further replies.

resistant

Member
Joined
Aug 17, 2008
Messages
119
Reaction score
22
<?
$credits = '50'; //Credits per vote
$votetime = 43200; // 43200 for 12 hours ,86400 for 24 hours
$banner = 'http://'; // Link for banner
$votelink = 'http://'; //Link for vote
//Start voting code
$account = $GLOBALS['mu_user'];
$voted = mssql_fetch_array(mssql_query("SELECT * FROM Vote WHERE account='$account'"));
$del = mssql_query("DELETE FROM Vote WHERE VoteEnd < ".time()."");

if(($_GET['op']=='yes') AND (!$voted))
{
$query = mssql_fetch_array(mssql_query("exec XCredits '".$account."','".$credits."';"));
$sql = mssql_query("INSERT INTO Vote VALUES('$account',".( time() + $votetime ).")");
}
$voteip = mssql_fetch_array(mssql_query("SELECT * FROM Vote WHERE account='$account'"));
if($voteip['VoteEnd'] > time())
{
$voteend = $voteip['VoteEnd'] - time();
echo "You already vote! You can vote after:<br><script src=\"index/clock.js\" type=\"text/javascript\"></script><div id=\"bxx\"></div><script src=\"index/clock.js\" type=\"text/javascript\"></script><div id=\"bxx\"></div><SCRIPT language=\"JavaScript\">pp='$voteend'; pk='1'; pl='$account'; ps=''; t(); </script>"; $error=1;
}
if($error!=1)
{
echo "<a href='?op=yes' OnClick=\"window.open('$votelink')\"><img src='$banner'></a>";
}
/****************************************
End
Coded by Mephisto
Feedback, bug reports at this email -> [[email protected]]
*****************************************/
?>

Трябва ми sql query script-a от тоя php script на mephisto
 
Code:
CREATE TABLE [dbo].[vote] (
	[acc] [varchar] (100) NULL ,
	[voteend] [varchar] (100) NULL ,
	[ip] [varchar] (100) NULL ,
) ON [PRIMARY];
 
  • Like
Reactions: resistant
Code:
create table [dbo].[vote] (
	[acc] [varchar] (100) null ,
	[voteend] [varchar] (100) null ,
	[ip] [varchar] (100) null ,
) on [primary];

Тоя скрипт не работи! АЕЕЕЕЕ Дайте верния!
 
CREATE TABLE [dbo].[vote] (
[account] [varchar] (100) NULL ,
[voteend] [int] (100) NULL ,
[ip] [varchar] (100) NULL ,
) ON [PRIMARY];

Пробвай така.
 
Use MuOnline
$script...

Това нищо не ми говори. Иначе ползвам MuOnline database.

CREATE TABLE [dbo].[vote] (
[account] [varchar] (100) NULL ,
[voteend] [int] (100) NULL ,
[ip] [varchar] (100) NULL ,
) ON [PRIMARY];

Пробвай така.

Нестава.

Дори неможе да направи таблицата заради [int] след [voteend]
 
По кода виждам че има тези полета.

<?
$credits = '50'; //credits per vote
$votetime = 43200; // 43200 for 12 hours ,86400 for 24 hours
$banner = 'http://'; // link for banner
$votelink = 'http://'; //link for vote
//start voting code
$account = $globals['mu_user'];
$voted = mssql_fetch_array(mssql_query("select * from vote where account='$account'"));
$del = mssql_query("delete from vote where voteend < ".time()."");

if(($_get['op']=='yes') and (!$voted))
{
$query = mssql_fetch_array(mssql_query("exec xcredits '".$account."','".$credits."';"));
$sql = mssql_query("insert into vote values('$account',".( time() + $votetime ).")");
}
$voteip = mssql_fetch_array(mssql_query("select * from vote where account='$account'"));
if($voteip['voteend'] > time())
{
$voteend = $voteip['voteend'] - time();
echo "you already vote! You can vote after:<br><script src=\"index/clock.js\" type=\"text/javascript\"></script><div id=\"bxx\"></div><script src=\"index/clock.js\" type=\"text/javascript\"></script><div id=\"bxx\"></div><script language=\"javascript\">pp='$voteend'; pk='1'; pl='$account'; ps=''; t(); </script>"; $error=1;
}
if($error!=1)
{
echo "<a href='?op=yes' onclick=\"window.open('$votelink')\"><img src='$banner'></a>";
}
/****************************************
end
coded by mephisto
feedback, bug reports at this email -> [[email protected]]
*****************************************/
?>
 
Status
Not open for further replies.