lotsa little fixes
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once('include/Scrape.php');
|
||||
|
||||
function acctlink_init(&$a) {
|
||||
|
||||
if(x($_GET,'addr')) {
|
||||
$addr = trim($_GET['addr']);
|
||||
$res = probe_url($addr);
|
||||
//logger('acctlink: ' . print_r($res,true));
|
||||
if($res['url']) {
|
||||
goaway($res['url']);
|
||||
killme();
|
||||
}
|
||||
}
|
||||
}
|
||||
11
mod/apps.php
11
mod/apps.php
@@ -1,18 +1,17 @@
|
||||
<?php
|
||||
|
||||
function apps_content(&$a) {
|
||||
$title = t('Applications');
|
||||
|
||||
if(count($a->apps)==0)
|
||||
$apps = $a->get_apps();
|
||||
|
||||
if(count($apps) == 0)
|
||||
notice( t('No installed applications.') . EOL);
|
||||
|
||||
|
||||
$tpl = get_markup_template("apps.tpl");
|
||||
return replace_macros($tpl, array(
|
||||
'$title' => $title,
|
||||
'$apps' => $a->apps,
|
||||
'$title' => t('Applications'),
|
||||
'$apps' => $apps,
|
||||
));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
/* identi.ca -> friendica items permanent-url compatibility */
|
||||
|
||||
function notice_init(&$a){
|
||||
$id = $a->argv[1];
|
||||
$r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d",
|
||||
intval($id)
|
||||
);
|
||||
if (count($r)){
|
||||
$nick = $r[0]['nickname'];
|
||||
$url = $a->get_baseurl()."/display/$nick/$id";
|
||||
goaway($url);
|
||||
} else {
|
||||
$a->error = 404;
|
||||
notice( t('Item not found.') . EOL);
|
||||
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
@@ -1,28 +1,30 @@
|
||||
<?php
|
||||
require_once("include/oembed.php");
|
||||
|
||||
function oembed_content(&$a){
|
||||
function oembed_init(&$a){
|
||||
// logger('mod_oembed ' . $a->query_string, LOGGER_ALL);
|
||||
|
||||
if ($a->argv[1]=='b2h'){
|
||||
$url = array( "", trim(hex2bin($_REQUEST['url'])));
|
||||
echo oembed_replacecb($url);
|
||||
killme();
|
||||
}
|
||||
if(argc() > 1) {
|
||||
if (argv(1) == 'b2h'){
|
||||
$url = array( "", trim(hex2bin($_REQUEST['url'])));
|
||||
echo oembed_replacecb($url);
|
||||
killme();
|
||||
}
|
||||
|
||||
if ($a->argv[1]=='h2b'){
|
||||
$text = trim(hex2bin($_REQUEST['text']));
|
||||
echo oembed_html2bbcode($text);
|
||||
killme();
|
||||
}
|
||||
elseif (argv(1) == 'h2b'){
|
||||
$text = trim(hex2bin($_REQUEST['text']));
|
||||
echo oembed_html2bbcode($text);
|
||||
killme();
|
||||
}
|
||||
|
||||
if ($a->argc == 2){
|
||||
echo "<html><body>";
|
||||
$url = base64url_decode($a->argv[1]);
|
||||
$j = oembed_fetch_url($url);
|
||||
echo $j->html;
|
||||
// logger('mod-oembed ' . $j->html, LOGGER_ALL);
|
||||
echo "</body></html>";
|
||||
else {
|
||||
echo "<html><body>";
|
||||
$url = base64url_decode($argv(1));
|
||||
$j = oembed_fetch_url($url);
|
||||
echo $j->html;
|
||||
// logger('mod-oembed ' . $j->html, LOGGER_ALL);
|
||||
echo "</body></html>";
|
||||
}
|
||||
}
|
||||
killme();
|
||||
}
|
||||
|
||||
@@ -3,25 +3,22 @@
|
||||
|
||||
function oexchange_init(&$a) {
|
||||
|
||||
if(($a->argc > 1) && ($a->argv[1] === 'xrd')) {
|
||||
if((argc() > 1) && (argv(1) === 'xrd')) {
|
||||
$tpl = get_markup_template('oexchange_xrd.tpl');
|
||||
|
||||
$o = replace_macros($tpl, array('$base' => $a->get_baseurl()));
|
||||
echo $o;
|
||||
killme();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function oexchange_content(&$a) {
|
||||
|
||||
if(! local_user()) {
|
||||
$o = login(false);
|
||||
return $o;
|
||||
return login(false);
|
||||
}
|
||||
|
||||
if(($a->argc > 1) && $a->argv[1] === 'done') {
|
||||
if((argc() > 1) && argv(1) === 'done') {
|
||||
info( t('Post successful.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<?php
|
||||
function opensearch_content(&$a) {
|
||||
|
||||
function opensearch_init(&$a) {
|
||||
|
||||
$tpl = get_markup_template('opensearch.tpl');
|
||||
$tpl = get_markup_template('opensearch.tpl');
|
||||
|
||||
header("Content-type: application/opensearchdescription+xml");
|
||||
header("Content-type: application/opensearchdescription+xml");
|
||||
|
||||
$o = replace_macros($tpl, array(
|
||||
'$baseurl' => $a->get_baseurl(),
|
||||
'$nodename' => $a->get_hostname(),
|
||||
));
|
||||
$o = replace_macros($tpl, array(
|
||||
'$baseurl' => $a->get_baseurl(),
|
||||
'$nodename' => $a->get_hostname(),
|
||||
));
|
||||
|
||||
echo $o;
|
||||
echo $o;
|
||||
|
||||
killme();
|
||||
killme();
|
||||
|
||||
}
|
||||
?>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user