';
+ . L10n::t('Post to libertree') . '';
}
}
@@ -47,7 +51,7 @@ function libertree_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */
- $a->page['htmlhead'] .= '' . "\r\n";
+ $a->page['htmlhead'] .= '' . "\r\n";
/* Get the current state of our config variables */
@@ -66,36 +70,36 @@ function libertree_settings(&$a,&$s) {
/* Add some HTML to the existing form */
$s .= '';
- $s .= '
'. t('libertree Export').'
';
+ $s .= '
'. L10n::t('libertree Export').'
';
$s .= '';
$s .= '
';
$s .= '';
- $s .= '
'. t('libertree Export').'
';
+ $s .= '
'. L10n::t('libertree Export').'
';
$s .= '';
$s .= '
';
- $s .= '';
+ $s .= '';
$s .= '';
$s .= '
';
$s .= '
';
- $s .= '';
+ $s .= '';
$s .= '';
$s .= '
';
$s .= '
';
- $s .= '';
+ $s .= '';
$s .= '';
$s .= '
';
$s .= '
';
- $s .= '';
+ $s .= '';
$s .= '';
$s .= '
';
/* provide a submit button */
- $s .= '
';
+ $s .= '';
}
@@ -169,7 +173,7 @@ function libertree_send(&$a,&$b) {
// Dont't post if the post doesn't belong to us.
// This is a check for forum postings
- $self = dba::selectFirst('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
+ $self = DBA::selectFirst('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
if ($b['contact-id'] != $self['id']) {
return;
}
@@ -177,14 +181,12 @@ function libertree_send(&$a,&$b) {
$ltree_api_token = PConfig::get($b['uid'],'libertree','libertree_api_token');
$ltree_url = PConfig::get($b['uid'],'libertree','libertree_url');
$ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token";
- $ltree_source = $a->get_hostname();
+ $ltree_source = $a->getHostName();
if ($b['app'] != "")
$ltree_source .= " (".$b['app'].")";
if($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) {
-
- require_once('include/bb2diaspora.php');
$tag_arr = [];
$tags = '';
$x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER);
@@ -216,7 +218,7 @@ function libertree_send(&$a,&$b) {
} while ($oldbody != $body);
// convert to markdown
- $body = bb2diaspora($body, false, false);
+ $body = BBCode::toMarkdown($body, false);
// Adding the title
if(strlen($title))
@@ -229,9 +231,7 @@ function libertree_send(&$a,&$b) {
// 'token' => $ltree_api_token
];
- $result = post_url($ltree_blog,$params);
+ $result = Network::post($ltree_blog, $params)->getBody();
logger('libertree: ' . $result);
-
}
}
-