if (!checkrights("RC") || !defined("iAUTH") || $aid != iAUTH) fallback("../index.php"); opentable('Add New Rank'); echo "<center>Sorry, this function is currently unavailable.</center>"; closetable();
tablebreak();
opentable('Manage Ranks');
if($_GET[clanranks]) { if ($_POST['submit'] != 'Update') { $data = mysql_query("SELECT * from fusion_clanranks where rank_id = '$_GET[clanranks]'"); $data = mysql_fetch_array($data); echo(" <div align='center'><form method='post'> <table> <tr> <td valign='top'>Rank ID #: </td> <td valign='top'><input name='rank_id' type='text' value='$data[rank_id]'></td> </tr> <tr> <td valign='top'>Rank Name: </td> <td valign='top'><input name='rank_name' type='text' value='$data[rank_name]'></td> </tr> <tr> <td valign='top'>Rank Color: </td> <td valign='top'><input name='rank_color' type='text' value='$data[rank_color]'> </td> </tr> <tr> <td align='center' colspan=2><input type='submit' name='submit' value='Update'></td> </tr> </table> </form> </div>"); } else { $rank_id = $_POST['rank_id']; $rank_name = $_POST['rank_name']; $rank_color = $_POST['rank_color']; $update = ("UPDATE fusion_clanranks set rank_id = '$rank_id', rank_name = '$ramk_name', rank_color = '$rank_color' where rank_id = '{$_GET[clanranks]}'"); mysql_query($update) or die(mysql_error()); echo "The rank has been successfully updated."; } } else { $getclanranks = mysql_query("SELECT * from fusion_clanranks order by rank_id asc"); while($data = mysql_fetch_array($getclanranks)) { $result = mysql_query("select * from fusion_clanranks order by rank_id"); while($r=mysql_fetch_array($result)) { $rank_id=$r['rank_id']; } echo("<a href='?clanranks=$data[rank_id]'>$data[rank_name]</a><br />"); }
if (!checkrights("RC") || !defined("iAUTH") || $aid != iAUTH) fallback("../index.php"); opentable('Add New Rank'); echo "<center>Sorry, this function is currently unavailable.</center>"; closetable();
tablebreak();
opentable('Manage Ranks');
if($_GET[clanranks]) { if ($_POST['submit'] != 'Update') { $data = mysql_query("SELECT * from fusion_clanranks where rank_id = '$_GET[clanranks]'"); $data = mysql_fetch_array($data); echo(" <div align='center'><form method='post'> <table> <tr> <td valign='top'>Rank ID #: </td> <td valign='top'><input name='rank_id' type='text' value='$data[rank_id]'></td> </tr> <tr> <td valign='top'>Rank Name: </td> <td valign='top'><input name='rank_name' type='text' value='$data[rank_name]'></td> </tr> <tr> <td valign='top'>Rank Color: </td> <td valign='top'><input name='rank_color' type='text' value='$data[rank_color]'> </td> </tr> <tr> <td align='center' colspan=2><input type='submit' name='submit' value='Update'></td> </tr> </table> </form> </div>"); } else { $rank_id = $_POST['rank_id']; $rank_name = $_POST['rank_name']; $rank_color = $_POST['rank_color']; $update = ("UPDATE fusion_clanranks set rank_id = '$rank_id', rank_name = '$ramk_name', rank_color = '$rank_color' where rank_id = '{$_GET[clanranks]}'"); mysql_query($update) or die(mysql_error()); echo "The rank has been successfully updated."; } } else { $getclanranks = mysql_query("SELECT * from fusion_clanranks order by rank_id asc"); while($data = mysql_fetch_array($getclanranks)) { $result = mysql_query("select * from fusion_clanranks order by rank_id"); while($r=mysql_fetch_array($result)) { $rank_id=$r['rank_id']; } echo("<a href='?clanranks=$data[rank_id]'>$data[rank_name]</a><br />"); } } closetable();
require_once BASEDIR."footer.php"; ?>
as you can see I formatted the code to make it better readable, do the same and you will see your misatkes much better.
aka J Love Community Supporter?
Bill Gates is my home boy
Gender:
Posts: 886
1148 credits Members referred : 4
« Reply #2 on: Aug 24, 2006, 09:27:14 pm »
i dont get the parsing error anymore, but when i click a link to the rank, to edit it, it reloads my sites front page (backtracks outside of the admin panel)
edit: typo- from=front
« Last Edit: Aug 24, 2006, 09:45:20 pm by Meth0d »
aka J Love Community Supporter?
Bill Gates is my home boy
Gender:
Posts: 886
1148 credits Members referred : 4
« Reply #3 on: Aug 25, 2006, 06:31:07 am »
well i spent all day trying to work this out on my own, going back and reading tutorials, snippets on php.net, and advice from Wineo, Nikolas, and the latest ones from you Olaf. i have completed what this page was intended for, it turned out to be 3 pages in the end, here are the working results:
this is a rank system add on for php fusion. you can add, manage/edit, and delete existing ranks from this management centre. they also come with colors, and this color can be changed via the same area, this color applies to all areas of the site where you see a users username.
website: see 3rd-evolution.net (not real link to prevent any value i might gain from it being here), but add www. and check it out for yourselves (the colored ranks).
if($_GET["cmd"]=="delete") { $sql = "DELETE FROM ".$db_prefix."clanranks WHERE rank_id=$rank_id"; $result = mysql_query($sql); echo "<center>Rank deleted!<br><br>Click [<a href='".BASEDIR."administration/ranks_colors.php".$aidlink."'>here</a>] to return to the Ranks/Colors Manager.</center>"; } closetable();
require_once BASEDIR."footer.php"; ?>
if you would like screenshots of the management centre in action let me know