aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--boot.php72
-rw-r--r--database.sql1
-rw-r--r--htconfig.php4
-rw-r--r--include/items.php2
-rw-r--r--include/notifier.php2
-rw-r--r--include/poller.php17
-rw-r--r--index.php13
-rw-r--r--mod/contacts.php11
-rw-r--r--mod/network.php9
-rw-r--r--mod/profile.php11
-rw-r--r--update.php35
-rw-r--r--view/de/htconfig.tpl10
-rw-r--r--view/en/htconfig.tpl4
-rw-r--r--view/fr/htconfig.tpl9
-rw-r--r--view/it/htconfig.tpl9
-rw-r--r--view/theme/clean/style.css2
-rw-r--r--view/theme/darkness/style.css2
-rw-r--r--view/theme/default/dfrn.gifbin109 -> 0 bytes
-rw-r--r--view/theme/default/friendika16.gifbin1071 -> 0 bytes
-rw-r--r--view/theme/duepuntozero/style.css3
-rw-r--r--view/theme/goldenrod/style.css2
-rw-r--r--view/theme/loozah/ff-16.jpg (renamed from view/theme/default/ff-16.jpg)bin644 -> 644 bytes
-rwxr-xr-xview/theme/loozah/lock.cur (renamed from view/theme/default/lock.cur)bin4286 -> 4286 bytes
-rw-r--r--view/theme/loozah/login-bg.gif (renamed from view/theme/default/login-bg.gif)bin237 -> 237 bytes
-rw-r--r--view/theme/loozah/style.css (renamed from view/theme/default/style.css)4
-rw-r--r--view/theme/shady/style.css2
-rw-r--r--view/theme/three-d/style.css2
27 files changed, 177 insertions, 49 deletions
diff --git a/boot.php b/boot.php
index 4fc05f81a..5327688dd 100644
--- a/boot.php
+++ b/boot.php
@@ -2,8 +2,8 @@
set_time_limit(0);
-define ( 'BUILD_ID', 1034 );
-define ( 'FRIENDIKA_VERSION', '2.10.0904' );
+define ( 'BUILD_ID', 1037 );
+define ( 'FRIENDIKA_VERSION', '2.10.0905' );
define ( 'DFRN_PROTOCOL_VERSION', '2.1' );
define ( 'EOL', "<br />\r\n" );
@@ -215,9 +215,19 @@ class App {
$this->scheme = ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'])) ? 'https' : 'http' );
- if(x($_SERVER,'SERVER_NAME'))
+ if(x($_SERVER,'SERVER_NAME')) {
$this->hostname = $_SERVER['SERVER_NAME'];
+ /**
+ * Figure out if we are running at the top of a domain
+ * or in a sub-directory and adjust accordingly
+ */
+
+ $path = trim(dirname($_SERVER['SCRIPT_NAME']),'/\\');
+ if(isset($path) && strlen($path) && ($path != $this->path))
+ $this->path = $path;
+ }
+
set_include_path("include/$this->hostname" . PATH_SEPARATOR . 'include' . PATH_SEPARATOR . '.' );
if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=")
@@ -225,14 +235,6 @@ class App {
if(x($_GET,'q'))
$this->cmd = trim($_GET['q'],'/\\');
- /**
- * Figure out if we are running at the top of a domain
- * or in a sub-directory and adjust accordingly
- */
-
- $path = trim(dirname($_SERVER['SCRIPT_NAME']),'/\\');
- if(isset($path) && strlen($path) && ($path != $this->path))
- $this->path = $path;
/**
@@ -295,8 +297,20 @@ class App {
}
function set_baseurl($url) {
+ $parsed = parse_url($url);
+
$this->baseurl = $url;
- $this->hostname = basename($url);
+
+ if($parsed) {
+ $this->scheme = $parsed['scheme'];
+
+ $this->hostname = $parsed['host'];
+ if($parsed['port'])
+ $this->hostname .= ':' . $parsed['port'];
+ if($parsed['path'])
+ $this->path = trim($parsed['path'],'\\/');
+ }
+
}
function get_hostname() {
@@ -406,8 +420,12 @@ function system_unavailable() {
if(! function_exists('check_config')) {
function check_config(&$a) {
+
load_config('system');
+ if(! x($_SERVER,'SERVER_NAME'))
+ return;
+
$build = get_config('system','build');
if(! x($build))
$build = set_config('system','build',BUILD_ID);
@@ -2275,3 +2293,33 @@ function proc_run($cmd){
proc_close(proc_open($cmdline." &",array(),$foo));
}}
+/*
+ * Return full URL to theme which is currently in effect.
+ * Provide a sane default if nothing is chosen or the specified theme does not exist.
+ */
+
+if(! function_exists('current_theme_url')) {
+function current_theme_url() {
+
+ $app_base_themes = array('duepuntozero', 'loozah');
+
+ $a = get_app();
+
+ $system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : '');
+ $theme_name = ((x($_SESSION,'theme')) ? $_SESSION['theme'] : $system_theme);
+
+ if($theme_name && file_exists('view/theme/' . $theme_name . '/style.css'))
+ return($a->get_baseurl() . '/view/theme/' . $theme_name . '/style.css');
+
+ foreach($app_base_themes as $t) {
+ if(file_exists('view/theme/' . $t . '/style.css'))
+ return($a->get_baseurl() . '/view/theme/' . $t . '/style.css');
+ }
+
+ $fallback = glob('view/theme/*/style.css');
+ if(count($fallback))
+ return($a->get_baseurl() . $fallback[0]);
+
+
+}}
+
diff --git a/database.sql b/database.sql
index 817fd0922..83e0e4b6f 100644
--- a/database.sql
+++ b/database.sql
@@ -77,6 +77,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
`subhub` tinyint(1) NOT NULL DEFAULT '0',
`hub-verify` char(255) NOT NULL,
`last-update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `success_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`name-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`uri-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`avatar-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
diff --git a/htconfig.php b/htconfig.php
index 5f5c76cbd..fb62245d2 100644
--- a/htconfig.php
+++ b/htconfig.php
@@ -64,6 +64,10 @@ $a->config['system']['huburl'] = 'http://pubsubhubbub.appspot.com';
$a->config['system']['rino_encrypt'] = true;
+// default system theme
+
+$a->config['system']['theme'] = 'duepuntozero';
+
// Addons or plugins are configured here.
// This is a comma seperated list of addons to enable. Example:
diff --git a/include/items.php b/include/items.php
index 359378ff7..15fd262f4 100644
--- a/include/items.php
+++ b/include/items.php
@@ -144,7 +144,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0)
`contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `contact-id`, `contact`.`uid` AS `contact-uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
- WHERE `item`.`uid` = %d AND `item`.`visible` = 1
+ WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`parent` != 0
AND `item`.`wall` = 1 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND ( `item`.`edited` > '%s' OR `item`.`changed` > '%s' )
$sql_extra
diff --git a/include/notifier.php b/include/notifier.php
index a71da853d..07bde7c4d 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -84,7 +84,7 @@ function notifier_run($argv, $argc){
if($items[0]['deleted']) {
foreach($items as $item)
$item['deleted'] = 1;
-
+ }
}
$r = q("SELECT `contact`.*, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`, `user`.`page-flags`
diff --git a/include/poller.php b/include/poller.php
index 20c84990e..66df080a9 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -28,7 +28,6 @@ function poller_run($argv, $argc){
// run queue delivery process in the background
$php_path = ((x($a->config,'php_path') && strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
- //proc_close(proc_open("\"$php_path\" \"include/queue.php\" &", array(), $foo));
proc_run($php_path,"include/queue.php");
// clear old cache
@@ -239,6 +238,7 @@ function poller_run($argv, $argc){
$xml = post_url($contact['poll'],$postvars);
}
else {
+
// $contact['network'] !== 'dfrn'
$xml = fetch_url($contact['poll']);
@@ -246,8 +246,14 @@ function poller_run($argv, $argc){
logger('poller: received xml : ' . $xml, LOGGER_DATA);
- if(! strlen($xml))
+ if(! strstr($xml,'<?xml')) {
+ logger('poller: post_handshake: response from ' . $url . ' did not contain XML.');
+ $r = q("UPDATE `contact` SET `last-update` = '%s' WHERE `id` = %d LIMIT 1",
+ dbesc(datetime_convert()),
+ intval($contact['id'])
+ );
continue;
+ }
consume_feed($xml,$importer,$contact,$hub,1);
@@ -271,8 +277,11 @@ function poller_run($argv, $argc){
}
- $r = q("UPDATE `contact` SET `last-update` = '%s' WHERE `id` = %d LIMIT 1",
- dbesc(datetime_convert()),
+ $updated = datetime_convert();
+
+ $r = q("UPDATE `contact` SET `last-update` = '%s', `success_update` = '%s' WHERE `id` = %d LIMIT 1",
+ dbesc($updated),
+ dbesc($updated),
intval($contact['id'])
);
diff --git a/index.php b/index.php
index 685a76a13..5f128ebb1 100644
--- a/index.php
+++ b/index.php
@@ -238,21 +238,10 @@ if($a->module != 'install')
require_once('nav.php');
/**
- *
* Build the page - now that we have all the components
- * Make sure the desired theme exists, though if the default theme doesn't exist we're stuffed.
- *
*/
-$default_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : 'default');
-if((x($_SESSION,'theme')) && (! file_exists('view/theme/' . $_SESSION['theme'] . '/style.css')))
- unset($_SESSION['theme']);
-
-$a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array(
- '$stylesheet' => $a->get_baseurl() . '/view/theme/'
- . ((x($_SESSION,'theme')) ? $_SESSION['theme'] : $default_theme)
- . '/style.css'
- ));
+$a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array('$stylesheet' => current_theme_url()));
$page = $a->page;
$profile = $a->profile;
diff --git a/mod/contacts.php b/mod/contacts.php
index 61d9ce398..36f42f8e5 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -245,6 +245,13 @@ function contacts_content(&$a) {
$sparkle = '';
}
+ $last_update = (($r[0]['last-update'] == '0000-00-00 00:00:00')
+ ? t('Never')
+ : datetime_convert('UTC',date_default_timezone_get(),$r[0]['last-update'],'D, j M Y, g:i A'));
+
+ if($r[0]['last-update'] !== '0000-00-00 00:00:00')
+ $last_update .= ' ' . (($r[0]['last-update'] == $r[0]['success_update']) ? t("\x28Update was successful\x29") : t("\x28Update was not successful\x29"));
+
$o .= replace_macros($tpl,array(
'$header' => t('Contact Editor'),
'$visit' => t('Visit $name\'s profile'),
@@ -254,9 +261,7 @@ function contacts_content(&$a) {
'$poll_interval' => contact_poll_interval($r[0]['priority']),
'$lastupdtext' => t('Last updated: '),
'$updpub' => t('Update public posts: '),
- '$last_update' => (($r[0]['last-update'] == '0000-00-00 00:00:00')
- ? t('Never')
- : datetime_convert('UTC',date_default_timezone_get(),$r[0]['last-update'],'D, j M Y, g:i A')),
+ '$last_update' => $last_update,
'$udnow' => t('Update now'),
'$profile_select' => contact_profile_assign($r[0]['profile-id'],(($r[0]['network'] !== 'dfrn') ? true : false)),
'$contact_id' => $r[0]['id'],
diff --git a/mod/network.php b/mod/network.php
index 2ec06fe61..b0196f92a 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -79,8 +79,10 @@ function network_content(&$a, $update = 0) {
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
- $jotplugins = "";
- call_hooks('jot_tool', $jotplugins);
+ $jotplugins = "";
+ call_hooks('jot_tool', $jotplugins);
+
+ $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
$o .= replace_macros($tpl,array(
'$return_path' => $a->cmd,
@@ -92,8 +94,7 @@ function network_content(&$a, $update = 0) {
'$lockstate' => $lockstate,
'$acl' => populate_acl((($group) ? $group_acl : $a->user), $celeb),
'$bang' => (($group) ? '!' : ''),
- '$profile_uid' => $_SESSION['uid'],
- '$jotplugins' => $jotplugins
+ '$profile_uid' => $_SESSION['uid']
));
diff --git a/mod/profile.php b/mod/profile.php
index 91c1ba6d8..3b4616a34 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -135,9 +135,11 @@ function profile_content(&$a, $update = 0) {
else
$lockstate = 'unlock';
- $jotplugins = "";
- call_hooks('jot_tool', $jotplugins);
-
+ $jotplugins = "";
+ call_hooks('jot_tool', $jotplugins);
+
+ $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
+
$o .= replace_macros($tpl,array(
'$baseurl' => $a->get_baseurl(),
'$defloc' => (($is_owner) ? $a->user['default-location'] : ''),
@@ -148,8 +150,7 @@ function profile_content(&$a, $update = 0) {
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
'$bang' => '',
'$acl' => (($is_owner) ? populate_acl($a->user, $celeb) : ''),
- '$profile_uid' => $a->profile['profile_uid'],
- '$jotplugins' => $jotplugins
+ '$profile_uid' => $a->profile['profile_uid']
));
}
diff --git a/update.php b/update.php
index f7bf9da1e..e51e8ac33 100644
--- a/update.php
+++ b/update.php
@@ -328,3 +328,38 @@ function update_1033() {
`updated` DATETIME NOT NULL
) ENGINE = MYISAM DEFAULT CHARSET=utf8;");
}
+
+
+function update_1034() {
+
+ // If you have any of these parent-less posts they can cause problems, and
+ // we need to delete them. You can't see them anyway.
+ // Legitimate items will usually get re-created on the next
+ // pull from the hub.
+ // But don't get rid of a post that may have just come in
+ // and may not yet have the parent id set.
+
+ q("DELETE FROM `item` WHERE `parent` = 0 AND `created` < UTC_TIMESTAMP() - INTERVAL 2 MINUTE");
+
+}
+
+
+function update_1035() {
+
+ q("ALTER TABLE `contact` ADD `success_update` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `last-update` ");
+
+}
+
+function update_1036() {
+
+ $r = dbq("SELECT * FROM `contact` WHERE `network` = 'dfrn' && `photo` LIKE '%include/photo%' ");
+ if(count($r)) {
+ foreach($r as $rr) {
+ q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `micro` = '%s' WHERE `id` = %d LIMIT 1",
+ dbesc(str_replace('include/photo','photo',$rr['photo'])),
+ dbesc(str_replace('include/photo','photo',$rr['thumb'])),
+ dbesc(str_replace('include/photo','photo',$rr['micro'])),
+ intval($rr['id']));
+ }
+ }
+}
diff --git a/view/de/htconfig.tpl b/view/de/htconfig.tpl
index c7c19bf69..d3bb6b411 100644
--- a/view/de/htconfig.tpl
+++ b/view/de/htconfig.tpl
@@ -62,3 +62,13 @@ $a->config['system']['huburl'] = 'http://pubsubhubbub.appspot.com';
$a->config['system']['rino_encrypt'] = true;
+// default system theme
+
+$a->config['system']['theme'] = 'duepuntozero';
+
+// Addons or plugins are configured here.
+// This is a comma seperated list of addons to enable. Example:
+// $a->config['system']['addon'] = 'js_upload,randplace,oembed';
+
+$a->config['system']['addon'] = 'js_upload';
+
diff --git a/view/en/htconfig.tpl b/view/en/htconfig.tpl
index 0182dbe5c..d3bb6b411 100644
--- a/view/en/htconfig.tpl
+++ b/view/en/htconfig.tpl
@@ -62,6 +62,10 @@ $a->config['system']['huburl'] = 'http://pubsubhubbub.appspot.com';
$a->config['system']['rino_encrypt'] = true;
+// default system theme
+
+$a->config['system']['theme'] = 'duepuntozero';
+
// Addons or plugins are configured here.
// This is a comma seperated list of addons to enable. Example:
// $a->config['system']['addon'] = 'js_upload,randplace,oembed';
diff --git a/view/fr/htconfig.tpl b/view/fr/htconfig.tpl
index c7c19bf69..d31d5a39f 100644
--- a/view/fr/htconfig.tpl
+++ b/view/fr/htconfig.tpl
@@ -62,3 +62,12 @@ $a->config['system']['huburl'] = 'http://pubsubhubbub.appspot.com';
$a->config['system']['rino_encrypt'] = true;
+// default system theme
+
+$a->config['system']['theme'] = 'duepuntozero';
+
+// Addons or plugins are configured here.
+// This is a comma seperated list of addons to enable. Example:
+// $a->config['system']['addon'] = 'js_upload,randplace,oembed';
+
+$a->config['system']['addon'] = 'js_upload';
diff --git a/view/it/htconfig.tpl b/view/it/htconfig.tpl
index 78e014cc1..180f7885c 100644
--- a/view/it/htconfig.tpl
+++ b/view/it/htconfig.tpl
@@ -62,3 +62,12 @@ $a->config['system']['huburl'] = 'http://pubsubhubbub.appspot.com';
$a->config['system']['rino_encrypt'] = true;
+// default system theme
+
+$a->config['system']['theme'] = 'duepuntozero';
+
+// Addons or plugins are configured here.
+// This is a comma seperated list of addons to enable. Example:
+// $a->config['system']['addon'] = 'js_upload,randplace,oembed';
+
+$a->config['system']['addon'] = 'js_upload';
diff --git a/view/theme/clean/style.css b/view/theme/clean/style.css
index ea8f54ddf..4730b5c2f 100644
--- a/view/theme/clean/style.css
+++ b/view/theme/clean/style.css
@@ -1,4 +1,4 @@
-@import url('../default/style.css');
+@import url('../loozah/style.css');
footer {
background: #CCC;
diff --git a/view/theme/darkness/style.css b/view/theme/darkness/style.css
index 3aff559d3..828fdd104 100644
--- a/view/theme/darkness/style.css
+++ b/view/theme/darkness/style.css
@@ -1,4 +1,4 @@
-@import url('../default/style.css');
+@import url('../loozah/style.css');
nav {
background: #CCC;
diff --git a/view/theme/default/dfrn.gif b/view/theme/default/dfrn.gif
deleted file mode 100644
index 104f42e51..000000000
--- a/view/theme/default/dfrn.gif
+++ /dev/null
Binary files differ
diff --git a/view/theme/default/friendika16.gif b/view/theme/default/friendika16.gif
deleted file mode 100644
index f5321b1e5..000000000
--- a/view/theme/default/friendika16.gif
+++ /dev/null
Binary files differ
diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css
index c7eb56fb1..50745ac15 100644
--- a/view/theme/duepuntozero/style.css
+++ b/view/theme/duepuntozero/style.css
@@ -1210,7 +1210,8 @@ input#dfrn-url {
margin-top: 30px;
}
#contact-edit-poll-text {
- margin-bottom: 10px;
+ margin-top: 15px;
+ margin-bottom: 5px;
}
#contact-edit-update-now {
diff --git a/view/theme/goldenrod/style.css b/view/theme/goldenrod/style.css
index a9c04a08d..2a098e955 100644
--- a/view/theme/goldenrod/style.css
+++ b/view/theme/goldenrod/style.css
@@ -1,4 +1,4 @@
-@import url('../default/style.css');
+@import url('../loozah/style.css');
footer {
background: #CCC;
diff --git a/view/theme/default/ff-16.jpg b/view/theme/loozah/ff-16.jpg
index 3621f5914..3621f5914 100644
--- a/view/theme/default/ff-16.jpg
+++ b/view/theme/loozah/ff-16.jpg
Binary files differ
diff --git a/view/theme/default/lock.cur b/view/theme/loozah/lock.cur
index 892c5e851..892c5e851 100755
--- a/view/theme/default/lock.cur
+++ b/view/theme/loozah/lock.cur
Binary files differ
diff --git a/view/theme/default/login-bg.gif b/view/theme/loozah/login-bg.gif
index cde836c89..cde836c89 100644
--- a/view/theme/default/login-bg.gif
+++ b/view/theme/loozah/login-bg.gif
Binary files differ
diff --git a/view/theme/default/style.css b/view/theme/loozah/style.css
index 5dd0b8712..d7d735d6d 100644
--- a/view/theme/default/style.css
+++ b/view/theme/loozah/style.css
@@ -1335,8 +1335,10 @@ input#dfrn-url {
margin-top: 30px;
}
#contact-edit-poll-text {
- margin-bottom: 10px;
+ margin-top: 15px;
+ margin-bottom: 5px;
}
+
#contact-edit-update-now {
margin-top: 15px;
}
diff --git a/view/theme/shady/style.css b/view/theme/shady/style.css
index 071310541..1e3e6ec40 100644
--- a/view/theme/shady/style.css
+++ b/view/theme/shady/style.css
@@ -1,4 +1,4 @@
-@import url('../default/style.css');
+@import url('../loozah/style.css');
body {
background: #DDDDDD;
diff --git a/view/theme/three-d/style.css b/view/theme/three-d/style.css
index e885a70d3..56d36914e 100644
--- a/view/theme/three-d/style.css
+++ b/view/theme/three-d/style.css
@@ -1,4 +1,4 @@
-@import url('../default/style.css');
+@import url('../loozah/style.css');
.error-message {
-moz-box-shadow: 5px 5px 5px #888888;