Example #1
0
<?php

include "includes/application-top.php";
$dbObj = new DB();
$dbObj->fun_db_connect();
$objAdmin = new Admins();
$objAdmin->fun_authenticate_admin();
if (@$_SESSION['session_admin_type'] == "1") {
    $sqlSel_post = "SELECT * FROM " . TABLE_COMMENT;
} else {
    $sqlSel_post = "SELECT * FROM " . TABLE_COMMENT . " WHERE post_id in (SELECT GROUP_CONCAT(id) as ids FROM " . TABLE_POST . " GROUP BY user_id HAVING user_id= " . $_SESSION['session_admin_userid'] . ")";
}
$rsResult_post = $dbObj->fun_db_query($sqlSel_post);
$total_Post = $dbObj->fun_db_get_num_rows($rsResult_post);
$total_pages = ceil($total_Post / limit);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xml:lang="en">
<head>

	<title><?php 
echo prefix . " | Comment List";
?>
</title>
<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1">	
<link rel="stylesheet" href="css/style.css" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
	   $(document).ready(
				function(){
 $(".menu-icon").click(function(){
Example #2
0
if (count($_POST) > 0) {
    $arr = $_POST;
    $arr['add_date'] = date("Y-m-d H:i:s");
    $lastID1 = $dbObj->insert_data(TABLE_COMMENT, $arr);
    /* mail for new comment*/
    if ($_SESSION['session_admin_userid'] == '') {
        if ($lastID1) {
            $_SESSION['msg'] = '<span style=" color:green;font-size:13px;">Your comment is successfully posted. Will display after approval.</span>';
        }
        $user_name = 'jwasser.com';
        //site url
        $mail = new PHPMailer();
        $mail->From = "*****@*****.**";
        $mail->FromName = $user_name;
        $mail->AddReplyTo($_POST['email']);
        $mail->AddAddress("*****@*****.**");
        $mail->Subject = "Comment Posted On Post";
        $mail->IsHTML(true);
        $mail->Body = "<b><font  style='font-size:14px;'>Below comment posted on post for approvel</font></b><br><br>\n\t\t                    <br>" . $arr['comment'] . "<br>";
        $mail->send();
        //if(!$mail->send()){echo "Not Send";die;}else{echo "Mail Send";die;}
    }
    $sqlSel_com1 = "SELECT * FROM " . TABLE_COMMENT . " where post_id=" . $arr['post_id'];
    $rsResult_com1 = $dbObj->fun_db_query($sqlSel_com1);
    $total_comment = $dbObj->fun_db_get_num_rows($rsResult_com1);
    $arr['total_comment'] = $total_comment;
    $lastID = $dbObj->update_data(TABLE_POST, 'id', $arr, md5($arr['post_id']));
    if ($lastID) {
        redirectURL("show-post.php?id=" . $arr['post_id']);
    }
}
Example #3
0
<?php

require_once "includes/application-top.php";
$dbObj = new DB();
$dbObj->fun_db_connect();
?>
 <?php 
$sql_like = "SELECT *  FROM  " . TABLE_LIKE . " where post_id=" . $_REQUEST['post_id'] . " and  user_id=" . $_REQUEST['user_id'];
$rsResult_like = $dbObj->fun_db_query($sql_like);
$like = $dbObj->fun_db_get_num_rows($rsResult_like);
if ($like == '') {
    $arr['post_id'] = $_REQUEST['post_id'];
    $arr['user_id'] = $_REQUEST['user_id'];
    $lastID = $dbObj->insert_data(TABLE_LIKE, $arr);
    $sql_like1 = "SELECT *  FROM  " . TABLE_LIKE . " where post_id=" . $_REQUEST['post_id'];
    $rsResult_like1 = $dbObj->fun_db_query($sql_like1);
    $like1 = $dbObj->fun_db_get_num_rows($rsResult_like1);
    $arr['total_like'] = $like1;
    $lastID = $dbObj->update_data(TABLE_POST, 'id', $arr, md5($_REQUEST['post_id']));
    echo $like1;
} else {
    $sql_like1 = "SELECT *  FROM  " . TABLE_LIKE . " where post_id=" . $_REQUEST['post_id'];
    $rsResult_like1 = $dbObj->fun_db_query($sql_like1);
    $like1 = $dbObj->fun_db_get_num_rows($rsResult_like1);
    echo $like1;
}
?>

                  
Example #4
0
<?php

require_once "includes/application-top.php";
$objAdmin = new Admins();
$objAdmin->fun_authenticate_admin();
$dbObj = new DB();
$dbObj->fun_db_connect();
//print_r($_POST);
if (count($_POST) > 0) {
    $sql_pwd = "SELECT * FROM " . TABLE_USERS . " where password='******'o_password']) . "' and id=" . $_POST['user_id'];
    $rsResult_pwd = $dbObj->fun_db_query($sql_pwd);
    $total = $dbObj->fun_db_get_num_rows($rsResult_pwd);
    if ($total) {
        if (@$_POST['n_password'] == @$_POST['c_password']) {
            $arr['password'] = md5($_POST['n_password']);
            $lastID = $dbObj->update_data(TABLE_USERS, 'id', $arr, md5($_POST['user_id']));
            $_SESSION['msg'] = '<span style=" color:green;font-size:13px;">Password changed</span>';
            redirectURL(SITE_ADMIN_URL . "logout.php");
        } else {
            $_SESSION['msg'] = "New password and Comform password are not matching";
            redirectURL(SITE_ADMIN_URL . "reset-password.php");
        }
    } else {
        $_SESSION['msg'] = "old password incorrect";
        redirectURL(SITE_ADMIN_URL . "reset-password.php");
    }
}
Example #5
0
<?php

require "PHPMailer/class.phpmailer.php";
require_once "includes/application-top.php";
$dbObj = new DB();
$dbObj->fun_db_connect();
$sqlSel_post = "SELECT * FROM " . TABLE_POST . " where id=" . $_REQUEST['id'];
$rsResult_post = $dbObj->fun_db_query($sqlSel_post);
$post = $dbObj->fun_db_fetch_rs_object($rsResult_post);
$sqlSel_post_like = "SELECT * FROM " . TABLE_LIKE . " where post_id=" . $post->id;
$rsResult_post_like = $dbObj->fun_db_query($sqlSel_post_like);
$like = $dbObj->fun_db_get_num_rows($rsResult_post_like);
$sqlSel_post_comment = "SELECT * FROM " . TABLE_COMMENT . " where post_id=" . $post->id . " and status=1 order by id desc";
$rsResult_post_comment = $dbObj->fun_db_query($sqlSel_post_comment);
$comment = $dbObj->fun_db_get_num_rows($rsResult_post_comment);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xml:lang="en">
<head>

	<title><?php 
echo prefix . " | Post Details";
?>
</title>
<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1">	
<link rel="stylesheet" href="css/style.css" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
	   $(document).ready(
				function(){
 $(".menu-icon").click(function(){