From 30aeb42bed0b4bb6bf90c16674565ee5d7a26945 Mon Sep 17 00:00:00 2001 From: Christian Vogeley Date: Sat, 1 Feb 2014 23:28:27 +0100 Subject: Press return to post chat posts- SHIFT-RETURN creates line break on mobile devices keep default behavior --- view/tpl/chat.tpl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/view/tpl/chat.tpl b/view/tpl/chat.tpl index 0ebe879a1..a0c18f8d6 100644 --- a/view/tpl/chat.tpl +++ b/view/tpl/chat.tpl @@ -89,3 +89,20 @@ function update_chats(chats) { } + -- cgit v1.2.3 From a2761213e025d55f96803847712db10ac5f8e78c Mon Sep 17 00:00:00 2001 From: Tazman DeVille Date: Sun, 2 Feb 2014 04:26:56 +0100 Subject: link colour options --- view/theme/redbasic/css/style.css | 6 +++--- view/theme/redbasic/php/config.php | 3 +++ view/theme/redbasic/php/style.php | 3 +++ view/theme/redbasic/tpl/theme_settings.tpl | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 02832b5f0..c4eddc179 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -40,11 +40,11 @@ abbr { a, a:visited, a:link, .fakelink, .fakelink:visited, .fakelink:link { font-weight: bold; - color: #0080FF; + color: #7b0000; text-decoration: none; } -a:hover, .fakelink:hover { color: #44AAFF; text-decoration: underline; } +a:hover, .fakelink:hover { color: #c40003; text-decoration: underline; } .fakelink { cursor: pointer; @@ -2449,4 +2449,4 @@ img.mail-list-sender-photo { .online-now { color: red; cursor: pointer; -} \ No newline at end of file +} diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index 20355197f..d6adf5381 100644 --- a/view/theme/redbasic/php/config.php +++ b/view/theme/redbasic/php/config.php @@ -7,6 +7,7 @@ function theme_content(&$a) { $arr['schema'] = get_pconfig(local_user(),'redbasic', 'schema' ); $arr['nav_colour'] = get_pconfig(local_user(),'redbasic', 'nav_colour' ); + $arr['link_colour'] = get_pconfig(local_user(),'redbasic', 'link_colour' ); $arr['banner_colour'] = get_pconfig(local_user(),'redbasic', 'banner_colour' ); $arr['bgcolour'] = get_pconfig(local_user(),'redbasic', 'background_colour' ); $arr['background_image'] = get_pconfig(local_user(),'redbasic', 'background_image' ); @@ -33,6 +34,7 @@ function theme_post(&$a) { if (isset($_POST['redbasic-settings-submit'])) { set_pconfig(local_user(), 'redbasic', 'schema', $_POST['redbasic_schema']); set_pconfig(local_user(), 'redbasic', 'nav_colour', $_POST['redbasic_nav_colour']); + set_pconfig(local_user(), 'redbasic', 'link_colour', $_POST['redbasic_link_colour']); set_pconfig(local_user(), 'redbasic', 'background_colour', $_POST['redbasic_background_colour']); set_pconfig(local_user(), 'redbasic', 'banner_colour', $_POST['redbasic_banner_colour']); set_pconfig(local_user(), 'redbasic', 'background_image', $_POST['redbasic_background_image']); @@ -88,6 +90,7 @@ if(feature_enabled(local_user(),'expert')) '$title' => t("Theme settings"), '$schema' => array('redbasic_schema', t('Set scheme'), $arr['schema'], '', $scheme_choices), '$nav_colour' => array('redbasic_nav_colour', t('Navigation bar colour'), $arr['nav_colour'], '', $nav_colours), + '$link_colour' => array('redbasic_link_colour', t('link colour'), $arr['link_colour'], '', $link_colours), '$banner_colour' => array('redbasic_banner_colour', t('Set font-colour for banner'), $arr['banner_colour']), '$bgcolour' => array('redbasic_background_colour', t('Set the background colour'), $arr['bgcolour']), '$background_image' => array('redbasic_background_image', t('Set the background image'), $arr['background_image']), diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index 9956ccd31..85420fbaf 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -63,6 +63,8 @@ $nav_bg_3 = "#f00"; $nav_bg_4 = "#b00"; } + if (! $link_colour) + $link_colour = "#7b0000"; if (! $banner_colour) $banner_colour = "fff"; if (! $bgcolour) @@ -141,6 +143,7 @@ $options = array ( '$nav_bg_2' => $nav_bg_2, '$nav_bg_3' => $nav_bg_3, '$nav_bg_4' => $nav_bg_4, +'$link_colour' => $link_colour, '$banner_colour' => $banner_colour, '$search_background' => $search_background, '$bgcolour' => $bgcolour, diff --git a/view/theme/redbasic/tpl/theme_settings.tpl b/view/theme/redbasic/tpl/theme_settings.tpl index e0f546896..ca05986a2 100644 --- a/view/theme/redbasic/tpl/theme_settings.tpl +++ b/view/theme/redbasic/tpl/theme_settings.tpl @@ -6,6 +6,7 @@ {{if $expert}} {{include file="field_select.tpl" field=$nav_colour}} {{include file="field_input.tpl" field=$banner_colour}} +{{include file="field_input.tpl" field=$link_colour}} {{include file="field_input.tpl" field=$bgcolour}} {{include file="field_input.tpl" field=$background_image}} {{include file="field_input.tpl" field=$item_colour}} -- cgit v1.2.3 From bd8378339117f307c73e176e80a3417c8fb2a3f4 Mon Sep 17 00:00:00 2001 From: Tazman DeVille Date: Sun, 2 Feb 2014 04:32:43 +0100 Subject: link colours --- view/theme/redbasic/php/style.php | 1 + 1 file changed, 1 insertion(+) diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index 85420fbaf..35fe54fe4 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -10,6 +10,7 @@ // A further two - $nav_bg_3 and $nav_bg_4 are used to create the hover, if any particular scheme // wants to implement that $nav_colour = get_pconfig($uid, "redbasic", "nav_colour"); + $link_colour = get_pconfig($uid, "redbasic", "link_colour"); // Load the owners pconfig $banner_colour = get_pconfig($uid,'redbasic','banner_colour'); -- cgit v1.2.3 From 2c75210fdbb316d13ad27950b14302266fff9a8e Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 1 Feb 2014 20:07:47 -0800 Subject: config: don't try to unserialise an array --- include/config.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/config.php b/include/config.php index bccf0737f..8d98d56fa 100644 --- a/include/config.php +++ b/include/config.php @@ -65,7 +65,7 @@ function get_config($family, $key) { if(! array_key_exists($key,$a->config[$family])) { return false; } - return ((preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$family][$key])) + return ((! is_array($a->config[$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$family][$key])) ? unserialize($a->config[$family][$key]) : $a->config[$family][$key] ); @@ -174,8 +174,8 @@ function get_pconfig($uid,$family, $key, $instore = false) { if((! array_key_exists($family,$a->config[$uid])) || (! array_key_exists($key,$a->config[$uid][$family]))) return false; - - return ((preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$uid][$family][$key])) + + return ((! is_array($a->config[$uid][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$uid][$family][$key])) ? unserialize($a->config[$uid][$family][$key]) : $a->config[$uid][$family][$key] ); @@ -304,7 +304,7 @@ function get_xconfig($xchan,$family, $key) { if((! array_key_exists($family,$a->config[$xchan])) || (! array_key_exists($key,$a->config[$xchan][$family]))) return false; - return ((preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$xchan][$family][$key])) + return ((! is_array($a->config[$xchan][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', $a->config[$xchan][$family][$key])) ? unserialize($a->config[$xchan][$family][$key]) : $a->config[$xchan][$family][$key] ); -- cgit v1.2.3 From de412abe88a697f08755f09694fd16f9230482cb Mon Sep 17 00:00:00 2001 From: Tazman DeVille Date: Sun, 2 Feb 2014 05:19:29 +0100 Subject: user configured link colour --- view/theme/redbasic/css/style.css | 2 +- view/theme/redbasic/php/style.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index c4eddc179..1a36c1c43 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -40,7 +40,7 @@ abbr { a, a:visited, a:link, .fakelink, .fakelink:visited, .fakelink:link { font-weight: bold; - color: #7b0000; + color: $link_colour; text-decoration: none; } diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index 35fe54fe4..fcb762891 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -10,10 +10,10 @@ // A further two - $nav_bg_3 and $nav_bg_4 are used to create the hover, if any particular scheme // wants to implement that $nav_colour = get_pconfig($uid, "redbasic", "nav_colour"); - $link_colour = get_pconfig($uid, "redbasic", "link_colour"); // Load the owners pconfig $banner_colour = get_pconfig($uid,'redbasic','banner_colour'); + $link_colour = get_pconfig($uid, "redbasic", "link_colour"); $schema = get_pconfig($uid,'redbasic','schema'); $bgcolour = get_pconfig($uid, "redbasic", "background_colour"); $background_image = get_pconfig($uid, "redbasic", "background_image"); -- cgit v1.2.3 From 61cc4de2255b344e9f607ae9fa545f45d7423b56 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 1 Feb 2014 21:03:21 -0800 Subject: provide donation options on siteinfo page --- mod/siteinfo.php | 18 +++++++++++++++++- view/tpl/siteinfo.tpl | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/mod/siteinfo.php b/mod/siteinfo.php index 37cba02ec..14ef17516 100644 --- a/mod/siteinfo.php +++ b/mod/siteinfo.php @@ -90,6 +90,21 @@ function siteinfo_content(&$a) { $admininfo = bbcode(get_config('system','admininfo')); + $donate = <<< EOT +

The Red Matrix is provided for you by volunteers working in their spare time. Your support will help us to build a better web. Select the following option for a one-time donation of your choosing

+

+

or

+ +

+ + +
Recurring Donation Options
+

+

+EOT; + + + $o = replace_macros(get_markup_template('siteinfo.tpl'), array( '$title' => t('Red'), '$description' => t('This is a hub of the Red Matrix - a global cooperative network of decentralised privacy enhanced websites.'), @@ -100,7 +115,8 @@ function siteinfo_content(&$a) { '$bug_text' => t('Bug reports and issues: please visit'), '$bug_link_url' => 'https://github.com/friendica/red/issues', '$bug_link_text' => 'redmatrix issues', - '$contact' => t('Suggestions, praise, donations, etc. - please email "redmatrix" at librelist - dot com'), + '$contact' => t('Suggestions, praise, etc. - please email "redmatrix" at librelist - dot com'), + '$donate' => $donate, '$adminlabel' => t('Site Administrators'), '$admininfo' => $admininfo, '$plugins_text' => $plugins_text, diff --git a/view/tpl/siteinfo.tpl b/view/tpl/siteinfo.tpl index 4baa1969b..d956a7228 100755 --- a/view/tpl/siteinfo.tpl +++ b/view/tpl/siteinfo.tpl @@ -14,3 +14,4 @@ {{if $plugins_list}}
{{$plugins_list}}
{{/if}} +

{{$donate}}

-- cgit v1.2.3 From 17436f060f54e1c218296bce0bdc7b05abe4ee33 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 1 Feb 2014 21:12:26 -0800 Subject: fix default link color --- view/theme/redbasic/css/style.css | 2 +- view/theme/redbasic/php/style.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 1a36c1c43..fe6d24f18 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -44,7 +44,7 @@ a, a:visited, a:link, .fakelink, .fakelink:visited, .fakelink:link { text-decoration: none; } -a:hover, .fakelink:hover { color: #c40003; text-decoration: underline; } +a:hover, .fakelink:hover { color: #44AAFF; text-decoration: underline; } .fakelink { cursor: pointer; diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index fcb762891..981aaddb2 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -65,7 +65,7 @@ $nav_bg_4 = "#b00"; } if (! $link_colour) - $link_colour = "#7b0000"; + $link_colour = "#0080FF"; if (! $banner_colour) $banner_colour = "fff"; if (! $bgcolour) -- cgit v1.2.3 From 6b15e57cdbb1b525528f1e67aaa071d0ef4e6e25 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 02:43:36 -0800 Subject: add epub mimetype (application/epub+zip) --- include/attach.php | 1 + version.inc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/attach.php b/include/attach.php index dbc489a2d..af1159957 100644 --- a/include/attach.php +++ b/include/attach.php @@ -26,6 +26,7 @@ function z_mime_content_type($filename) { 'xml' => 'application/xml', 'swf' => 'application/x-shockwave-flash', 'flv' => 'video/x-flv', + 'epub' => 'application/epub+zip', // images 'png' => 'image/png', diff --git a/version.inc b/version.inc index a3517ab74..4b99b62b1 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2014-02-01.575 +2014-02-02.576 -- cgit v1.2.3 From e83419b53e27078867f8449f476d87b064b9d502 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 03:43:52 -0800 Subject: add links to change chat status and leave room --- include/chat.php | 8 +++++--- mod/chat.php | 10 ++++++++-- mod/chatsvc.php | 32 +++++++++++++++++++++----------- view/tpl/chat.tpl | 2 ++ 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/include/chat.php b/include/chat.php index 08fd154b5..5af3a3a9a 100644 --- a/include/chat.php +++ b/include/chat.php @@ -122,10 +122,10 @@ function chatroom_enter($observer_xchan,$room_id,$status,$client) { intval($room_id) ); if($r) { - q("update chatpresence set cp_status = %d and cp_last = '%s' where cp_id = %d limit 1", - dbesc($status), + q("update chatpresence set cp_last = '%s' where cp_id = %d and cp_client = '%s' limit 1", dbesc(datetime_convert()), - intval($r[0]['cp_id']) + intval($r[0]['cp_id']), + dbesc($client) ); return true; } @@ -145,6 +145,7 @@ function chatroom_enter($observer_xchan,$room_id,$status,$client) { function chatroom_leave($observer_xchan,$room_id,$client) { if(! $room_id || ! $observer_xchan) return; + $r = q("select * from chatpresence where cp_xchan = '%s' and cp_room = %d and cp_client = '%s' limit 1", dbesc($observer_xchan), intval($room_id), @@ -155,6 +156,7 @@ function chatroom_leave($observer_xchan,$room_id,$client) { intval($r[0]['cp_id']) ); } + return true; } diff --git a/mod/chat.php b/mod/chat.php index 612878cb2..e79973aef 100644 --- a/mod/chat.php +++ b/mod/chat.php @@ -91,7 +91,7 @@ function chat_content(&$a) { } if((argc() > 3) && intval(argv(2)) && (argv(3) === 'leave')) { - chatroom_leave($observer,$room_id,$_SERVER['REMOTE_ADDR']); + chatroom_leave($observer,argv(2),$_SERVER['REMOTE_ADDR']); goaway(z_root() . '/channel/' . argv(1)); } @@ -111,7 +111,13 @@ function chat_content(&$a) { $o = replace_macros(get_markup_template('chat.tpl'),array( '$room_name' => $room_name, '$room_id' => $room_id, - '$submit' => t('Submit') + '$baseurl' => z_root(), + '$nickname' => argv(1), + '$submit' => t('Submit'), + '$leave' => t('Leave Room'), + '$away' => t('I am away right now'), + '$online' => t('I am online') + )); return $o; } diff --git a/mod/chatsvc.php b/mod/chatsvc.php index 0a69834f0..bbe616c48 100644 --- a/mod/chatsvc.php +++ b/mod/chatsvc.php @@ -29,17 +29,6 @@ function chatsvc_post(&$a) { $room_id = $a->data['chat']['room_id']; $text = escape_tags($_REQUEST['chat_text']); - $status = strip_tags($_REQUEST['status']); - - if($status && $room_id) { - $r = q("update chatpresence set cp_status = '%s', cp_last = '%s' where cp_room = %d and cp_xchan = '%s' and cp_client = '%s' limit 1", - dbesc($status), - dbesc(datetime_convert()), - intval($room_id), - dbesc(get_observer_hash()), - dbesc($_SERVER['REMOTE_ADDR']) - ); - } if(! $text) return; @@ -65,6 +54,27 @@ function chatsvc_post(&$a) { function chatsvc_content(&$a) { + $status = strip_tags($_REQUEST['status']); + $room_id = intval($a->data['chat']['room_id']); + + if($status && $room_id) { + + $x = q("select channel_address from channel where channel_id = %d limit 1", + intval($a->data['chat']['uid']) + ); + + $r = q("update chatpresence set cp_status = '%s', cp_last = '%s' where cp_room = %d and cp_xchan = '%s' and cp_client = '%s' limit 1", + dbesc($status), + dbesc(datetime_convert()), + intval($room_id), + dbesc(get_observer_hash()), + dbesc($_SERVER['REMOTE_ADDR']) + ); + + goaway(z_root() . '/chat/' . $x[0]['channel_address'] . '/' . $room_id); + } + + $lastseen = intval($_REQUEST['last']); $ret = array('success' => false); diff --git a/view/tpl/chat.tpl b/view/tpl/chat.tpl index a0c18f8d6..dba6a777f 100644 --- a/view/tpl/chat.tpl +++ b/view/tpl/chat.tpl @@ -17,6 +17,8 @@ + {{$leave}} | {{$away}} | {{$online}} + -- cgit v1.2.3