aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-10-21 22:11:02 -0700
committerfriendica <info@friendica.com>2012-10-21 22:11:02 -0700
commit8f9ddcb536ae46f1c6b3d3c19db1598dc4a51616 (patch)
tree1941b7e5879c9d1e54cc45529f92e9b0a8a7a0c3
parent87c171030c8de2e36f284fa6b58f11a5535a9a29 (diff)
downloadvolse-hubzilla-8f9ddcb536ae46f1c6b3d3c19db1598dc4a51616.tar.gz
volse-hubzilla-8f9ddcb536ae46f1c6b3d3c19db1598dc4a51616.tar.bz2
volse-hubzilla-8f9ddcb536ae46f1c6b3d3c19db1598dc4a51616.zip
lotsa little fixes
-rw-r--r--boot.php11
-rw-r--r--include/Contact.php6
-rw-r--r--include/nav.php4
-rw-r--r--index.php4
-rw-r--r--mod/acctlink.php16
-rw-r--r--mod/apps.php11
-rw-r--r--mod/notice.php20
-rw-r--r--mod/oembed.php38
-rw-r--r--mod/oexchange.php9
-rw-r--r--mod/opensearch.php22
10 files changed, 56 insertions, 85 deletions
diff --git a/boot.php b/boot.php
index 43672695c..a85a927ef 100644
--- a/boot.php
+++ b/boot.php
@@ -426,7 +426,7 @@ if(! class_exists('App')) {
public $timezone;
public $interactive = true;
public $plugins;
- public $apps = array();
+ private $apps = array();
public $identities;
public $css_sources = array();
public $js_sources = array();
@@ -654,6 +654,15 @@ if(! class_exists('App')) {
return $this->observer;
}
+ function get_apps() {
+ return $this->apps;
+ }
+
+ function set_apps($arr) {
+ $this->apps = $arr;
+ }
+
+
function set_widget($title,$html, $location = 'aside') {
$this->widgets[] = array('title' => $title, 'html' => $html, 'location' => $location);
}
diff --git a/include/Contact.php b/include/Contact.php
index 9a6d6a973..6b565f27c 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -353,9 +353,9 @@ function contact_photo_menu($contact) {
function random_profile() {
- $r = q("select url from gcontact where url like '%%://%%/profile/%%' order by rand() limit 1");
- if(count($r))
- return dirname($r[0]['url']);
+ $r = q("select xchan_profile from xchan where xchan_network = 'zot' order by rand() limit 1");
+ if($r && count($r))
+ return $r[0]['xchan_profile'];
return '';
}
diff --git a/include/nav.php b/include/nav.php
index 85af378ff..5c6c7cd14 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -90,7 +90,7 @@ function nav(&$a) {
if(! get_config('system','hide_help'))
$nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'));
- if(count($a->apps)>0)
+ if(count($a->get_apps()) > 0)
$nav['apps'] = array('apps', t('Apps'), "", t('Addon applications, utilities, games'));
$nav['search'] = array('search', t('Search'), "", t('Search site content'));
@@ -170,7 +170,7 @@ function nav(&$a) {
'$emptynotifications' => t('Nothing new here'),
'$userinfo' => $userinfo,
'$sel' => $a->nav_sel,
- '$apps' => $a->apps,
+ '$apps' => $a->get_apps(),
));
call_hooks('page_header', $a->page['nav']);
diff --git a/index.php b/index.php
index 18d54d79e..3d9886a29 100644
--- a/index.php
+++ b/index.php
@@ -126,11 +126,11 @@ else
nav_set_selected('nothing');
-$arr = array('app_menu' => $a->apps);
+$arr = array('app_menu' => $a->get_apps());
call_hooks('app_menu', $arr);
-$a->apps = $arr['app_menu'];
+$a->set_apps($arr['app_menu']);
/**
*
diff --git a/mod/acctlink.php b/mod/acctlink.php
deleted file mode 100644
index a2365803a..000000000
--- a/mod/acctlink.php
+++ /dev/null
@@ -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();
- }
- }
-}
diff --git a/mod/apps.php b/mod/apps.php
index 8049b45fb..43540a3de 100644
--- a/mod/apps.php
+++ b/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,
));
-
-
}
diff --git a/mod/notice.php b/mod/notice.php
deleted file mode 100644
index 19cf53189..000000000
--- a/mod/notice.php
+++ /dev/null
@@ -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;
-
- }
diff --git a/mod/oembed.php b/mod/oembed.php
index 236625f68..720a6d72b 100644
--- a/mod/oembed.php
+++ b/mod/oembed.php
@@ -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();
}
diff --git a/mod/oexchange.php b/mod/oexchange.php
index bbb436e70..791a493ff 100644
--- a/mod/oexchange.php
+++ b/mod/oexchange.php
@@ -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;
}
diff --git a/mod/opensearch.php b/mod/opensearch.php
index ff748d1c5..d28c4f1b8 100644
--- a/mod/opensearch.php
+++ b/mod/opensearch.php
@@ -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();
- }
-?> \ No newline at end of file
+}