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: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277:
|
<?php
// 11072004
// Item Editor // by anpera; based on mount editor // // This is for administer items of all kind with anpera's item table // (first introduced in houses mod) // items table REQUIRED! // // insert: // if ($session[user][superuser]>=2) addnav("Item Editor","itemeditor.php"); // into menu of superuser.php //
/********************************************************************* * MODIFIZIERT DURCH * Admin @ Dreythal * Oktober 2015 *********************************************************************/
require_once 'common.php';
page_header('Item-Editor');
addnav('Zurück...'); addnav('G?... in die Grotte','superuser.php'); addnav('D?... nach Dreythal','village.php');
if ($_GET['op']=='del') { $sql = 'DELETE FROM items WHERE id="'.$_GET['id'].'"'; db_query($sql); $_GET['op']=''; $_GET['show']=$_GET['show']; // huh? weshalb hab ich das geschrieben? }
if ($_GET['op']=='add') { output('Item erzeugen:`n'); addnav('Item Editor','itemeditor.php');
if ($_GET['show']) addnav(''.$_GET['show'].'','itemeditor.php?show='.urlencode($_GET['show']).'');
itemform(array('class'=>$_GET['show'])); }
elseif ($_GET['op']=='edit') { addnav('Ü?... zur Übersicht','itemeditor.php');
if ($_GET['show']) addnav('K?... zur Klasse "'.$_GET['show'].'"','itemeditor.php?show='.urlencode($_GET['show']).'');
$sql = 'SELECT * FROM items WHERE id="'.$_GET['id'].'"'; $result = db_query($sql);
if (db_num_rows($result)<=0) {output('`iItem nicht vorhanden.`i');}
else { output('Item Editor:`n');
$row = db_fetch_assoc($result); $row['buff']=unserialize($row['buff']); itemform($row); } }
elseif ($_GET['op']=='save') { $buff = array(); reset($_POST['item']['buff']);
if (isset($_POST['item']['buff']['activate'])) $_POST['item']['buff']['activate']=join(",",$_POST['item']['buff']['activate']);
while (list($key,$val)=each($_POST['item']['buff'])) { if ($val>"") {$buff[$key]=stripslashes($val);} } $_POST['item']['buff']=$buff; reset($_POST['item']); $keys=''; $vals=''; $sql=''; $i=0; while (list($key,$val)=each($_POST['item'])) { if (is_array($val)) $val = addslashes(serialize($val));
if ($_GET['id']>"") {$sql.=($i>0?",":"")."$key='$val'";}
else { $keys.=($i>0?",":"")."$key"; $vals.=($i>0?",":"")."'$val'"; }
$i++; }
if ($_GET['id']>'') {$sql='UPDATE items SET '.$sql.' WHERE id="'.$_GET['id'].'"';}
else {$sql='INSERT INTO items ('.$keys.') VALUES ('.$vals.')';}
db_query($sql);
if (db_affected_rows()>0) {output('Item gespeichert!');}
else {output('Item nicht gespeichert: '.$sql.'');}
addnav('Ü?... zur Übersicht','itemeditor.php');
if ($_GET['show']) addnav('K?... zur Klasse "'.$_GET['show'].'"','itemeditor.php?show='.urlencode($_GET['show']).''); }
else { if($_GET['show']) { $ppp=49; // Player Per Page to display if (!$_GET['limit']) {$page=0;} else { $page=(int)$_GET['limit']; addnav('Blättere auf...'); addnav('v?... vorherige Seite','itemeditor.php?show='.urlencode($_GET['show']).'&limit='.($page-1).''); }
$limit=''.($page*$ppp).','.($ppp+1); $sql = 'SELECT items.*,accounts.name AS ownername FROM items LEFT JOIN accounts ON accounts.acctid=items.owner WHERE class="'.$_GET['show'].'" ORDER BY id LIMIT '.$limit.'';
output('<table cellpadding="3" cellspacing="3" width="100%"><tr class="trhead"> <td width="10%">`bAktion`b</td> <td width="20%">`bItem`b</td> <td width="20%">`bBesitzer`b</td> <td width="50%">`bBeschreibung`b</td></tr>',true);
$result = db_query($sql);
if (db_num_rows($result)>$ppp) addnav('n?... nächste Seite','itemeditor.php?show='.urlencode($_GET['show']).'&limit='.($page+1).'');
$cat = '';
for ($i=0;$i<db_num_rows($result);$i++) { $row = db_fetch_assoc($result);
output('<tr>',true); output('<td><a href="itemeditor.php?op=edit&id='.$row['id'].'&show='.urlencode($row['class']).'">`6bearbeiten`0</a>`n',true);
addnav('','itemeditor.php?op=edit&id='.$row['id'].'&show='.urlencode($row['class']).'');
output(' <a href="itemeditor.php?op=del&id='.$row['id'].'&show='.urlencode($row['class']).'" onClick="return confirm(\'Diesen Gegenstand wirklich löschen?\');">`alöschen`0</a></td>',true);
addnav('','itemeditor.php?op=del&id='.$row['id'].'&show='.urlencode($row['class']).'');
output('<td>`l'.$row['name'].'`0</td> <td>`l'.$row['ownername'].'`0</td> <td>`l'.$row['description'].'`0</td></tr>',true); }
output('</table>',true);
addnav('Item...'); addnav('E?... Editor anzeigen','itemeditor.php'); addnav('h?... hinzufügen','itemeditor.php?op=add&show='.urlencode($_GET['show']).''); } else { $sql = 'SELECT class FROM items ORDER BY class';
output('Verfügbare "classes":`n`n<table>',true); output('<tr><td>Name</td></tr>',true);
$result = db_query($sql); $cat = '';
for ($i=0;$i<db_num_rows($result);$i++) { $row = db_fetch_assoc($result);
if ($cat!=$row['class']) { output('<tr><td> <a href="itemeditor.php?show='.urlencode($row['class']).'">'.$row['class'].'</a></td></tr>',true);
$cat = $row['class'];
addnav('','itemeditor.php?show='.urlencode($row['class']).'');
output('</tr>',true); } }
output('</table>`n`nUm eine class zu löschen, müssen alle Items dieser class gelöscht werden.`nUm eine neue class zu erstellen, einfach ein Item erzeugen.',true);
addnav('Item...'); addnav('h?... hinzufügen','itemeditor.php?op=add'); } }
function itemform($item) { global $output;
output("<form action='itemeditor.php?op=save&id=$item[id]' method='POST'>",true);
addnav("","itemeditor.php?op=save&id=$item[id]"); $output.="<table>"; $output.="<tr><td>Item Name:</td><td><input name='item[name]' value=\"".htmlentities($item['name'])."\" maxlength='25'></td></tr>"; $output.="<tr><td>Item Beschreibung:</td><td><input name='item[description]' value=\"".htmlentities($item['description'])."\" maxlength='255'></td></tr>"; $output.="<tr><td>Item Class:</td><td><input name='item[class]' value=\"".htmlentities($item['class'])."\" maxlength='25'></td></tr>"; $output.="<tr><td>Besitzer ID:</td><td><input name='item[owner]' value=\"".htmlentities((int)$item['owner'])."\" size='5'></td></tr>"; $output.="<tr><td>Item Wert (Edelsteine):</td><td><input name='item[gems]' value=\"".htmlentities((int)$item['gems'])."\" size='5'></td></tr>"; $output.="<tr><td>Item Wert (Gold):</td><td><input name='item[gold]' value=\"".htmlentities((int)$item['gold'])."\" size='5'></td></tr>"; $output.="<tr><td>Item Wert 1:</td><td><input name='item[value1]' value=\"".htmlentities((int)$item['value1'])."\" size='5'></td></tr>"; $output.="<tr><td>Item Wert 2:</td><td><input name='item[value2]' value=\"".htmlentities((int)$item['value2'])."\" size='5'></td></tr>"; $output.="<tr><td>Versteckter Wert:</td><td><input name='item[hvalue]' value=\"".htmlentities((int)$item['hvalue'])."\" size='5'></td></tr>"; $output.="<tr><td valign='top'>Item Buff:</td><td>"; $output.="<b>Meldungen:</b><Br/>"; $output.="Buff Name: <input name='item[buff][name]' value=\"".htmlentities($item['buff']['name'])."\"><Br/>"; //output("Initial Message: <input name='mount[mountbuff][startmsg]' value=\"".htmlentities($mount['mountbuff']['startmsg'])."\">`n",true); $output.="Meldung jede Runde: <input name='item[buff][roundmsg]' value=\"".htmlentities($item['buff']['roundmsg'])."\"><Br/>"; $output.="Ablaufmeldung: <input name='item[buff][wearoff]' value=\"".htmlentities($item['buff']['wearoff'])."\"><Br/>"; $output.="Effektmeldung: <input name='item[buff][effectmsg]' value=\"".htmlentities($item['buff']['effectmsg'])."\"><Br/>"; $output.="Kein Schaden Meldung: <input name='item[buff][effectnodmgmsg]' value=\"".htmlentities($item['buff']['effectnodmgmsg'])."\"><Br/>"; $output.="Fehlgeschlagen Meldung: <input name='item[buff][effectfailmsg]' value=\"".htmlentities($item['buff']['effectfailmsg'])."\"><Br/>"; $output.="<Br/><b>Effekt:</b><Br/>"; $output.="Hält Runden (nach Aktivierung): <input name='item[buff][rounds]' value=\"".htmlentities($item['buff']['rounds'])."\" size='5'><Br/>"; $output.="Angriffsmulti Spieler: <input name='item[buff][atkmod]' value=\"".htmlentities($item['buff']['atkmod'])."\" size='5'><Br/>"; $output.="Verteidigungsmulti Spieler: <input name='item[buff][defmod]' value=\"".htmlentities($item['buff']['defmod'])."\" size='5'><Br/>"; $output.="Regen: <input name='item[buff][regen]' value=\"".htmlentities($item['buff']['regen'])."\"><Br/>"; $output.="Diener Anzahl: <input name='item[buff][minioncount]' value=\"".htmlentities($item['buff']['minioncount'])."\"><Br/>"; $output.="Min Badguy Damage: <input name='item[buff][minbadguydamage]' value=\"".htmlentities($item['buff']['minbadguydamage'])."\" size='5'><Br/>"; $output.="Max Badguy Damage: <input name='item[buff][maxbadguydamage]' value=\"".htmlentities($item['buff']['maxbadguydamage'])."\" size='5'><Br/>"; $output.="Lifetap: <input name='item[buff][lifetap]' value=\"".htmlentities($item['buff']['lifetap'])."\" size='5'><Br/>"; $output.="Damage shield: <input name='item[buff][damageshield]' value=\"".htmlentities($item['buff']['damageshield'])."\" size='5'> (multiplier)<Br/>"; $output.="Badguy Damage mod: <input name='item[buff][badguydmgmod]' value=\"".htmlentities($item['buff']['badguydmgmod'])."\" size='5'> (multiplier)<Br/>"; $output.="Badguy Atk mod: <input name='item[buff][badguyatkmod]' value=\"".htmlentities($item['buff']['badguyatkmod'])."\" size='5'> (multiplier)<Br/>"; $output.="Badguy Def mod: <input name='item[buff][badguydefmod]' value=\"".htmlentities($item['buff']['badguydefmod'])."\" size='5'> (multiplier)<Br/>"; //$output.=": <input name='mount[mountbuff][]' value=\"".htmlentities($mount['mountbuff'][''])."\">`n",true); $output.="<Br/><b>Aktiviert bei:</b><Br/>"; $output.="<input type='checkbox' name='item[buff][activate][]' value=\"roundstart\"".(strpos($item['buff']['activate'],"roundstart")!==false?" checked":"")."> Start der Runde<Br/>"; $output.="<input type='checkbox' name='item[buff][activate][]' value=\"offense\"".(strpos($item['buff']['activate'],"offense")!==false?" checked":"")."> Bei Angriff<Br/>"; $output.="<input type='checkbox' name='item[buff][activate][]' value=\"defense\"".(strpos($item['buff']['activate'],"defense")!==false?" checked":"")."> Bei Verteidigung<Br/>"; $output.="<Br/>"; $output.="</td></tr>"; $output.="</table>"; $output.="<input type='submit' class='button' value='Speichern'></form>"; }
page_footer(); ?>
|