if (!$wall_action) { $page = "error"; $smarty->assign('error_header', 639); $smarty->assign('error_message', 690706081); $smarty->assign('error_submit', 641); include "footer.php"; } $action_wall_owner = he_wall::get_wall_owner($action_info['action_object_owner'], $action_info['action_object_owner_id']); if ($user->user_exists && ($user->user_info['user_id'] == $wall_action['action_user_id'] || $user->user_info['user_id'] == $action_wall_owner->user_info['user_id'])) { he_wall::delete_action_notify($action_id); } $wall_action['owner'] = new se_user(array($wall_action['action_user_id'])); $total_comments = he_wall::total_comments($action_id); $per_click = $setting['setting_he_wall_comments_per_page']; $result = he_wall::get_paging_comments($action_id, $total_comments - $per_click, $per_click); $action_likes = he_wall::get_likes(array($action_id)); $count = $result['count']; $action_comments = $result['action_comments']; $per_click = $result['per_click']; $actiontype = he_wall::get_actiontype($action_id); $filename = he_wall::get_action_filename($action_id); if ($actiontype == 'wallpostphoto' && !$filename && $action_info['action_object_owner'] == 'group') { $media_ext = he_wall::get_action_media_ext($action_id, 'group'); $wall_action['action_media'][0]['actionmedia_path'] = str_replace('_thumb.jpg', ".{$media_ext}", $wall_action['action_media'][0]['actionmedia_path']); $group_info = he_wall::get_group_info($action_info['action_object_owner_id']); $group_info['media_id'] = he_wall::group_action_media_id($action_id); if ($global_plugins['group']) { $smarty->assign('group_info', $group_info); } } elseif ($actiontype == 'wallpostphoto' && !$filename && $action_info['action_object_owner'] == 'pages') { $wall_action['action_media'][0]['actionmedia_path'] = str_replace('_thumb', '', $wall_action['action_media'][0]['actionmedia_path']);
function he_wall_actions_display($wall_object, $wall_object_id, $first_id = false, $last_id = false) { global $user, $setting, $smarty; $setting_actions_visibility = 0; $setting_actions_actionsper = $setting['setting_actions_actionsonprofile']; if ($wall_object == 'user') { $owner = new se_user(array($wall_object_id)); $actiontype_ids = he_wall::get_actiontype_ids(); $actiontype_ids_str = implode(',', $actiontype_ids); $where_clause .= "\r\n IF ( \r\n se_actions.action_actiontype_id IN ({$actiontype_ids_str}),\r\n ( se_actions.action_object_owner='user' AND se_actions.action_object_owner_id='{$owner->user_info['user_id']}'),\r\n se_actions.action_user_id='{$owner->user_info['user_id']}'\r\n )\r\n "; } elseif ($wall_object == 'userhome') { $owner = new se_user(array($wall_object_id)); $setting_actions_visibility = 10; $setting_actions_actionsper = $setting['setting_actions_actionsperuser']; $where_clause .= "1"; } elseif ($wall_object == 'group') { $owner = new se_group($user->user_info['user_id'], $wall_object_id); $privacy_max = $owner->user_rank; $allow_post = (int) ($privacy_max != -1); $setting_actions_visibility = 10; $setting_actions_actionsper = $setting['setting_actions_actionsonprofile']; $where_clause .= "se_actions.action_object_owner='group' AND se_actions.action_object_owner_id='{$wall_object_id}'"; } elseif ($wall_object == 'pages') { $setting_actions_visibility = 10; $where_clause .= " se_actions.action_object_owner='pages' AND se_actions.action_object_owner_id='{$wall_object_id}'"; } else { $where_clause .= ''; } $hidden_action_ids = he_wall::get_hidden_actions($user->user_info['user_id']); if ($hidden_action_ids) { $where_clause .= $where_clause != '' ? " AND " : ''; $where_clause .= " se_actions.action_id NOT IN (" . implode(',', $hidden_action_ids) . ")"; } $wall_actions = he_wall::actions_display($setting_actions_visibility, $setting_actions_actionsper, $where_clause, $last_id, $first_id); $action_owner_ids = array(); foreach ($wall_actions as $key => $wall_action) { $action_owner_ids[] = $wall_action['action_user_id']; } $action_owner_ids = array_unique($action_owner_ids); $action_owners = he_wall::get_users($action_owner_ids); $action_ids = array(); foreach ($wall_actions as $key => $wall_action) { $action_ids[] = $wall_action['action_id']; $wall_actions[$key]['owner'] = $action_owners[$wall_action['action_user_id']]; } $action_likes = he_wall::get_likes($action_ids); $action_comments = he_wall::get_comments($action_ids); $video_actiontype_id = he_wall::video_actiontype_id(); $smarty->assign('wall_actions', $wall_actions); $smarty->assign('action_likes', $action_likes); $smarty->assign('action_comments', $action_comments); $smarty->assign('video_actiontype_id', $video_actiontype_id); return array('action_ids' => $action_ids, 'html' => he_wall_include_footer_logic('he_wall_actions.tpl')); }