$txt = $purifier->purify($txt);
}
$txt = html2bbcode($txt);
-
+
$a->argv[1]=$user_info['screen_name']; //should be set to username?
-
+
$_REQUEST['hush']='yeah'; //tell wall_upload function to return img info instead of echo
require_once('mod/wall_upload.php');
$bebop = wall_upload_post($a);
-
+
//now that we have the img url in bbcode we can add it to the status and insert the wall item.
$_REQUEST['body']=$txt."\n\n".$bebop;
require_once('mod/item.php');
if (count($lastwall)>0){
$lastwall = $lastwall[0];
-
+
$in_reply_to_status_id = '';
$in_reply_to_user_id = '';
$in_reply_to_screen_name = '';
$in_reply_to_status_id=$lastwall['parent'];
$in_reply_to_user_id = $lastwall['reply_uid'];
$in_reply_to_screen_name = $lastwall['reply_author'];
- }
+ }
$status_info = array(
- 'text' => html2plain(bbcode($lastwall['body']), 0),
+ 'text' => html2plain(bbcode($lastwall['body'], false, false, true), 0),
'truncated' => false,
'created_at' => api_date($lastwall['created']),
'in_reply_to_status_id' => $in_reply_to_status_id,
$in_reply_to_status_id=$lastwall['parent'];
$in_reply_to_user_id = $lastwall['reply_uid'];
$in_reply_to_screen_name = $lastwall['reply_author'];
- }
+ }
$user_info['status'] = array(
'created_at' => api_date($lastwall['created']),
'id' => $lastwall['contact-id'],
- 'text' => html2plain(bbcode($lastwall['body']), 0),
+ 'text' => html2plain(bbcode($lastwall['body'], false, false, true), 0),
'source' => (($lastwall['app']) ? $lastwall['app'] : 'web'),
'truncated' => false,
'in_reply_to_status_id' => $in_reply_to_status_id,
$ret['text'] = bbcode($item['body']);
}
elseif ($_GET["getText"] == "plain") {
- $ret['text'] = html2plain(bbcode($item['body']), 0);
+ $ret['text'] = html2plain(bbcode($item['body'], false, false, true), 0);
}
}
else {
- $ret['text'] = $item['title']."\n".html2plain(bbcode($item['body']), 0);
+ $ret['text'] = $item['title']."\n".html2plain(bbcode($item['body'], false, false, true), 0);
}
if (isset($_GET["getUserObjects"]) && $_GET["getUserObjects"] == "false") {
unset($ret['sender']);
}
// Workaround for ostatus messages where the title is identically to the body
- $statusbody = trim(html2plain(bbcode($item['body']), 0));
+ $statusbody = trim(html2plain(bbcode($item['body'], false, false, true), 0));
$statustitle = trim($item['title']);
if (($statustitle != '') and (strpos($statusbody, $statustitle) !== false))
return($text);
}
+function bb_ShareAttributesSimple($match) {
+
+ $attributes = $match[1];
+
+ $author = "";
+ preg_match("/author='(.*?)'/ism", $attributes, $matches);
+ if ($matches[1] != "")
+ $author = html_entity_decode($matches[1],ENT_QUOTES,'UTF-8');
+
+ preg_match('/author="(.*?)"/ism', $attributes, $matches);
+ if ($matches[1] != "")
+ $author = $matches[1];
+
+ $profile = "";
+ preg_match("/profile='(.*?)'/ism", $attributes, $matches);
+ if ($matches[1] != "")
+ $profile = $matches[1];
+
+ preg_match('/profile="(.*?)"/ism', $attributes, $matches);
+ if ($matches[1] != "")
+ $profile = $matches[1];
+
+ $text = "<br />".html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').' <a href="'.$profile.'">'.$author."</a>: <br />»".$match[2]."«";
+
+ return($text);
+}
+
// BBcode 2 HTML was written by WAY2WEB.net
// extended to work with Mistpark/Friendica - Mike Macgirvin
-function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
+function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = false) {
$stamp1 = microtime(true);
$Text = str_replace("\r\n","\n", $Text);
// removing multiplicated newlines
-// $search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]");
-// $replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]");
-// do {
-// $oldtext = $Text;
-// $Text = str_replace($search, $replace, $Text);
-// } while ($oldtext != $Text);
-
+ if (get_config("system", "remove_multiplicated_lines")) {
+ $search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]");
+ $replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]");
+ do {
+ $oldtext = $Text;
+ $Text = str_replace($search, $replace, $Text);
+ } while ($oldtext != $Text);
+ }
$Text = str_replace(array("\r","\n"), array('<br />','<br />'), $Text);
$Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img src="$1" alt="' . t('Image/photo') . '" />', $Text);
// Shared content
- $Text = preg_replace_callback("/\[share(.*?)\](.*?)\[\/share\]/ism","bb_ShareAttributes",$Text);
+ if (!$simplehtml)
+ $Text = preg_replace_callback("/\[share(.*?)\](.*?)\[\/share\]/ism","bb_ShareAttributes",$Text);
+ else
+ $Text = preg_replace_callback("/\[share(.*?)\](.*?)\[\/share\]/ism","bb_ShareAttributesSimple",$Text);
$Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism",'<br/><img src="' .$a->get_baseurl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br />', $Text);
$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism",'<br/><img src="' .$a->get_baseurl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . '$1' . ' ' . t('Encrypted content') . '" /><br />', $Text);
max-width: 766px;
padding: 10px 10px 10px 10px;
background-color: white;
+ border-bottom: 1px solid lightgray;
+ border-right: 1px solid lightgray;
+ border-left: 1px solid lightgray;
}
/* wall item */
.tread-wrapper {
background: linear-gradient(top, #ffffff 0%,#ececf2 100%);*/
}
-#event-notice:hover, ul.tabs li .active, ul.tabs a:hover, #jot-preview-link:hover, .comment-edit-submit-wrapper .fakelink:hover {
+#event-notice:hover, #birthday-notice:hover, ul.tabs li .active, ul.tabs a:hover, #jot-preview-link:hover, .comment-edit-submit-wrapper .fakelink:hover {
color: black;
background-color: #e5e5e5;
text-decoration: none;