Browse Source

theme name cleanup - rename default to loozah, provide sane fallbacks and change system primary theme.

Provide indication on contact edit page of last update success/failure - can be extended later to
show actual timestamp of last successful update.
pull/1/head
Friendika 10 years ago
parent
commit
147d7f3bbf
23 changed files with 107 additions and 26 deletions
  1. +31
    -1
      boot.php
  2. +1
    -0
      database.sql
  3. +4
    -0
      htconfig.php
  4. +13
    -3
      include/poller.php
  5. +1
    -12
      index.php
  6. +8
    -3
      mod/contacts.php
  7. +7
    -0
      update.php
  8. +10
    -0
      view/de/htconfig.tpl
  9. +4
    -0
      view/en/htconfig.tpl
  10. +9
    -0
      view/fr/htconfig.tpl
  11. +9
    -0
      view/it/htconfig.tpl
  12. +1
    -1
      view/theme/clean/style.css
  13. +1
    -1
      view/theme/darkness/style.css
  14. BIN
      view/theme/default/dfrn.gif
  15. BIN
      view/theme/default/friendika16.gif
  16. +2
    -1
      view/theme/duepuntozero/style.css
  17. +1
    -1
      view/theme/goldenrod/style.css
  18. +0
    -0
      view/theme/loozah/ff-16.jpg
  19. +0
    -0
      view/theme/loozah/lock.cur
  20. +0
    -0
      view/theme/loozah/login-bg.gif
  21. +3
    -1
      view/theme/loozah/style.css
  22. +1
    -1
      view/theme/shady/style.css
  23. +1
    -1
      view/theme/three-d/style.css

+ 31
- 1
boot.php View File

@ -2,7 +2,7 @@
set_time_limit(0);
define ( 'BUILD_ID', 1035 );
define ( 'BUILD_ID', 1036 );
define ( 'FRIENDIKA_VERSION', '2.10.0905' );
define ( 'DFRN_PROTOCOL_VERSION', '2.1' );
@ -2275,3 +2275,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]);
}}

+ 1
- 0
database.sql View File

@ -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',


+ 4
- 0
htconfig.php View File

@ -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:


+ 13
- 3
include/poller.php View File

@ -239,6 +239,7 @@ function poller_run($argv, $argc){
$xml = post_url($contact['poll'],$postvars);
}
else {
// $contact['network'] !== 'dfrn'
$xml = fetch_url($contact['poll']);
@ -246,8 +247,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 +278,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'])
);


+ 1
- 12
index.php View File

@ -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;


+ 8
- 3
mod/contacts.php View File

@ -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'],


+ 7
- 0
update.php View File

@ -342,3 +342,10 @@ function update_1034() {
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` ");
}

+ 10
- 0
view/de/htconfig.tpl View File

@ -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';

+ 4
- 0
view/en/htconfig.tpl View File

@ -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';


+ 9
- 0
view/fr/htconfig.tpl View File

@ -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';

+ 9
- 0
view/it/htconfig.tpl View File

@ -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';

+ 1
- 1
view/theme/clean/style.css View File

@ -1,4 +1,4 @@
@import url('../default/style.css');
@import url('../loozah/style.css');
footer {
background: #CCC;


+ 1
- 1
view/theme/darkness/style.css View File

@ -1,4 +1,4 @@
@import url('../default/style.css');
@import url('../loozah/style.css');
nav {
background: #CCC;


BIN
view/theme/default/dfrn.gif View File

Before After
Width: 17  |  Height: 17  |  Size: 109 B

BIN
view/theme/default/friendika16.gif View File

Before After
Width: 16  |  Height: 16  |  Size: 1.0 KiB

+ 2
- 1
view/theme/duepuntozero/style.css View File

@ -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 {


+ 1
- 1
view/theme/goldenrod/style.css View File

@ -1,4 +1,4 @@
@import url('../default/style.css');
@import url('../loozah/style.css');
footer {
background: #CCC;


view/theme/default/ff-16.jpg → view/theme/loozah/ff-16.jpg View File


view/theme/default/lock.cur → view/theme/loozah/lock.cur View File


view/theme/default/login-bg.gif → view/theme/loozah/login-bg.gif View File


view/theme/default/style.css → view/theme/loozah/style.css View File


+ 1
- 1
view/theme/shady/style.css View File

@ -1,4 +1,4 @@
@import url('../default/style.css');
@import url('../loozah/style.css');
body {
background: #DDDDDD;


+ 1
- 1
view/theme/three-d/style.css View File

@ -1,4 +1,4 @@
@import url('../default/style.css');
@import url('../loozah/style.css');
.error-message {
-moz-box-shadow: 5px 5px 5px #888888;


Loading…
Cancel
Save