My little Faction Manager

Dante_A - Heavens Tear
Posts: 11 Arc User
*Users who follow this guide do so at their own risk*
Well, i was using a long time the Titles to have an overview about my faction.
Like 0284 - Last seen on 2nd with lvl 84
But me and my members get pi**ed with this. So i've decided to write a little script, to handle all of this.
All you need is a webspace with mysql.
There you can simply create and update a memberlist.
Informations that can be entered:
Name, Date of joining, level joining, last seen, current level, additional information.
All protected with a simple password, so you can give this to your marshalls and executors too.
Other Members can look at the list, ofc. But need the PW to change things.
How to use?
Create a folder with a name of your choice
Create the file
put this into file:
change the changemes to your informations
save it
create
save and create
save and create
save and open now in browser
www.yourside.de/yourfolder/install.php
delete install.php
and open www.yourside.de/yourfolder/index.php
there you go
maybe someone find this usefull ^^
i just can say, my faction is happy now, since they can use the title option
Well, i was using a long time the Titles to have an overview about my faction.
Like 0284 - Last seen on 2nd with lvl 84
But me and my members get pi**ed with this. So i've decided to write a little script, to handle all of this.
All you need is a webspace with mysql.
There you can simply create and update a memberlist.
Informations that can be entered:
Name, Date of joining, level joining, last seen, current level, additional information.
All protected with a simple password, so you can give this to your marshalls and executors too.
Other Members can look at the list, ofc. But need the PW to change things.
How to use?
Create a folder with a name of your choice
Create the file
db.php
put this into file:
<?php $MYSQL_HOST = "localhost"; //Hostname of MySQL Server, usually localhost $MYSQL_USER = "changeme"; //MySQL Username $MYSQL_PW = "changeme"; //MySQL Password $MYSQL_DB = "changeme"; //MySQL Tablename $password = "changeme"; //Password for Webinterface $faction = "changeme"; //Faction Name $conn = mysql_connect($MYSQL_HOST, $MYSQL_USER, $MYSQL_PW); mysql_select_db($MYSQL_DB, $conn); ?>
change the changemes to your informations
save it
create
install.php
<?php include './db.php'; $sql = 'CREATE TABLE `manage` (' . ' `id` INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, ' . ' `name` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, ' . ' `joined` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, ' . ' `jlvl` INT(3) NOT NULL, ' . ' `seen` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, ' . ' `slvl` INT(3) NOT NULL, ' . ' `info` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL' . ' )' . ' ENGINE = myisam;'; $do_it = mysql_query($sql); ?>
save and create
index.php
<?php include './db.php'; $state = mysql_real_escape_string(htmlspecialchars($_GET["state"])); ?> <html> <head> <title><?php echo $faction; ?> Faction Manager - by Dante_A, Heavens Tear</title> <style type="text/css"> <!-- input { background-color: #330000; color: #aaa; border: 1px solid #111; } button { background-color: #330000; color: #aaa; border: 1px solid #111; } --> </style> </head> <body bgcolor="#190000" style="color: #aaa;"> <table> <tr> <td colspan="11"> <center><h2> <?php if($state == 1) { echo '<font color="#880000">Access denied!</font>'; } if($state == 2) { echo '<font color="#880000">Error: Not all fields filled!</font>'; } if($state == 3) { echo '<font color="#008800">Updated Successfully!</font>'; } if($state == 4) { echo '<font color="#880000">Entry for this Name allready in Database!</font>'; } ?> </h2></center> </td> </tr> <tr> <td> Delete: </td> <td> *Name: </td> <td> *Joined: </td> <td> *With Level: </td> <td> *Last seen: </td> <td> *With Level: </td> <td> </td> <td> Information: </td> <td> </td> <td> *Password: </td> <td> </td> </tr> <?php $count = 0; $query = mysql_query("SELECT * FROM `manage` ORDER BY `id` ; "); while($row = mysql_fetch_object($query)){ $count++; $id = "$row->id"; $name = "$row->name"; $joined = "$row->joined"; $jlvl = "$row->jlvl"; $seen = "$row->seen"; $slvl = "$row->slvl"; $info = "$row->info"; ?> <tr> <form name="handle_<?php echo $id; ?>" action="./handle.php" method="post"> <td> <input name="id" maxlength="10" value="<?php echo $id; ?>" style="display: none; width: 0px;" readonly /><input type="checkbox" name="delete" "value="1"> </td> <td> <input name="name" maxlength="32" value="<?php echo $name; ?>" /> </td> <td> <input name="joined" maxlength="32" value="<?php echo $joined; ?>" /> </td> <td> <input name="jlvl" maxlength="3" value="<?php echo $jlvl; ?>" /> </td> <td> <input name="seen" maxlength="32" value="<?php echo $seen; ?>" /> </td> <td> <input name="slvl" maxlength="3" value="<?php echo $slvl; ?>" /> </td> <td> </td> <td> <input name="info" maxlength="32" value="<?php echo $info; ?>" /> </td> <td> </td> <td> <input name="pass" maxlength="32" value="" /> </td> <td> </td> <td> <button type="submit">Submit</button> </td> </form> </tr> <?php if ($count == 15){ $count = 0; ?> <tr> <td> Delete: </td> <td> *Name: </td> <td> *Joined: </td> <td> *With Level: </td> <td> *Last seen: </td> <td> *With Level: </td> <td> </td> <td> Information: </td> <td> </td> <td> *Password: </td> <td> </td> </tr> <?php }} ?> <tr> <td> Delete: </td> <td> *Name: </td> <td> *Joined: </td> <td> *With Level: </td> <td> *Last seen: </td> <td> *With Level: </td> <td> </td> <td> Information: </td> <td> </td> <td> *Password: </td> <td> </td> </tr> <tr> <form name="handler" action="./handle.php" method="post"> <td> <input name="id" maxlength="60" value="none" style="display: none; width: 0px;" readonly /> </td> <td> <input name="name" maxlength="32" value="" /> </td> <td> <input name="joined" maxlength="32" value="" /> </td> <td> <input name="jlvl" maxlength="3" value="" /> </td> <td> <input name="seen" maxlength="32" value="" /> </td> <td> <input name="slvl" maxlength="3" value="" /> </td> <td> </td> <td> <input name="info" maxlength="32" value="" /> </td> <td> </td> <td> <input name="pass" maxlength="32" value="" /> </td> <td> </td> <td> <button type="submit">Submit</button> </td> </form> </tr> </table> <br><br><small>* Required</small> </body> </html>
save and create
handle.php
<?php include './db.php'; $pass = mysql_real_escape_string(htmlspecialchars($_POST["pass"])); if ($pass != "$password") { header("Location: ./index.php?state=1 "); die(); } $id = mysql_real_escape_string(htmlspecialchars($_POST["id"])); $del = mysql_real_escape_string(htmlspecialchars($_POST["delete"])); $name = mysql_real_escape_string(htmlspecialchars($_POST["name"])); $joined = mysql_real_escape_string(htmlspecialchars($_POST["joined"])); $jlvl = mysql_real_escape_string(htmlspecialchars($_POST["jlvl"])); $seen = mysql_real_escape_string(htmlspecialchars($_POST["seen"])); $slvl = mysql_real_escape_string(htmlspecialchars($_POST["slvl"])); $info = mysql_real_escape_string(htmlspecialchars($_POST["info"])); if( $name == "" || $joined == "" || $jlvl == "" || $seen == "" || $slvl == "" ) { header("Location: ./index.php?state=2 "); die(); } $query = mysql_query("SELECT * FROM `manage` WHERE `name` = '$name' ; "); while($row = mysql_fetch_object($query)){ $check = "$row->id"; } if ($id != "none") { if ($del != 1) { $query = "UPDATE `manage` Set name='$name' WHERE id = '$id'"; $do_it = mysql_query($query); $query = "UPDATE `manage` Set joined='$joined' WHERE id = '$id'"; $do_it = mysql_query($query); $query = "UPDATE `manage` Set jlvl='$jlvl' WHERE id = '$id'"; $do_it = mysql_query($query); $query = "UPDATE `manage` Set seen='$seen' WHERE id = '$id'"; $do_it = mysql_query($query); $query = "UPDATE `manage` Set slvl='$slvl' WHERE id = '$id'"; $do_it = mysql_query($query); $query = "UPDATE `manage` Set info='$info' WHERE id = '$id'"; $do_it = mysql_query($query); } else { $query = "DELETE FROM `manage` WHERE `id` = '$id'"; $do_it = mysql_query($query); } header("Location: ./index.php?state=3 "); die(); } else { if( $check != '') { header("Location: ./index.php?state=4 "); die(); } $m_m_e = "INSERT INTO `manage` (name, joined, jlvl, seen, slvl, info) VALUES ('$name', '$joined', '$jlvl', '$seen', '$slvl', '$info')"; $do_it = mysql_query($m_m_e); header("Location: ./index.php?state=3 "); die(); } echo "Unexpected Error!<br>Please inform admin!"; ?>
save and open now in browser
www.yourside.de/yourfolder/install.php
delete install.php
and open www.yourside.de/yourfolder/index.php
there you go

maybe someone find this usefull ^^
i just can say, my faction is happy now, since they can use the title option
0
Categories
- All Categories
- 182K PWI
- 699 Official Announcements
- 2 Rules of Conduct
- 264 Cabbage Patch Notes
- 61.1K General Discussion
- 1.5K Quality Corner
- 11.1K Suggestion Box
- 77.4K Archosaur City
- 3.5K Cash Shop Huddle
- 14.3K Server Symposium
- 18.1K Dungeons & Tactics
- 2K The Crafting Nook
- 4.9K Guild Banter
- 6.6K The Trading Post
- 28K Class Discussion
- 1.9K Arigora Colosseum
- 78 TW & Cross Server Battles
- 337 Nation Wars
- 8.2K Off-Topic Discussion
- 3.7K The Fanatics Forum
- 207 Screenshots and Videos
- 22.8K Support Desk