- unset($_REQUEST);
- $_REQUEST["type"] = "wall";
- $_REQUEST["api_source"] = true;
- $_REQUEST["profile_uid"] = $uid;
- //$_REQUEST["source"] = "Twitter";
- $_REQUEST["source"] = $post->source;
- $_REQUEST["extid"] = NETWORK_TWITTER;
-
- //$_REQUEST["date"] = $post->created_at;
-
- $_REQUEST["title"] = "";
-
- if (is_object($post->retweeted_status)) {
-
- $_REQUEST['body'] = $post->retweeted_status->text;
-
- $picture = "";
-
- // media
- if (is_array($post->retweeted_status->entities->media)) {
- foreach($post->retweeted_status->entities->media AS $media) {
- switch($media->type) {
- case 'photo':
- //$_REQUEST['body'] = str_replace($media->url, "\n\n[img]".$media->media_url_https."[/img]\n", $_REQUEST['body']);
- //$has_picture = true;
- $_REQUEST['body'] = str_replace($media->url, "", $_REQUEST['body']);
- $picture = $media->media_url_https;
- break;
- }
- }
- }
-
- $converted = twitter_expand_entities($a, $_REQUEST['body'], $post->retweeted_status, true, $picture);
- $_REQUEST['body'] = $converted["body"];
-
- $_REQUEST['body'] = "[share author='".$post->retweeted_status->user->name.
- "' profile='https://twitter.com/".$post->retweeted_status->user->screen_name.
- "' avatar='".$post->retweeted_status->user->profile_image_url_https.
- "' link='https://twitter.com/".$post->retweeted_status->user->screen_name."/status/".$post->retweeted_status->id_str."']".
- $_REQUEST['body'];
- $_REQUEST['body'] .= "[/share]";
- } else {
- $_REQUEST["body"] = $post->text;
-
- $picture = "";
-
- if (is_array($post->entities->media)) {
- foreach($post->entities->media AS $media) {
- switch($media->type) {
- case 'photo':
- //$_REQUEST['body'] = str_replace($media->url, "\n\n[img]".$media->media_url_https."[/img]\n", $_REQUEST['body']);
- //$has_picture = true;
- $_REQUEST['body'] = str_replace($media->url, "", $_REQUEST['body']);
- $picture = $media->media_url_https;
- break;
- }
- }
- }
-
- $converted = twitter_expand_entities($a, $_REQUEST["body"], $post, true, $picture);
- $_REQUEST['body'] = $converted["body"];
- }
-
- if (is_string($post->place->name))
- $_REQUEST["location"] = $post->place->name;
-
- if (is_string($post->place->full_name))
- $_REQUEST["location"] = $post->place->full_name;