$recycle = html_entity_decode("◌ ", ENT_QUOTES, 'UTF-8');
$body = preg_replace( '/'.$recycle.'\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', "\n", $body);
+ // remove the share element
+ $body = preg_replace("/\[share(.*?)\](.*?)\[\/share\]/ism","\n\n$2\n\n",$body);
+
// At first convert the text to html
$html = bbcode($body, false, false);
$image = $msgarr["image"];
if ($image != "") {
$imagedata = file_get_contents($image);
- $tempfile = tempnam("", "upload");
+ $tempfile = tempnam(get_config("system","temppath"), "upload");
file_put_contents($tempfile, $imagedata);
$postdata = array("status"=>$msg, "media"=>"@".$tempfile);
} else
//$result = $dent->post('statuses/update', array('status' => $msg));
$result = $dent->post('statuses/update', $postdata);
logger('statusnet_post send, result: ' . print_r($result, true).
- "\nmessage: ".$msg, LOGGER_DEBUG."\nOriginal post: ".print_r($b)."\nPost Data: ".print_r($postdata));
+ "\nmessage: ".$msg, LOGGER_DEBUG."\nOriginal post: ".print_r($b, true)."\nPost Data: ".print_r($postdata, true));
if ($result->error) {
logger('Send to StatusNet failed: "' . $result->error . '"');
}
);
- $t = file_get_contents( dirname(__file__). "/admin.tpl" );
- $o = replace_macros($t, array(
+ $t = get_markup_template( "admin.tpl", "addon/statusnet/" );
+
+ $includes = array(
+ '$field_input' => 'field_input.tpl',
+ '$field_checkbox' => 'field_checkbox.tpl',
+ );
+ $includes = set_template_includes($a->theme['template_engine'], $includes);
+
+ $o = replace_macros($t, $includes + array(
'$submit' => t('Submit'),
'$sites' => $sitesform,