Clear shoutbox 2

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

    Clear shoutbox 2

    Hello why do not you delete the text message?
    PHP Code:
    ///////////////////////////////////////Delete chat shoutbox 2
    else if($action=="delsh")
    {
      
    $shid $_GET["shid"];
    echo 
    "<meta http-equiv=Refresh content=0;url=index.php?action=uchat&amp;sid=$sid>";
     echo 
    "<head>";
          echo 
    "<title>Admin Tools</title>";
          echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
          echo 
    "</head>";
          echo 
    "<body>";
      echo 
    "<p align=\"center\">";
      
    $sht mysql_fetch_array(mysql_query("SELECT shouter, shout FROM ibwf_shouts2 WHERE id='".$shid."'"));
      
    $msg getnick_uid($sht[0]);
      
    $msg .= ": ".htmlspecialchars((strlen($sht[1])<20?$sht[1]:substr($sht[1], 020)));
      
    $res mysql_query("DELETE FROM ibwf_shouts2 WHERE id ='".$shid."'");
      if(
    $res)
              {
        
    mysql_query("INSERT INTO ibwf_mlog SET action='shouts2', details='<b>".getnick_uid(getuid_sid($sid))."</b> Cancella lo shout <b>".$shid."</b> - $msg', actdt='".(time() - $timeadjust)."'");
                echo 
    "<img src=\"../images/ok.gif\" alt=\"O\"/>Shout cancellato";
              }else{
                echo 
    "<img src=\"../images/notok.gif\" alt=\"X\"/>Database Error";
              }
      echo 
    "<br/><br/>"
    Last edited by Leviathan73; 06.05.11, 18:38.

    #2
    Try adding this on your page and you might find your answer
    PHP Code:
    echo '<b>Debug: Shout id: '.$shid.'</b>'

    Comment


      #3
      sorry but I have to put in what page? put it in 3 pages but does not work

      Comment


        #4
        if it doesnt work there is your answer
        $shid is not set
        so you need to look at the page with the delete link on it to find out why $shid is not set

        Comment


          #5
          list.php
          PHP Code:
          //////////////////////////////////chat shouts 2
          else if($action=="shouts2")
          {
              
          addonline(getuid_sid($sid),"รจ nel chat shout","");
              echo 
          "<head>";
              echo 
          "<title>Chat ShoutBox</title>";
              echo 
          "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
              echo 
          "</head>";
              echo 
          "<body>";
              echo 
          "<p align=\"center\">";
              
          $who $_GET["who"];
              
          //////ALL LISTS SCRIPT <<
              
          if($page=="" || $page<=0)$page=1;
              if(
          $who=="")
              {
              
          $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts2"));
              }else{
              
          $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts2 WHERE shouter='".$who."'"));
              }
              
          $num_items $noi[0]; //changable
              
          $items_per_page10;
              
          $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
              
          if($who =="")
              {
                  
          $sql "SELECT id, shout, shouter, shtime  FROM ibwf_shouts2 ORDER BY shtime DESC LIMIT $limit_start$items_per_page";
          }else{
              
          $sql "SELECT id, shout, shouter, shtime  FROM ibwf_shouts2  WHERE shouter='".$who."'ORDER BY shtime DESC LIMIT $limit_start$items_per_page";
          }
              echo 
          "<p><small>";
              
          $items mysql_query($sql);
              echo 
          mysql_error();
              if(
          mysql_num_rows($items)>0)
              {
              while (
          $item mysql_fetch_array($items))
              {
                  
          $shnick getnick_uid($item[2]);
                  
          $sht htmlspecialchars($item[1]);
                  
          $shdt date("d m y-H:i"$item[3]);
                
          $lnk "<a href=\"index.php?action=viewuser&amp;who=$item[2]&amp;sid=$sid\">$shnick</a>: $sht<br/>$shdt";
                if(
          ismod(getuid_sid($sid)))
                {
                
          $dlsh "<a href=\"modproc.php?action=delsh&amp;sid=$sid&amp;shid=$item[0]\">[x]</a>";
                }else{
                  
          $dlsh "";
                }
                echo 
          "$lnk $dlsh<br/>";
           
              }
              } 

          Comment


            #6
            have you got 2 actions for delsh in modproc.php ? ... as delsh in lava is to delete normal shoutbox

            Comment


              #7
              somethingelse exact, I have 2 Action delsh. But I can not erase that of normal Shout, because the result is that you delete the message in the shoutbox 2, but the message in the shoutbox normal, not canceled. You have to find a solution, so that you can erase all 2 Shout

              Comment


                #8
                just have
                PHP Code:
                if($action=="delsh2"
                on your modproc for your new delete shout and replace the link on your lists.php eg:
                PHP Code:
                $dlsh "<a href=\"modproc.php?action=delsh2&amp;sid=$sid&amp;shid=$item[0]\">[x]</a>"

                Comment


                  #9
                  It works! Thanks somethingelse..:-)

                  Comment

                  Working...
                  X