From 5abd8fa70262627ed71ebf91b3bcdf0f0f03532e Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 3 Jun 2014 15:44:57 +0100 Subject: Crude, but working bellendian filter. --- mod/network.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/network.php b/mod/network.php index 8202b1044..916ac7ad8 100644 --- a/mod/network.php +++ b/mod/network.php @@ -99,7 +99,8 @@ function network_content(&$a, $update = 0, $load = false) { $conv = ((x($_GET,'conv')) ? intval($_GET['conv']) : 0); $spam = ((x($_GET,'spam')) ? intval($_GET['spam']) : 0); $cmin = ((x($_GET,'cmin')) ? intval($_GET['cmin']) : 0); - $cmax = ((x($_GET,'cmax')) ? intval($_GET['cmax']) : 99); + $cmax = get_pconfig(local_user(), system, cmax); + if (! $cmax) $cmax = ((x($_GET,'cmax')) ? intval($_GET['cmax']) : 99); $firehose = ((x($_GET,'fh')) ? intval($_GET['fh']) : 0); $file = ((x($_GET,'file')) ? $_GET['file'] : ''); -- cgit v1.2.3 From 5f6f2bb9b1a93ead1333b2e60054e48d2cb9dc58 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 3 Jun 2014 16:05:23 +0100 Subject: Revert that - sorry, pushed to the wrong repo. We probably want that in the long term, but this was a quick hack - you can't override a pconfig yet. --- mod/network.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mod/network.php b/mod/network.php index 916ac7ad8..8202b1044 100644 --- a/mod/network.php +++ b/mod/network.php @@ -99,8 +99,7 @@ function network_content(&$a, $update = 0, $load = false) { $conv = ((x($_GET,'conv')) ? intval($_GET['conv']) : 0); $spam = ((x($_GET,'spam')) ? intval($_GET['spam']) : 0); $cmin = ((x($_GET,'cmin')) ? intval($_GET['cmin']) : 0); - $cmax = get_pconfig(local_user(), system, cmax); - if (! $cmax) $cmax = ((x($_GET,'cmax')) ? intval($_GET['cmax']) : 99); + $cmax = ((x($_GET,'cmax')) ? intval($_GET['cmax']) : 99); $firehose = ((x($_GET,'fh')) ? intval($_GET['fh']) : 0); $file = ((x($_GET,'file')) ? $_GET['file'] : ''); -- cgit v1.2.3 From 565089feb435c30498bd3577e43d08919ca8f0c8 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 3 Jun 2014 19:14:19 +0100 Subject: Doco - 10% of the issues take up 90% of the time. The worst offenders are documented here. --- doc/technical_faq.bb | 38 ++++++++++++++++++++++++++++++++++++++ doc/troubleshooting.bb | 3 ++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 doc/technical_faq.bb diff --git a/doc/technical_faq.bb b/doc/technical_faq.bb new file mode 100644 index 000000000..74ee0afc5 --- /dev/null +++ b/doc/technical_faq.bb @@ -0,0 +1,38 @@ +These are common questions with answers which are almost always correct. Note these aren't the [i]only[/i] possible +answers, they're merely the most probably answers. 90% of the time, these solutions should work. The other 10% of +the time is when you should use a support forum. + +[b]I can log in, but there are no posts or webpages[/b] + +Your item table has crashed. Run the MySQL command repair table item; + +[b]Login doesn't work, immediately after login, the page reloads and I'm logged out[/b] + +Your session table has crashed. Run the MySQL command repair table session; + +[b]When I switch theme, I sometimes get elements of one theme superimposed on top of the other[/b] + +a) view/tpl/smarty/cache isn't writeable by the webserver. + +b) You're using Midori. + +[b]My network tab won't load, it appears to be caused by a photo or video[/b] + +Your PHP memory limit is too low. Increase the size of the memory_limit directive in your php.ini + +[b]I have no communication with anybody[/b] + +You're listening on port 443, but do not have a valid SSL certificate. Note this applies even if your baseurl is http. +Don't listen on port 443 if you cannot use it. + +[b]I can't see private resources[/b] + +You have disabled third party cookies. + +[b]What do I need to do when moving my hub to a different server[/b] + +1) Git clone on the new server. Repeat the process for any custom themes, and addons. +2) Copy .htconfig.php +3) Rsync everything in store/ +4) Rsync everything in custom/ +5) Dump and restore DB. diff --git a/doc/troubleshooting.bb b/doc/troubleshooting.bb index ea7dbb11a..f5572c6ed 100644 --- a/doc/troubleshooting.bb +++ b/doc/troubleshooting.bb @@ -1,5 +1,6 @@ [b]Troubleshooting[/b] +[li][zrl=[baseurl]/help/technical_faq]Technical FAQ[/zrl][/li] [li][zrl=[baseurl]/help/problems-following-an-update]Problems following an update[/zrl][/li] -Return to the [url=[baseurl]/help/main]Main documentation page[/url] \ No newline at end of file +Return to the [url=[baseurl]/help/main]Main documentation page[/url] -- cgit v1.2.3 From 30b355fa0dec7eceb52851f37a61b4c5c21fe829 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 3 Jun 2014 19:20:01 +0100 Subject: Doco - couple of typos --- doc/technical_faq.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/technical_faq.bb b/doc/technical_faq.bb index 74ee0afc5..122e82ddb 100644 --- a/doc/technical_faq.bb +++ b/doc/technical_faq.bb @@ -1,5 +1,5 @@ These are common questions with answers which are almost always correct. Note these aren't the [i]only[/i] possible -answers, they're merely the most probably answers. 90% of the time, these solutions should work. The other 10% of +answers, they're merely the most probable answers. 90% of the time, these solutions should work. The other 10% of the time is when you should use a support forum. [b]I can log in, but there are no posts or webpages[/b] @@ -12,7 +12,7 @@ Your session table has crashed. Run the MySQL command repair table session; [b]When I switch theme, I sometimes get elements of one theme superimposed on top of the other[/b] -a) view/tpl/smarty/cache isn't writeable by the webserver. +a) view/tpl/smarty3 isn't writeable by the webserver. b) You're using Midori. @@ -34,5 +34,5 @@ You have disabled third party cookies. 1) Git clone on the new server. Repeat the process for any custom themes, and addons. 2) Copy .htconfig.php 3) Rsync everything in store/ -4) Rsync everything in custom/ +4) Rsync everything in custom/ (this will only exist if you have custom modules) 5) Dump and restore DB. -- cgit v1.2.3 From c034cb5d71bec9c6ce789b52147897e8d581a70c Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Jun 2014 13:45:35 -0700 Subject: make system generated birthday events un-commentable since comments won't go where you think. --- include/event.php | 19 +++++++++++++++++-- version.inc | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/include/event.php b/include/event.php index 861d74f00..e198fe15c 100644 --- a/include/event.php +++ b/include/event.php @@ -318,7 +318,22 @@ function event_store_item($arr,$event) { } } - $prefix = (($event['type'] === 'birthday') ? t('This event has been added to your calendar.') . "\n\n" : ''); + $item_arr = array(); + $prefix = ''; + $birthday = false; + + if($event['type'] === 'birthday') { + $prefix = t('This event has been added to your calendar.'); + $birthday = true; + + // The event is created on your own site by the system, but appears to belong + // to the birthday person. It also isn't propagated - so we need to prevent + // folks from trying to comment on it. If you're looking at this and trying to + // fix it, you'll need to completely change the way birthday events are created + // and send them out from the source. This has its own issues. + + $item_arr['comment_policy'] = 'none'; + } $r = q("SELECT * FROM item left join xchan on author_xchan = xchan_hash WHERE resource_id = '%s' AND resource_type = 'event' and uid = %d LIMIT 1", dbesc($event['event_hash']), @@ -373,7 +388,6 @@ function event_store_item($arr,$event) { $private = (($arr['allow_cid'] || $arr['allow_gid'] || $arr['deny_cid'] || $arr['deny_gid']) ? 1 : 0); - $item_arr = array(); if($item) { $item_arr['id'] = $item['id']; @@ -387,6 +401,7 @@ function event_store_item($arr,$event) { $item_flags |= ITEM_ORIGIN; } $item_arr['item_flags'] = $item_flags; + } if(! $arr['mid']) diff --git a/version.inc b/version.inc index 8ff524f4f..30620af00 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2014-06-02.694 +2014-06-03.695 -- cgit v1.2.3 From 04cd60a0e3f2999bcd0c990e7a3020d151231cb2 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Jun 2014 17:17:26 -0700 Subject: add sys channel (discover) posts to "anonymous" search. They will by default be public. --- mod/display.php | 9 +++++++-- mod/search.php | 18 +++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/mod/display.php b/mod/display.php index efc3265c8..8eb271b9c 100644 --- a/mod/display.php +++ b/mod/display.php @@ -150,6 +150,9 @@ function display_content(&$a, $update = 0, $load = false) { if($load || ($_COOKIE['jsAvailable'] != 1)) { $r = null; + require_once('include/identity.php'); + $sys = get_sys_channel(); + if(local_user()) { $r = q("SELECT * from item WHERE item_restrict = 0 @@ -169,12 +172,14 @@ function display_content(&$a, $update = 0, $load = false) { $r = q("SELECT * from item WHERE item_restrict = 0 and mid = '%s' - AND ((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' + AND (((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 ) and owner_xchan in ( " . stream_perms_xchans(($observer) ? PERMS_NETWORK : PERMS_PUBLIC) . " )) + OR owner_xchan = '%s') $sql_extra ) group by mid limit 1", - dbesc($target_item['parent_mid']) + dbesc($target_item['parent_mid']), + dbesc($sys['xchan_hash']) ); } diff --git a/mod/search.php b/mod/search.php index 82990913b..16837a107 100644 --- a/mod/search.php +++ b/mod/search.php @@ -114,6 +114,10 @@ function search_content(&$a,$update = 0, $load = false) { $pub_sql = public_permissions_sql(get_observer_hash()); + require_once('include/identity.php'); + + $sys = get_sys_channel(); + if(($update) && ($load)) { $itemspage = get_pconfig(local_user(),'system','itemspage'); $a->set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); @@ -125,24 +129,24 @@ function search_content(&$a,$update = 0, $load = false) { if(local_user()) { $r = q("SELECT distinct mid, item.id as item_id, item.* from item WHERE item_restrict = 0 - AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 ) - OR ( `item`.`uid` = %d )) + AND ((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 ) + OR ( `item`.`uid` = %d )) OR item.owner_xchan = '%s' ) $sql_extra group by mid ORDER BY created DESC $pager_sql ", intval(local_user()), - intval(ABOOK_FLAG_BLOCKED) - + dbesc($sys['xchan_hash']) ); } if($r === null) { $r = q("SELECT distinct mid, item.id as item_id, item.* from item WHERE item_restrict = 0 - AND ((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' + AND (((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 ) and owner_xchan in ( " . stream_perms_xchans(($observer) ? PERMS_NETWORK : PERMS_PUBLIC) . " )) - $pub_sql ) + $pub_sql ) OR owner_xchan = '%s') $sql_extra - group by mid ORDER BY created DESC $pager_sql" + group by mid ORDER BY created DESC $pager_sql", + dbesc($sys['xchan_hash']) ); } } -- cgit v1.2.3 From 97a4479513130658fffdcc1f8ef0d349f08520bc Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Jun 2014 18:19:27 -0700 Subject: don't provide a second (actually third counting the navbar) search box on the search page if you've got saved searches turned on. This should solve some problems with duplicate html id's (and save wasn't working anyway). If you don't have saved search ability (which will provide a saved search widget in the sidebar), provide a simple search box in the main content region but without save ability. --- include/widgets.php | 2 +- mod/search.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/widgets.php b/include/widgets.php index c7a4da6a0..d197eb240 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -264,7 +264,7 @@ function widget_savedsearch($arr) { $o = replace_macros($tpl, array( '$title' => t('Saved Searches'), '$add' => t('add'), - '$searchbox' => searchbox('','netsearch-box',$srchurl . (($hasq) ? '' : '?f='),true), + '$searchbox' => searchbox($search,'netsearch-box',$srchurl . (($hasq) ? '' : '?f='),true), '$saved' => $saved, )); diff --git a/mod/search.php b/mod/search.php index 16837a107..2c2e8c86a 100644 --- a/mod/search.php +++ b/mod/search.php @@ -39,7 +39,8 @@ function search_content(&$a,$update = 0, $load = false) { $search = ((x($_GET,'tag')) ? trim(rawurldecode($_GET['tag'])) : ''); } - $o .= search($search,'search-box','/search',((local_user()) ? true : false)); + if((! local_user()) || (! feature_enabled(local_user(),'savedsearch'))) + $o .= search($search,'search-box','/search',((local_user()) ? true : false)); if(strpos($search,'#') === 0) { $tag = true; -- cgit v1.2.3 From 737d3f583665f24881e484b40acf0bbc5f498e48 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Jun 2014 19:25:59 -0700 Subject: don't add a birthday event if the birthday channel doesn't have permission to send you posts. --- include/datetime.php | 5 +++++ include/widgets.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/datetime.php b/include/datetime.php index 4884cda11..0214b9e4c 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -484,11 +484,16 @@ function z_birthday($dob,$tz,$format="Y-m-d H:i:s") { function update_birthdays() { require_once('include/event.php'); + require_once('include/permissions.php'); $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_dob > utc_timestamp() + interval 7 day and abook_dob < utc_timestamp() + interval 14 day"); if($r) { foreach($r as $rr) { + + if(! perm_is_allowed($rr['abook_channel'],$rr['xchan_hash'],'send_stream')) + continue; + $ev = array(); $ev['uid'] = $rr['abook_channel']; $ev['account'] = $rr['abook_account']; diff --git a/include/widgets.php b/include/widgets.php index d197eb240..96bced87f 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -196,7 +196,7 @@ function widget_savedsearch($arr) { $a = get_app(); $search = ((x($_GET,'search')) ? $_GET['search'] : ''); - + if(x($_GET,'searchsave') && $search) { $r = q("select * from `term` where `uid` = %d and `type` = %d and `term` = '%s' limit 1", intval(local_user()), -- cgit v1.2.3 From b5617a5552896a7715264a374299a241df47b062 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Jun 2014 19:45:38 -0700 Subject: suggest app --- app/suggest.apd | 4 ++++ app/suggest.png | Bin 0 -> 2164 bytes include/apps.php | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 app/suggest.apd create mode 100644 app/suggest.png diff --git a/app/suggest.apd b/app/suggest.apd new file mode 100644 index 000000000..ff82a73d3 --- /dev/null +++ b/app/suggest.apd @@ -0,0 +1,4 @@ +url: $baseurl/suggest +requires: local_user +name: Suggest +photo: $baseurl/app/suggest.png diff --git a/app/suggest.png b/app/suggest.png new file mode 100644 index 000000000..6868da30f Binary files /dev/null and b/app/suggest.png differ diff --git a/include/apps.php b/include/apps.php index a24d8e503..f7b09c7b6 100644 --- a/include/apps.php +++ b/include/apps.php @@ -131,7 +131,9 @@ function translate_system_apps(&$arr) { 'Mood' => t('Mood'), 'Poke' => t('Poke'), 'Chat' => t('Chat'), - 'Search' => t('Search') + 'Search' => t('Search'), + 'Probe' => t('Probe'), + 'Suggest' => t('Suggest') ); if(array_key_exists($arr['name'],$apps)) -- cgit v1.2.3 From 424f23858ef10066d913db5ada45786f1beaea29 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Jun 2014 22:30:05 -0700 Subject: add an icon to connect actions --- view/js/icon_translate.js | 1 + view/theme/redbasic/css/style.css | 4 ++++ view/tpl/direntry.tpl | 2 +- view/tpl/direntry_large.tpl | 2 +- view/tpl/match.tpl | 2 +- view/tpl/profile_vcard.tpl | 2 +- view/tpl/suggest_friends.tpl | 2 +- 7 files changed, 10 insertions(+), 5 deletions(-) diff --git a/view/js/icon_translate.js b/view/js/icon_translate.js index 930d3b265..fcbc26a3f 100644 --- a/view/js/icon_translate.js +++ b/view/js/icon_translate.js @@ -54,4 +54,5 @@ $(document).ready(function() { $('.icon-bookmark').addClass(''); $('.icon-fullscreen').addClass(''); $('.icon-share').addClass(''); + $('.icon-plus').addClass(''); }); \ No newline at end of file diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 262819469..422a72e26 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -43,6 +43,10 @@ abbr { text-indent: 0px; } +.connect-icon { + margin-right: 5px; +} + a, a:visited, a:link, .fakelink, .fakelink:visited, .fakelink:link { font-weight: bold; color: $link_colour; diff --git a/view/tpl/direntry.tpl b/view/tpl/direntry.tpl index 7a3d42e01..e5f12944e 100755 --- a/view/tpl/direntry.tpl +++ b/view/tpl/direntry.tpl @@ -9,7 +9,7 @@
{{$entry.name}}
{{if $entry.connect}} - + {{/if}}
{{$entry.details}}
diff --git a/view/tpl/direntry_large.tpl b/view/tpl/direntry_large.tpl index 487839f7a..da6ea1a44 100755 --- a/view/tpl/direntry_large.tpl +++ b/view/tpl/direntry_large.tpl @@ -15,7 +15,7 @@
{{$name}}{{if $online}} {{/if}}
{{if $connect}} - + {{/if}}
{{$address}}
diff --git a/view/tpl/match.tpl b/view/tpl/match.tpl index 0688ca26b..41587430b 100755 --- a/view/tpl/match.tpl +++ b/view/tpl/match.tpl @@ -10,7 +10,7 @@
{{if $connlnk}} - + {{/if}} diff --git a/view/tpl/profile_vcard.tpl b/view/tpl/profile_vcard.tpl index 10a0a25a9..d72507d4c 100755 --- a/view/tpl/profile_vcard.tpl +++ b/view/tpl/profile_vcard.tpl @@ -45,7 +45,7 @@ {{if $connect}} -{{$connect}} + {{$connect}} {{/if}} diff --git a/view/tpl/suggest_friends.tpl b/view/tpl/suggest_friends.tpl index 0388504d2..6cf8f7ba8 100755 --- a/view/tpl/suggest_friends.tpl +++ b/view/tpl/suggest_friends.tpl @@ -11,6 +11,6 @@
{{if $entry.connlnk}} - + {{/if}} -- cgit v1.2.3 From d84f03d59b4b3f625b36852211698f5606b6b37c Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 4 Jun 2014 01:37:50 -0700 Subject: if photo import failed during channel import, reset the xchan_photo_date so it will automatically fix itself. --- mod/import.php | 8 +++++++- version.inc | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mod/import.php b/mod/import.php index 5b3b53156..d3b237c3a 100644 --- a/mod/import.php +++ b/mod/import.php @@ -254,12 +254,18 @@ function import_post(&$a) { require_once('include/photo/photo_driver.php'); $photos = import_profile_photo($xchan['xchan_photo_l'],$xchan['xchan_hash']); - $r = q("update xchan set xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s' + if($photos[4]) + $photodate = '0000-00-00 00:00:00'; + else + $photodate = $xchan['xchan_photo_date']; + + $r = q("update xchan set xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s', xchan_photo_date = '%s' where xchan_hash = '%s' limit 1", dbesc($photos[0]), dbesc($photos[1]), dbesc($photos[2]), dbesc($photos[3]), + dbesc($photodate), dbesc($xchan_hash) ); diff --git a/version.inc b/version.inc index 30620af00..1bedfc22b 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2014-06-03.695 +2014-06-04.696 -- cgit v1.2.3