- $params = array(
- 'format' => 'html',
- 'tweet' => 'off',
- 'tags' => $tags);
-
- if (($link != '') and $video) {
- $params['type'] = "video";
- $params['embed'] = $link;
- if ($title != '')
- $params['caption'] = '<h1><a href="'.$link.'">'.$title.
- "</a></h1><p>".bbcode($body, false, false)."</p>";
- else
- $params['caption'] = bbcode($body, false, false);
- } else if (($link != '') and !$video) {
- $params['type'] = "link";
- $params['title'] = $title;
- $params['url'] = $link;
- $params['description'] = bbcode($b["body"], false, false);
- } else {
- $params['type'] = "text";
- $params['title'] = $title;
- $params['body'] = bbcode($b['body'], false, false);
+ if (isset($siteinfo["text"]))
+ $body = $siteinfo["text"];
+ else
+ $body = bb_remove_share_information($b["body"]);
+
+ switch ($siteinfo["type"]) {
+ case "photo":
+ $params['type'] = "photo";
+ $params['caption'] = bbcode($body, false, false, 4);
+
+ if (isset($siteinfo["url"]))
+ $params['link'] = $siteinfo["url"];
+
+ $params['source'] = $siteinfo["image"];
+ break;
+ case "link":
+ $params['type'] = "link";
+ $params['title'] = $title;
+ $params['url'] = $siteinfo["url"];
+ $params['description'] = bbcode($body, false, false, 4);
+ break;
+ case "audio":
+ $params['type'] = "audio";
+ $params['external_url'] = $siteinfo["url"];
+ $params['caption'] = bbcode($body, false, false, 4);
+ break;
+ case "video":
+ $params['type'] = "video";
+ $params['embed'] = $siteinfo["url"];
+ $params['caption'] = bbcode($body, false, false, 4);
+ break;
+ default:
+ $params['type'] = "text";
+ $params['title'] = $title;
+ $params['body'] = bbcode($b['body'], false, false, 4);
+ break;