From: <eri...@us...> - 2008-03-16 21:18:42
|
Revision: 1195 http://planeshift.svn.sourceforge.net/planeshift/?rev=1195&view=rev Author: eriroley Date: 2008-03-16 14:18:48 -0700 (Sun, 16 Mar 2008) Log Message: ----------- WC - An update to allow for simple modifications to the Prioroty of a KA Modified Paths: -------------- www/docs/history.txt www/webconsole/npcs/npc_actions.php Modified: www/docs/history.txt =================================================================== --- www/docs/history.txt 2008-03-16 21:15:18 UTC (rev 1194) +++ www/docs/history.txt 2008-03-16 21:18:48 UTC (rev 1195) @@ -1,3 +1,6 @@ +*** 2008-03-16 by Eriroley +WC - An update to allow for simple modifications to the Prioroty of a KA + *** 2008-03-10 by Eriroley WC - An update to work with ka-scripts Modified: www/webconsole/npcs/npc_actions.php =================================================================== --- www/webconsole/npcs/npc_actions.php 2008-03-16 21:15:18 UTC (rev 1194) +++ www/webconsole/npcs/npc_actions.php 2008-03-16 21:18:48 UTC (rev 1195) @@ -380,7 +380,14 @@ echo '<b>Knowledge Areas present in this NPC: </b><br><br>'; echo '<TABLE border=1><TH>Knowledge Area - </TH><TH>Priority</TH><TH></TH>'; while ($line = mysql_fetch_array($result, MYSQL_NUM)){ - echo "<TR><TD VALIGN=top><b>$line[0]</b></TD><TD>$line[1]</TD><TD><FORM action=index.php?page=npc_actions&operation=editkas&npcid=$id&subop=del METHOD=POST><INPUT type=hidden name=area value=\"$line[0]\"><INPUT type=submit name=submit value=Delete></FORM></TD></TR>"; + echo "<TR><TD VALIGN=top><b>$line[0]</b></TD><TD><FORM action=index.php?page=npc_actions&operation=editkas&npcid=$id&subop=mod METHOD=POST><select name=priority>"; + for($i=1;$i<=10;$i++){ + echo "<option value=$i"; + if($i == $line[1]) + echo " selected=selected"; + echo ">$i</option>"; + } + echo "</select><input type=hidden name=area value=\"$line[0]\"></TD><TD><input type=submit name=mod value=\"Edit Priority\"></FORM><FORM action=index.php?page=npc_actions&operation=editkas&npcid=$id&subop=del METHOD=POST><INPUT type=hidden name=area value=\"$line[0]\"><INPUT type=submit name=submit value=Delete></FORM></TD></TR>"; $found = 1; } echo '</TABLE><br><br>'; @@ -437,7 +444,15 @@ document.location = "index.php?page=npc_actions&operation=viewkas&npcid=<?=$id?>"; </script> <?PHP - + }else if ($subop == 'mod'){ + $id = $_GET['npcid']; + $priority = $_POST['priority']; + $area = $_POST['area']; + $query = "UPDATE npc_knowledge_areas SET priority=$priority WHERE player_id='$id' AND area='$area'"; + $result = mysql_query2($query); + ?><SCRIPT language="javascript"> + document.location = "index.php?page=npc_actions&operation=viewkas&npcid=<?=$id?>"; + </script> }else{ echo "Operation editkas supported, suboperation $subop not supported."; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |