Ejemplo n.º 1
0
<?php

use_class('wall_post');
$id = tep_db_prepare_input($_GET['id']);
$wp = new wall_post($id);
if (isset($_POST['me_action'])) {
    if (isset($wp)) {
        if ($_POST['me_action'] == 'WALLPOSTREM') {
            $wpid = tep_db_prepare_input($_POST['wpid']);
            $wp = new wall_post($wpid);
            $wp->delete();
            echo utf8_encode('DELETED');
            exit;
        }
        $wp->comments->processPostAction($wp->posted_by_id, $wp->followers);
        $wp->followers->processPostAction();
        $wp->likes->processPostAction();
    }
}
$content .= '<div id="wp-page" style="width:500px;">';
$content .= $wp->draw();
$content .= '<div style="clear:both;">';
$content .= $wp->likes->drawLikes();
$content .= '<div>&nbsp</div>';
$content .= $wp->comments->drawComments($session_userinfo['username'], 'Post Comments');
$content .= $wp->followers->drawFollowersWithContainer('MIMS Followers');
$content .= '</div></div>';
$javascript .= $wp->comments->drawCommentsJSAction($wp->followers->JSReloader() . 'reloadList();');
$javascript .= $wp->followers->drawFollowersJSAction($session_userinfo['id'], 'reloadList();');
$javascript .= $wp->likes->drawLikesJSAction('reloadList();');
$javascript .= '
Ejemplo n.º 2
0
 public static function processPostAction()
 {
     global $session_userinfo;
     if (isset($_POST['me_action'])) {
         if ($_POST['me_action'] == 'WALLPOSTADD') {
             $user_id = tep_db_prepare_input($_POST['user_id']);
             $team = tep_db_prepare_input($_POST['team']);
             $message = htmlspecialchars(tep_db_prepare_input($_POST['message'], true));
             $wp = new wall_post();
             $wp->create($user_id, $team, $session_userinfo['id'], date('Y-m-d H:i:s'), $message);
             $ajaxResult = array();
             $ajaxResult['user_id'] = $wp->user_id;
             $ajaxResult['newpost'] = $wp->draw(true, true);
             ajaxReturn($ajaxResult);
             exit;
         } elseif ($_POST['me_action'] == 'WALLPOSTREM') {
             $wpid = tep_db_prepare_input($_POST['wpid']);
             $wp = new wall_post($wpid);
             $wp->delete();
             echo utf8_encode($wpid);
             exit;
         }
         objectSocialLinePostAction('wall_post');
     }
 }