From 44b2503572700ab24e7afad4637f62c413d3d489 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 29 Feb 2016 13:42:30 -0800 Subject: revup --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index d9a8e384f..f06413611 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2016-02-28.1321H +2016-02-29.1322H -- cgit v1.2.3 From be2b7c0b5f7f9b8080affbb4bc44c5adda18e82f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 29 Feb 2016 19:31:52 -0800 Subject: abconfig --- boot.php | 4 +-- include/config.php | 66 ++++++++++++++++++++++++++++++++++++++++++++- include/identity.php | 8 ++++-- include/zot.php | 19 +++++++++++-- install/schema_mysql.sql | 14 ++++++++++ install/schema_postgres.sql | 13 +++++++++ install/update.php | 43 +++++++++++++++++++++++++++-- mod/connedit.php | 7 +++++ mod/follow.php | 8 +++++- mod/import.php | 15 +++++++++++ 10 files changed, 187 insertions(+), 10 deletions(-) diff --git a/boot.php b/boot.php index 7610f16d8..2a3a3d062 100755 --- a/boot.php +++ b/boot.php @@ -47,10 +47,10 @@ require_once('include/account.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'RED_VERSION', trim(file_get_contents('version.inc'))); -define ( 'STD_VERSION', '1.2.4' ); +define ( 'STD_VERSION', '1.2.5' ); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1164 ); +define ( 'DB_UPDATE_VERSION', 1165 ); /** diff --git a/include/config.php b/include/config.php index f65e4a470..51d4e99ac 100644 --- a/include/config.php +++ b/include/config.php @@ -549,4 +549,68 @@ function set_aconfig($account_id, $family, $key, $value) { function del_aconfig($account_id, $family, $key) { return del_xconfig('a_' . $account_id, $family, $key); -} \ No newline at end of file +} + + +function load_abconfig($chash,$xhash) { + $r = q("select * from abconfig where chan = '%s' and xchan = '%s'", + dbesc($chash), + dbesc($xhash) + ); + return $r; +} + +function get_abconfig($chash,$xhash,$family,$key) { + $r = q("select * from abconfig where chan = '%s' and xchan = '%s' and cat = '%s' and k = '%s' limit 1", + dbesc($chash), + dbesc($xhash), + dbesc($family), + dbesc($key) + ); + if($r) { + return ((preg_match('|^a:[0-9]+:{.*}$|s', $r[0]['v'])) ? unserialize($r[0]['v']) : $r[0]['v']); + } + return false; +} + + +function set_abconfig($chash,$xhash,$family,$key,$value) { + + $dbvalue = ((is_array($value)) ? serialize($value) : $value); + $dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue); + + if(get_abconfig($chash,$xhash,$family,$key) === false) { + $r = q("insert into abconfig ( chan, xchan, cat, k, v ) values ( '%s', '%s', '%s', '%s', '%s' ) ", + dbesc($chash), + dbesc($xhash), + dbesc($family), + dbesc($key), + dbesc($dbvalue) + ); + } + else { + $r = q("update abconfig set v = '%s' where chan = '%s' and xchan = '%s' and cat = '%s' and k = '%s' ", + dbesc($dbvalue), + dbesc($chash), + dbesc($xhash), + dbesc($family), + dbesc($key) + ); + } + if($r) + return $value; + return false; +} + + +function del_abconfig($chash,$xhash,$family,$key) { + + $r = q("delete from abconfig where chan = '%s' and xchan = '%s' and cat = '%s' and k = '%s' ", + dbesc($chash), + dbesc($xhash), + dbesc($family), + dbesc($key) + ); + + return $r; +} diff --git a/include/identity.php b/include/identity.php index caf2de710..478079d39 100644 --- a/include/identity.php +++ b/include/identity.php @@ -505,8 +505,12 @@ function identity_basic_export($channel_id, $items = false) { if($r) { $ret['abook'] = $r; - foreach($r as $rr) - $xchans[] = $rr['abook_xchan']; + for($x = 0; $x < count($ret['abook']); $x ++) { + $xchans[] = $ret['abook'][$x]['abook_chan']; + $abconfig = load_abconfig($ret['channel']['channel_hash'],$ret['abook'][$x]['abook_xchan']); + if($abconfig) + $ret['abook'][$x]['abconfig'] = $abconfig; + } stringify_array_elms($xchans); } diff --git a/include/zot.php b/include/zot.php index 01dd06fda..a60a50d8f 100644 --- a/include/zot.php +++ b/include/zot.php @@ -522,6 +522,11 @@ function zot_refresh($them, $channel = null, $force = false) { unset($new_connection[0]['abook_id']); unset($new_connection[0]['abook_account']); unset($new_connection[0]['abook_channel']); + + $abconfig = load_abconfig($channel['channel_hash'],$new_connection['abook_xchan']); + if($abconfig) + $new_connection['abconfig'] = $abconfig; + build_sync_packet($channel['channel_id'], array('abook' => $new_connection)); } } @@ -3124,6 +3129,11 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { foreach($arr['abook'] as $abook) { + $abconfig = null; + + if(array_key_exists('abconfig',$abook) && is_array($abook['abconfig']) && count($abook['abconfig'])) + $abconfig = $abook['abconfig']; + if(! array_key_exists('abook_blocked',$abook)) { // convert from redmatrix $abook['abook_blocked'] = (($abook['abook_flags'] & 0x0001) ? 1 : 0); @@ -3214,8 +3224,13 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { } } - - + if($abconfig) { + // @fixme does not handle sync of del_abconfig + foreach($abconfig as $abc) { + if($abc['chan'] === $channel['channel_hash']) + set_abconfig($abc['chan'],$abc['xchan'],$abc['cat'],$abc['k'],$abc['v']); + } + } } } diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 07a88cf0a..01cf97674 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -1,4 +1,18 @@ +CREATE TABLE IF NOT EXISTS `abconfig` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `chan` char(255) NOT NULL DEFAULT '', + `xchan` char(255) NOT NULL DEFAULT '', + `cat` char(255) NOT NULL DEFAULT '', + `k` char(255) NOT NULL DEFAULT '', + `v` mediumtext NOT NULL, + PRIMARY KEY (`id`), + KEY `chan` (`chan`), + KEY `xchan` (`xchan`), + KEY `cat` (`cat`), + KEY `k` (`k`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + CREATE TABLE IF NOT EXISTS `abook` ( `abook_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `abook_account` int(10) unsigned NOT NULL DEFAULT '0', diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 3302ef6c0..0ff78e873 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -1,3 +1,16 @@ +CREATE TABLE "abconfig" ( + "id" serial NOT NULL, + "chan" text NOT NULL, + "xchan" text NOT NULL, + "cat" text NOT NULL, + "k" text NOT NULL, + "v" text NOT NULL, + PRIMARY KEY ("id") +); +create index "abconfig_chan" on abconfig ("chan"); +create index "abconfig_xchan" on abconfig ("xchan"); +create index "abconfig_cat" on abconfig ("cat"); +create index "abconfig_k" on abconfig ("k"); CREATE TABLE "abook" ( "abook_id" serial NOT NULL, "abook_account" bigint NOT NULL, diff --git a/install/update.php b/install/update.php index 0f9b3ab28..bfd01494f 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ poi) return; + + $channel = $a->get_channel(); + $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d and abook_id = %d LIMIT 1", @@ -338,6 +341,10 @@ function connedit_clone(&$a) { unset($clone['abook_account']); unset($clone['abook_channel']); + $abconfig = load_abconfig($channel['channel_hash'],$clone['abook_xchan']); + if($abconfig) + $clone['abconfig'] = $abconfig; + build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone))); } diff --git a/mod/follow.php b/mod/follow.php index 3ad2cb3bb..73e87c16f 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -14,7 +14,9 @@ function follow_init(&$a) { $return_url = $_SESSION['return_url']; $confirm = intval($_REQUEST['confirm']); - $result = new_contact($uid,$url,$a->get_channel(),true,$confirm); + $channel = $a->get_channel(); + + $result = new_contact($uid,$url,$channel,true,$confirm); if($result['success'] == false) { if($result['message']) @@ -34,6 +36,10 @@ function follow_init(&$a) { unset($clone['abook_account']); unset($clone['abook_channel']); + $abconfig = load_abconfig($channel['channel_hash'],$clone['abook_xchan']); + if($abconfig) + $clone['abconfig'] = $abconfig; + build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone))); diff --git a/mod/import.php b/mod/import.php index 184159585..0b239d822 100644 --- a/mod/import.php +++ b/mod/import.php @@ -341,6 +341,10 @@ function import_account(&$a, $account_id) { if($abooks) { foreach($abooks as $abook) { + $abconfig = null; + if(array_key_exists('abconfig',$abook) && is_array($abook['abconfig']) && count($abook['abconfig'])) + $abconfig = $abook['abconfig']; + unset($abook['abook_id']); unset($abook['abook_rating']); unset($abook['abook_rating_text']); @@ -382,6 +386,17 @@ function import_account(&$a, $account_id) { $friends ++; if(intval($abook['abook_feed'])) $feeds ++; + + if($abconfig) { + // @fixme does not handle sync of del_abconfig + foreach($abconfig as $abc) { + if($abc['chan'] === $channel['channel_hash']) + set_abconfig($abc['chan'],$abc['xchan'],$abc['cat'],$abc['k'],$abc['v']); + } + } + + + } } logger('import step 8'); -- cgit v1.2.3 From 0ebce75c7d53d209e47f4549105d27bbf1b5052a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 1 Mar 2016 13:09:04 +0100 Subject: css fixes to make jot look better with background colors or images --- view/css/conversation.css | 25 ++++++++++++++++++----- view/css/mod_photos.css | 2 +- view/theme/redbasic/css/style.css | 42 +++++++++++---------------------------- view/tpl/jot.tpl | 15 +++++++------- view/tpl/photos_upload.tpl | 2 +- 5 files changed, 42 insertions(+), 44 deletions(-) diff --git a/view/css/conversation.css b/view/css/conversation.css index 9063ffa60..92eafb4aa 100644 --- a/view/css/conversation.css +++ b/view/css/conversation.css @@ -19,20 +19,30 @@ code { display:none; } +#jot-title-wrap, +#jot-pagetitle-wrap, +#jot-category-wrap { + border-bottom: 1px solid #ccc; +} + +#jot-attachment-wrap { + border-top: 1px solid #ccc; +} + #jot-title-wrap input, #jot-pagetitle-wrap input { - padding: 8px; - margin-bottom: 5px; + padding: 10px; } .profile-jot-text { height: 39px; - padding: 8px; + padding: 11px; width: 100%; } .jot-attachment { - padding: 8px; + border: 0px; + padding: 11px; width: 100%; } @@ -42,13 +52,18 @@ code { } #profile-jot-submit-wrapper { - margin-top: 10px; + border-top: 1px solid #ccc; + padding: 10px; } #profile-jot-perms-end { height: 30px; } +#profile-jot-form { + line-height: 1; +} + #profile-jot-wrapper { margin-bottom: 30px; } diff --git a/view/css/mod_photos.css b/view/css/mod_photos.css index ae250bc1c..72dd7ffe7 100644 --- a/view/css/mod_photos.css +++ b/view/css/mod_photos.css @@ -25,7 +25,7 @@ } #photos-upload-choose { - padding: 4px; + padding: 7px 10px; width: 100%; } diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 5dca2785c..82b6d0277 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -295,7 +295,7 @@ footer { .vcard { margin-bottom: 10px; - padding: 10px; + padding: 0px 10px 10px 10px; background-color: rgba(254,254,254,0.5); border: 1px solid rgba(254,254,254,0.5); -moz-border-radius: $radiuspx; @@ -341,9 +341,7 @@ footer { #profile-photo-wrapper { width: 251px; height: 251px; - margin-top: -10px; margin-bottom: 10px; - border: 1px solid #ccc; border-radius: $radiuspx; } @@ -1142,7 +1140,6 @@ img.mail-conv-sender-photo { .jothidden { font-weight: bold; - border-radius: $radiuspx; } .jothidden input::-webkit-input-placeholder { @@ -1153,27 +1150,18 @@ img.mail-conv-sender-photo { font-weight: bold; } -.jothidden > input { - border: 1px solid transparent; - background-color: transparent; -} -.jothidden > input:hover, -.jothidden > input:focus { - border: 1px solid #cccccc; - background-color: #fff; -} + #profile-jot-wrapper { - background-color: rgba(254,254,254,.5); - border: 1px solid rgba(254,254,254,.5); + background-color: rgba(254,254,254,1); + border: 1px solid #ccc; border-radius: $radiuspx; } #profile-jot-text { - color:#000; - border: 1px solid #cccccc; - -moz-border-radius: $radiuspx; + resize: vertical; + border-width: 0px; border-radius: $radiuspx; } @@ -1515,7 +1503,7 @@ nav .dropdown-menu { .section-content-tools-wrapper { padding: 7px 10px; background-color: $comment_item_colour; - border-bottom: 3px solid $comment_item_colour; + border-bottom: 1px solid #ccc; } .section-content-info-wrapper { @@ -1709,9 +1697,8 @@ nav .badge.mail-update:hover { .nav-tabs.nav-justified { background-color: rgba(254,254,254,.5); - border: 1px solid rgba(254,254,254,.5); - border-top-left-radius: $radiuspx; - border-top-right-radius: $radiuspx; + border-top-left-radius: 4px; + border-top-right-radius: 4px; } .nav-tabs.nav-justified > .active > a, @@ -1824,13 +1811,13 @@ nav .badge.mail-update:hover { /* Modified original CSS to match input in Redbasic */ .jothidden .bootstrap-tagsinput { - border-color: $bgcolour; - background-color: $bgcolour; + border: 0px solid transparent; + margin-bottom: 0px; box-shadow: none; display: inline-block; border-radius: $radiuspx; cursor: text; - padding: 0px 8px; + padding: 0px 10px; width: 100%; } @@ -1838,11 +1825,6 @@ nav .badge.mail-update:hover { font-size: 100%; } -.jothidden .bootstrap-tagsinput:hover, .jothidden .bootstrap-tagsinput:focus { - border: 1px solid #ccc; - background-color: #fff; -} - /* Abusing theme-green is less work than makeing a new new one */ .theme-green .back-bar .selected-bar { background-color: #000000; background-image: none; !important } diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index 32a08a9b3..4f1ecfef2 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -1,3 +1,10 @@ +{{$mimeselect}} +{{$layoutselect}} +{{if $id_select}} +
+ {{$id_seltext}} {{$id_select}} +
+{{/if}}
{{if $parent}} @@ -17,13 +24,7 @@ {{if $showacl}}{{$acl}}{{/if}} - {{$mimeselect}} - {{$layoutselect}} - {{if $id_select}} -
- {{$id_seltext}} {{$id_select}} -
- {{/if}} + {{if $webpage}}
diff --git a/view/tpl/photos_upload.tpl b/view/tpl/photos_upload.tpl index 11a08204d..5bcef5dc1 100755 --- a/view/tpl/photos_upload.tpl +++ b/view/tpl/photos_upload.tpl @@ -26,7 +26,7 @@
{{include file="field_textarea.tpl" field=$body}}
-
+
{{if $lockstate}}
-
+ + - {{else}} + {{elseif $editmenu}} {{/if}} {{/if}} -- cgit v1.2.3 From 4df78b06cf1db2760afe10d5b905858df513d9b4 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 1 Mar 2016 15:11:15 +0100 Subject: fix padding --- view/css/mod_cloud.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/css/mod_cloud.css b/view/css/mod_cloud.css index 76ac82690..ed07ceb6f 100644 --- a/view/css/mod_cloud.css +++ b/view/css/mod_cloud.css @@ -38,6 +38,6 @@ } #files-upload { - padding: 4px; + padding: 7px 10px; width: 100%; } -- cgit v1.2.3 From 7edc505c2f261924a72055dc66561764b5863324 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Tue, 1 Mar 2016 17:54:52 +0100 Subject: fix typo in postgres schema --- install/schema_postgres.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 0ff78e873..a7cd5875c 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -560,7 +560,7 @@ CREATE TABLE "iconfig" ( "k" text NOT NULL DEFAULT '', "v" text NOT NULL DEFAULT '', "sharing" int NOT NULL DEFAULT '0', - PRIMARY_KEY("id") + PRIMARY KEY("id") ); create index "iconfig_iid" on iconfig ("iid"); create index "iconfig_cat" on iconfig ("cat"); -- cgit v1.2.3 From 966d1586c084a1c03c0c22c45efa26c1e7704d5b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 1 Mar 2016 20:40:11 +0100 Subject: fix js error and add id to field input block --- view/tpl/events-js.tpl | 2 +- view/tpl/field_input.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/view/tpl/events-js.tpl b/view/tpl/events-js.tpl index 08c8aa64a..c29d80347 100755 --- a/view/tpl/events-js.tpl +++ b/view/tpl/events-js.tpl @@ -1,7 +1,7 @@
- +
diff --git a/view/tpl/field_input.tpl b/view/tpl/field_input.tpl index 128bbfbe1..d6a7f56b2 100755 --- a/view/tpl/field_input.tpl +++ b/view/tpl/field_input.tpl @@ -1,4 +1,4 @@ -
+
{{$field.3}} -- cgit v1.2.3