Code:
elseif ( $task == 'post_action' )
{
$first_action_id = isset($_POST['first_action_id']) ? (int)$_POST['first_action_id'] : false;
$action_privacy_level = isset($_POST['action_privacy_level']) ? (int)$_POST['action_privacy_level'] : 63;
$text = isset($_POST['text']) ? trim($_POST['text']) : '';
$new_action_id = he_wall::new_action_id();
$ctext = he_wall_format_text($text);
if ($prof_owner == $real_owner)
{
$text = he_wall_format_text($text);
}
else
{
$text = " » <a href='profile.php?user=".$prof_owner."'>".$myownprof."</a>: ".$ctext;
}
he_wall::add_action( $action_object_owner, $wall_object_id, $text, $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);
}
elseif ( $task == 'share_photo' )
{
$headers_sent = true;
$new_action_id = he_wall::new_action_id();
$text = isset($_POST['text']) ? trim($_POST['text']) : '';
$privacy_level = isset($_POST['wall_action_privacy']) ? (int)$_POST['wall_action_privacy'] : 63;
$upload_result = array();
if ( $wall_object == 'group' )
{
$upload_result = he_wall_group_photo_upload($wall_object_id, $text, $new_action_id);
}
elseif ( isset($global_plugins['album']) && $setting['setting_he_wall_photo_sync'] )
{
$upload_result = he_wall_photo_upload($text, $new_action_id);
}
else
{
$upload_result = he_wall_custom_photo_upload($new_action_id);
}
if ( $upload_result['result'] == 1 )
{
$ctext = he_wall_format_text($text);
if ($prof_owner == $real_owner)
{
$text = he_wall_format_text($text);
}
else
{
$text = " posted a picture on <a href='profile.php?user=".$prof_owner."'>".$myownprof."'s</a> profile<br />".$ctext;
}
$replace_arr = array( $user->user_info['user_username'], $user->user_displayname, $text );
$action_media = array();
$action_media[] = array(
'media_link' => $url->url_base . 'wall_action.php?id=' . $new_action_id,
'media_path' => $upload_result['media_path'],
'media_width' => $upload_result['media_width'],
'media_height' => $upload_result['media_height']
);
$actions->actions_add($user, 'wallpostphoto', $replace_arr, $action_media, 0, true, $action_object_owner, $wall_object_id, $privacy_level);
he_wall::new_post_notify($wall_object, $wall_object_id, $new_action_id);
$result = array( 'result' => 1 );
}
else
{
$result = array( 'result' => 0, 'message' => $upload_result['error'] );
}
}
elseif ( $task == 'share_music' )
{
$headers_sent = true;
$text = isset($_POST['text']) ? trim($_POST['text']) : '';
$privacy_level = isset($_POST['wall_action_privacy']) ? (int)$_POST['wall_action_privacy'] : 63;
$new_action_id = he_wall::new_action_id();
$upload_result = array();
if ( isset($global_plugins['music']) && $setting['setting_he_wall_music_sync'] )
{
$upload_result = he_wall_music_upload();
}
else
{
$upload_result = he_wall_custom_music_upload($new_action_id);
}
if ( $upload_result['result'] == 1 )
{
$ctext = he_wall_format_text($text);
if ($prof_owner == $real_owner)
{
$text = he_wall_format_text($text);
}
else
{
$text = " uploaded a music to <a href='profile.php?user=".$prof_owner."'>".$myownprof."'s</a> profile<br />".$ctext;
}
$player = '<div class="wall_music_container"><div id="action_music_' . $new_action_id . '" class="wall_music_player">' .
'<script type="text/javascript">/* <![CDATA[ */' .
'AudioPlayer.embed("action_music_' . $new_action_id . '", ' .
'{soundFile: "' . $upload_result['file_url'] . '",titles: "' . $upload_result['title'] . '"});' .
'/* ]]> */</script>' .
'</div></div>';
$replace_arr = array( $user->user_info['user_username'], $user->user_displayname, $text, $upload_result['title'], $player );
$actions->actions_add($user, 'wallpostmusic', $replace_arr, array(), 0, false, $action_object_owner, $wall_object_id, $privacy_level);
he_wall::new_post_notify($wall_object, $wall_object_id, $new_action_id);
if ( isset($upload_result['music_id']) && $upload_result['music_id'] )
{
he_wall::add_music_action_link($user->user_info['user_id'], $new_action_id, $upload_result['music_id']);
}
$result = array( 'result' => 1 );
}
else
{
$result = array( 'result' => 0, 'message' => $upload_result['error'] );
}
}
elseif ( $task == 'new_actions' )
{
$first_action_id = isset($_POST['first_action_id']) ? (int)$_POST['first_action_id'] : false;
$result = he_wall_actions_display($wall_object, $wall_object_id, $first_action_id);
}
elseif ( $task == 'post_link' )
{
$first_action_id = isset($_POST['first_action_id']) ? (int)$_POST['first_action_id'] : false;
$action_privacy_level = isset($_POST['action_privacy_level']) ? (int)$_POST['action_privacy_level'] : 63;
$text = isset($_POST['text']) ? trim($_POST['text']) : '';
$link = isset($_POST['link']) ? trim($_POST['link']) : '';
$new_action_id = he_wall::new_action_id();
if ( strstr($link, 'https://') !== false )
{
$link_label = str_replace('https://', '', $link);
$link_url = 'https://' . $link_label;
}
else
{
$link_label = str_replace('http://', '', $link);
$link_url = 'http://' . $link_label;
}
$ctext = he_wall_format_text($text);
if ($prof_owner == $real_owner)
{
$text = he_wall_format_text($text);
}
else
{
$text = " posted a link on <a href='profile.php?user=".$prof_owner."'>".$myownprof."'s</a> profile<br />".$ctext;
}
$replace_arr = array( $user->user_info['user_username'], $user->user_displayname, $text, $link_url, $link_label );
$actions->actions_add($user, 'wallpostlink', $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);
}
elseif ( $task == 'post_video' )
{
$first_action_id = isset($_POST['first_action_id']) ? (int)$_POST['first_action_id'] : false;
$action_privacy_level = isset($_POST['action_privacy_level']) ? (int)$_POST['action_privacy_level'] : 63;
$text = isset($_POST['text']) ? trim($_POST['text']) : '';
$video_provider = isset($_POST['video_provider']) ? trim($_POST['video_provider']) : '';
$video_url = isset($_POST['video_url']) ? trim($_POST['video_url']) : '';
if ( $video_provider != 'youtube' && $video_provider != 'vimeo' )
{
$result = array( 'result' => 0, 'message' => SE_Language::get(690706072) );
}
elseif ( $video_url == '' )
{
$result = array( 'result' => 0, 'message' => SE_Language::get(690706073) );
}
else
{
$new_action_id = he_wall::new_action_id();
if ( $video_provider == 'vimeo' )
{
$upload_result = he_wall_vimeo_video_upload($new_action_id, $video_url);
}
elseif ( $video_provider == 'youtube' )
{
if ( isset($global_plugins['video']) && $setting['setting_he_wall_video_sync'] )
{
$upload_result = he_wall_youtube_video_upload($new_action_id, $video_url, $action_privacy_level);
}
else
{
$upload_result = he_wall_youtube_video_custom_upload($new_action_id, $video_url);
}
}
if ( $upload_result['result'] == 1 )
{
$ctext = he_wall_format_text($text);
if ($prof_owner == $real_owner)
{
$text = he_wall_format_text($text);
}
else
{
$text = " posted a video on <a href='profile.php?user=".$prof_owner."'>".$myownprof."'s</a> profile<br />".$ctext;
}
$video_player = '<a href="javascript://" onclick="he_wall_show_player(this);" class="photo_cont video_thumb">' .
'<span class="video_length">' . $upload_result['video_length'] . '</span>' .
'<img class="recentaction_media" src="' . $upload_result['media_src'] . '"/></a>' .
'<div class="video_cont display_none">' . $upload_result['player'] . '</div>';
$video_info = '<div class="video_info"><a href="' . $upload_result['video_url'] . '" class="video_title">' . $upload_result['title'] .
'</a><div class="video_desc">' . he_wall_format_text($upload_result['description']) . '</div></div>';
$replace_arr = array( $user->user_info['user_username'], $user->user_displayname, $text, $video_player, $video_info );
$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;
}
}
}