From 67899677db8bde044284aaec6237559a68a27b6a Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 15:50:07 -0800 Subject: [PATCH 01/11] make chat honour the pause key (but we still need to ping the server to maintain the in_room status), also the recent change to pull css out of the template file used classes instead of ids so none of the styles were sticking --- mod/chatsvc.php | 94 ++++++++++++++++++++++--------------------- view/css/mod_chat.css | 8 ++-- view/tpl/chat.tpl | 4 +- 3 files changed, 55 insertions(+), 51 deletions(-) diff --git a/mod/chatsvc.php b/mod/chatsvc.php index bbe616c48..e6590f57a 100644 --- a/mod/chatsvc.php +++ b/mod/chatsvc.php @@ -56,6 +56,7 @@ function chatsvc_content(&$a) { $status = strip_tags($_REQUEST['status']); $room_id = intval($a->data['chat']['room_id']); + $stopped = ((x($_REQUEST,'stopped') && intval($_REQUEST['stopped'])) ? true : false); if($status && $room_id) { @@ -74,58 +75,60 @@ function chatsvc_content(&$a) { goaway(z_root() . '/chat/' . $x[0]['channel_address'] . '/' . $room_id); } + if(! $stopped) { - $lastseen = intval($_REQUEST['last']); + $lastseen = intval($_REQUEST['last']); - $ret = array('success' => false); + $ret = array('success' => false); - $sql_extra = permissions_sql($a->data['chat']['uid']); + $sql_extra = permissions_sql($a->data['chat']['uid']); - $r = q("select * from chatroom where cr_uid = %d and cr_id = %d $sql_extra", - intval($a->data['chat']['uid']), - intval($a->data['chat']['room_id']) - ); - if(! $r) - json_return_and_die($ret); + $r = q("select * from chatroom where cr_uid = %d and cr_id = %d $sql_extra", + intval($a->data['chat']['uid']), + intval($a->data['chat']['room_id']) + ); + if(! $r) + json_return_and_die($ret); - $inroom = array(); + $inroom = array(); - $r = q("select * from chatpresence left join xchan on xchan_hash = cp_xchan where cp_room = %d order by xchan_name", - intval($a->data['chat']['room_id']) - ); - if($r) { - foreach($r as $rr) { - switch($rr['cp_status']) { - case 'away': - $status = t('Away'); - break; - case 'online': - default: - $status = t('Online'); - break; + $r = q("select * from chatpresence left join xchan on xchan_hash = cp_xchan where cp_room = %d order by xchan_name", + intval($a->data['chat']['room_id']) + ); + if($r) { + foreach($r as $rr) { + switch($rr['cp_status']) { + case 'away': + $status = t('Away'); + break; + case 'online': + default: + $status = t('Online'); + break; + } + + $inroom[] = array('img' => zid($rr['xchan_photo_m']), 'img_type' => $rr['xchan_photo_mimetype'],'name' => $rr['xchan_name'], status => $status); } - - $inroom[] = array('img' => zid($rr['xchan_photo_m']), 'img_type' => $rr['xchan_photo_mimetype'],'name' => $rr['xchan_name'], status => $status); } - } - $chats = array(); + $chats = array(); - $r = q("select * from chat left join xchan on chat_xchan = xchan_hash where chat_room = %d and chat_id > %d", - intval($a->data['chat']['room_id']), - intval($lastseen) - ); - if($r) { - foreach($r as $rr) { - $chats[] = array( - 'id' => $rr['chat_id'], - 'img' => zid($rr['xchan_photo_m']), - 'img_type' => $rr['xchan_photo_mimetype'], - 'name' => $rr['xchan_name'], - 'isotime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'c'), - 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'r'), - 'text' => smilies(bbcode($rr['chat_text'])) - ); + $r = q("select * from chat left join xchan on chat_xchan = xchan_hash where chat_room = %d and chat_id > %d", + intval($a->data['chat']['room_id']), + intval($lastseen) + ); + if($r) { + foreach($r as $rr) { + $chats[] = array( + 'id' => $rr['chat_id'], + 'img' => zid($rr['xchan_photo_m']), + 'img_type' => $rr['xchan_photo_mimetype'], + 'name' => $rr['xchan_name'], + 'isotime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'c'), + 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'r'), + 'text' => smilies(bbcode($rr['chat_text'])) + ); + } } } @@ -137,9 +140,10 @@ function chatsvc_content(&$a) { ); $ret['success'] = true; - $ret['inroom'] = $inroom; - $ret['chats'] = $chats; - + if(! $stopped) { + $ret['inroom'] = $inroom; + $ret['chats'] = $chats; + } json_return_and_die($ret); } diff --git a/view/css/mod_chat.css b/view/css/mod_chat.css index 7f33f2c48..ce6e59af1 100644 --- a/view/css/mod_chat.css +++ b/view/css/mod_chat.css @@ -1,23 +1,23 @@ - .chatContainer { + #chatContainer { height: 100%; width: 100%; } - .chatTopBar { + #chatTopBar { float: left; height: 400px; width: 650px; overflow-y: auto; } - .chatUsers { + #chatUsers { float: right; width: 120px; height: 100%; border: 1px solid #000; } - .chatBottomBar { + #chatBottomBar { position: relative; bottom: 0; height: 150px; diff --git a/view/tpl/chat.tpl b/view/tpl/chat.tpl index eb98063fa..e4cd1d20b 100644 --- a/view/tpl/chat.tpl +++ b/view/tpl/chat.tpl @@ -47,8 +47,8 @@ $('#chat-form').submit(function(ev) { function load_chats() { - $.get("chatsvc?f=&room_id=" + room_id + '&last=' + last_chat,function(data) { - if(data.success) { + $.get("chatsvc?f=&room_id=" + room_id + '&last=' + last_chat + ((stopped) ? '&stopped=1' : ''),function(data) { + if(data.success && (! stopped)) { update_inroom(data.inroom); update_chats(data.chats); } From abb68e846d828995f6ba016246143ba3d6f04181 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 16:02:04 -0800 Subject: [PATCH 02/11] remove the text "requires compatible chat plugin" --- include/permissions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/permissions.php b/include/permissions.php index 45ea7c3eb..1b11dfb87 100644 --- a/include/permissions.php +++ b/include/permissions.php @@ -24,7 +24,7 @@ function get_perms() { 'post_mail' => array('channel_w_mail', intval(PERMS_W_MAIL), false, t('Can send me private mail messages'), ''), 'post_photos' => array('channel_w_photos', intval(PERMS_W_PHOTOS), false, t('Can post photos to my photo albums'), ''), 'tag_deliver' => array('channel_w_tagwall', intval(PERMS_W_TAGWALL), false, t('Can forward to all my channel contacts via post @mentions'), t('Advanced - useful for creating group forum channels')), - 'chat' => array('channel_w_chat', intval(PERMS_W_CHAT), false, t('Can chat with me (when available)'), t('Requires compatible chat plugin')), + 'chat' => array('channel_w_chat', intval(PERMS_W_CHAT), false, t('Can chat with me (when available)'), t('')), 'write_storage' => array('channel_w_storage', intval(PERMS_W_STORAGE), false, t('Can write to my "public" file storage'), ''), 'write_pages' => array('channel_w_pages', intval(PERMS_W_PAGES), false, t('Can edit my "public" pages'), ''), From 2768262f9386e063efb4d7e276c5a7108c40d44b Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 16:49:09 -0800 Subject: [PATCH 03/11] Add switch to allow menus to be used as bookmark collections --- include/menu.php | 2 +- mod/menu.php | 4 ++++ view/tpl/menuedit.tpl | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/menu.php b/include/menu.php index d69c5d0d3..be9831951 100644 --- a/include/menu.php +++ b/include/menu.php @@ -152,7 +152,7 @@ function menu_edit($arr) { return false; } - return q("update menu set menu_name = '%s', menu_desc = '%s', menu_flags = %d, + return q("update menu set menu_name = '%s', menu_desc = '%s', menu_flags = %d where menu_id = %d and menu_channel_id = %d limit 1", dbesc($menu_name), dbesc($menu_desc), diff --git a/mod/menu.php b/mod/menu.php index 47eed6484..3d6b9939c 100644 --- a/mod/menu.php +++ b/mod/menu.php @@ -8,6 +8,8 @@ function menu_post(&$a) { return; $_REQUEST['menu_channel_id'] = local_user(); + if($_REQUEST['menu_bookmark']) + $_REQUEST['menu_flags'] = MENU_BOOKMARK; $menu_id = ((argc() > 1) ? intval(argv(1)) : 0); if($menu_id) { @@ -76,6 +78,7 @@ function menu_content(&$a) { '$header' => t('New Menu'), '$menu_name' => array('menu_name', t('Menu name'), '', t('Must be unique, only seen by you'), '*'), '$menu_desc' => array('menu_desc', t('Menu title'), '', t('Menu title as seen by others'), ''), + '$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), 0 , t('Menu can be used to store saved bookmarks'), ''), '$submit' => t('Create') )); return $o; @@ -104,6 +107,7 @@ function menu_content(&$a) { '$editcontents' => t('Edit menu contents'), '$menu_name' => array('menu_name', t('Menu name'), $m['menu_name'], t('Must be unique, only seen by you'), '*'), '$menu_desc' => array('menu_desc', t('Menu title'), $m['menu_desc'], t('Menu title as seen by others'), ''), + '$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), (($m['menu_flags'] & MENU_BOOKMARK) ? 1 : 0), t('Menu can be used to store saved bookmarks'), ''), '$submit' => t('Modify') )); return $o; diff --git a/view/tpl/menuedit.tpl b/view/tpl/menuedit.tpl index ea9e775e2..324dbe426 100644 --- a/view/tpl/menuedit.tpl +++ b/view/tpl/menuedit.tpl @@ -13,7 +13,7 @@ {{include file="field_input.tpl" field=$menu_name}} {{include file="field_input.tpl" field=$menu_desc}} - +{{include file="field_checkbox.tpl" field=$menu_bookmark}} From 3eed73d5195bbf736e2e243b512155b6933108a1 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 16:51:11 -0800 Subject: [PATCH 04/11] minor text change "can" -> "may" --- mod/menu.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/menu.php b/mod/menu.php index 3d6b9939c..dd8fe8300 100644 --- a/mod/menu.php +++ b/mod/menu.php @@ -78,7 +78,7 @@ function menu_content(&$a) { '$header' => t('New Menu'), '$menu_name' => array('menu_name', t('Menu name'), '', t('Must be unique, only seen by you'), '*'), '$menu_desc' => array('menu_desc', t('Menu title'), '', t('Menu title as seen by others'), ''), - '$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), 0 , t('Menu can be used to store saved bookmarks'), ''), + '$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), 0 , t('Menu may be used to store saved bookmarks'), ''), '$submit' => t('Create') )); return $o; @@ -107,7 +107,7 @@ function menu_content(&$a) { '$editcontents' => t('Edit menu contents'), '$menu_name' => array('menu_name', t('Menu name'), $m['menu_name'], t('Must be unique, only seen by you'), '*'), '$menu_desc' => array('menu_desc', t('Menu title'), $m['menu_desc'], t('Menu title as seen by others'), ''), - '$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), (($m['menu_flags'] & MENU_BOOKMARK) ? 1 : 0), t('Menu can be used to store saved bookmarks'), ''), + '$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), (($m['menu_flags'] & MENU_BOOKMARK) ? 1 : 0), t('Menu may be used to store saved bookmarks'), ''), '$submit' => t('Modify') )); return $o; From d2b55f5eeab330b08410424d96211f40050d7a1f Mon Sep 17 00:00:00 2001 From: Tazman DeVille Date: Mon, 3 Feb 2014 02:06:07 +0100 Subject: [PATCH 05/11] added Thomas' additional navbar colours from APW to redbasic --- view/theme/redbasic/php/config.php | 14 ++++++++++--- view/theme/redbasic/php/style.php | 32 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index d6adf5381..68a72fffd 100644 --- a/view/theme/redbasic/php/config.php +++ b/view/theme/redbasic/php/config.php @@ -74,9 +74,17 @@ function redbasic_form(&$a, $arr) { $nav_colours = array ( '' => t('Scheme Default'), - 'red' => t('red'), - 'black' => t('black'), - 'silver' => t('silver'), + 'red' => 'red', + 'pink' => 'pink', + 'green' => 'green', + 'blue' => 'blue', + 'purple' => 'purple', + 'black' => 'black', + 'orange' => 'orange', + 'brown' => 'brown', + 'grey' => 'grey', + 'gold' => 'gold', + 'silver' => t('silver'), ); if(feature_enabled(local_user(),'expert')) diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index 981aaddb2..aec27961e 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -133,6 +133,38 @@ $nav_bg_1 = $nav_bg_2 = $nav_bg_3 = $nav_bg_4 = "silver"; $search_background = '#EEEEEE'; } + if($nav_colour === "pink") { + $nav_bg_1 = $nav_bg_3 = "#FFC1CA"; + $nav_bg_2 = $nav_bg_4 = "#FFC1CA"; + } + if($nav_colour === "green") { + $nav_bg_1 = $nav_bg_3 = "#5CD65C"; + $nav_bg_2 = $nav_bg_4 = "#5CD65C"; + } + if($nav_colour === "blue") { + $nav_bg_1 = $nav_bg_3 = "#1872a2"; + $nav_bg_2 = $nav_bg_4 = "#1872a2"; + } + if($nav_colour === "purple") { + $nav_bg_1 = $nav_bg_3 = "#551A8B"; + $nav_bg_2 = $nav_bg_4 = "#551A8B"; + } + if($nav_colour === "orange") { + $nav_bg_1 = $nav_bg_3 = "#FF3D0D"; + $nav_bg_2 = $nav_bg_4 = "#FF3D0D"; + } + if($nav_colour === "brown") { + $nav_bg_1 = $nav_bg_3 = "#330000"; + $nav_bg_2 = $nav_bg_4 = "#330000"; + } + if($nav_colour === "grey") { + $nav_bg_1 = $nav_bg_3 = "#2e2f2e"; + $nav_bg_2 = $nav_bg_4 = "#2e2f2e"; + } + if($nav_colour === "gold") { + $nav_bg_1 = $nav_bg_3 = "#FFAA00"; + $nav_bg_2 = $nav_bg_4 = "#FFAA00"; + } // Apply the settings From ee1580427e9a1bc4e2b86906f7b42d3071ed516d Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 17:54:36 -0800 Subject: [PATCH 06/11] don't draw attention to advanced permissions and their corresponding complexity and clearly mark the simple permissions which people are encouraged to use. --- mod/connedit.php | 8 +++---- mod/settings.php | 10 ++++---- view/css/mod_connedit.css | 14 +++++++++++ view/css/mod_settings.css | 14 +++++++++++ view/tpl/abook_edit.tpl | 49 ++++++++++++++++++++++----------------- view/tpl/settings.tpl | 3 ++- 6 files changed, 68 insertions(+), 30 deletions(-) diff --git a/mod/connedit.php b/mod/connedit.php index e2d4b861c..b7101fcab 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -442,13 +442,13 @@ function connedit_content(&$a) { '$perms' => $perms, '$forum' => t('Forum Members'), '$soapbox' => t('Soapbox'), - '$full' => t('Full Sharing'), - '$cautious' => t('Cautious Sharing'), + '$full' => t('Full Sharing (typical social network permissions)'), + '$cautious' => t('Cautious Sharing '), '$follow' => t('Follow Only'), '$permlbl' => t('Individual Permissions'), - '$permnote' => t('Some permissions may be inherited from your channel privacy settings, which have higher priority. Changing those inherited settings on this page will have no effect.'), + '$permnote' => t('Some permissions may be inherited from your channel privacy settings, which have higher priority than individual settings. Changing those inherited settings on this page will have no effect.'), '$advanced' => t('Advanced Permissions'), - '$quick' => t('Quick Links'), + '$quick' => t('Simple Permissions (select one and submit)'), '$common_link' => $a->get_baseurl(true) . '/common/loc/' . local_user() . '/' . $contact['id'], '$all_friends' => $all_friends, '$relation_text' => $relation_text, diff --git a/mod/settings.php b/mod/settings.php index 7ff76cd3e..c0e8122cb 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -923,15 +923,17 @@ function settings_content(&$a) { '$h_prv' => t('Security and Privacy Settings'), - '$hide_presence' => array('hide_presence', t('Hide my online presence'),$hide_presence, t('Prevents showing if you are available for chat')), + '$hide_presence' => array('hide_presence', t('Hide my online presence'),$hide_presence, t('Prevents displaying in your profile that you are online')), - '$lbl_pmacro' => t('Quick Privacy Settings:'), - '$pmacro3' => t('Very Public - extremely permissive'), - '$pmacro2' => t('Typical - default public, privacy when desired'), + '$lbl_pmacro' => t('Simple Privacy Settings:'), + '$pmacro3' => t('Very Public - extremely permissive (use with caution)'), + '$pmacro2' => t('Typical - default public, privacy when desired (similar to social network permissions)'), '$pmacro1' => t('Private - default private, rarely open or public'), '$pmacro0' => t('Blocked - default blocked to/from everybody'), '$permiss_arr' => $permiss, + '$lbl_p2macro' => t('Advanced Privacy Settings'), + '$maxreq' => array('maxreq', t('Maximum Friend Requests/Day:'), intval($channel['channel_max_friend_req']) , t('May reduce spam activity')), '$permissions' => t('Default Post Permissions'), '$permdesc' => t("\x28click to open/close\x29"), diff --git a/view/css/mod_connedit.css b/view/css/mod_connedit.css index c460fec28..f6da96433 100644 --- a/view/css/mod_connedit.css +++ b/view/css/mod_connedit.css @@ -135,3 +135,17 @@ .contact-entry-end { clear: both; } + +#abook-advanced-panel, #abook-advanced { + opacity: 0.3; + filter:alpha(opacity=30); +} + +#abook-advanced-panel:hover, #abook-advanced:hover { + opacity: 1.0; + filter:alpha(opacity=100); +} + +#abook-advanced { + margin-top: 15px; +} \ No newline at end of file diff --git a/view/css/mod_settings.css b/view/css/mod_settings.css index 601cb2e0e..2049d9bc6 100644 --- a/view/css/mod_settings.css +++ b/view/css/mod_settings.css @@ -1,3 +1,17 @@ +#settings-permissions-wrapper, #settings-perm-advanced { + opacity: 0.3; + filter:alpha(opacity=30); +} + +#settings-permissions-wrapper:hover, #settings-perm-advanced:hover { + opacity: 1.0; + filter:alpha(opacity=100); +} + +#settings-perm-advanced { + margin-top: 15px; +} + #settings-permissions-wrapper .field { margin-bottom: 10px; } diff --git a/view/tpl/abook_edit.tpl b/view/tpl/abook_edit.tpl index 590213fd3..265a1a953 100755 --- a/view/tpl/abook_edit.tpl +++ b/view/tpl/abook_edit.tpl @@ -31,18 +31,6 @@ -

{{$permlbl}}

-
{{$permnote}}
- -
- - - -{{if $noperms}} -
{{$noperms}}
-
{{$noperm_desc}}
-{{/if}} - {{if $is_pending}}
@@ -50,8 +38,32 @@
{{/if}} +{{if $multiprofs }} +
+

{{$lbl_vis1}}

+
{{$lbl_vis2}}
+ +{{$profile_select}} +
+{{/if}} + +

{{$permlbl}}

+
{{$permnote}}
+ + + + + +{{* {{if $noperms}} +
{{$noperms}}
+
{{$noperm_desc}}
+{{/if}} +*}} + + +
-{{$quick}} +

{{$quick}}

    {{if $self}}
  • {{$forum}}
  • @@ -62,6 +74,9 @@
  • {{$follow}}
+ + +
@@ -76,14 +91,6 @@
-{{if $multiprofs }} -
-

{{$lbl_vis1}}

-
{{$lbl_vis2}}
- -{{$profile_select}} -
-{{/if}} diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl index b1a4f956d..ab5bb02cc 100755 --- a/view/tpl/settings.tpl +++ b/view/tpl/settings.tpl @@ -25,7 +25,7 @@ {{include file="field_checkbox.tpl" field=$hide_presence}} -
{{$lbl_pmacro}}
+

{{$lbl_pmacro}}

+

{{$lbl_p2macro}}

{{foreach $permiss_arr as $permit}} From 38bce48f288244c967d325639e033e0602fa0bcc Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 18:06:15 -0800 Subject: [PATCH 07/11] wordsmithing --- mod/settings.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mod/settings.php b/mod/settings.php index c0e8122cb..543bef5ed 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -926,10 +926,10 @@ function settings_content(&$a) { '$hide_presence' => array('hide_presence', t('Hide my online presence'),$hide_presence, t('Prevents displaying in your profile that you are online')), '$lbl_pmacro' => t('Simple Privacy Settings:'), - '$pmacro3' => t('Very Public - extremely permissive (use with caution)'), - '$pmacro2' => t('Typical - default public, privacy when desired (similar to social network permissions)'), - '$pmacro1' => t('Private - default private, rarely open or public'), - '$pmacro0' => t('Blocked - default blocked to/from everybody'), + '$pmacro3' => t('Very Public - extremely permissive (should be used with caution)'), + '$pmacro2' => t('Typical - default public, privacy when desired (similar to social network permissions but with improved privacy)'), + '$pmacro1' => t('Private - default private, never open or public'), + '$pmacro0' => t('Blocked - default blocked to/from everybody'), '$permiss_arr' => $permiss, '$lbl_p2macro' => t('Advanced Privacy Settings'), From baf3b052f645d7826ada25a05c742d1e5d4a0b51 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 18:18:22 -0800 Subject: [PATCH 08/11] don't load any configs from DB if installing - especially in style.pcss --- boot.php | 1 + index.php | 10 +++++----- view/theme/redbasic/php/style.php | 6 +++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/boot.php b/boot.php index 8460d76c6..c58580312 100755 --- a/boot.php +++ b/boot.php @@ -576,6 +576,7 @@ function startup() { class App { + public $install = false; // true if we are installing the software public $account = null; // account record of the logged-in account public $channel = null; // channel record of the current channel of the logged-in account diff --git a/index.php b/index.php index 0012798a6..736918661 100755 --- a/index.php +++ b/index.php @@ -23,7 +23,7 @@ $a = new App; * */ -$install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false : true); +$a->install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false : true); @include(".htconfig.php"); @@ -38,8 +38,8 @@ $a->language = get_best_language(); require_once("include/dba/dba_driver.php"); -if(! $install) { - $db = dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $install); +if(! $a->install) { + $db = dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $a->install); unset($db_host, $db_port, $db_user, $db_pass, $db_data); /** @@ -91,7 +91,7 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) { load_translation_table($a->language); } -if((x($_GET,'zid')) && (! $install)) { +if((x($_GET,'zid')) && (! $a->install)) { $a->query_string = preg_replace('/[\?&]zid=(.*?)([\?&]|$)/is','',$a->query_string); if(! local_user()) { $_SESSION['my_address'] = $_GET['zid']; @@ -116,7 +116,7 @@ if(! x($_SESSION,'sysmsg_info')) */ -if($install) { +if($a->install) { /* Allow an exception for the view module so that pcss will be interpreted during installation */ if($a->module != 'view') $a->module = 'setup'; diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index aec27961e..8d5c23a03 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -1,5 +1,7 @@ install) { + // Get the UID of the channel owner $uid = get_theme_uid(); if($uid) @@ -32,6 +34,8 @@ $top_photo=get_pconfig($uid,'redbasic','top_photo'); $reply_photo=get_pconfig($uid,'redbasic','reply_photo'); +} + // Now load the scheme. If a value is changed above, we'll keep the settings // If not, we'll keep those defined by the schema // Setting $scheme to '' wasn't working for some reason, so we'll check it's From 5cc6efe21f51f5e3696b5f047a74186e957a7780 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 20:14:57 -0800 Subject: [PATCH 09/11] changed order of the privacy macros so that the dangerous settings come last and the preferred settings come first --- view/tpl/settings.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl index ab5bb02cc..c4b89a543 100755 --- a/view/tpl/settings.tpl +++ b/view/tpl/settings.tpl @@ -27,9 +27,9 @@

{{$lbl_pmacro}}

From c7cad26b4187736065d02876c3a260309a5c6691 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 20:22:41 -0800 Subject: [PATCH 10/11] more wordsmithing --- mod/settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/settings.php b/mod/settings.php index 543bef5ed..38b1d6fdf 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -919,7 +919,7 @@ function settings_content(&$a) { '$defloc' => array('defloc', t('Default Post Location:'), $defloc, ''), '$allowloc' => array('allow_location', t('Use Browser Location:'), ((get_pconfig(local_user(),'system','use_browser_location')) ? 1 : ''), ''), - '$adult' => array('adult', t('Adult Content'), $adult_flag, t('This channel publishes adult content.')), + '$adult' => array('adult', t('Adult Content'), $adult_flag, t('This channel frequently or regularly publishes adult content. (Please tag any adult material and/or nudity with #NSFW)')), '$h_prv' => t('Security and Privacy Settings'), From ee42079685dd4df721b1090bdaa0d86316e3358a Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 2 Feb 2014 21:25:52 -0800 Subject: [PATCH 11/11] The problem with a lot of packages is that it's easier to re-write them than to re-use them. --- include/spam.php | 35 +++++++++++++++++++++++ library/spam/b8/storage/storage_frndc.php | 8 +++--- 2 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 include/spam.php diff --git a/include/spam.php b/include/spam.php new file mode 100644 index 000000000..8b158b7ae --- /dev/null +++ b/include/spam.php @@ -0,0 +1,35 @@ + 2) + $ret[] = substr($y,0,64); + } + } + return $ret; +} + + + +function get_words($uid,$list) { + + stringify($list,true); + + $r = q("select * from spam where term in ( " . $list . ") and uid = %d", + intval($uid) + ); + + return $r; +} + diff --git a/library/spam/b8/storage/storage_frndc.php b/library/spam/b8/storage/storage_frndc.php index 62909d471..f211d4431 100644 --- a/library/spam/b8/storage/storage_frndc.php +++ b/library/spam/b8/storage/storage_frndc.php @@ -205,7 +205,7 @@ class b8_storage_frndc extends b8_storage_base foreach($to_create as $term) { if(strlen($sql)) $sql .= ','; - $sql .= sprintf("(term,datetime,uid) values('%s','%s',%d)", + $sql .= sprintf("(term,date,uid) values('%s','%s',%d)", dbesc(str_tolower($term)) dbesc(datetime_convert()), intval($uid) @@ -280,16 +280,16 @@ class b8_storage_frndc extends b8_storage_base $result = q(' DELETE FROM ' . $this->config['table_name'] . ' - WHERE token IN ("' . implode('", "', $this->_deletes) . '") AND uid = ' . $this->uid); + WHERE term IN ("' . implode('", "', $this->_deletes) . '") AND uid = ' . $this->uid); $this->_deletes = array(); } if(count($this->_puts) > 0) { - +//fixme $result = q(' - INSERT INTO ' . $this->config['table_name'] . '(token, count, uid) + INSERT INTO ' . $this->config['table_name'] . '(term, count, uid) VALUES ' . implode(', ', $this->_puts)); $this->_puts = array();