
Originally Posted by
thajj
Everyone goodluck fixing the bugs, there alot of m, the admin panel thats with it also is just the basic emisand panel, there is an coin system in it but you will need to code it yourself to make it work with sending and gifting and recieving.
fixes you need are the register page, the download page, ranking page and some others. But register is anoyying to fix but i got it done.
I'll fix it and release an sql for the tables , just to make you leechers shut the fuck up.
Ticket table for the contact system :
Code:
USE [GunzDB]
CREATE TABLE [dbo].[Ticket](
[Email] [varchar](50) NULL,
[Type] [varchar] (50) NULL,
[Description] [varchar] (500) NULL,
[Date] [datetime] NULL,
[Opened] [int] NULL,
)
Where did you hear about us column :
Code:
Use [GunzDB]
Alter table account add hear varchar(50)
ItemShop used CashShop table :
Code:
USE [GunzDB]
GO
/****** Object: Table [dbo].[CashShop] Script Date: 08/12/2010 05:11:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[CashShop](
[CSID] [int] NOT NULL,
[ItemID] [int] NOT NULL,
[CashPrice] [int] NOT NULL,
[WebImgName] [varchar](64) COLLATE Latin1_General_CI_AS NULL,
[Opened] [tinyint] NULL,
[RegDate] [datetime] NULL,
[Name] [varchar](265) COLLATE Latin1_General_CI_AS NOT NULL,
[TotalPoint] [int] NULL,
[ResSex] [tinyint] NULL,
[ResLevel] [int] NULL,
[Slot] [tinyint] NULL,
[Weight] [int] NULL,
[BountyPrice] [int] NULL,
[Damage] [int] NULL,
[Delay] [int] NULL,
[Controllability] [int] NULL,
[Magazine] [int] NULL,
[ReloadTime] [int] NULL,
[HP] [int] NULL,
[AP] [int] NULL,
[MaxWeight] [int] NULL,
[SF] [int] NULL,
[FR] [int] NULL,
[CR] [smallint] NULL,
[PR] [smallint] NULL,
[LR] [int] NULL,
[Description] [nchar](1024) COLLATE Latin1_General_CI_AS NULL,
[MaxBullet] [int] NULL,
[LimitSpeed] [tinyint] NULL,
[IsCashItem] [tinyint] NULL,
[Control] [int] NULL,
[Duration] [int] NULL,
[CSSID] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Selled] [nchar](10) COLLATE Latin1_General_CI_AS NULL,
[ModelName] [varchar](64) COLLATE Latin1_General_CI_AS NULL,
[BlendColor] [int] NULL,
[ResRace] [tinyint] NULL,
[EffectID] [int] NULL,
[NewItemOrder] [tinyint] NULL,
[RentType] [tinyint] NULL,
[Gadget] [int] NULL,
[SlugOutput] [tinyint] NULL,
[RentHourPeriod] [int] NULL,
CONSTRAINT [CashShop_PK] PRIMARY KEY CLUSTERED
(
[CSID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
Donations coins and event coins :
Code:
Use [GunzDB]
Alter Table Account add points int
Alter Table Account add eventpoints int
actions/ind_rank.php
Code:
<table border="0" style="position:relative; top:3px;" class="ranking">
<?php
$ind_rank = mssql_query("SELECT TOP 5 * FROM Character WHERE DeleteFlag = 0 OR DeleteFlag = NULL ORDER BY XP DESC");
if(mssql_num_rows($ind_rank) == 0){
echo 'No Data';
}else{
while($lofasz = mssql_fetch_assoc($ind_rank)){
echo'
<tr>
<td style="width:130px; height:23px;" align="middle">
'.$lofasz['Name'].'
</td>
<td style="width:20px; text-align:right; height:23px;">
'.$lofasz['Level'].'
</td>
</tr>
';
}
}
?>
</table>
actions/clan_rank.php
Code:
<table border="0" style="position:relative; top:3px;" class="ranking">
<?php
$ind_rank = mssql_query("SELECT TOP 5 * FROM Clan WHERE DeleteFlag = 0 OR DeleteFlag = NULL ORDER BY Point DESC");
if(mssql_num_rows($ind_rank) == 0){
echo 'No Data';
}else{
while($lofasz = mssql_fetch_assoc($ind_rank)){
echo'
<tr>
<td style="width:130px; height:23px;" align="middle">
'.$lofasz['Name'].'
</td>
<td style="width:20px; text-align:right; height:23px;">
'.$lofasz['Point'].'
</td>
</tr>
';
}
}
?>
</table>
actions/register.php
Code:
<div id="left_container">
<?php include 'Parts/Member_panel.php'; ?>
<div style="height:3px;"></div>
<a href="index.php?action=ranking"><img src="http://forum.ragezone.com/images/Left/weekly.png" style="opacity: 0.4;" onmouseover="BeginOpacity(this,40,100)" onmouseout="EndOpacity(this,40)" border="0"/></a>
<a href="index.php?action=guide"><img src="http://forum.ragezone.com/images/Left/howto.png" style="opacity: 0.4;" onmouseover="BeginOpacity(this,40,100)" onmouseout="EndOpacity(this,40)" border="0"/></a>
<a href="index.php?action=clan"><img src="http://forum.ragezone.com/images/Left/clan.png" style="opacity: 0.4;" onmouseover="BeginOpacity(this,40,100)" onmouseout="EndOpacity(this,40)" border="0"/></a>
</div>
<div id="right_container">
<?php include 'Parts/Ranking.php'; ?>
<div style="height:3px;"></div>
<?php include 'Parts/Quick_shop.php'; ?>
<a href="index.php?action=market"><img src="http://forum.ragezone.com/images/Right/shop_banner.png" style="opacity: 0.4;" onmouseover="BeginOpacity(this,40,100)" onmouseout="EndOpacity(this,40)" border="0" /></a>
</div>
<div id="middle_container">
<?php
include 'Parts/Front_buttons.php';
include 'Parts/Quick_event.php';
include 'Parts/register.php';
?>
</div>
parts/register.php
Code:
<?php
if($_SESSION['Username'] != "") {
redirect("index.php");
}
if(sql($_GET['progress']) == 'finish') {
$username = sql($_POST['username']);
$email = sql($_POST['email']);
$email_veri = sql($_POST['email_veri']);
$pass = sql($_POST['pass']);
$pass_veri = sql($_POST['pass_veri']);
$hear = sql($_POST['hear']);
$captcha = sql($_POST['c_text']);
$check_username = mssql_query("SELECT * FROM Account WHERE UserID = \"$username\"");
$check_email = mssql_query("SELECT * FROM Account WHERE Email = \"$email\"");
if (mssql_num_rows($check_username) != 0) {
alert("Username is already taken!", "index.php?action=register");
return false;
}
if (mssql_num_rows($check_email) != 0) {
alert("An account with this e-mail has been registered!", "index.php?action=register");
return false;
}
if (getLenght($username) < 3) {
alert("Username must contain minimum of 3 characters!", "index.php?action=register");
return false;
}
if (getLenght($email) < 6) {
alert("Please give correct e-mail address!", "index.php?action=register");
return false;
}
if (getLenght($pass) < 5) {
alert("Password must contain minimum of 5 characters!", "index.php?action=register");
return false;
}
if ($pass != $pass_veri) {
alert("Passwords does not match!", "index.php?action=register");
return false;
}
if ($email != $email_veri) {
alert("Passwords does not match!", "index.php?action=register");
return false;
}
if (getLenght($hear) < 1) {
alert("Please tell us how did you hear about us!", "index.php?action=register");
return false;
}
if(strtolower($captcha) != $_SESSION['captcha']){
alert("Image verification failed!", "index.php?action=register");
return false;
}
$update_account = mssql_query("INSERT INTO Account (UserID, Email, UGradeID, PGradeID, Hear, RegDate, Name , Points , EventPoints) VALUES (\"$username\", \"$email\", 0, 0, \"$hear\", GETDATE(), \"$username\" , 0,0)");
if(!$update_account) {
var_dump($update_account);
die();
alert(mssql_get_last_message(), "index.php");
}
$select_aid = mssql_query("SELECT * FROM Account WHERE UserID = \"$username\"");
$fetch_shit = mssql_fetch_array($select_aid);
$aid = $fetch_shit['AID'];
$update_login = mssql_query("INSERT INTO Login (UserID, Password, AID) VALUES (\"$username\", \"$pass\", \"$aid\")");
if(!$update_login) {
$delete_temporary_shit = mssql_query("DELETE FROM Account WHERE UserID = \"$username\"");
alert("Shit happened at login! Please try again later!", "index.php");
}
$_SESSION['Username'] = $username;
$_SESSION['AID'] = $aid;
alert("Registered successfully as ".$username, "index.php");
}
?>
<div style="width:449px; height:405px; background-image:url('images/Middle/register_bg.png');">
<div style="width:420px; height:280px; margin:0 auto; position:relative; top:50px;">
<form method="post" action="index.php?action=register&progress=finish">
<table width="420">
<tr>
<td width="210" height="28" align="left">
Username:
</td>
<td width="210" height="28" align="right">
<input type="text" name="username">
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
E-mail:
</td>
<td width="210" height="28" align="right">
<input type="text" name="email">
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
E-mail Verification:
</td>
<td width="210" height="28" align="right">
<input type="text" name="email_veri">
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
Password:
</td>
<td width="210" height="28" align="right">
<input type="password" name="pass">
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
Password Verification:
</td>
<td width="210" height="28" align="right">
<input type="password" name="pass_veri">
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
How did you hear about us?
</td>
<td width="210" height="28" align="right">
<select name="hear" style="width:155px;">
<option value="search_engine">Search Engine</option>
<option value="ragezone">Ragezone</option>
<option value="friend">Friend</option>
<option value="youtube">YouTube</option>
<option value="other">Other</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" width="420" height="28" align="center">
Verification Code:
</td>
</tr>
<tr>
<td colspan="2" width="210" height="28" align="center">
<img src="Parts/captcha.php"/>
</td>
</tr>
<tr>
<td colspan="2" width="210" height="28" align="center">
<input type="text" name="c_text">
</td>
</tr>
<tr>
<td width="210" height="50" align="left">
<input type="submit" name="submit" value="Register" style="height:35px; width:100px;">
</td>
<td width="210" height="50" align="right">
<input type="reset" name="reset" value="Reset" style="height:35px; width:100px;">
</td>
</tr>
</table>
</form>
</div>
</div>
actions/support.php
Code:
<div id="left_container">
<?php include 'Parts/Member_panel.php'; ?>
<div style="height:3px;"></div>
<a href="index.php?action=ranking"><img src="http://forum.ragezone.com/images/Left/weekly.png" style="opacity: 0.4;" onmouseover="BeginOpacity(this,40,100)" onmouseout="EndOpacity(this,40)" border="0"/></a>
<a href="index.php?action=guide"><img src="http://forum.ragezone.com/images/Left/howto.png" style="opacity: 0.4;" onmouseover="BeginOpacity(this,40,100)" onmouseout="EndOpacity(this,40)" border="0"/></a>
<a href="index.php?action=clan"><img src="http://forum.ragezone.com/images/Left/clan.png" style="opacity: 0.4;" onmouseover="BeginOpacity(this,40,100)" onmouseout="EndOpacity(this,40)" border="0"/></a>
</div>
<div id="right_container">
<?php include 'Parts/Ranking.php'; ?>
<div style="height:3px;"></div>
<?php include 'Parts/Quick_shop.php'; ?>
<a href="index.php?action=market"><img src="http://forum.ragezone.com/images/Right/shop_banner.png" style="opacity: 0.4;" onmouseover="BeginOpacity(this,40,100)" onmouseout="EndOpacity(this,40)" border="0" /></a>
</div>
<div id="middle_container">
<?php
include 'Parts/support.php';
?>
</div>
parts/support.php
Code:
<?php
if(isset($_GET['submit'])) {
$email = sql($_POST['email']);
$type = sql($_POST['type']);
$desc = sql($_POST['desc']);
$captcha = sql($_POST['c_text']);
if(getLenght($email) < 6) {
alert("Please give us valid e-mail address!", "index.php?action=support");
return false;
}
if(getLenght($type) < 4) {
alert("Please tell us the type of your problem!", "index.php?action=support");
return FALSE;
}
if(getLenght($desc) < 20) {
alert("The description must contain minimum of 20 characters!", "index.php?action=support");
}
if(strtolower($captcha) != $_SESSION['captcha']){
alert("Image verification failed!", "index.php?action=support");
return false;
}
$update = mssql_query("INSERT INTO TICKET (Email, Type, Description, Date, Opened) VALUES (\"$email\", \"$type\", \"$desc\", GETDATE(), 1)");
if($update) {
alert("You have been posted a ticket successfully! We will answer you soon!", "index.php");
} else {
alert("Shit happened! Try again later!", "index.php");
}
} else {
?>
<div style="width:449px; height:405px; background-image:url('images/Middle/support_bg.png'); text-align:center;">
<div style="width:420px; height:280px; margin:0 auto; position:relative; top:60px; text-align:left;">
<form method="post" action="index.php?action=support&submit">
<table width="100%">
<tr height="25">
<td align="left">E-mail address:</td>
<td align="right"><input type="text" name="email"></td>
</tr>
<tr height="25">
<td>Problem type:</td>
<td align="right">
<select name="type">
<option value="register">Registration Problem</option>
<option value="login">Login Problem</option>
<option value="bug">Bug Report</option>
<option value="hacker">Hacker Report</option>
<option value="technical">Technical Problem</option>
<option value="other">Other</option>
</select>
</td>
</tr>
<tr height="25">
<td colspan="2">Problem description:</td>
</tr>
<tr>
<td colspan="2" align="center">
<textarea rows="13" cols="49" name="desc"></textarea>
</td>
</tr>
<tr>
<td colspan="2" width="420" height="28" align="center">
Verification Code:
</td>
</tr>
<tr>
<td colspan="2" width="210" height="28" align="center">
<img src="parts/captcha.php"/>
</td>
</tr>
<tr>
<td colspan="2" width="210" height="28" align="center">
<input type="text" name="c_text">
</td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Submit Ticket!" style="width:100px; height:30px;"></td>
<td align="right"><input type="reset" name="reset" value="Reset!" style="width:100px; height:30px;" align="right"></td>
</tr>
</table>
</form>
</div>
</div>
<?php
}
?>
<br><br><br><br><br><br>
parts/my_acc.php
Code:
<?php
if($_SESSION['Username'] == "") {
redirect("index.php");
}
$username = $_SESSION['Username'];
$getlofasz = mssql_query("SELECT * FROM Messages WHERE Owner = \"$username\"");
$aid = $_SESSION['AID'];
$getchar = mssql_query("SELECT * FROM Character WHERE AID = \"$aid\"");
$email_e = mssql_query("SELECT * FROM Account WHERE AID = \"$aid\"");
$lofasz = mssql_fetch_array($email_e);
$email = $lofasz['Email'];
$name = $lofasz['Name'];
if ($lofasz['sa'] == "") {
$sa = "Not set yet!";
} else {
$sa = $lofasz['sa'];
}
if ($lofasz['sq'] == "") {
$sq = "Not set yet!";
} else {
$sq = $lofasz['sq'];
}
$getagain = mssql_query("SELECT * FROM Messages WHERE Owner = \"$username\"");
$mailcount = mssql_num_rows($getagain);
?>
<div style="width:449px; height:405px; background-image:url('images/Middle/myacc_bg.png');">
<div style="width:420px; height:280px; margin:0 auto; position:relative; top:50px;">
<table width="420">
<tr>
<td width="210" height="28" align="left">
<strong><?php echo '[' . $_SESSION['Username'] . ']'; ?></strong>
</td>
<td width="210" height="28" align="right">
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
Name:
</td>
<td width="210" height="28" align="right">
<?php echo $name; ?>
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
E-mail:
</td>
<td width="210" height="28" align="right">
<?php echo $email; ?>
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
Security Question:
</td>
<td width="210" height="28" align="right">
<?php echo $sq; ?>
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
Security Answer:
</td>
<td width="210" height="28" align="right">
<?php echo $sa; ?>
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
Password:
</td>
<td width="210" height="28" align="right">
**********
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
My Characters:
</td>
<td width="210" height="28" align="right">
<select>
<?php
while ($kaksi = mssql_fetch_array($getchar)) {
$charname = $kaksi['Name'];
$level = $kaksi['Level'];
echo '
<option value="blabla">Lvl.'.$level.' ' .$charname . '</option>
';
}
?>
</select>
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
My Condoms:
</td>
<td width="210" height="28" align="right">
<?php echo $lofasz['Points']; ?>
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
My Event Points:
</td>
<td width="210" height="28" align="right">
<?php echo $lofasz['EventPoints']; ?>
</td>
</tr>
<tr>
<td width="210" height="28" align="left">
My Messages:
</td>
<td width="210" height="28" align="right">
<?php echo $mailcount; ?>
</td>
</tr>
<tr>
<td width="210" height="50" align="left">
<button style="width:100px; height:30px;" onclick="window.location='index.php?action=edit_acc'">Edit Account</button>
</td>
</tr>
</table>
</div>
</div>
parts/captcha.php
Code:
<?php
session_start();
// Set the content-type
header('Content-type: image/png');
// Create the image
$im = imagecreatetruecolor(250, 55);
// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$lightblue = imagecolorallocate($im, 130, 189, 248);
$blue = imagecolorallocate($im, 22, 153, 196);
$yellow = imagecolorallocate($im, 237, 191, 33);
$greeny = imagecolorallocate($im, 33, 237, 168);
imagefilledrectangle($im, 0, 0, 249, 54, $blue);
// The text to draw
$charset = "abcdefghijklmnopqrstuvwxyz0123456789";
for ( $i = 0; $i < 8; ++$i )
{
$rand = rand(0, 35);
$sesstext = $sesstext.$charset[$rand];
$text[$i] = $charset[$rand];
}
// Place the text to session variable
$_SESSION['captcha'] = $sesstext;
// Replace path by your own font path
$font[1] = "28days.ttf";
$font[2] = "3rdman.ttf";
// Add some distortion
for ( $i = 1; $i < 9; ++$i )
{
$linerandx1 = rand(0, 249);
$linerandy1 = rand(0, 54);
$linerandx2 = rand(0, 249);
$linerandy2 = rand(0, 54);
imageline($im, $linerandx1, $linerandy1, $linerandx2, $linerandy2, $white);
imageline($im, $linerandx2, $linerandy2, $linerandx1, $linerandy1, $greeny);
imagearc($im, $linerandx1, $linerandy1, $linerandx2, $linerandy2, 0, 360, $lightblue);
imagearc($im, $linerandx1, $linerandy1, $linerandx2, $linerandy2, 0, 360, $yellow);
}
// méret, dolésszög, balról, fentrol, szín, betutípus, szöveg!
// imagettftext($im, 20, 0, 40, 30, $black, $font, $sesstext);
$leftmargin[0] = 5;
for ( $i = 1; $i < 9; ++$i )
{
//Add chars!
$anglerand = rand(-5, 6);
$leftmargin[$i] = $leftmargin[$i-1] + rand(20, 30);
$topmargin = rand(30, 40);
$fontrand = rand(1, 2);
imagettftext($im, 20, $anglerand, $leftmargin[$i], $topmargin, $black, $font[$fontrand], $text[$i-1]);
}
// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?>
I realized the images folder is missing , so here it is.
http://www.mediafire.com/?b7pjy9375w5zv7f
Bugs fixed so far ,
Register.
support.
my account had my characters fucked up , fixed it.
my messages in my account showed the event points , fixed it.
the ranking names weren't aligned in the middle , aligned it.
captcha.
I'm done with it , have fun.