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> </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 .= ' function reloadList() { top.window.reloadKPItab(); } $(".wall-post .del-text").click(function() { var wpid_raw = $(this).parents(".wall-post").attr("id").split("-");
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'); } }