Example #1
0
<style>
p.msg_wrap { word-wrap:break-word; }
</style>
<?php 
ob_start();
session_start();
$user_id = $_SESSION['USER_ID'];
if (!empty($_POST['topic']) && !empty($_POST['act_id'])) {
    include_once 'wall_includes/config.php';
    include_once 'wall_includes/security.php';
    include_once 'wall_includes/smileys.php';
    //clean the comment message
    $topic = clean(mysql_real_escape_string($_POST['topic']));
    $clientids = mysql_real_escape_string($_POST['clientids']);
    $topic = special_chars($topic);
    $time = time();
    $post_id = $_POST['act_id'];
    //insert into wall table
    $query = mysql_query("INSERT INTO `topic` (`topic`, `pid`, `users_id`, `client_id`, `topic_date`) VALUES ('{$topic}', '{$post_id}', '{$user_id}', '{$clientids}', '{$time}')") or die(mysql_error());
    $ins_id = mysql_insert_id();
    if ($ins_id != "") {
        $topquery = mysql_query("UPDATE `posts` SET `tid` = '{$ins_id}' WHERE `pid` = '{$post_id}'") or die(mysql_error());
    }
    $sql_usernames = "SELECT * FROM crm_users WHERE users_id = '{$user_id}'";
    $res_usernames = mysql_query($sql_usernames);
    $rows = mysql_num_rows($res_usernames);
    $fnames = stripslashes(mysql_result($res_usernames, 0, 'first_name'));
    $lnames = stripslashes(mysql_result($res_usernames, 0, 'last_name'));
    $fulln = ucfirst($fnames) . " " . ucfirst($lnames);
    ?>
<li id="li-comment-<?php 
Example #2
0
<style>
p.msg_wrap { word-wrap:break-word; }
</style>
<?php 
ob_start();
session_start();
$user_id = $_SESSION['USER_ID'];
if (!empty($_POST['comment']) && !empty($_POST['act_id'])) {
    include_once 'wall_includes/config.php';
    include_once 'wall_includes/security.php';
    include_once 'wall_includes/smileys.php';
    //clean the comment message
    $comment = clean(mysql_real_escape_string($_POST['comment']));
    $clientids = mysql_real_escape_string($_POST['clientids']);
    $comment = special_chars($comment);
    $time = time();
    $post_id = $_POST['act_id'];
    //insert into wall table
    $query = mysql_query("INSERT INTO `comments` (`comment`, `cpid`, `users_id`, `client_id`, `commented_date`) VALUES ('{$comment}', '{$post_id}', '{$user_id}', '{$clientids}', '{$time}')") or die(mysql_error());
    $ins_id = mysql_insert_id();
    $sql_usernames = "SELECT * FROM crm_users WHERE users_id = '{$user_id}'";
    $res_usernames = mysql_query($sql_usernames);
    $rows = mysql_num_rows($res_usernames);
    $fnames = stripslashes(mysql_result($res_usernames, 0, 'first_name'));
    $lnames = stripslashes(mysql_result($res_usernames, 0, 'last_name'));
    $fulln = ucfirst($fnames) . " " . ucfirst($lnames);
    ?>
<li id="li-comment-<?php 
    echo $ins_id;
    ?>
">
Example #3
0
<style>
p.msg_wrap { word-wrap:break-word; }
</style>
<?php 
ob_start();
session_start();
$user_id = $_SESSION['USER_ID'];
error_reporting(0);
if (!empty($_POST['message'])) {
    include_once 'wall_includes/config.php';
    include_once 'wall_includes/security.php';
    include_once 'wall_includes/smileys.php';
    $clientids = mysql_real_escape_string($_POST['clientids']);
    $message = clean(mysql_real_escape_string($_POST['message']));
    $top_id = mysql_real_escape_string($_POST['top_id']);
    $message = special_chars($message);
    $time = time();
    //getting image link
    if (!empty($_POST['pic_url'])) {
        $image = strip_tags($_POST['pic_url']);
    } else {
        $image = '';
    }
    //getting video link
    if (!empty($_POST['y_link'])) {
        $video = fix_url(strip_tags($_POST['y_link']));
    } else {
        $video = '';
    }
    //insert into wall table
    $query = mysql_query("INSERT INTO `posts` (`desc`, `image_url`, `vid_url`,`users_id`,`client_id`, `tid`, `date`) VALUES ('{$message}', '{$image}', '{$video}','{$user_id}', '{$clientids}', '', '{$time}')") or die(mysql_error());