<?php session_start(); require "../../../php_functions/connect.php"; require "../../../php_functions/function.php"; require "../../../php_functions/library.php"; require "../../../php_functions/source.php"; require "../../../php_functions/myclass.php"; $mc = new myclass(); delete_comment($_GET['plcno']); function delete_comment($plcno) { $deleted = delete('posted_looks_comments', array('plcno', $plcno)); $deleted = delete('posted_looks_comments_like_dislike', array('plcno', $plcno)); $deleted = delete('fs_plcm_dislike', array('plcno', $plcno)); $deleted = delete('fs_cflag', array('plcno', $plcno)); $creplies = selectV1('*', 'fs_plcm_reply', array('plcno' => $plcno)); // print_r($creplies); if (!empty($creplies)) { for ($i = 0; $i < count($creplies); $i++) { $plcrno = $creplies[$i]['plcr_no']; $rlike = delete('fs_plcm_rlike', array('plcrno', $plcrno)); $rflag = delete('fs_plcm_rflag', array('plcrno', $plcrno)); $reply = delete('fs_plcm_reply', array('plcr_no', $plcrno)); $rdislike = delete('fs_plcm_rdislike', array('plcrno', $plcrno)); } echo "main comment successfully deleted and ( " . count($creplies) . " ) total reply deleted with their specific like , dislike , flagged <br>"; } } $_SESSION['cTblens'] = get_total_len_comment($_SESSION['plno']);
public function print_look_comment($mno, $plno, $comment1, $post_comment, $dtime, $st, $nexprev = null, $sort = 'order by plcno asc', $profilepath = null) { ?> <!--original file: look-comment-display old --> <link rel="stylesheet" type="text/css" href="style.css"> <div class='main_comment_container' style="border:1px solid none" > <?php echo "<li style='list-style:none'>"; // echo " print_look_comment( $mno , $plno , $comment1 , $post_comment , $dtime , $nexprev=null )"; if ($post_comment == 'init') { // echo " comment initialized "; $comment = selectV1('*', 'posted_looks_comments', array('plno' => $plno), $sort, 'limit 10'); $_SESSION['plcnos_sortings'] = selectV1('*', 'posted_looks_comments', array('plno' => $plno), 'order by plcno desc'); $comment_len = count($comment); } else { if ($post_comment == 'reply_a_comment') { // if (strlen($comment)>0) { // insert( // 'fs_plcm_reply', // array('plcno','mno','plcr_date','plcr_message'), // array($plcno,$_SESSION['mno'],$date_time['date_time'],tcleaner($comment)), // 'plcr_no' // ); // } // echo "reply comment"; } else { if ($post_comment == 'posted_a_comment') { if (!empty($comment1)) { $cadded = $this->add_my_latest_look_comment($mno, $plno, $this->clean_text_before_save_to_db($comment1), $dtime); $comment = $this->get_my_latest_look_comment($mno, $plno); $comment_len = 1; // echo " comment posted $cadded now "; $this->update_or_add_my_activity_wall_post($mno, $plno, 'Commented', 'postedlooks', $dtime); $this->update_look_row($plno, 'pltcomment', count($this->get_look_all_comments($plno)), 'postedlooks'); } else { exit; } } else { if ($post_comment == 'live_check_new_message') { $Tblen = get_total_len_comment($_SESSION['plno']); if (!empty($Tblen) and $Tblen != 0) { #look have a comment if ($_SESSION['cTblens'] > $Tblen) { } else { if ($_SESSION['cTblens'] < $Tblen) { $total_new_comment = $Tblen - $_SESSION['cTblens']; $_SESSION['cTblens'] = $Tblen; // $comment=get_new_comments($_SESSION['plno'],$total_new_comment); $comment_len = count($comment); } } } else { # look is empty } } else { if ($post_comment == 'sort') { if (!empty($_GET['sort_as'])) { unset($_SESSION['plcnos_sortings']); unset($_SESSION['showMoreCounter']); $_SESSION['plcnos_sortings'] = comments_sorted($st, $_GET['sort_as']); $showMore_start = 0; $showMore_stop = 10; } else { #view more clicked. $showMore_start = $_SESSION['showMoreCounter']; $showMore_stop = $_SESSION['showMoreCounter'] + 10; } $res = $_SESSION['plcnos_sortings']; $res_len = count($res); #$comment = $st->set_and_show_more_comments( $res , $showMore_start , $showMore_stop ); $comment = $st->set_and_show_more_comments($res, 0, 100); $comment_len = count($comment); } else { if ($post_comment == 'next_prev') { // echo " sort as $sort" ; $comment = $this->get_look_all_comments($plno, $sort); if (!empty($comment)) { $start = $this->get_loop_start($nexprev, 10); $end = $this->get_loop_end($nexprev, 10); $comment = $st->set_and_show_more_comments($comment, $start, $end); $comment_len = count($comment); // echo " <li> jesus start $start end $end </li> "; } else { $comment_len = 0; } } else { # page loaded unset($_SESSION['plcnos_sortings']); unset($_SESSION['showMoreCounter']); $showMore_start = 0; $showMore_stop = 10; // temporary set as 100 original is 10 $_SESSION['plcnos_sortings'] = comments_sorted($st, 'oldest'); $res_len = count($_SESSION['plcnos_sortings']); // print_r($_SESSION['plcnos_sortings']); #$comment = $st->set_and_show_more_comments( $_SESSION['plcnos_sortings'] , $showMore_start , $showMore_stop ); $comment = $st->set_and_show_more_comments($_SESSION['plcnos_sortings'], 0, 100); if ($comment == 0) { $_SESSION['cTblens'] = 0; } else { $_SESSION['cTblens'] = intval(count($comment)); } $comment_len = count($comment); } } } } } } // echo " next prev $nexprev ssssssssssssssssss <br> "; // echo " plno $plno "; // echo " $comment1 "; // print_r($comment); echo "</li>"; $c = 0; $table_name = 'posted_looks_comments'; for ($i = 0; $i < $comment_len; $i++) { // for ($i=$comment_len-1; $i >= 0 ; $i--) { $c++; $plcno = $comment[$i]['plcno']; $cno = $comment[$i]['plcno']; $plno = $comment[$i]['plno']; $mno = $comment[$i]['mno']; $date_ = $comment[$i]['date_']; $msg = $comment[$i]['msg']; $plctlikes = $comment[$i]['plctlikes']; $plctdislike = $comment[$i]['plctdislike']; $meminfo = $this->get_user_full_fs_info($mno, null); $dateTime = $this->dateTime_convert($date_); $rating_img = $this->get_my_action_image_equivalent($mno, $plno, 'Rated'); $this->look_comment_css($cno, $mno); $ovarating = $meminfo['opercentage']; $fullname = $meminfo['fullName']; $gender = $meminfo['gender']; $tpercentage_look = $meminfo['tpercentage_look']; $member_avatar = $this->ppic_thumbnail . "/" . $comment[$i][2] . ".jpg"; $shadow = $mno == $_SESSION['mno'] ? 'box-shadow: inset 0px 0px 4px 0px #000;' : ''; $b = $this->get_your_look_comment_thumb_up_or_down($_SESSION['mno'], $plcno); // echo " $b "; $you_liked = $b == 'Thumb-Up' ? true : false; $you_disliked = $b == 'Thumb-Down' ? true : false; $pt = $this->get_equivalent_user_percentage($tpercentage_look, null); $username = $this->get_username_by_mno($mno); // set background image container white or grey if ($c % 2 == 0) { $background_color = 'background-color:white;'; } else { $background_color = ''; } // set flag icons $modal['src_img_flag'] = "modal-flag.png"; $response = $this->fs_flag(array('type' => 'select', 'limit_start' => 0, 'limit_end' => 1, 'where' => "table_id = {$cno} and table_name= 'posted_looks_comments' and mno = {$_SESSION['mno']} ")); if (!empty($response)) { $modal['src_img_flag'] = "large-flag-red.png"; } $edit_flag_id = " #edit-image-{$cno},#edit-text-{$cno}, #flag-image-{$cno}, #flag-text-{$cno}, #delete-image-{$cno}, #delete-text-{$cno}"; $message = $this->cleant_text_print_from_db($comment[$i][4]); echo "<span style='display:none'>"; $psrc = $this->member_thumbnail_display($this->ppic_thumbnail, $mno, "{$profilepath}" . $this->ppic_thumbnail); echo "</span>"; ?> <div id='comment_list_<?php echo $cno; ?> ' class='main_container' style=' border:1px solid none; ' > <li> <!-- new main comment --> <div style="margin-top:15px;" > <table border="0" id='comment_container' class='comment_container' style='border:1px solid none;<?php echo $background_color; ?> ' onmouseover="modal ( 'mouse-enter-to-comment' , '<?php echo $edit_flag_id; ?> ' )" onmouseout="modal ( 'mouse-out-to-comment' , '<?php echo $edit_flag_id; ?> ' )" > <tr> <td> <table border="0" id='img' class='img' > <td> <?php $this->member_thumbnail_display($this->ppic_thumbnail, $mno, "{$profilepath}" . $this->ppic_thumbnail); ?> </td><tr> <td><span class='red_bold' id='percentage' title='<?php echo $pt; ?> ' ><?php echo "{$tpercentage_look}% "; ?> </span></td> </table> <div id='comment_body_container' class='comment_body_container' > <div id='comment_header_container' > <table border="0" > <td> <a href="<?php echo "{$username}"; ?> " style='text-decoration:none' target='_parent' > <span id='full_name_<?php echo $cno; ?> ' class='blue_bold' > <?php echo $fullname; ?> </span> </a> </td> <td></td> <td> <table border="0" cellpadding="0" cellspacing="0" id="comment-modal-gender" > <tr> <td> <div class='blue_bold' style="font-size:11px;" > ( </div> </td> <td> <div id='gender' class='blue' style="font-size:12px; margin-left:5px" > <?php echo $gender; ?> RATED </div> </td> <td> <div class='rating_view' style="margin-left:5px" > <?php echo "{$rating_img}"; ?> </div> </td> <td> <div class='blue_bold' style="margin-left:5px;font-size:12px;" > ) </div> </td> </table> </td> <td> <?php // $replies=selectV1( // '*', // 'fs_plcm_reply', // array('plcno'=>$cno) // ); // if (empty($replies)) { // $rLen = 0; // }else { // $rLen = count($replies); // } ?> <?php if (false) { ?> <span class='blue_bold'> ( </span> <span id='viewReplies' class='viewReplies_<?php echo $cno; ?> ' onclick='viewReplies("<?php echo $cno; ?> ") ' >View replies</span><span class='totalReplies'> ( <?php echo $rLen; ?> ) </span> <span class='blue_bold'> ) </span> <?php } ?> </td> </table> </div> <div class='rcomment' id='comment_<?php echo $cno; ?> ' > <?php // $you_liked=you_like_this_comment($comment[$i][0],$_SESSION['mno']); // $you_disliked=you_dislike_this_comment($comment[$i][0],$_SESSION['mno']); // if (!empty($last_comment)) { // echo $comment[$last_comment][4]; // }else { // echo $comment[$i][4]; // } ?> <div class="comment_span_content_container" id='comment_span_<?php echo $cno; ?> ' > <div> <?php echo $this->cleant_text_print_from_db($comment[$i][4]); ?> </div> </div> </div> <div id='comment_footer_Container' > <table border="0" > <td> <span id='comment_time'> <!-- POSTED ON <?php echo $dformat['month'] . ' , ' . $dformat['day'] . ' , ' . $dformat['year'] . ' | ' . $dformat['hour'] . ':' . $dformat['min'] . ' ' . $dformat['stat']; ?> --> POSTED ON <?php echo $dateTime; ?> </span> </td> <td></td> <td></td> <td> <div style='margin-top:-2px;' > <?php echo $this->get_look_comment_thumbs_up_or_down_image($cno, $you_liked, $you_disliked, 'Thumbs-Up', $plno); ?> </div> </td> <td></td> <td></td> <td> <span class='red_bold' id="<?php echo "like_" . $cno; ?> " > <?php echo " {$plctlikes} "; ?> </span> </td> <td></td> <td></td> <td> <td> <div style='margin-top:-2px;' > <?php echo $this->get_look_comment_thumbs_up_or_down_image($cno, $you_liked, $you_disliked, 'Thumbs-Down', $plno); ?> </div> </td> <td></td> <td></td> <td> <span class='red_bold' id="<?php echo "dislike_" . $cno; ?> " > <?php echo " {$plctdislike}"; ?> </span> </td> </td> <td></td> <?php //if ($_SESSION['mno'] != $comment[$i][2] ) { if (false) { ?> <td> <td> <img src="<?php echo $this->img_attr_source; ?> /reply.jpg" class='img_like' title='reply comment' onclick='look_comment_attr_clicked("<?php echo "reply_" . $cno . "-0"; ?> ")' /> </td> <td> <span class='red_bold' > REPLY </span> </td> </td> <td></td> <?php } ?> <?php if ($_SESSION['mno'] == $comment[$i][2]) { ?> <td></td> <td> <td id='edit-image-<?php echo $cno; ?> ' style='display:none' > <img src="<?php echo $this->path_icons; ?> /comment-edit.png" class='img_like' title='reply comment' onclick="fs_popup( 'popup-small' , 'modal-comment-edit' , 'modal-comment-edit-design' , 'method' , '<?php echo $cno; ?> ' , '<?php echo $table_name; ?> ' )" /> </td> <td id='edit-text-<?php echo $cno; ?> ' style='display:none' > <span class='red_bold' onclick="fs_popup( 'popup-function' , 'modal-comment-edit' , 'modal-comment-edit-design' , 'method' , '<?php echo $cno; ?> ' , '<?php echo $table_name; ?> ' )" style='cursor:pointer' > EDIT </span> </td> </td> <?php } ?> <?php if ($_SESSION['mno'] != $comment[$i][2]) { ?> <td></td> <td> <td id='flag-image-<?php echo $cno; ?> ' style='display:none' > <!-- <img src="<?php echo $this->path_icons; ?> /comment-flag.png" class='img_like' title='flag comment' onclick='look_comment_attr_clicked("<?php echo "flag_{$cno}"; ?> ")' /> <div id='<?php echo "flag_{$cno}"; ?> '> </div> --> <img src="<?php echo "{$this->genImgs}/{$modal['src_img_flag']}"; ?> " class='img_like' id='comment-flag-icon<?php echo $cno; ?> ' title='flag comment' onclick="flag ( 'fs-flag' , '<?php echo 'posted_looks_comments'; ?> ' , '<?php echo $cno; ?> ' , '#comment-flag-icon<?php echo $cno; ?> ' , '<?php echo "{$this->genImgs}/large-flag-red.png"; ?> ' ) " /> </td> <td id='flag-text-<?php echo $cno; ?> ' style='display:none' > <span class='red_bold' > FLAG </span> </td> </td> <?php } ?> <?php if ($_SESSION['mno'] == $comment[$i][2] or $_SESSION['mno'] == get_look_owner($_SESSION['plno'])) { ?> <td></td> <td> <td id='delete-image-<?php echo $cno; ?> ' style='display:none' > <img src="<?php echo $this->path_icons; ?> /coment-delete.png" class='img_like' title='delete comment' onclick='delete_look_comment("<?php echo intval($cno); ?> " , "<?php echo "{$plno}"; ?> " , "postedlooks" )' /> <div id='<?php echo "flag_{$cno}"; ?> '> </div> </td> <td id='delete-text-<?php echo $cno; ?> ' style='display:none' > <span class='red_bold' onclick='delete_look_comment("<?php echo intval($cno); ?> " , "<?php echo "{$plno}"; ?> " , "postedlooks" )' style='cursor:pointer' > DELETE </span> </td> </td> <?php } ?> </table> </div> </div> </td> <tr> <td id='TA_main_comment_reply_td'> <div id ='TA_main_comment_reply_div' class='TA_main_comment_reply_div<?php echo $cno; ?> '> <textarea id='TA_main_comment_reply' class='TA_main_comment_reply<?php echo $cno; ?> ' placeholder='type your reply here..' ></textarea> <input id='TA_main_comment_reply_button' class='TA_main_comment_reply_button<?php echo $cno; ?> ' onclick="send_data('cancel reply','.TA_main_comment_reply_div<?php echo $cno; ?> ')" type='button' value='CANCEL' > <input id='TA_main_comment_reply_button' class='TA_main_comment_reply_button<?php echo $cno; ?> ' onclick="send_data('save reply','.TA_main_comment_reply_div<?php echo $cno; ?> ','.TA_main_comment_reply<?php echo $cno; ?> ',<?php echo $cno; ?> ,'reply')" type='button' value='POST A COMMENT' > </div> <div id ='TA_main_comment_edit_div' class='TA_main_comment_edit_div<?php echo $cno; ?> '> <textarea id='TA_main_comment_edit' class='TA_main_comment_edit<?php echo $cno; ?> ' ></textarea> <input id='TA_main_comment_edit_button' class='TA_main_comment_edit_button<?php echo $cno; ?> ' onclick="send_data('cancel edit','.TA_main_comment_edit_div<?php echo $cno; ?> ')" type='button' value='CANCEL' > <input id='TA_main_comment_edit_button' class='TA_main_comment_edit_button<?php echo $cno; ?> ' onclick="send_data('save edit','.TA_main_comment_edit_div<?php echo $cno; ?> ','.TA_main_comment_edit<?php echo $cno; ?> ',<?php echo $cno; ?> ,'edit')" type='button' value='SAVE COMMENT' > </div> <div id ='TA_main_comment_flag_div' class='TA_main_comment_flag_div<?php echo $cno; ?> '> <?php $this->unflagged_design_auto_hide(array('table' => 'fs_cflag', 'where' => 'plcno', 'whereV' => $cno)); ?> <!-- new not yet flag --> <table id='flagTable1' class='notflagged<?php echo $cno; ?> ' style="<?php echo $this->notflaggedStyle; ?> " border="0" cellpadding="0" cellspacing="0" > <tr> <td id='flagTitle1Td' > <span id='flagTitle1'> If you want to flag this comment fill up bellow.</span> </td> <tr> <td> <table id='flagTable2' border="0" cellpadding="0" cellspacing="0" > <tr> <td> <input type="checkbox" class='check_box1<?php echo $cno; ?> ' > </td> <td > <span id='flagTitle2'>NO SPAM or Unsolicited Advertising</span> </td> <tr> <td> <input type="checkbox" class='check_box2<?php echo $cno; ?> ' > </td> <td> <span id='flagTitle2'>NO Offensive or Harmful Content</span> </td> <tr> <td> <input type="checkbox" class='check_box3<?php echo $cno; ?> '> </td> <td id='flagTitle2Td3'> <span id='flagTitle2'>NO Stolen or Copyright Infriging Content</span> </td> </table> </td> <tr> <td> <textarea id='TA_main_comment_flag' class='TA_main_comment_flag<?php echo $cno; ?> ' placeholder='( Aditional Information )' ></textarea> <input id='TA_main_comment_flag_button' class='TA_main_comment_flag_button<?php echo $cno; ?> ' onclick="send_data('cancel flag','.TA_main_comment_flag_div<?php echo $cno; ?> ')" type='button' value='CANCEL' > <input id='TA_main_comment_flag_button' class='TA_main_comment_flag_button<?php echo $cno; ?> ' onclick="send_data('save flag','.TA_main_comment_flag_div<?php echo $cno; ?> ','.TA_main_comment_flag<?php echo $cno; ?> ','<?php echo $cno; ?> ','flag','')" type='button' value='SEND FLAG' > </td> </table> <!-- new not yet flag --> <!-- new already flagged --> <div id='flagged' class='flagged<?php echo $cno; ?> ' style="<?php echo $this->flaggedStyle; ?> " > <table > <tr> <td> <span id='flagTitle2' > This comment is already flagged. </span> </td> <tr> <td> <input id='TA_main_comment_flag_button' class='TA_main_comment_flag_button<?php echo $cno; ?> ' onclick="send_data('cancel flag','.TA_main_comment_flag_div<?php echo $cno; ?> ')" type='button' value='OK' > </td> </table> </div> <!-- new already flagged --> </div> </td> </table> <!-- <hr class='line_<?php echo $cno; ?> ' id='hr' > --> </div> </li> </div> <?php } //end for loop ?> <div style='width:500px; height: auto ; background-color:#000;color:#fff;margin-top:20px; margin-left:46px;text-align:center;display:none'> <div id='res'> action status , This is temporarily visible because of currently coding.. </div> </div> <?php }
require "data/comSortFunc.php"; $mc = new myclass(); $st = new Sorting(); ?> <link rel="stylesheet" type="text/css" href="style.css"> <div class='main_comment_container'> <?php if ($_GET['post_comment'] == 'posted_a_comment') { } else { if ($_GET['post_comment'] == 'live_check_new_message') { $Tblen = get_total_len_comment($_SESSION['plno']); if (!empty($Tblen) and $Tblen != 0) { #look have a comment if ($_SESSION['cTblens'] > $Tblen) { } else { if ($_SESSION['cTblens'] < $Tblen) { $total_new_comment = $Tblen - $_SESSION['cTblens']; $_SESSION['cTblens'] = $Tblen; $comment = get_new_comments($_SESSION['plno'], $total_new_comment); $comment_len = count($comment); } } } else { # look is empty } } else {