Jump to content

shan

Members
  • Posts

    57
  • Joined

  • Last visited

Posts posted by shan

  1. hi, guys after taking jacques1 advice on having a relational scheme for my db to fetch results for my project, i was finally able to produce results for the users timeline, but now the problem arises with the feeds page where i'm not able to make the comments to display to its appropriate posts. cant figure out where the bug is arising. if you can help me it would be much appreciated. other than the comments problem there seems to be no errors displaying on the page.i'll attach a DB schema here for you all to look in to.

    vvCDn.png

     

    here is the code:

    <?php
      
        
        
        
        $statusui_edit="";
           $status2view=$project->statusView($_SESSION['uname']);
       foreach($status2view as $row){
          $status_replies="";
    $updateid=$row['update_id'];
                    $account_name=$row['account_name'];
                    $os_id=$row['os_id'];
                    $author=$row['author'];
                    $post_date=$row['time'];
                    $title= stripslashes($row['title']);
                    $data= stripslashes($row['update_body']);
                   
                    $statusdeletebutton='';
               
           
            $sql1="select * from updates,comment_update where comment_update.os_id like updates.update_id and comment_update.type like 'b'";
           $sql2="select * from updates left join comment_update on comment_update.os_id = updates.update_id where updates.update_id=:statusid";
            $stmth=$conn->prepare($sql2);
           // $stmth->bindparam(":either",$_SESSION['uname']);
            $stmth->bindparam(":statusid",$updateid);
            $stmth->execute();
            $status_reply= $stmth->fetchAll(PDO::FETCH_ASSOC);
       
    
             foreach  ($status_reply as $row1) {
               
             
             $status_reply_id=$row1['comment_id'];
            
                    $reply_author=$row1['author'];
                    $reply_d=htmlentities($row1['comment_body']);
                    $reply_data=  stripslashes($reply_d);
                    $reply_osid=$row1['os_id'];
                    $reply_date=$row1['time'];
                    $reply_delete_button="";
                   if ($reply_author==$_SESSION['uname'] ) {
                       $reply_delete_button.="<li><span id='$status_reply_id' class='delete_reply_btn glyphicon glyphicon-remove'><a href='#' title='Delete this comment'>Remove X</a></span></li>";
                   }
                    if ($sql2==TRUE) {  
                  $status_replies.="<div  class='replyboxes pull-left reply_".$status_reply_id."'>Reply by:-<a href='home.php?u=".$reply_author."'>".$reply_author."</a>"
                          . "<span class='pull-right'>".$reply_date 
                           . "<b class='caret'>
                             <small><span class='btn-xs btn-danger dropdown-toggle pull-right' data-toggle='dropdown' aria-expanded='true' ><span class='glyphicon glyphicon-edit'></span>
                            <ul class='dropdown-menu'>".$reply_delete_button
                          . "<li><a href='#' class='hidden_text_area glyphicon glyphicon-pencil reply_".$status_reply_id."' title='Edit this comment' >Edit</a></li>"
                          . "<li><a href='report.php?u='".$reply_author."'>Report</a><li></ul>"
                          . "</span></span></small></b><br><legend>".  html_entity_decode($reply_data)."</legend><br></div>";
                  }  else {
                        $status_replies.="";
                   }
       }
       
                  
           
                    //insert_status_ui script to get message.
                    if ($author==$_SESSION['uname'] || $account_name==$_SESSION['uname']) {
                    $statusdeletebutton='<li>'
                               . '<a href="#" type="'.$updateid.'" class="delete_4_session hidden_text_delete_'.$updateid.' glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li>';
                    $edit_btn='<li>'
                            . '<a href="#" attr="'.$updateid.'" type="'.$updateid.'" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li>';
                    
                    }
                   
                        
                    
                    $status_list= $statusui_edit.'<div attr="'.$updateid.'" type="'.$updateid.'" class="statusboxes status_'.$updateid.'  jumbotron">'
                            . '<h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left">'
                            . '<div id="'.$updateid.'" class="title_s_2copy" value="'.html_entity_decode($title).'">'.html_entity_decode($title).'</div></h3>'
                            . '<span class="pull-right">'
                            . '<div class="dropdown">'
                            . '<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  >'
                            . '<span class="glyphicon glyphicon-edit"></span></button>'
                            . '<ul class="dropdown-menu">'
                            .$edit_btn.'<br>'. $statusdeletebutton.'</ul></div></span><br><hr>'
                            . '<legend><span class=" data_s_2copy" type="'.$updateid.'" >'
                            . html_entity_decode($data).'</span><br><br></legend><b style="text-align:right; color:black;"><small>Posted by:-  <a href="home.php?u='.$author.'">'.$author.   '</a>   '.$post_date.'</small></b>'
                            . '<br><p>'.$status_replies.'</p><br>';
    
                        $status_list.= '<textarea id="reply_textarea_'.$updateid.'"  class="status_reply_'.$updateid.' input-custom2" placeholder="comment\'s"></textarea>'
                                . '<button id="reply_btn_'.$updateid.'" attr="'.$updateid.'" type="b" class="btn btn-warning pull-right btn-sm reply_btn reply_'.$updateid.'">Reply</button></div>';
                 
         
       $friends = array();
            // select friend_one, friend_two from friends where (friend_one = 1 or friend_two =1) and accepted = 1
    	$stmt=  $conn->prepare("select friend_one from friends where friend_two=:session and accepted='1'");
                $stmt->bindparam(":session",$_SESSION['uname']);
                $stmt->execute();
                foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $r) {
        array_push($friends, $r["friend_one"]); 
       
    }
                $stmth1=  $conn->prepare("select friend_two from friends where friend_one=:session and accepted='1'");
                $stmth1->bindparam(":session",$_SESSION['uname']);
                $stmth1->execute();
                foreach ($stmth1->fetchAll(PDO::FETCH_ASSOC) as $r1) {
        array_push($friends, $r1["friend_two"]); 
       for($i = 0; $i < count($friends); $i++){
    		$friend = $friends[$i];
       $sql1="select* from updates where account_name=:friend and type='a' or account_name=:friend and type='c' order by time desc";
       $stmt=$conn->prepare($sql1);
       $stmt->bindValue(":friend",$friend);
       $stmt->execute();
       $feeds=$stmt->fetchAll(PDO::FETCH_ASSOC);             
       foreach ($feeds as $val) {
                    $updateid=$val['update_id'];
                    $account_name=$val['account_name'];
                    $os_id=$val['os_id'];
                    $author=$val['author'];
                    $post_date=$val['time'];
                    $title= stripslashes($val['title']);
                    $data= stripslashes($val['update_body']);
                    $statusdeletebutton='';
                    if ($author==$_SESSION['uname'] || $account_name==$_SESSION['uname']) {
                    $statusdeletebutton='<li>'
                               . '<a href="#" type="'.$updateid.'" class="delete_4_session hidden_text_delete_'.$updateid.' glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li>';
                    }
                   
                        
                    
                    $status_list.= $statusui_edit.'<div attr="'.$updateid.'" type="'.$updateid.'" class="statusboxes status_'.$updateid.'  jumbotron">'
                            . '<h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left">'
                            . '<div id="'.$updateid.'" class="title_s_2copy" value="'.html_entity_decode($title).'">'.html_entity_decode($title).'</div></h3>'
                            . '<span class="pull-right">'
                            . '<div class="dropdown">'
                            . '<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  >'
                            . '<span class="glyphicon glyphicon-edit"></span></button>'
                            . '<ul class="dropdown-menu">'
                            . '<li><a href="#" attr="'.$updateid.'" type="'.$updateid.'" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li>'.$statusdeletebutton.'</ul></div></span><br><hr>'
                            . '<legend><span class=" data_s_2copy" type="'.$updateid.'" >'
                            . html_entity_decode($data).'</span><br><br></legend><b style="text-align:right; color:black;"><small>Posted by:-  <a href="home.php?u='.$author.'">'.$author.   '</a>   '.$post_date.'</small></b>'
                            . '<br><p>'.$status_replies.'</p><br>';
    
                        $status_list.= '<textarea id="reply_textarea_'.$updateid.'"  class="status_reply_'.$updateid.' input-custom2" placeholder="comment\'s"></textarea>'
                                . '<button id="reply_btn_'.$updateid.'" attr="'.$updateid.'" type="b" class="btn btn-warning pull-right btn-sm reply_btn reply_'.$updateid.'">Reply</button></div>';
                   
         
    }              
                }
                
       }
       
         
                       
                          
                    echo $status_list;
                     
                    
                    }
       
                    
         
                   
          ?>
    
  2. try this: @lingo5

    if(mail($to,$subject,$message,$headers)){
            header("Location:../presupuesto.php?msg=CNT_TXT_WARNING_EMAILSENTOK");
        }else{
            header("Location:../presupuesto.php?msg=CNT_TXT_WARNING_EMAILSENTERROR");
            }

    if it doesnt work then check the presupuesto.php location and put the appropriate file path.

  3. hi, guys i'm trying to create a commenting system to posts in a example site. And i can't seem to print the exact comments to its original post. i created two tables updates and comment_update and kept os_id as the common table row, where it is refering to update_id of updates table. everything seems ok except for the loops which is screwing up the output. Any advice on how to rectify it as i tried with while & other loops everything gives the same problem. 

    here is my code for that logic:

    <?php
        $status_replies="";
        $statusui_edit="";
           $status2view=$project->statusView($_SESSION['uname']);
       foreach($status2view as $row){
          
    $updateid=$row['update_id'];
                    $account_name=$row['account_name'];
                    $os_id=$row['os_id'];
                    $author=$row['author'];
                    $post_date=$row['time'];
                    $title= stripslashes($row['title']);
                    $data= stripslashes($row['update_body']);
                   
                    $statusdeletebutton='';
               
           
            $sql1="select * from updates,comment_update where comment_update.os_id like updates.update_id and comment_update.type like 'b'";
           $sql2="select * from updates left join comment_update using (os_id) where comment_update.os_id=:statusid  ";
            $stmth=$conn->prepare($sql2);
           // $stmth->bindparam(":either",$_SESSION['uname']);
            //$stmth->bindparam(":statusid",$updateid);
            $stmth->execute(array( ":statusid"=>$updateid));
            $status_reply= $stmth->fetchAll(PDO::FETCH_ASSOC);
       
         foreach ($status_reply as $row) {
             
            
             $status_reply_id=$row['comment_id'];
            
                    $reply_author=$row['author'];
                    $reply_d=htmlentities($row['comment_body']);
                    $reply_data=  stripslashes($reply_d);
                    $reply_osid=$row['os_id'];
                    $reply_date=$row['time'];
                    $reply_delete_button="";
                   if ($reply_author==$_SESSION['uname'] || $account_name==$_SESSION['uname']) {
                       $reply_delete_button.="<li><span id='$status_reply_id' class='delete_reply_btn glyphicon glyphicon-remove'><a href='#' title='Delete this comment'>Remove X</a></span></li>";
                   }
                    if ($updateid==$reply_osid) {  
                  $status_replies="<div  class='replyboxes pull-left reply_".$status_reply_id."'>Reply by:-<a href='search_results.php?u=".$reply_author."'>".$reply_author."</a>"
                          . "<span class='pull-right'>".$reply_date 
                           . "<b class='caret'>
                             <small><span class='btn-xs btn-danger dropdown-toggle pull-right' data-toggle='dropdown' aria-expanded='true' ><span class='glyphicon glyphicon-edit'></span>
                            <ul class='dropdown-menu'>".$reply_delete_button
                          . "<li><a href='#' class='hidden_text_area glyphicon glyphicon-pencil reply_".$status_reply_id."' title='Edit this comment' >Edit</a></li>"
                          . "<li><a href='report.php?u='".$reply_author."'>Report</a><li></ul>"
                          . "</span></span></small></b><br><legend>".  html_entity_decode($reply_data)."</legend><br></div>";
                  }  else {
                        $status_replies="";
                   }
        
         }
                    //insert_status_ui script to get message.
                    if ($author==$_SESSION['uname'] || $account_name==$_SESSION['uname']) {
                    $statusdeletebutton='<li>'
                               . '<a href="#" type="'.$updateid.'" class="delete_4_session hidden_text_delete_'.$updateid.' glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li>';
                    }
                   
                        
                    
                    $status_list= $statusui_edit.'<div attr="'.$updateid.'" type="'.$updateid.'" class="statusboxes status_'.$updateid.'  jumbotron">'
                            . '<h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left">'
                            . '<div id="'.$updateid.'" class="title_s_2copy" value="'.html_entity_decode($title).'">'.html_entity_decode($title).'</div></h3>'
                            . '<span class="pull-right">'
                            . '<div class="dropdown">'
                            . '<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  >'
                            . '<span class="glyphicon glyphicon-edit"></span></button>'
                            . '<ul class="dropdown-menu">'
                            . '<li><a href="#" attr="'.$updateid.'" type="'.$updateid.'" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li>'.$statusdeletebutton.'</ul></div></span><br><hr>'
                            . '<legend><span class=" data_s_2copy" type="'.$updateid.'" >'
                            . html_entity_decode($data).'</span><br><br></legend><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u='.$author.'">'.$author.   '</a>   '.$post_date.'</small></b>'
                            . '<br><p>'.$status_replies.'</p><br>';
    
                        $status_list.= '<textarea id="reply_textarea_'.$updateid.'"  class="status_reply_'.$updateid.' input-custom2" placeholder="comment\'s"></textarea>'
                                . '<button id="reply_btn_'.$updateid.'" attr="'.$updateid.'" type="b" class="btn btn-warning pull-right btn-sm reply_btn reply_'.$updateid.'">Reply</button></div>';
                   
         
         
                             
                        
                    echo $status_list;
           }  
       
       
                    
         
                   
          ?>
        
    
  4. So did you activate PDO exceptions again? Is your PHP error reporting on? What do you mean by “no output”? An empty array? The boolean false?

     

    We cannot magically fix your code just by looking at it. Since only you can run it, you must provide us with the relevant info.

    i'm sorry for being hasty bro, it doesnt throw any errors, except the empty array. and btw i changed the code as above still no luck with it.

  5. it would seem that you have removed the code you previously had that was setting the PDO error mode to exceptions. the false value being returned means that the execute statement failed and an exception wasn't thrown for the error.

     

    so, why did you remove (or not copy) the error setting you did have in your code?

    actually i changed it because of  an advice given to me by a friend.

     

    And even after changing the code im not getting output. any help would be appreciated:

     

    here is the updated code:

    include '../includes/dbconfig.inc.php';
    
    $status2view=$project->statusView($_SESSION['uname']);
    
        foreach($status2view as $row){
               //print_r($row);
               $updateid=$row['update_id'];
         
        
    //gives output on var_dump
      // print_r($updateid); (gives output)
    $stmth= $conn->prepare("select * from updates where update_id=:statusid and type='b' order by time asc");
            $stmth->bindparam(":statusid", $updateid);
            $stmth->execute();
            $status_reply_=$stmth->fetchAll(PDO::FETCH_ASSOC);
            print_r($status_reply_);//no output
            foreach ($status_reply_ as $row) {
                    
                    $status_reply_id=$row['update_id'];
                    $reply_author=$row['author'];
                    $reply_d=htmlentities($row['update_body']);
                    $reply_data=  stripslashes($reply_d);
                    $reply_t=  htmlentities($row['title']);
                    $reply_title=  stripslashes($reply_t);
                    $account_name=$row['account_name'];
                   $reply_date=$row['time'];
                   $reply_delete_button="";
                   if ($reply_author==$session_uname || $account_name==$session_uname) {
                       $reply_delete_button="<li><span id='$status_reply_id' class='delete_reply_btn glyphicon glyphicon-remove'><a href='#' title='Delete this comment'>Remove X</a></span></li>";
                   }
                  $status_replies="<div  class='replyboxes pull-left reply".$status_reply_id."'><b>Reply by<a href='search_results.php?u=".$reply_author."'>".$reply_author."</a><span class='pull-right'>".$reply_date ."</pan><legend>"
                           . "<b class='caret'>
                               <button type='button' class='btn btn-danger dropdown-toggle pull-right' data-toggle='dropdown' aria-expanded='true' ><span class='glyphicon glyphicon-edit'></span>
                            <ul class='dropdown-menu'>".$reply_delete_button
                          . "<li><a href='#' class='hidden_text_area glyphicon glyphicon-pencil reply".$status_reply_id."' title='Edit this comment' >Edit</a></li>"
                          . "<li><a href='report.php?u='".$reply_author."'>Report</a><li></ul>"
                          . "</button></b></legend><br>".  html_entity_decode($reply_data)."";
                }
            
    }    
    
  6. @ginerjm sorry about the mess.

    it is not working in the instantiated object.

    $status_reply_=$project->reply2StatusView($updateid);
    

    its outputting bool(false) when var_dumped.

    (edited)

    here is the method:

    public function reply2StatusView($updateid){
            $stmth=  $this->_db->prepare("select * from updates where update_id=:statusid and type='b' order by time asc");
            $stmth->bindparam(":statusid", $updateid);
            $stmth->execute();
         return $stmth->fetchAll(PDO::FETCH_ASSOC);
    
  7. hi guys im actually perplexed with this problem where im not able to read anything from DB, when i var dump the object it just outputs bool(false). dont know where im going wrong, Pl help me

    here is the code logic for status_list page where status_reply resides which i want to read from DB and display it:-

    $status2view=$project->statusView($f_uname);
    
        foreach($status2view as $row){
               //print_r($row);
               $updateid=$row['update_id'];
         
        
    //gives output on var_dump
      // print_r($updateid); (gives output)
    $status_reply_=$project->reply2StatusView($updateid);
            print_r($status_reply_);
    
            foreach ($status_reply_ as $row) {
                    
                    $status_reply_id=$row['update_id'];
                    $reply_author=$row['author'];
                    $reply_d=htmlentities($row['update_body']);
                    $reply_data=  stripslashes($reply_d);
                    $reply_t=  htmlentities($row['title']);
                    $reply_title=  stripslashes($reply_t);
                    $account_name=$row['account_name'];
                   $reply_date=$row['time'];
                   $reply_delete_button="";
                   if ($reply_author==$session_uname || $account_name==$session_uname) {
                       $reply_delete_button="<li><span id='$status_reply_id' class='delete_reply_btn glyphicon glyphicon-remove'><a href='#' title='Delete this comment'>Remove X</a></span></li>";
                   }
                  $status_replies="<div  class='replyboxes pull-left reply".$status_reply_id."'><b>Reply by<a href='search_results.php?u=".$reply_author."'>".$reply_author."</a><span class='pull-right'>".$reply_date ."</pan><legend>"
                           . "<b class='caret'>
                               <button type='button' class='btn btn-danger dropdown-toggle pull-right' data-toggle='dropdown' aria-expanded='true' ><span class='glyphicon glyphicon-edit'></span>
                            <ul class='dropdown-menu'>".$reply_delete_button
                          . "<li><a href='#' class='hidden_text_area glyphicon glyphicon-pencil reply".$status_reply_id."' title='Edit this comment' >Edit</a></li>"
                          . "<li><a href='report.php?u='".$reply_author."'>Report</a><li></ul>"
                          . "</button></b></legend><br>".  html_entity_decode($reply_data)."";
                }
            
    }       
         foreach ($status2view as $row1) {
            
             //got values here.
                    $updateid=$row1['update_id'];
                    $account_name=$row1['account_name'];
                    $os_id=$row1['os_id'];
                    $author=$row1['author'];
                    $post_date=$row1['time'];
                    $title= stripslashes($row1['title']);
                    $data= stripslashes($row1['update_body']);
                    $statusdeletebutton='';
                    //insert_status_ui script to get message.
            
                    if($isowner=="yes"){
     $statusui_edit="<div type='".$updateid."' class='hidden_edit_4_session session_editor".$updateid." jumbotron'>"
                . "<a href='#' type='".$updateid."' class='pull-right close_edit' title='Close without editing'>Close X</a>"
                . "<input type='text' class='form-control title_s_edit title_s_".$updateid."' name='status_title' value='".html_entity_decode($title)."' placeholder='Title' >"
                . "<span> </span>"
                . "<textarea id='wall_edit_1' type='".$updateid."' rows='5' cols='50'  class='session_edit text_value_".$updateid."' wrap='hard' placeholder='whats up ".$session_uname."'>
                 ".html_entity_decode($data)."</textarea><br>"
                . "<button style='float:right;' value='".$updateid."' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div>" ;
     
        
    }
     elseif ($is_friend==TRUE&&$session_uname!=$f_uname) {
         
         
         $statusui_edit="<div type='".$updateid."' class='hidden_edit_4_friend friend_editor".$updateid." jumbotron'>"
                 . "<a title='Close without editing' type='".$updateid."' href='#' class='pull-right close_edit_f'>Close X</a>"
                   . "<input type='text' class='form-control title_f_edit title_f_".$updateid."''  name='status_title' value='".html_entity_decode($title)."' placeholder='Title'><br>"
                   . "<div> </div>"
                . "<textarea id='wall_edit_2' value='' type='".$updateid."' rows='5' cols='50'  class='friend_edit update_friend_".$updateid."' placeholder='hi ".$session_uname." want to say something to ".$f_uname.". '>"
                   .html_entity_decode($data)."</textarea><br>"
                   . "<button style='float:right;' value='".$updateid."' type='c' class='btn btn-warning btn-large btn-lg post-f-edit'>Update</button></form></div>";
     }
     
                    if ($author==$session_uname || $account_name==$session_uname) {
                    $statusdeletebutton='<li>'
                               . '<a href="#" type="'.$updateid.'" class="delete_4_session hidden_text_delete_'.$updateid.' glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li>';
                    }
                    if($isowner=="yes"){
                    $status_list= $statusui_edit.'<div attr="'.$updateid.'" type="'.$updateid.'" class="statusboxes status_'.$updateid.'  jumbotron">'
                            . '<h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left">'
                            . '<div id="'.$updateid.'" class="title_s_2copy" value="'.html_entity_decode($title).'">'.html_entity_decode($title).'</div></h3>'
                            . '<span class="pull-right">'
                            . '<div class="dropdown">'
                            . '<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  >'
                            . '<span class="glyphicon glyphicon-edit"></span></button>'
                            . '<ul class="dropdown-menu">'
                            . '<li><a href="#" attr="'.$updateid.'" type="'.$updateid.'" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li>'.$statusdeletebutton.'</ul></div></span><br><hr>'
                            . '<legend><span class=" data_s_2copy" type="'.$updateid.'" value="'.html_entity_decode($data).'">'
                            . html_entity_decode($data).'</span><br><br></legend><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u='.$author.'">'.$author.   '</a>   '.$post_date.'</small></b>'
                            . '<br><p>'.$status_replies.'</p><br>';
    
                    if ($is_friend==TRUE||$session_uname==$f_uname) {
                        $status_list.= '<textarea id="'.$updateid.'"  class="status_reply_'.$updateid.' input-custom2" placeholder="comment\'s"></textarea>'
                                . '<button id="reply_btn_'.$updateid.'" attr="'.$updateid.'" type="b" class="btn btn-warning pull-right btn-sm reply_btn reply_'.$updateid.'">Reply</button></div>';
                        }
                        
                        }elseif ($is_friend==TRUE&&$session_uname!=$f_uname) {
                        $status_list= $statusui_edit.'<div attr="'.$updateid.'" type="'.$updateid.'" class="statusboxes status_'.$updateid.'  jumbotron">'
                            . '<h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left">'
                            . '<div id="'.$updateid.'" class="title_s_2copy" value="'.html_entity_decode($title).'">'.html_entity_decode($title).'</div></h3><br><hr>'
                            . '<legend><span class=" data_s_2copy" type="'.$updateid.'" value="'.html_entity_decode($data).'">'
                            . html_entity_decode($data).'</span><br><br></legend><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u='.$author.'">'.$author.   '</a>   '.$post_date.'</small></b>'
                            . '<br><p>'.$status_replies.'</p><br>';
                                 $status_list.= '<textarea id="'.$updateid.'"  class="status_update input-custom2" placeholder="comment\'s"></textarea>'
                                . '<button id="reply_btn'.$updateid.'"  attr="'.$updateid.'" type="b" class="btn btn-warning pull-right btn-sm reply_btn reply_'.$updateid.'">Reply</button></div>';
                        
                        
                    }
                    echo $status_list;
                    }  
                    
         
    

    the above code is called in home and search results page through include_once function.

    if you need any details please do ask me for it

  8. hi, guys im trying to echo out results of a particular variable in my search_results.php file where i want to actually display the status of a friend which isn't showing up but is showing up in home.php page which handles the session user data. though i tried some variations it isn't of any help. The satusui variable which has the same logic works well but not the status_list variable for the friend in search_results page. please, help me to build the conversation system.

    code in status_list page:-

    $status2view=$project->statusView($f_uname);
    
        foreach($status2view as $row){
               //print_r($row);
               $id=$row['update_id'];
              
        
    //gives output on var_dump
    
    $status_replies_=$project->reply2StatusView($id);
    
    
    foreach ($status_replies_ as $row) {
                    
                    $status_reply_id=$row['update_id'];
                    $reply_author=$row['author'];
                    $reply_d=htmlentities($row['update_body']);
                    $reply_data=  stripslashes($reply_d);
                    $reply_t=  htmlentities($row['title']);
                    $reply_title=  stripslashes($reply_t);
                    $account_name=$row['account_name'];
                   $reply_date=$row['time'];
                   $reply_delete_button="";
                   if ($reply_author==$session_uname || $account_name==$session_uname) {
                       $reply_delete_button="<li><span id='$status_reply_id' class='delete_reply_btn glyphicon glyphicon-remove'><a href='#' title='Delete this comment'>Remove X</a></span></li>";
                   }
                  $status_replies="<div id='".$status_reply_id."' class='replyboxes'><b>Reply by<a href='search_results.php?u=".$reply_author."'>".$reply_author."</a>".$reply_date ."<legend>"
                           . "<b class='caret'><button type='button' class='btn btn-danger dropdown-toggle pull-right' data-toggle='dropdown' aria-expanded='true' ><span class='glyphicon glyphicon-edit'></span>
                            <ul class='dropdown-menu'>".$reply_delete_button." "
                          . "<li><a href='#' class='hidden_text_area glyphicon glyphicon-pencil' title='Edit this comment' >Edit</a></li>"
                          . "<li><a href='report.php?u='".$reply_author."'>Report</a><li></ul>"
                          . "</button></b></legend><br>".  html_entity_decode($reply_data)."";
                }
            }
           
         foreach ($status2view as $row1) {
            
             //got values here.
                    $updateid=$row1['update_id'];
                    $account_name=$row1['account_name'];
                    $os_id=$row1['os_id'];
                    $author=$row1['author'];
                    $post_date=$row1['time'];
                    $title= stripslashes($row1['title']);
                    $data= stripslashes($row1['update_body']);
                    $statusdeletebutton='';
                    //insert_status_ui script to get message.
            
                    if($isowner=="yes"){
     $statusui_edit="<div type='".$updateid."' class='hidden_edit_4_session session_editor".$updateid." jumbotron'>"
                . "<a href='#' type='".$updateid."' class='pull-right close_edit' title='Close without editing'>Close X</a>"
                . "<input type='text' class='form-control title_s_edit title_s_".$updateid."' name='status_title' value='".html_entity_decode($title)."' placeholder='Title' >"
                . "<div> </div>"
                . "<textarea id='wall_edit_1' type='".$updateid."' rows='5' cols='50'  class='session_edit text_value_".$updateid."' wrap='hard' placeholder='whats up ".$session_uname."'>
                 ".html_entity_decode($data)."</textarea><br>"
                . "<button style='float:right;' value='".$updateid."' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div>";
     
        
    }
     elseif ($is_friend==TRUE&&$session_uname!=$f_uname) {
         
         
         $statusui_edit="<div type='".$updateid."' class='hidden_edit_4_friend friend_editor".$updateid." jumbotron'>"
                 . "<a title='Close without editing' type='".$updateid."' href='#' class='pull-right close_edit_f'>Close X</a>"
                   . "<input type='text' class='form-control title_f_edit title_f_".$updateid."''  name='status_title' value='".html_entity_decode($title)."' placeholder='Title'><br>"
                   . "<div> </div>"
                . "<textarea id='wall_edit_2' value='' type='".$updateid."' rows='5' cols='50'  class='friend_edit update_friend_".$updateid."' placeholder='hi ".$session_uname." want to say something to ".$f_uname.". '>"
                   .html_entity_decode($data)."</textarea><br>"
                   . "<button style='float:right;' value='".$updateid."' type='c' class='btn btn-warning btn-large btn-lg post-f-edit'>Update</button></form>";
     }
     
                    if ($author==$session_uname || $account_name==$session_uname) {
                    $statusdeletebutton='<li>'
                               . '<a href="#" type="'.$updateid.'" class="delete_4_session hidden_text_delete_'.$updateid.' glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li>';
                    }
                    if($isowner=="yes"){
                    $status_list= $statusui_edit.'<div attr="'.$updateid.'" type="'.$updateid.'" class="statusboxes status_'.$updateid.'  jumbotron">'
                            . '<h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left">'
                            . '<div id="'.$updateid.'" class="title_s_2copy" value="'.html_entity_decode($title).'">'.html_entity_decode($title).'</div></h3>'
                            . '<span class="pull-right">'
                            . '<div class="dropdown">'
                            . '<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  >'
                            . '<span class="glyphicon glyphicon-edit"></span></button>'
                            . '<ul class="dropdown-menu">'
                            . '<li><a href="#" attr="'.$updateid.'" type="'.$updateid.'" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li>'.$statusdeletebutton.'</ul></div></span><br><hr>'
                            . '<legend><span class=" data_s_2copy" type="'.$updateid.'" value="'.html_entity_decode($data).'" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;">'
                            . html_entity_decode($data).'</span><br><br></legend><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u='.$author.'">'.$author.   '</a>   '.$post_date.'</small></b>'
                            . '<br>'.$status_replies.'<br>';
    
                    if ($is_friend==TRUE||$session_uname==$f_uname) {
                        $status_list.= '<textarea id="'.$updateid.'"  class="status_update input-custom2" placeholder="comment\'s"></textarea>'
                                . '<button id="'.$updateid.'" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div>';
                        }
                        
                        echo $status_list;
                    }elseif ($is_friend==TRUE&&$session_uname!=$f_uname) {
                        $status_list= $statusui_edit.'<div attr="'.$updateid.'" type="'.$updateid.'" class="statusboxes status_'.$updateid.'  jumbotron">'
                            . '<h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left">'
                            . '<div id="'.$updateid.'" class="title_s_2copy" value="'.html_entity_decode($title).'">'.html_entity_decode($title).'</div></h3>'
                            . '<legend><span class=" data_s_2copy" type="'.$updateid.'" value="'.html_entity_decode($data).'" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;">'
                            . html_entity_decode($data).'</span><br><br></legend><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u='.$author.'">'.$author.   '</a>   '.$post_date.'</small></b>'
                            . '<br>'.$status_replies.'<br>';
                                 $status_list.= '<textarea id="'.$updateid.'"  class="status_update input-custom2" placeholder="comment\'s"></textarea>'
                                . '<button id="'.$updateid.'" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div></div>';
                        
                        echo $status_list;
                    }
                    }  
                    
        

    code for search_results page where the statuslist is included:-

    
    if($isowner=="yes"){
        $statusui="<div class='jumbotron'><input type='text' class='form-control title_s' name='status_title' placeholder='Title ' ><br>"
                . "<textarea id='wall_id_1' class='update_session' placeholder='whats up ".$session_uname."'>"
                . "</textarea>"
                . "<button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s'>Post</button></div>";
     $statusui_edit="<div attr='".$updateid."' class='hidden_edit_4_session session_edit".$updateid." jumbotron'>"
                . "<a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a>"
                . "<input type='text' class='form-control title_s_edit' name='status_title' value='".html_entity_decode($title)."' placeholder='Title' >"
                . "<div> </div>"
                . "<textarea id='wall_edit_1'  class='session_edit' placeholder='whats up ".$session_uname."'>
                 ".html_entity_decode($data)."</textarea><br>"
                . "<button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div>";
     
        
    }
     elseif ($is_friend==TRUE&&$session_uname!=$f_uname) {
           $statusui="<div class='jumbotron'><input type='text' class='form-control title_f' name='status_title' placeholder='Title'><br>"
                   . "<textarea id='wall_id_2' type='c'  class='status_4_friend' style='' placeholder='hi ".$session_uname." want to say something to ".$f_uname.". '>"
                   . "</textarea><br>"
                   . "<button style='float:right;' type='c' class='btn btn-warning btn-large btn-lg post-f'>Post</button></div>";
           $statusui_edit="<div attr='".$updateid."' class='hidden_edit_4_friend friend_edit".$updateid." jumbotron'>"
                   . "<a title='Close without editing' href='#' class='pull-right close_edit_f'>Close X</a>"
                   . "<input type='text' class='form-control title_f_edit' name='status_title' value='".html_entity_decode($title)."' placeholder='Title'><br>"
                   . "<textarea id='wall_edit_2' value='' class='update_4_expresspad'placeholder='hi ".$session_uname." want to say something to ".$f_uname.". '>"
                   .html_entity_decode($data)."</textarea><br>"
                   . "<button style='float:right;' type='c' class='btn btn-warning btn-large btn-lg post-f-edit'>Update</button>";
     }
        ?>
        <div class="container-fluid">
            <br><div class="row"> </div><br>
            <div class="row">
                <div class="col-sm-2">
                    <p>Friends list:</p>
                    <?php
                    include_once 'notification/friend_list.php';
                    echo $friends_html;
                    ?>
                </div>    
                <div class="col-lg-8">
                    <div class="tab-content">
                        <ul class="nav nav-tabs">
                            <li class="active"><a href="#tabs-1" data-toggle="tab" class="profile">Profile</a></li>
                            <li><a href="#tabs-2" data-toggle="tab"class="articles">Status</a></li>
                            <li><a href="#tabs-4"data-toggle="tab" class="gallery_photos">Gallery</a></li>
                            <li><a href="#tabs-5" data-toggle="tab" class="videos">Videos</a></li>
    
                        </ul>
                        <div id="tabs-1" class="tab-pane fade profile1 active in">
                               
                  <?php
                            echo '<table border="0"><tr width="20%"><td>Profile Photo</td><td>' . $friend_button . '</td></tr>
                <tr><td></td><td>' . $block_button . '</td></tr>
                <tr width="100%"><td width="20%"></td><td width="55%"><p>Full Name:' . $fname_s . ' ' . $lname_s . '<br>
    
        </td><td width="20%"></td></tr>
            </table>';
                            ?>
                            
                        </div>
                        <div id="tabs-2" class="tab-pane fade articles">
    
  9. im trying to load tinymce dynamically in my script when the edit button is clicked but its not loading. please help with simple and working example as im new to javascript.

    code for tinymce :

     tinymce.init({
        menubar:false,
        selector: "textarea#wall_edit_1",
        theme: "modern",
        resize: false,
        height: 200,
        plugins: [
             " autolink link image preview hr anchor pagebreak spellchecker",
             "searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking",
             "save table contextmenu directionality emoticons paste textcolor"
       ],
       content_css: "css/content.css",
       toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l      ink image | print preview media fullpage | forecolor backcolor emoticons", 
       style_formats: [
            {title: 'Bold text', inline: 'b'},
            {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
            {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
            {title: 'Example 1', inline: 'span', classes: 'example1'},
            {title: 'Example 2', inline: 'span', classes: 'example2'},
            {title: 'Table styles'},
            {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
        ]
        });
    

    jquery code in home page to show the editor dynamically:

    $(".session_edit").hide();
    $(".friend_edit").hide();
    $(".hidden_text_edit").click(function(){
        var id=$(this).attr("type");
    
    $(".hidden_edit_4_session"+id).show();
    
    var hide_status=$(".statusboxes").attr('type');
    var title=$(".title_s_2copy").attr('type');
    var data=$(".data_s_2copy").attr('type');
    $(hide_status).hide();
    
    tinyMCE.get('.hidden_edit_4_session').setContent(data);
    $(".title_s_edit").val(title);
    
    
    });
    $(".close_edit").click(function(){
        $(".hidden_edit_4_session").hide();    
    var hide_status=$(".statusboxes").attr('div', 'type');
    $(hide_status).show();
    });
    

    html code that was generated using php which i want to edit:

    <div class='jumbotron'><input type='text' class='form-control title_s' name='status_title' placeholder='Title ' ><br><textarea id='wall_id_1' class='update_session' placeholder='whats up qwerty'></textarea><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s'>Post</button></div><div attr='7' class='hidden_edit_4_session7 session_edit jumbotron'><a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a><input type='text' class='form-control title_s_edit' name='status_title' value='hello shan!' placeholder='Title' ><div> </div><textarea id='wall_edit_1'  class='session_edit 7' placeholder='whats up qwerty'>
                 <p>what's up.</p></textarea><br><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div><div id="7" type="7" class="statusboxes jumbotron"><h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="7" class="title_s_2copy" value="hello shan!">hello shan!</div></h3><span class="pull-right"><div class="dropdown"><button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-edit"></span></button><ul class="dropdown-menu"><li><a href="#" id="7" type="7" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li><li><a href="#" id="7" class="delete_4_session hidden_text_delete_7 glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li></ul></div></span><br><hr><span class="pull-left data_s_2copy" id="7" value="<p>what's up.</p>" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;"><p>what's up.</p></span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u=qwerty">qwerty</a>   2015-10-20 10:13:18</small></b><br><br><textarea id="7"  class="status_update input-custom2" placeholder="comment's"></textarea><button id="7" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div><div attr='6' class='hidden_edit_4_session6 session_edit jumbotron'><a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a><input type='text' class='form-control title_s_edit' name='status_title' value='pen test' placeholder='Title' ><div> </div><textarea id='wall_edit_1'  class='session_edit 6' placeholder='whats up qwerty'>
                 <p><script type="text/javascript">alert("hooya hacked")</script></p></textarea><br><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div><div id="6" type="6" class="statusboxes jumbotron"><h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="6" class="title_s_2copy" value="pen test">pen test</div></h3><span class="pull-right"><div class="dropdown"><button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-edit"></span></button><ul class="dropdown-menu"><li><a href="#" id="6" type="6" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li><li><a href="#" id="6" class="delete_4_session hidden_text_delete_6 glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li></ul></div></span><br><hr><span class="pull-left data_s_2copy" id="6" value="<p><script type="text/javascript">alert("hooya hacked")</script></p>" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;"><p><script type="text/javascript">alert("hooya hacked")</script></p></span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u=qwerty">qwerty</a>   2015-10-18 21:53:31</small></b><br><br><textarea id="6"  class="status_update input-custom2" placeholder="comment's"></textarea><button id="6" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div><div attr='5' class='hidden_edit_4_session5 session_edit jumbotron'><a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a><input type='text' class='form-control title_s_edit' name='status_title' value='pen test' placeholder='Title' ><div> </div><textarea id='wall_edit_1'  class='session_edit 5' placeholder='whats up qwerty'>
                 <p><script type="text/javascript">alert("hooya hacked")</script></p></textarea><br><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div><div id="5" type="5" class="statusboxes jumbotron"><h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="5" class="title_s_2copy" value="pen test">pen test</div></h3><span class="pull-right"><div class="dropdown"><button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-edit"></span></button><ul class="dropdown-menu"><li><a href="#" id="5" type="5" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li><li><a href="#" id="5" class="delete_4_session hidden_text_delete_5 glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li></ul></div></span><br><hr><span class="pull-left data_s_2copy" id="5" value="<p><script type="text/javascript">alert("hooya hacked")</script></p>" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;"><p><script type="text/javascript">alert("hooya hacked")</script></p></span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u=qwerty">qwerty</a>   2015-10-18 21:53:30</small></b><br><br><textarea id="5"  class="status_update input-custom2" placeholder="comment's"></textarea><button id="5" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div><div attr='3' class='hidden_edit_4_session3 session_edit jumbotron'><a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a><input type='text' class='form-control title_s_edit' name='status_title' value='this is not working' placeholder='Title' ><div> </div><textarea id='wall_edit_1'  class='session_edit 3' placeholder='whats up qwerty'>
                 <p>wht to do???</p></textarea><br><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div><div id="3" type="3" class="statusboxes jumbotron"><h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="3" class="title_s_2copy" value="this is not working">this is not working</div></h3><span class="pull-right"><div class="dropdown"><button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-edit"></span></button><ul class="dropdown-menu"><li><a href="#" id="3" type="3" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li><li><a href="#" id="3" class="delete_4_session hidden_text_delete_3 glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li></ul></div></span><br><hr><span class="pull-left data_s_2copy" id="3" value="<p>wht to do???</p>" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;"><p>wht to do???</p></span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u=qwerty">qwerty</a>   2015-10-17 19:32:35</small></b><br><br><textarea id="3"  class="status_update input-custom2" placeholder="comment's"></textarea><button id="3" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div><div attr='2' class='hidden_edit_4_session2 session_edit jumbotron'><a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a><input type='text' class='form-control title_s_edit' name='status_title' value='im grateful to mother nature and god' placeholder='Title' ><div> </div><textarea id='wall_edit_1'  class='session_edit 2' placeholder='whats up qwerty'>
                 <p>as the title says im grateful</p></textarea><br><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div><div id="2" type="2" class="statusboxes jumbotron"><h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="2" class="title_s_2copy" value="im grateful to mother nature and god">im grateful to mother nature and god</div></h3><span class="pull-right"><div class="dropdown"><button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-edit"></span></button><ul class="dropdown-menu"><li><a href="#" id="2" type="2" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li><li><a href="#" id="2" class="delete_4_session hidden_text_delete_2 glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li></ul></div></span><br><hr><span class="pull-left data_s_2copy" id="2" value="<p>as the title says im grateful</p>" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;"><p>as the title says im grateful</p></span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u=qwerty">qwerty</a>   2015-10-17 19:29:15</small></b><br><br><textarea id="2"  class="status_update input-custom2" placeholder="comment's"></textarea><button id="2" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div><div attr='1' class='hidden_edit_4_session1 session_edit jumbotron'><a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a><input type='text' class='form-control title_s_edit' name='status_title' value='hello world' placeholder='Title' ><div> </div><textarea id='wall_edit_1'  class='session_edit 1' placeholder='whats up qwerty'>
                 <p>this is my 1st post</p></textarea><br><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div><div id="1" type="1" class="statusboxes jumbotron"><h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="1" class="title_s_2copy" value="hello world">hello world</div></h3><span class="pull-right"><div class="dropdown"><button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-edit"></span></button><ul class="dropdown-menu"><li><a href="#" id="1" type="1" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li><li><a href="#" id="1" class="delete_4_session hidden_text_delete_1 glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li></ul></div></span><br><hr><span class="pull-left data_s_2copy" id="1" value="<p>this is my 1st post</p>" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;"><p>this is my 1st post</p></span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u=qwerty">qwerty</a>   2015-10-17 19:25:09</small></b><br><br><textarea id="1"  class="status_update input-custom2" placeholder="comment's"></textarea><button id="1" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div>    </div>   
    
  10. the browser's source code is as follows:

    <div class='jumbotron'><input type='text' class='form-control title_s' name='status_title' placeholder='Title ' ><br><textarea id='wall_id_1' class='update_session' placeholder='whats up qwerty'></textarea><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s'>Post</button></div><div id="7" type="7" class="statusboxes jumbotron"><h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="7" class="title_s_2copy" value="hello shan!">hello shan!</div></h3><span class="pull-right"><div class="dropdown"><button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-edit"></span></button><ul class="dropdown-menu"><li><a href="#" id="7" type="7" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li><li><a href="#" id="7" class="delete_4_session hidden_text_delete_7 glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li></ul></div></span><br><hr><span class="pull-left data_s_2copy" id="7" value="<p>what's up.</p>" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;"><p>what's up.</p></span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u=qwerty">qwerty</a>   2015-10-20 10:13:18</small></b><br><br><div id='' class='hidden_edit_4_session jumbotron'><a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a><input type='text' class='form-control title_s_edit' name='status_title' value='' placeholder='Title' ><div> </div><textarea id='wall_edit_1' value='' class='session_edit' placeholder='whats up qwerty'></textarea><br><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div><textarea id="7"  class="status_update input-custom2" placeholder="comment's"></textarea><button id="7" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div><div id="6" type="6" class="statusboxes jumbotron"><h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="6" class="title_s_2copy" value="pen test">pen test</div></h3><span class="pull-right"><div class="dropdown"><button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-edit"></span></button><ul class="dropdown-menu"><li><a href="#" id="6" type="6" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li><li><a href="#" id="6" class="delete_4_session hidden_text_delete_6 glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li></ul></div></span><br><hr><span class="pull-left data_s_2copy" id="6" value="<p><script type="text/javascript">alert("hooya hacked")</script></p>" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;"><p><script type="text/javascript">alert("hooya hacked")</script></p></span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u=qwerty">qwerty</a>   2015-10-18 21:53:31</small></b><br><br><div id='' class='hidden_edit_4_session jumbotron'><a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a><input type='text' class='form-control title_s_edit' name='status_title' value='' placeholder='Title' ><div> </div><textarea id='wall_edit_1' value='' class='session_edit' placeholder='whats up qwerty'></textarea><br><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div><textarea id="6"  class="status_update input-custom2" placeholder="comment's"></textarea><button id="6" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div><div id="5" type="5" class="statusboxes jumbotron"><h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="5" class="title_s_2copy" value="pen test">pen test</div></h3><span class="pull-right"><div class="dropdown"><button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-edit"></span></button><ul class="dropdown-menu"><li><a href="#" id="5" type="5" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li><li><a href="#" id="5" class="delete_4_session hidden_text_delete_5 glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li></ul></div></span><br><hr><span class="pull-left data_s_2copy" id="5" value="<p><script type="text/javascript">alert("hooya hacked")</script></p>" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;"><p><script type="text/javascript">alert("hooya hacked")</script></p></span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u=qwerty">qwerty</a>   2015-10-18 21:53:30</small></b><br><br><div id='' class='hidden_edit_4_session jumbotron'><a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a><input type='text' class='form-control title_s_edit' name='status_title' value='' placeholder='Title' ><div> </div><textarea id='wall_edit_1' value='' class='session_edit' placeholder='whats up qwerty'></textarea><br><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div><textarea id="5"  class="status_update input-custom2" placeholder="comment's"></textarea><button id="5" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div><div id="3" type="3" class="statusboxes jumbotron"><h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="3" class="title_s_2copy" value="this is not working">this is not working</div></h3><span class="pull-right"><div class="dropdown"><button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-edit"></span></button><ul class="dropdown-menu"><li><a href="#" id="3" type="3" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li><li><a href="#" id="3" class="delete_4_session hidden_text_delete_3 glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li></ul></div></span><br><hr><span class="pull-left data_s_2copy" id="3" value="<p>wht to do???</p>" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;"><p>wht to do???</p></span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u=qwerty">qwerty</a>   2015-10-17 19:32:35</small></b><br><br><div id='' class='hidden_edit_4_session jumbotron'><a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a><input type='text' class='form-control title_s_edit' name='status_title' value='' placeholder='Title' ><div> </div><textarea id='wall_edit_1' value='' class='session_edit' placeholder='whats up qwerty'></textarea><br><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div><textarea id="3"  class="status_update input-custom2" placeholder="comment's"></textarea><button id="3" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div><div id="2" type="2" class="statusboxes jumbotron"><h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="2" class="title_s_2copy" value="im grateful to mother nature and god">im grateful to mother nature and god</div></h3><span class="pull-right"><div class="dropdown"><button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-edit"></span></button><ul class="dropdown-menu"><li><a href="#" id="2" type="2" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li><li><a href="#" id="2" class="delete_4_session hidden_text_delete_2 glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li></ul></div></span><br><hr><span class="pull-left data_s_2copy" id="2" value="<p>as the title says im grateful</p>" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;"><p>as the title says im grateful</p></span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u=qwerty">qwerty</a>   2015-10-17 19:29:15</small></b><br><br><div id='' class='hidden_edit_4_session jumbotron'><a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a><input type='text' class='form-control title_s_edit' name='status_title' value='' placeholder='Title' ><div> </div><textarea id='wall_edit_1' value='' class='session_edit' placeholder='whats up qwerty'></textarea><br><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div><textarea id="2"  class="status_update input-custom2" placeholder="comment's"></textarea><button id="2" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div><div id="1" type="1" class="statusboxes jumbotron"><h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="1" class="title_s_2copy" value="hello world">hello world</div></h3><span class="pull-right"><div class="dropdown"><button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-edit"></span></button><ul class="dropdown-menu"><li><a href="#" id="1" type="1" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li><li><a href="#" id="1" class="delete_4_session hidden_text_delete_1 glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li></ul></div></span><br><hr><span class="pull-left data_s_2copy" id="1" value="<p>this is my 1st post</p>" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;"><p>this is my 1st post</p></span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u=qwerty">qwerty</a>   2015-10-17 19:25:09</small></b><br><br><div id='' class='hidden_edit_4_session jumbotron'><a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a><input type='text' class='form-control title_s_edit' name='status_title' value='' placeholder='Title' ><div> </div><textarea id='wall_edit_1' value='' class='session_edit' placeholder='whats up qwerty'></textarea><br><button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div><textarea id="1"  class="status_update input-custom2" placeholder="comment's"></textarea><button id="1" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div>    </div>
    
  11. hi, guys i have a problem in outputting the id in php. what i'm trying to do is create a article and when the user clicks the edit button the text area shows up for editing while the original article hides. i'm using both jquery and php to do it. the problem is that when the user clicks the edit button the hidden text area doesn't showup when i looked in to the browser source i found that the id is not outputting in the hidden textarea. so, please guide me on how to print the id in the hidden area.

     

    here is the code for jquery :

    $(".hidden_text_edit").click(function(){
        var id=$(this).attr("id");
    
    
    $(".hidden_edit_4_session").find("id").show();    
    var hide_status=$(".statusboxes").attr('type');
    var title=$(".title_s_2copy").attr('type');
    var data=$(".data_s_2copy").attr('type');
    $(hide_status).hide();
    
    
    //tinyMCE.get('.hidden_edit_4_session').setContent(data);
    $(".title_s_edit").val(title);
    
    
    
    
    });
    $(".close_edit").click(function(){
        $(".hidden_edit_4_session").hide();    
    var hide_status=$(".statusboxes").attr('div', 'type');
    $(hide_status).show();
    });

    code for article and hidden text area logic:

    <?php
    
    if(isset($_SESSION['app'])){
        
        $statusui="<div class='jumbotron'><input type='text' class='form-control title_s' name='status_title' placeholder='Title ' ><br>"
                . "<textarea id='wall_id_1' class='update_session' placeholder='whats up ".$session_uname."'>"
                . "</textarea>"
                . "<button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s'>Post</button></div>";
     $statusui_edit="<div id=".$updateid." class='hidden_edit_4_session".$updateid." jumbotron'><a href='#' class='pull-right close_edit' title='Close without editing'>Close X</a><input type='text' class='form-control title_s_edit' name='status_title' value='".html_entity_decode($title)."' placeholder='Title' ><div> </div>"
                . "<textarea id='wall_edit_1' value='".html_entity_decode($data)."' class='session_edit' placeholder='whats up ".$session_uname."'>"
                . "" .html_entity_decode($data)."</textarea><br>"
                . "<button style='float:right;' type='a' class='btn btn-warning btn btn-large btn-lg post-s-edit'>Update</button></div>";
     
        
    }
     elseif ($is_friend==TRUE&&$session_uname!=$f_uname) {
           $statusui="<input type='text' class='form-control title_f' name='status_title' placeholder='Title'><br>"
                   . "<textarea id='wall_id_1' type='c' value='".html_entity_decode($data)." class='status_4_expresspad_friend' style='' placeholder='hi ".$session_uname." want to say something to ".$f_uname.". '>"
                   . "</textarea><br>"
                   . "<button style='float:right;' class='btn btn-warning btn-large btn-lg post-f'>Post</button><br><br><br><div> </div>";
           $statusui_edit="<div class='hidden_edit_4_friend jumbotron'><a title='Close without editing' href='#' class='pull-right close_edit_f'>Close X</a><input type='text' class='form-control title_f_edit' name='status_title' value='".html_entity_decode($title)."' placeholder='Title'><br>"
                   . "<textarea id='wall_edit_2' value='".html_entity_decode($data)."' class='update_4_expresspad'placeholder='hi ".$session_uname." want to say something to ".$f_uname.". '>"
                   . "</textarea><br>"
                   . "<button style='float:right;' type='c' class='btn btn-warning btn-large btn-lg post-f-edit'>Update</button>";
    }
    
    ?>
    

    here is the code where the status list is outputting in a loop with the hidden text area's logic:

     

    <?php
    
    
    $status2view=$project->statusView($session_uname, $f_uname);
    //gives output on var dump
    #row vars to extract user's update data.
    
    
    
    
        foreach($status2view as $row){
               $id=$row['update_id'];
              
        
    
    
    
    
    $status_replies_=$project->reply2StatusView($id);
    
    
    
    
    foreach ($status_replies_ as $row) {
                    
                    $status_reply_id=$row['update_id'];
                    $reply_author=$row['author'];
                    $reply_d=htmlentities($row['update_body']);
                    $reply_data=  stripslashes($reply_d);
                    $reply_t=  htmlentities($row['title']);
                    $reply_title=  stripslashes($reply_t);
                    $account_name=$row['account_name'];
                   $reply_date=$row['time'];
                   $reply_delete_button="";
                   if ($reply_author==$session_uname || $account_name==$session_uname) {
                       $reply_delete_button="<li><span id='$status_reply_id' class='delete_reply_btn glyphicon glyphicon-remove'><a href='#' title='Delete this comment'>Remove X</a></span></li>";
                   }
                  $status_replies="<div id='".$status_reply_id."' class='replyboxes'><b>Reply by<a href='search_results.php?u=".$reply_author."'>".$reply_author."</a>".$reply_date ."<legend>"
                           . "<b class='caret'><button type='button' class='btn btn-danger dropdown-toggle pull-right' data-toggle='dropdown' aria-expanded='true' ><span class='glyphicon glyphicon-edit'></span>
                            <ul class='dropdown-menu'>".$reply_delete_button." "
                          . "<li><a href='#' class='hidden_text_area glyphicon glyphicon-pencil' title='Edit this comment' >Edit</a></li>"
                          . "<li><a href='report.php?u='".$reply_author."'>Report</a><li></ul>"
                          . "</button></b></legend><br>".  html_entity_decode($reply_data)."";
                }
            }
      
         foreach ($status2view as $row1) {
            
             //got values here.
                    $updateid=$row1['update_id'];
                    $account_name=$row1['account_name'];
                    $os_id=$row1['os_id'];
                    $author=$row1['author'];
                    $post_date=$row1['time'];
                    $title= $row1['title'];
                    $data= $row1['update_body'];
                    $statusdeletebutton='';
                    if ($author==$session_uname || $account_name==$session_uname) {
                    $statusdeletebutton='<li>'
                               . '<a href="#" id="'.$updateid.'" class="delete_4_session hidden_text_delete_'.$updateid.' glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li>';
                    }
                    $status_list= '<div id="'.$updateid.'" type="'.$updateid.'" class="statusboxes jumbotron">'
                            . '<h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="'.$updateid.'" class="title_s_2copy" value="'.html_entity_decode($title).'">'.html_entity_decode($title).'</div></h3>'
                            . '<span class="pull-right">'
                            . '<div class="dropdown">'
                            . '<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  >'
                            . '<span class="glyphicon glyphicon-edit"></span></button>'
                            . '<ul class="dropdown-menu">'
                            . '<li><a href="#" id="'.$updateid.'" type="'.$updateid.'" class="edit_4_session hidden_text_edit glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li>'.$statusdeletebutton.'</ul></div></span><br><hr><span class="pull-left data_s_2copy" id="'.$updateid.'" value="'.html_entity_decode($data).'" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;">'
                            . html_entity_decode($data).'</span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u='.$author.'">'.$author.   '</a>   '.$post_date.'</small></b>'
                            . '<br>'.$status_replies.'<br>'.$statusui_edit;
    
    
                    if ($is_friend==TRUE||$session_uname==$f_uname) {
                        $status_list.= '<textarea id="'.$updateid.'"  class="status_update input-custom2" placeholder="comment\'s"></textarea>'
                                . '<button id="'.$updateid.'" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div>';
    
    
                        }
                        echo $status_list;
                    }
    
  12. @mac_gyver thanks for the tips, but while using it i'm able to only get a single output can you please recheck the updated code here and tell me where im going wrong???

    <?php
    
    $status2view=$project->statusView($session_uname, $f_uname);
    //gives output on var dump
    #row vars to extract user's update data.
    
    
        foreach($status2view as $row){
               //print_r($row);
               $id=$row['update_id'];
              
        
    //gives output on var_dump
    
    $status_replies_=$project->reply2StatusView($id);
    
    
    foreach ($status_replies_ as $row) {
                    
                    $status_reply_id=$row['update_id'];
                    $reply_author=$row['author'];
                    $reply_d=htmlentities($row['update_body']);
                    $reply_data=  stripslashes($reply_d);
                    $reply_t=  htmlentities($row['title']);
                    $reply_title=  stripslashes($reply_t);
                    $account_name=$row['account_name'];
                   $reply_date=$row['time'];
                   $reply_delete_button="";
                   if ($reply_author==$session_uname || $account_name==$session_uname) {
                       $reply_delete_button="<li><span id='$status_reply_id' class='delete_reply_btn glyphicon glyphicon-remove'><a href='#' title='Delete this comment'>Remove X</a></span></li>";
                   }
                  $status_replies="<div id='".$status_reply_id."' class='replyboxes'><b>Reply by<a href='search_results.php?u=".$reply_author."'>".$reply_author."</a>".$reply_date ."<legend>"
                           . "<b class='caret'><button type='button' class='btn btn-danger dropdown-toggle pull-right' data-toggle='dropdown' aria-expanded='true' ><span class='glyphicon glyphicon-edit'></span>
                            <ul class='dropdown-menu'>".$reply_delete_button." "
                          . "<li><a href='#' class='hidden_text_area glyphicon glyphicon-pencil' title='Edit this comment' >Edit</a></li>"
                          . "<li><a href='report.php?u='".$reply_author."'>Report</a><li></ul>"
                          . "</button></b></legend><br>".htmlentities($reply_data)."</div>";
                }
            }
      
         foreach ($status2view as $row1) {
             
            
                    $updateid=$row1['update_id'];
                    $account_name=$row1['account_name'];
                    $os_id=$row1['os_id'];
                    $author=$row1['author'];
                    $post_date=$row1['time'];
                    $title= $row1['title'];
                    $data= $row1['update_body'];
                    $statusdeletebutton='';
                    if ($author==$session_uname || $account_name==$session_uname) {
                    $statusdeletebutton='<li>'
                               . '<a href="#" id="'.$updateid.'" class="hidden_text_area glyphicon glyphicon-trash delete_reply_btn" title="Delete this status and its replies">Remove</a></li>';
                    }
                    $status_list= $statusui_edit .'<div id="'.$updateid.'" type="'.$updateid.'" class="statusboxes jumbotron">'
                            . '<h3 style="color:black; margin-bottom:5px; margin-top:5px;" class="pull-left"><div id="'.$updateid.'" class="title_s_2copy" value="'.html_entity_decode($title).'">'.html_entity_decode($title).'</div></h3>'
                            . '<span class="pull-right">'
                            . '<div class="dropdown">'
                            . '<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  >'
                            . '<span class="glyphicon glyphicon-edit"></span></button>'
                            . '<ul class="dropdown-menu">'
                            . '<li><a href="#" class="hidden_text_area glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li>'.$statusdeletebutton.'</ul></div></span><br><hr><span class="pull-left data_s_2copy" id="'.$updateid.'" value="'.html_entity_decode($data).'" style="font-size:9px; margin-bottom:0px; margin-top:0px; text-align:left; color:black;">'
                            . html_entity_decode($data).'</span><br><br><hr><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u='.$author.'">'.$author.   '</a>   '.$post_date.'</small></b>'
                            . '<br>'.$status_replies.'</div>';
    
                    if ($is_friend==TRUE||$session_uname==$f_uname) {
                        $status_list.= '<textarea id="'.$updateid.'"  class="status_update input-custom2" placeholder="comment\'s"></textarea>'
                                . '<button id="'.$updateid.'" type="b" class="btn btn-warning pull-right btn-sm">Reply</button></div>';
    
                        }
                    }
    

    thanks in advance.

  13. hi guys im trying to hide a specific class selector in jquery. where the id and the type attributes are generated dynamically. but dont know how to select and hide it so, as to do a ajax call. can anyone help.
    here is the code for the jquery:
     
    $(".hidden_text_area").click(function(){
    $(".hidden_edit_4_session").show();    
    var hide_status=$(".statusboxes").attr('type');
    $(hide_status).find(".statusboxes").hide();
    });
     
    and here is the code where the type attribute is which i want to select and hide if the user clicks edit button.
     
    $status_list='<fieldset><div class="jumbotron"><div id="'.$updateid.'" type="'.$updateid.'" class="statusboxes">'
                            . '<h3 style="text-align:left; color:black;" class="pull-left">'.$title.'</h3>'
                            . '<span class="pull-right">'
                            . '<div class="dropdown">'
                            . '<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"  >'
                            . '<span class="glyphicon glyphicon-edit"></span></button>'
                            . '<ul class="dropdown-menu">'
                            . '<li><a href="#" class="hidden_text_area glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li>'.$statusdeletebutton.'</ul></div></span><br><hr><span class="pull-left"style="font-size:14px; text-align:left; color:black;"><legend>'
                            . $data.'</legend></span><br><b style="text-align:right; color:black;"><small>Posted by:-  <a href="search_results.php?u='.$author.'">'.$author.   '</a>   '.$post_date.'</small></b>'
                            . '<br>'.$status_replies 
                            . '</div></div>'.$statusui_edit ;

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.