Example #1
0
require "../../php_functions/library.php";
require "../../php_functions/source.php";
require "../../php_functions/myclass.php";
require "data/sortingTest.php";
require "data/comSortFunc.php";
$st = new Sorting();
require "test_reply.php";
$plcno = $_GET['plcno'];
$tableName = 'fs_plcm_reply';
$select = 'plcr_no';
$replied_no = 0;
$r = get_first_main_reply($select, $tableName, $plcno, $replied_no);
// print_r($r);
for ($i = 0; $i < count($r); $i++) {
    $plcr_no = $r[$i]['plcr_no'];
    reply_print($plcno, $plcr_no, true, null, null, 'yes');
    // $r1 = get_more_replies( $select , $tableName , $plcr_no );
    // print_sub1_reply( $plcno , $r1 , $select , $tableName);
}
/*
function print_sub1_reply( $plcno , $r1  , $select , $tableName  )  
{ 
	echo"<ul>";
	 	for ($j=0; $j < count($r1) ; $j++) { 
	 		$plcr_no = $r1[$j]['plcr_no'];
	 		// echo " <li> $plcr_no </li>";
	 		reply_print( $plcno , $plcr_no  , true , null , null , 'yes' );
	 		 // $plcno , $plcr_no , $allow_reply , $isMainReply = null , $mno = null , $isReplyIndented = null 
	 		$r2 = get_more_replies( $select , $tableName , $plcr_no );
	 		// print_sub2_reply($plcno , $r2 , $select , $tableName);
	 	}
Example #2
0
if ($view == 'start') {
    #view reply clicked
    $_SESSION['replies'] = comments_reply_sorted($st, $sort, $plcno);
    $limit = $st->reply_limit($_SESSION['replies']);
    $view_start = $start;
    $view_stop = $limit;
    $_SESSION['counter'] = 0;
    // echo " counter is ".$_SESSION['counter'].'<br>';
} else {
    if ($view == 'viewMore') {
        $limit = $st->reply_limit($_SESSION['replies']);
        $view_start = $_SESSION['counter'];
        $view_stop = $_SESSION['counter'] + $limit;
    }
}
$repliesLen = reply_print($mc, $_SESSION['replies'], $view_start, $view_stop, $plcno);
$rlen = count($_SESSION['replies']);
// echo " bellow is the result";
// print_r( $res );
// echo "total result = $rlen <br> ";
function reply_print($mc, $replies, $view_start, $view_stop, $plcno)
{
    $repliesLen = count($replies);
    // echo " total len $repliesLen <br>";
    for ($j = $view_start; $j < $view_stop; $j++) {
        if ($j < $repliesLen) {
            // echo " </li>";
            $_SESSION['counter']++;
            // echo "c = ".$_SESSION['counter'].'<br>';
            $rplcr_no = $replies[$j]['plcr_no'];
            $plcrno = $rplcr_no;
Example #3
0
function main()
{
    $mc = new myclass();
    $mc->date_difference();
    $plcno = !empty($_GET['plcno']) ? intval($_GET["plcno"]) : "";
    $rcomment = !empty($_GET['rcomment']) ? $_GET['rcomment'] : "";
    $plcrno = !empty($_GET['plcrno']) ? intval($_GET['plcrno']) : 0;
    $mno = intval($_SESSION['mno']);
    $status = $_GET['status'];
    $date_time = $mc->date_time;
    $flag_note = !empty($_GET['flag_note']) ? $_GET['flag_note'] : 0;
    $cboxes = !empty($_GET['cboxes']) ? $_GET['cboxes'] : 0;
    $replyEdited = !empty($_GET['replyEdited']) ? $_GET['replyEdited'] : 0;
    $replied_no = !empty($_GET['replied_no']) ? $_GET['replied_no'] : 0;
    $isReplyIndented = !empty($_GET['isReplyIndented']) ? $_GET['isReplyIndented'] : 0;
    $mc->auto_detect_path();
    // echo " status = [$status]  replied_no = $replied_no <br> ";
    if ($status == 'replySave') {
        save_reply_comment($status, $plcno, $replied_no, $mno, $rcomment, $date_time);
        $posted_comment = false;
        // require ('replyDesign.php');
        require '../test_reply.php';
        // echo "result of the output";
        reply_print($plcno, 0, true, 'YES', $mno, $isReplyIndented, '../../../../');
        // echo "reply design print here !";
    } else {
        if ($status == 'replyLike') {
            replyLike($mno, $plcrno);
        } else {
            if ($status == 'replyDisLike') {
                replyDisLike($mno, $plcrno);
            } else {
                if ($status == 'check_flag') {
                    // echo "chekcing flagged ";
                    // echo "$flag_note $cboxes";
                    check_flagged($plcrno);
                    // echo "1";
                } else {
                    if ($status == 'replySaveFlag') {
                        // echo " 	save flag reply  note = $flag_note  check box options = $cboxes <br>";
                        save_reply_flagged($plcrno, $mno, tcleaner($flag_note), $cboxes, $date_time);
                    } else {
                        if ($status == 'replyDelete') {
                            // echo "delete reply   plcrno = $plcrno ";
                            $del_array = $mc->get_multiple_reply($plcrno);
                            // for ($i=0; $i < count($del_array) ; $i++)
                            // {
                            // 	 // replyDelete  ($del_array[$i]);
                            // 	echo " plcrno to del =  ".$del_array[$i].'<br>';
                            // }
                        } else {
                            if ($status == 'replyEdit') {
                                // echo " edit reply plcrno = $plcrno edited reply = $replyEdited <br> ";
                                replyEdit($plcrno, $replyEdited);
                            }
                        }
                    }
                }
            }
        }
    }
}