return str_replace($match[0],'<div class="map" >' . generate_named_map($match[1]) . '</div>', $match[0]);
}
-function bb_attachment($Text, $plaintext = false, $tryoembed = true) {
+function bb_attachment($Text, $simplehtml = false, $tryoembed = true) {
$Text = preg_replace_callback("/(.*?)\[attachment(.*?)\](.*?)\[\/attachment\]/ism",
- function ($match) use ($plaintext, $tryoembed){
+ function ($match) use ($simplehtml, $tryoembed){
$attributes = $match[2];
$image = "";
}
- if ($plaintext)
+ if ($simplehtml == 7)
+ $text = sprintf('<a href="%s" title="%s" class="attachment thumbnail" rel="nofollow external">%s</a>',
+ $url, $title, $title);
+ elseif (($simplehtml != 4) AND ($simplehtml != 0))
$text = sprintf('<a href="%s" target="_blank">%s</a><br>', $url, $title);
else {
$text = sprintf('<span class="type-%s">', $type);
}
// Handle attached links or videos
- $Text = bb_attachment($Text, ($simplehtml != 4) AND ($simplehtml != 0), $tryoembed);
+ $Text = bb_attachment($Text, $simplehtml, $tryoembed);
$Text = str_replace(array("\r","\n"), array('<br />','<br />'), $Text);
require_once('include/ostatus_conversation.php');
require_once('include/threads.php');
require_once('include/socgraph.php');
+require_once('include/plaintext.php');
require_once('mod/share.php');
function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0, $forpubsub = false) {
if ($item['title'] != "")
$htmlbody = "[b]".$item['title']."[/b]\n\n".$htmlbody;
- $htmlbody = bbcode(bb_remove_share_information($htmlbody), false, false, 7);
+ //$htmlbody = bbcode(bb_remove_share_information($htmlbody), false, false, 7);
+ $htmlbody = bbcode($htmlbody, false, false, 7);
$o .= '<id>' . xmlify($item['uri']) . '</id>' . "\r\n";
$o .= '<title>' . xmlify($item['title']) . '</title>' . "\r\n";
}
}
+ $o .= item_get_attachment($item);
+
$o .= item_getfeedattach($item);
$mentioned = get_mentions($item);
return $ret;
}
+function item_get_attachment($item) {
+ $o = "";
+ $siteinfo = get_attached_data($item["body"]);
+
+ switch($siteinfo["type"]) {
+ case 'link':
+ $o = '<link rel="enclosure" href="'.xmlify($siteinfo["url"]).'" type="text/html; charset=UTF-8" length="" title="'.xmlify($siteinfo["title"]).'"/>'."\r\n";
+ break;
+ case 'photo':
+ $imgdata = get_photo_info($siteinfo["image"]);
+ $o = '<link rel="enclosure" href="'.xmlify($siteinfo["image"]).'" type="'.$imgdata["mime"].'" length="'.$imgdata["size"].'"/>'."\r\n";
+ break;
+ case 'video':
+ $o = '<link rel="enclosure" href="'.xmlify($siteinfo["url"]).'" type="text/html; charset=UTF-8" length="" title="'.xmlify($siteinfo["title"]).'"/>'."\r\n";
+ break;
+ default:
+ break;
+ }
+
+ return $o;
+}
+
function item_getfeedattach($item) {
$ret = '';
$arr = explode('[/attach],',$item['attach']);
return array();
// Set the start and end date to the beginning of the month
- $dnow = substr($dnow,0,8).'01';
+ $dnow = substr($dnow,0,8).'01';
$dthen = substr($dthen,0,8).'01';
$ret = array();
$str = day_translate(datetime_convert('','',$dnow,'F'));
if(! $ret[$dyear])
$ret[$dyear] = array();
- $ret[$dyear][] = array($str,$end_month,$start_month);
+ $ret[$dyear][] = array($str,$end_month,$start_month);
$dnow = datetime_convert('','',$dnow . ' -1 month', 'Y-m-d');
}
return $ret;
if(! $visible_years)
$visible_years = 5;
- $ret = list_post_dates($uid,$wall);
+ $ret = list_post_dates($uid,$wall);
if(! count($ret))
return $o;
- $cutoff_year = intval(datetime_convert('',date_default_timezone_get(),'now','Y')) - $visible_years;
+ $cutoff_year = intval(datetime_convert('',date_default_timezone_get(),'now','Y')) - $visible_years;
$cutoff = ((array_key_exists($cutoff_year,$ret))? true : false);
$o = replace_macros(get_markup_template('posted_date_widget.tpl'),array(
'$cutoff' => $cutoff,
'$url' => $url,
'$dates' => $ret,
- '$showmore' => t('show more')
+ '$showmore' => t('show more')
));
return $o;