Team BlueWater Game Online Tutorial's
Bine ati venit la Team-BlueWater!!Tutorial's 4 all Games!

[Release] Vote for site win credits

View previous topic View next topic Go down

[Release] Vote for site win credits

Post  m4s4cru on Tue Aug 02, 2011 11:01 am

Put thise in your Sql Quarety:
Code:

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vote_credits]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[vote_credits]
GO

CREATE TABLE [dbo].[vote_credits] (
 [account] [varchar] (255) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [time] [bigint] NOT NULL
) ON [PRIMARY]
GO

Then make a new file .php in your website in folder modules "vote.php"
Put thise code inside:

Code:

<?php
if (isset($_SESSION['user'])){
require("config.php");
$account_id = stripslashes($_SESSION['user']);
$account_id = clean_var($account_id);
$id = (int)$_GET['id'];
$credits = '10'; // how much credits to give
$link = 'http://yourvotelink.net '; // edit this [Linka for vote]
echo "
<form method='post' action='' >
<table class='sort-table' width='350' border='0' cellspacing='0' cellpadding='0' align='center'>         
<thead>
<tr><td> Vote for us and win credits </td></tr>
</thead>
<tbody>
<tr><td>

- Enter the code and vote for us.

- For every vote you will win $credits.

- You can vote only one time for 12 hours.
</td></tr>
<tr><td> </td></tr>
</tbody>
</table>
</form>";

$time = time();
$timeup = $time - 43200;
$query = mssql_query("SELECT * from vote_credits WHERE account='$account_id' and time>'$timeup'");
$check = mssql_num_rows($query);
if ($check == "0") {
$insert = mssql_query("INSERT INTO vote_credits (account, time) VALUES ('$account_id','$time')");
$update = mssql_query("Update MEMB_CREDITS set credits = credits+$credits WHERE memb___id='$account_id'");
echo "<meta http-equiv=\"refresh\" content=\"0;url=$link\" />";
}
else
{
echo "
<table class='sort-table' width='350' border='0' cellspacing='0' cellpadding='0' align='center'>         
<tr><td><font color=red>Вече сте гласували за последните 24 часа.</font></td></tr>
</table>";
}
}
else {
echo "<table class='sort-table' width='450' border='0' cellpadding='0' cellspacing='0' align='center'><tr><td> </td></tr><tr><td class='center'><a href='$link' target='_blank'>Please Vote For Us</a></td></tr><tr><td> </td></tr></table>
";
}
?>
To test it use thise:
[You must be registered and logged in to see this link.]
avatar
m4s4cru
Admin
Admin

Mesaje : 172
Data de inscriere : 2011-07-29
Varsta : 26

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum