iv added the delete link in list.php for owners to delete avatars its on and says avatar deleted but it doesnt delete it iv tried all diff ways i know so thort id come see if 1 of u lot can help me hers wot i got
lists.php
ownrproc.php
any help be great
lists.php
Code:
//////////////////////////////////Avatars else if($action=="avatars") { addonline(getuid_sid($sid),"Viewing The Avatars List",""); echo "<head>"; echo "<title>Avartars List</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; echo "</head>"; echo "<body>"; //////ALL LISTS SCRIPT << if($page=="" || $page<=0)$page=1; $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_avatars")); $num_items = $noi[0]; //changable $items_per_page= 2; $num_pages = ceil($num_items/$items_per_page); if(($page>$num_pages)&&$page!=1)$page= $num_pages; $limit_start = ($page-1)*$items_per_page; //changable sql $sql = "SELECT id, avlink FROM ibwf_avatars ORDER BY id DESC LIMIT $limit_start, $items_per_page"; echo "<p>"; $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) { while ($item = mysql_fetch_array($items)) { echo "<img src=\"$item[1]\" alt=\"avatar\"/><br/>"; echo "<a href=\"genproc.php?action=upav&sid=$sid&avid=$item[0]\">SELECT</a><br/>"; echo "<br/>"; if(isowner(getuid_sid($sid))) { $dlsh = "<a href=\"ownrproc.php?action=dela&sid=$sid&shid=$item[0]\">[x]</a>"; }else{ $dlsh = ""; } echo "$lnk $dlsh<br/>"; } } echo "</p>"; echo "<p align=\"center\">"; if($page>1) { $ppage = $page-1; echo "<a href=\"lists.php?action=avatars&page=$ppage&sid=$sid&view=$view\">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href=\"lists.php?action=avatars&page=$npage&sid=$sid&view=$view\">Next»</a>"; } echo "<br/>$page/$num_pages<br/>"; if($num_pages>2) { $rets = "<form action=\"lists.php\" method=\"get\">"; $rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>"; $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>"; $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>"; $rets .= "<input type=\"submit\" value=\"Go To Page\"/>"; $rets .= "</form>"; echo $rets; } echo "</p>"; ////// UNTILL HERE >> echo "<p align=\"center\">"; echo "<a href=\"index.php?action=cpanel&sid=$sid\">Settings</a><br/>"; echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../usersmilies/home.gif\" alt=\"\"/>Home</a>"; echo "</p>"; echo "</body>"; }
Code:
//////////////////////////delete avatar////////////////////////// else if($action=="dela") { $smid = $_GET["smid"]; echo "<head>"; echo "<title>Owner Tools</title>"; $thmname=$theme["theme"]; $them=explode("_",$thmname); $them2=$them[0]; if($them2=="Custom") { include("custom_theme.inc.php"); }else{ echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; } echo "</head>"; echo "<body>"; echo "<p align=\"center\">"; echo "<br/>"; $res = mysql_query("DELETE FROM ibwf_avatars WHERE id='".$avlink."'"); if($res) { echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Avatar deleted successfully"; }else{ echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error deleting Avatar "; } echo "<br/><br/><b>9 </b><a accesskey=\"9\" href=\"ownercp.php?action=ownercp&sid=$sid\"><img src=\"../images/admn.gif\" alt=\"\"/>Owner Tools</a><br/>"; echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../usersmilies/home.gif\" alt=\"\"/>Home</a>"; echo "</p></body>"; }
Comment