$replace_arr = array($user->user_info['user_username'], $user->user_displayname, $text, $video_player, $video_info, he_wall::get_wall_link($wall_object, $wall_object_id)); $actions->actions_add($user, 'wallpostvideo', $replace_arr, array(), 0, false, $action_object_owner, $wall_object_id, $action_privacy_level); he_wall::new_post_notify($wall_object, $wall_object_id, $new_action_id); $result = he_wall_actions_display($wall_object, $wall_object_id, $first_action_id); $result['result'] = 1; } else { $result = $upload_result; } } } elseif ($task == 'paging') { $action_id = $_GET['action_id']; $count = $_GET['count']; $total_comments = he_wall::total_comments($action_id); $per_click = $setting['setting_he_wall_comments_per_page']; $per_click = $total_comments - $count - $per_click < 0 ? $total_comments - $count : $setting['setting_he_wall_comments_per_page']; $result_2 = he_wall::get_paging_comments($action_id, $total_comments - $count - $per_click, $per_click); $count = $result_2['count']; $action_comments = $result_2['action_comments']; ksort($action_comments); $smarty->assign('action_comments', $action_comments); $smarty->assign('action_id', $action_id); $result = array('action_id' => $action_id, 'count' => $count, 'html' => he_wall_include_footer_logic('he_wall_comments.tpl')); } // CONSTRUCT AND OUTPUT JSON if (!$headers_sent) { header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
function delete_action_notify($action_id) { if (!$action_id) { return false; } $notifytype_ids = he_wall::get_wall_noptifytype_ids(); if (!$notifytype_ids) { return false; } $notifytype_str = implode(',', $notifytype_ids); $sql = he_database::placeholder("DELETE FROM `se_notifys` " . "WHERE `notify_object_id`=? AND `notify_notifytype_id` IN ({$notifytype_str})", $action_id); he_database::query($sql); }
function he_wall_youtube_video_upload($new_action_id, $video_url, $video_privacy_level) { global $setting, $user, $url; if (!$user->level_info['level_youtube_allow']) { return array('result' => 0, 'message' => SE_Language::get(690706078)); } $video = new se_video($user->user_info['user_id'], 0); $total_videos = $video->video_total(); if ($total_videos >= $user->level_info['level_video_maxnum']) { return array('result' => 0, 'message' => SE_Language::get(5500201)); } // GET PRIVACY SETTINGS $level_video_privacy = unserialize($user->level_info['level_video_privacy']); rsort($level_video_privacy); $level_video_comments = unserialize($user->level_info['level_video_comments']); rsort($level_video_comments); $video->video_info = array('video_title' => '', 'video_desc' => '', 'video_search' => true, 'video_privacy' => $video_privacy_level, 'video_comments' => $level_video_comments[0]); $video_code = extract_youtube_code($video_url); $video_info_json = @file_get_contents("http://gdata.youtube.com/feeds/api/videos/{$video_code}?alt=json"); if ($video_info_json === false) { return array('result' => 0, 'message' => SE_Language::get(690706074)); } $video_info = $video_info_json ? json_decode($video_info_json, true) : array(); $video_title = isset($video_info['entry']['title']['$t']) ? $video_info['entry']['title']['$t'] : ''; $video_description = isset($video_info['entry']['content']['$t']) ? $video_info['entry']['content']['$t'] : ''; $video_duration = isset($video_info['entry']['media$group']['yt$duration']['seconds']) ? $video_info['entry']['media$group']['yt$duration']['seconds'] : ''; $video_thumb = isset($video_info['entry']['media$group']['media$thumbnail'][3]) ? $video_info['entry']['media$group']['media$thumbnail'][3] : ''; $video_thumb_src = $video_thumb['url']; $thumb_dimensions = array($video_thumb['width'], $video_thumb['height']); $video_thumb_dimensions = array($setting['setting_video_thumb_width'], $setting['setting_video_thumb_height']); $video_id = he_wall::add_youtube_video($video_code, censor(str_replace(array("\r", "\n"), "<br>", $video_title)), censor(str_replace(array("\r", "\n"), "<br>", $video_description)), true, $video_privacy_level, $level_video_comments[0]); he_wall::add_video_action_link($user->user_info['user_id'], $new_action_id, $video_id); $video_directory = $video->video_dir($user->user_info['user_id'], true); $destination = $video_directory . $video_id . '_thumb.jpg'; $video_result = he_wall_update_video_thumb($video_thumb_src, $destination, $thumb_dimensions, $video_thumb_dimensions); $video_result['result'] = 1; $video_result['title'] = $video_title; $video_result['description'] = $video_description; $video_result['media_src'] = $url->url_base . substr($destination, 2); $video_result['video_url'] = $url->url_base . 'wall_action.php?id=' . $new_action_id; $video_result['video_length'] = he_wall_format_duration($video_duration); $width = $setting['setting_he_wall_video_player_width']; $height = $setting['setting_he_wall_video_player_height']; $video_result['player'] = '<object width="' . $width . '" height="' . $height . '"><param name="wmode" value="transparent"></param><param name="movie" value="http://www.youtube.com/v/' . $video_code . '&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed wmode="transparent" src="http://www.youtube.com/v/' . $video_code . '&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="' . $width . '" height="' . $height . '"></embed></object>'; return $video_result; }
$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']); } elseif ($actiontype == 'wallpostphoto' && !$filename) { $media_ext = he_wall::get_action_media_ext($action_id); $wall_action['action_media'][0]['actionmedia_path'] = str_replace('_thumb.jpg', ".{$media_ext}", $wall_action['action_media'][0]['actionmedia_path']); $album_id = he_wall::get_wall_album($wall_action['action_user_id']); $album_info = he_wall::get_wall_album_info($album_id); $global_page_title[0] = 1000155; $global_page_title[1] = $wall_action['owner']->user_displayname; $global_page_title[2] = $album_info['album_title']; $global_page_description[0] = 1000156; $global_page_description[1] = $album_info['album_desc']; if ($global_plugins['album']) { $smarty->assign('album_info', $album_info); } } $smarty->assign('referrer', $_SERVER['HTTP_REFERER']); $smarty->assign('total_comments', $total_comments); $smarty->assign('count', $count); $smarty->assign('actiontype', $actiontype); $smarty->assign('filename', $filename); $smarty->assign('action_id', $action_id);
if ($page == 'admin_viewalbums' && $task == 'deletealbum') { $album_id = isset($_GET['album_id']) ? (int) $_GET['album_id'] : 0; $user_id = he_wall::get_album_owner($album_id); he_wall::delete_wall_album($user_id, $album_id); } if ($page == 'admin_viewalbums' && $task == 'delete') { foreach ($_POST as $var_key => $value) { if (strstr($var_key, 'delete_album_') === false) { continue; } $album_id = substr($var_key, 13); $user_id = he_wall::get_album_owner($album_id); he_wall::delete_wall_album($user_id, $album_id); } } if ($page == 'admin_viewvideos' && $task == 'deletevideo') { $video_id = isset($_GET['video_id']) ? (int) $_GET['video_id'] : 0; $video_id = isset($_POST['video_id']) && !$video_id ? (int) $_POST['video_id'] : $video_id; $user_id = he_wall::get_video_owner($video_id); he_wall::delete_video_action($user_id, $video_id); } if ($page == 'admin_viewvideos' && $task == 'delete') { foreach ($_POST as $var_key => $value) { if (strstr($var_key, 'delete_video_') === false) { continue; } $video_id = substr($var_key, 13); $user_id = he_wall::get_video_owner($video_id); he_wall::delete_video_action($user_id, $video_id); } }