delete avatar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    delete avatar

    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
    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&amp;sid=$sid&amp;avid=$item[0]\">SELECT</a><br/>";
            echo "<br/>";
        if(isowner(getuid_sid($sid)))
          {
          $dlsh = "<a href=\"ownrproc.php?action=dela&amp;sid=$sid&amp;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&amp;page=$ppage&amp;sid=$sid&amp;view=$view\">&#171;PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"lists.php?action=avatars&amp;page=$npage&amp;sid=$sid&amp;view=$view\">Next&#187;</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&amp;sid=$sid\">Settings</a><br/>";
      echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../usersmilies/home.gif\" alt=\"\"/>Home</a>";
      echo "</p>";
        echo "</body>";
    }
    ownrproc.php
    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&amp;sid=$sid\"><img src=\"../images/admn.gif\" alt=\"\"/>Owner Tools</a><br/>";
      echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../usersmilies/home.gif\" alt=\"\"/>Home</a>";
      echo "</p></body>";
    }
    any help be great

    #2
    //////////////////////////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='".$smid."'");
    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&amp;sid=$sid\">< img src=\"../images/admn.gif\" alt=\"\"/>Owner Tools</a><br/>";
    echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../usersmilies/home.gif\" alt=\"\"/>Home</a>";
    echo "</p></body>";
    }
    Last edited by crazybrumi; 03.08.09, 22:16.
    Want something coded email me at sales@webnwaphost.com for a prices.




    Comment


      #3
      cheers brumi but that doesnt work m8 just whites ownrproc out now

      Comment


        #4
        Originally posted by lee27 View Post
        cheers brumi but that doesnt work m8 just whites ownrproc out now
        //////////////////////////////////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&amp;sid=$sid&amp;av id=$item[0]\">SELECT</a><br/>";
        echo "<br/>";
        if(isowner(getuid_sid($sid)))
        {
        $smid=item[0];
        $dlsh = "<a href=\"ownrproc.php?action=dela&amp;sid=$sid&amp;s hid=$smid\">[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&amp;page=$ppage&am p;sid=$sid&amp;view=$view\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
        $npage = $page+1;
        echo "<a href=\"lists.php?action=avatars&amp;page=$npage&am p;sid=$sid&amp;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&amp;sid=$sid\">Sett ings</a><br/>";
        echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../usersmilies/home.gif\" alt=\"\"/>Home</a>";
        echo "</p>";
        echo "</body>";
        }
        Want something coded email me at sales@webnwaphost.com for a prices.




        Comment

        Working...
        X