-
Notifications
You must be signed in to change notification settings - Fork 7
/
createguild.php
111 lines (51 loc) · 2.35 KB
/
createguild.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
//////////////////////////////////////////////////
//Please allow me to build this entire system. //
//I want to have fun with it. //
//////////////////////////////////////////////////
//Deus //
//////////////////////////////////////////////////
session_name("icsession");
session_start();
include('db.php');
include('varset.php');
if($chargold >= "10000000" && isset($_POST['guildname']) && isset($_POST['guildtag'])) //10m
{
$guildname = $_POST['guildname'];
$guildtag = $_POST['guildtag'];
$getguild = mysql_query("SELECT * FROM guilds WHERE name='".$guildname."'");
if(mysql_num_rows($getguild) != "1")
{
if($guildname != "" || $guildname != "None" || $guildname != "Select Guild" || $guildname != "Admin" || $guildname != "Administration" || $guildname != "Mod" || $guildname != "Moderator" || strlen($guildname) <= "40")
{
if($guildtag != "" || strlen($guildtag) <= "5")
{
$newgold = $char['gold'] - "10000000";
$news = "You have successfully created your Guild [b]".$guildname."[/b]. This is your Guild Portal where every aspect of your Guild can be modified to suit your needs.";
$setchar = mysql_query("UPDATE characters SET guild='".$guildname."', gold='".$newgold."' WHERE id='".$_SESSION['userid']."'");
$setguild = mysql_query("INSERT INTO guilds (`name`, `tag`, `leader`, `news`) VALUES ('".$guildname."', '".$guildtag."', '".$char['username']."', '".$news."')");
$messagechat = "<strong><font color=\'#CCFF00\'>".$char['username']." has registered a new Guild by the name ".$guildname.".</font></strong><br />";
$query = mysql_query("INSERT INTO chatroom (`date`, `userlevel`, `username`, `message`, `to`) VALUES ('', '3', '".$char['username']."', '".$messagechat."', 'Chatroom')");
print("viewGuild();");
}
else
{
$data = "<font color=\'#FF0000\'>You need to specify a Guild Tag.</font>";
}
}
else
{
$data = "<font color=\'#FF0000\'>You have chosen an illegal or disallowed Guild Name, please choose another.</font>";
}
}
else
{
$data = "<font color=\'#FF0000\'>A Guild already exists by this name, please choose another.</font>";
}
}
else
{
$data = "<font color=\'#FF0000\'>You do not have the 10,000,000 Gold required to create a Guild. Or invalid guild name and/or tag.</font>";
}
print("fillDiv('guildinfo','".$data."');");
?>