From fd3274ff5342491e9cec4fe9c628bfccfeeaa517 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 23 Feb 2012 16:17:36 +0100 Subject: less html in mod/group.php, template for group members editor, quattro theme for group edit. --- mod/group.php | 80 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 39 insertions(+), 41 deletions(-) (limited to 'mod') diff --git a/mod/group.php b/mod/group.php index c896362ca..f6f8e4173 100755 --- a/mod/group.php +++ b/mod/group.php @@ -76,14 +76,17 @@ function group_content(&$a) { if($switchtotext === false) $switchtotext = 400; + $tpl = get_markup_template('group_edit.tpl'); + $context = array('$submit' => t('Submit')); + if(($a->argc == 2) && ($a->argv[1] === 'new')) { - $tpl = get_markup_template('group_new.tpl'); - $o .= replace_macros($tpl,array( - '$desc' => t('Create a group of contacts/friends.'), - '$name' => t('Group Name: '), - '$submit' => t('Submit') - )); - return $o; + + return replace_macros($tpl, $context + array( + '$title' => t('Create a group of contacts/friends.'), + '$gname' => array('groupname',t('Group Name: '),$group['name'], ''), + )); + + } if(($a->argc == 3) && ($a->argv[1] === 'drop')) { @@ -156,66 +159,61 @@ function group_content(&$a) { $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); - $tpl = get_markup_template('group_edit.tpl'); - $o .= replace_macros($tpl, array( + + $context = $context + array( + '$title' => t('Group Editor'), + '$gname' => array('groupname',t('Group Name: '),$group['name'], ''), '$gid' => $group['id'], - '$name' => $group['name'], '$drop' => $drop_txt, - '$desc' => t('Click on a contact to add or remove.'), - '$title' => t('Group Editor'), - '$gname' => t('Group Name: '), - '$submit' => t('Submit') - )); + ); } if(! isset($group)) return; - $o .= '
'; - if($change) - $o = ''; + $groupeditor = array( + 'label_members' => t('Members'), + 'members' => array(), + 'label_contacts' => t('All Contacts'), + 'contacts' => arraY(), + ); + - $o .= '

' . t('Members') . '

'; - $o .= '
'; $textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false); foreach($members as $member) { if($member['url']) { $member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;'; - $o .= micropro($member,true,'mpgroup', $textmode); + $groupeditor['members'][] = micropro($member,true,'mpgroup', $textmode); } else group_rmv_member(local_user(),$group['name'],$member['id']); } - $o .= '
'; - $o .= '
'; - - $o .= '

' . t('All Contacts') . '

'; - $o .= '
'; + $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 ORDER BY `name` ASC", + intval(local_user()) + ); - $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 ORDER BY `name` ASC", - intval(local_user()) - ); - - if(count($r)) { - $textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false); - foreach($r as $member) { - if(! in_array($member['id'],$preselected)) { - $member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;'; - $o .= micropro($member,true,'mpall', $textmode); - } + if(count($r)) { + $textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false); + foreach($r as $member) { + if(! in_array($member['id'],$preselected)) { + $member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;'; + $groupeditor['contacts'][] = micropro($member,true,'mpall', $textmode); } } + } - $o .= '
'; + $context['$groupeditor'] = $groupeditor; + $context['$desc'] = t('Click on a contact to add or remove.'); if($change) { - echo $o; + $tpl = get_markup_template('groupeditor.tpl'); + echo replace_macros($tpl, $context); killme(); } - $o .= '
'; - return $o; + + return replace_macros($tpl, $context); } -- cgit v1.2.3 From 4dd4a2258235cfafc0d5a4f87d116755ebe52ead Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 28 Feb 2012 14:52:23 -0800 Subject: From Tobias H - catch some irregularities caused by cut/paste code --- mod/display.php | 8 ++++---- mod/network.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index d96be4333..f510f793d 100755 --- a/mod/display.php +++ b/mod/display.php @@ -74,11 +74,11 @@ function display_content(&$a) { $x = array( 'is_owner' => true, 'allow_location' => $a->user['allow_location'], - 'default_location' => $a->user['default_location'], + 'default_location' => $a->user['default-location'], 'nickname' => $a->user['nickname'], - 'lockstate' => ((($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'), - 'acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb), - 'bang' => (($group || $cid) ? '!' : ''), + 'lockstate' => ( (is_array($a->user)) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))) ? 'lock' : 'unlock'), + 'acl' => populate_acl($a->user, $celeb), + 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user() ); diff --git a/mod/network.php b/mod/network.php index 03a671b61..894ac48ed 100755 --- a/mod/network.php +++ b/mod/network.php @@ -263,7 +263,7 @@ function network_content(&$a, $update = 0) { $x = array( 'is_owner' => true, 'allow_location' => $a->user['allow_location'], - 'default_location' => $a->user['default_location'], + 'default_location' => $a->user['default-location'], 'nickname' => $a->user['nickname'], 'lockstate' => ((($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'), 'acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb), -- cgit v1.2.3 From 60ae0d8974ce9f0406978130e4feac84a332509b Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 28 Feb 2012 17:32:44 -0800 Subject: cleaned up mess created when both people request friendship and one approves as duplex --- mod/dfrn_confirm.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 5a24f0089..0bc3ea7df 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -107,7 +107,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { * */ - $r = q("SELECT * FROM `contact` WHERE ( ( `issued-id` != '' AND `issued-id` = '%s' ) OR ( `id` = %d AND `id` != 0 ) ) AND `uid` = %d LIMIT 1", + $r = q("SELECT * FROM `contact` WHERE ( ( `issued-id` != '' AND `issued-id` = '%s' ) OR ( `id` = %d AND `id` != 0 ) ) AND `uid` = %d AND `duplex` = 0 LIMIT 1", dbesc($dfrn_id), intval($cid), intval($uid) @@ -116,6 +116,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { if(! count($r)) { logger('dfrn_confirm: Contact not found in DB.'); notice( t('Contact not found.') . EOL ); + notice( t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL ); return; } @@ -631,6 +632,15 @@ function dfrn_confirm_post(&$a,$handsfree = null) { xml_status(3,$message); } + // It's possible that the other person also requested friendship. + // If it is a duplex relationship, ditch the issued-id if one exists. + + if($duplex) { + $r = q("UPDATE `contact` SET `issued-id` = '' WHERE `id` = %d LIMIT 1", + intval($dfrn_record) + ); + } + // We're good but now we have to scrape the profile photo and send notifications. -- cgit v1.2.3 From 84d5f495e6e6edd7114b7e72711035e96479e39a Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 29 Feb 2012 16:26:07 -0800 Subject: better handling of multiple notifications for same item, and old notifications --- mod/notify.php | 4 ++-- mod/ping.php | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/notify.php b/mod/notify.php index e6a7a8859..16b87b76f 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -11,8 +11,8 @@ function notify_init(&$a) { intval(local_user()) ); if(count($r)) { - q("update notify set seen = 1 where id = %d and uid = %d limit 1", - intval($a->argv[2]), + q("update notify set seen = 1 where link = '%s' and uid = %d", + dbesc($r[0]['link']), intval(local_user()) ); goaway($r[0]['link']); diff --git a/mod/ping.php b/mod/ping.php index 7380ff7d0..1562254b1 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -14,10 +14,29 @@ function ping_init(&$a) { $firehose = intval(get_pconfig(local_user(),'system','notify_full')); - $z = q("select * from notify where uid = %d - order by seen asc, date desc limit 0, 50", + $t = q("select count(*) as total from notify where uid = %d and seen = 0", intval(local_user()) ); + if($t && intval($t[0]['total']) > 49) { + $z = q("select * from notify where uid = %d + and seen = 0 order by date desc limit 0, 50", + intval(local_user()) + ); + } + else { + $z1 = q("select * from notify where uid = %d + and seen = 0 order by date desc limit 0, 50", + intval(local_user()) + ); + + $z2 = q("select * from notify where uid = %d + and seen = 1 order by date desc limit 0, %d", + intval(local_user()), + intval(50 - intval($t[0]['total'])) + ); + $z = array_merge($z1,$z2); + } + $tags = array(); -- cgit v1.2.3 From bbebb4c2a050f22e9aa51cb123359b169bcb3b3c Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 29 Feb 2012 18:19:08 -0800 Subject: notification enhancements --- mod/notify.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/notify.php b/mod/notify.php index 16b87b76f..a572b1534 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -11,8 +11,10 @@ function notify_init(&$a) { intval(local_user()) ); if(count($r)) { - q("update notify set seen = 1 where link = '%s' and uid = %d", + q("update notify set seen = 1 where ( link = '%s' or ( parent != 0 and parent = %d and otype = '%s' )) and uid = %d", dbesc($r[0]['link']), + intval($r[0]['parent']), + dbesc($r[0]['otype']), intval(local_user()) ); goaway($r[0]['link']); -- cgit v1.2.3 From f0b6e7629312c6eaf8b1ac2a0abca2bb6ef49c8c Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 1 Mar 2012 11:28:48 +0100 Subject: admin: fix small string --- mod/admin.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index 0f600e312..94bf44503 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -366,7 +366,7 @@ function admin_page_users_post(&$a){ intval( $uid ) ); } - notice( sprintf( tt("%s user blocked", "%s users blocked/unblocked", count($users)), count($users)) ); + notice( sprintf( tt("%s user blocked/unblocked", "%s users blocked/unblocked", count($users)), count($users)) ); } if (x($_POST,'page_users_delete')){ require_once("include/Contact.php"); @@ -428,6 +428,7 @@ function admin_page_users(&$a){ LEFT JOIN `contact` ON `register`.`uid` = `contact`.`uid` LEFT JOIN `user` ON `register`.`uid` = `user`.`uid`;"); + /* get users */ $total = q("SELECT count(*) as total FROM `user` where 1"); @@ -435,7 +436,8 @@ function admin_page_users(&$a){ $a->set_pager_total($total[0]['total']); $a->set_pager_itemspage(100); } - + + $users = q("SELECT `user` . * , `contact`.`name` , `contact`.`url` , `contact`.`micro`, `lastitem`.`lastitem_date` FROM (SELECT MAX(`item`.`changed`) as `lastitem_date`, `item`.`uid` @@ -469,6 +471,7 @@ function admin_page_users(&$a){ } $users = array_map("_setup_users", $users); + $t = get_markup_template("admin_users.tpl"); $o = replace_macros($t, array( // strings // -- cgit v1.2.3 From 5fc3c3ab854d1e2100fc5fdeb82298c60e320c92 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Fri, 2 Mar 2012 15:40:17 +0100 Subject: group: fix create new group form --- mod/group.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod') diff --git a/mod/group.php b/mod/group.php index f6f8e4173..13401ef0d 100755 --- a/mod/group.php +++ b/mod/group.php @@ -84,6 +84,7 @@ function group_content(&$a) { return replace_macros($tpl, $context + array( '$title' => t('Create a group of contacts/friends.'), '$gname' => array('groupname',t('Group Name: '),$group['name'], ''), + '$gid' => 'new', )); -- cgit v1.2.3 From 23460302f5e6b97a5e7b9d6038e77dc4c2d13033 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 5 Mar 2012 18:51:21 -0800 Subject: some admin page fixes and cleanup --- mod/admin.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index 94bf44503..2115f9241 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -145,9 +145,10 @@ function admin_page_summary(&$a) { Array( t('Automatic Friend Account'), 0) ); $users=0; - foreach ($r as $u){ $accounts[$u['page-flags']][1] = $u['count']; $users+=$u['count']; } + foreach ($r as $u){ $accounts[$u['page-flags']][1] = $u['count']; $users+= $u['count']; } + + logger('accounts: ' . print_r($accounts,true)); - $r = q("SELECT COUNT(id) as `count` FROM `register`"); $pending = $r[0]['count']; @@ -574,6 +575,8 @@ function admin_page_plugins(&$a){ '$status' => $status, '$action' => $action, '$info' => get_plugin_info($plugin), + '$str_author' => t('Author: '), + '$str_maintainer' => t('Maintainer: '), '$admin_form' => $admin_form, '$function' => 'plugins', @@ -747,7 +750,8 @@ function admin_page_themes(&$a){ '$info' => get_theme_info($theme), '$function' => 'themes', '$admin_form' => $admin_form, - + '$str_author' => t('Author: '), + '$str_maintainer' => t('Maintainer: '), '$readme' => $readme )); } -- cgit v1.2.3 From 8fb0ea4048745c09ece6c84f23bffdccfc59d67d Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 14:27:53 -0800 Subject: bugs #312, #313 --- mod/admin.php | 38 +++++++++++++++++++------------------- mod/network.php | 30 ++++++++++++++---------------- 2 files changed, 33 insertions(+), 35 deletions(-) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index 2115f9241..93714bb5f 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -321,32 +321,32 @@ function admin_page_site(&$a) { '$sitename' => array('sitename', t("Site name"), htmlentities($a->config['sitename'], ENT_QUOTES), ""), '$banner' => array('banner', t("Banner/Logo"), $banner, ""), '$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices), - '$theme' => array('theme', t("System theme"), get_config('system','theme'), "Default system theme (which may be over-ridden by user profiles)", $theme_choices), + '$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles"), $theme_choices), - '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), "Maximum size in bytes of uploaded images. Default is 0, which means no limits."), + '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), '$register_policy' => array('register_policy', t("Register policy"), $a->config['register_policy'], "", $register_choices), - '$register_text' => array('register_text', t("Register text"), htmlentities($a->config['register_text'], ENT_QUOTES), "Will be displayed prominently on the registration page."), + '$register_text' => array('register_text', t("Register text"), htmlentities($a->config['register_text'], ENT_QUOTES), t("Will be displayed prominently on the registration page.")), '$abandon_days' => array('abandon_days', t('Accounts abandoned after x days'), get_config('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')), - '$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), "Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains"), - '$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), "Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains"), - '$block_public' => array('block_public', t("Block public"), get_config('system','block_public'), "Check to block public access to all otherwise public personal pages on this site unless you are currently logged in."), - '$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), "Check to force all profiles on this site to be listed in the site directory."), - '$global_directory' => array('directory_submit_url', t("Global directory update URL"), get_config('system','directory_submit_url'), "URL to update the global directory. If this is not set, the global directory is completely unavailable to the application."), + '$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")), + '$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")), + '$block_public' => array('block_public', t("Block public"), get_config('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.")), + '$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")), + '$global_directory' => array('directory_submit_url', t("Global directory update URL"), get_config('system','directory_submit_url'), t("URL to update the global directory. If this is not set, the global directory is completely unavailable to the application.")), - '$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), get_config('system','block_extended_register'), "Disallow users to register additional accounts for use as pages."), - '$no_openid' => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), "OpenID support for registration and logins."), - '$no_gravatar' => array('no_gravatar', t("Gravatar support"), !get_config('system','no_gravatar'), "Search new user's photo on Gravatar."), - '$no_regfullname' => array('no_regfullname', t("Fullname check"), !get_config('system','no_regfullname'), "Force users to register with a space between firstname and lastname in Full name, as an antispam measure"), - '$no_utf' => array('no_utf', t("UTF-8 Regular expressions"), !get_config('system','no_utf'), "Use PHP UTF8 regular expressions"), - '$no_community_page' => array('no_community_page', t("Show Community Page"), !get_config('system','no_community_page'), "Display a Community page showing all recent public postings on this site."), - '$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disable'), "Provide built-in OStatus \x28identi.ca, status.net, etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed."), - '$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), "Provide built-in Diaspora network compatibility."), - '$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), "All contacts must use Friendica protocols. All other built-in communication protocols disabled."), - '$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), "If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites."), + '$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), get_config('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")), + '$no_openid' => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), t("OpenID support for registration and logins.")), + '$no_gravatar' => array('no_gravatar', t("Gravatar support"), !get_config('system','no_gravatar'), t("Search new user's photo on Gravatar.")), + '$no_regfullname' => array('no_regfullname', t("Fullname check"), !get_config('system','no_regfullname'), t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")), + '$no_utf' => array('no_utf', t("UTF-8 Regular expressions"), !get_config('system','no_utf'), t("Use PHP UTF8 regular expressions")), + '$no_community_page' => array('no_community_page', t("Show Community Page"), !get_config('system','no_community_page'), t("Display a Community page showing all recent public postings on this site.")), + '$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disable'), t("Provide built-in OStatus \x28identi.ca, status.net, etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")), + '$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), t("Provide built-in Diaspora network compatibility.")), + '$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")), + '$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), t("If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.")), '$proxyuser' => array('proxyuser', t("Proxy user"), get_config('system','proxyuser'), ""), '$proxy' => array('proxy', t("Proxy URL"), get_config('system','proxy'), ""), - '$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), "Value is in seconds. Set to 0 for unlimited (not recommended)."), + '$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")), )); diff --git a/mod/network.php b/mod/network.php index 894ac48ed..8da1561a0 100755 --- a/mod/network.php +++ b/mod/network.php @@ -51,14 +51,14 @@ function network_init(&$a) { function saved_searches($search) { - $srchurl = '/network' - . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '') - . ((x($_GET,'star')) ? '?star=' . $_GET['star'] : '') - . ((x($_GET,'bmark')) ? '?bmark=' . $_GET['bmark'] : '') - . ((x($_GET,'conv')) ? '?conv=' . $_GET['conv'] : '') - . ((x($_GET,'nets')) ? '?nets=' . $_GET['nets'] : '') - . ((x($_GET,'cmin')) ? '?cmin=' . $_GET['cmin'] : '') - . ((x($_GET,'cmax')) ? '?cmax=' . $_GET['cmax'] : ''); + $srchurl = '/network?f=' + . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') + . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '') + . ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '') + . ((x($_GET,'conv')) ? '&conv=' . $_GET['conv'] : '') + . ((x($_GET,'nets')) ? '&nets=' . $_GET['nets'] : '') + . ((x($_GET,'cmin')) ? '&cmin=' . $_GET['cmin'] : '') + . ((x($_GET,'cmax')) ? '&cmax=' . $_GET['cmax'] : ''); $o = ''; @@ -164,33 +164,33 @@ function network_content(&$a, $update = 0) { $tabs = array( array( 'label' => t('Commented Order'), - 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : ''), + 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?f=&cid=' . $_GET['cid'] : ''), 'sel'=>$all_active, ), array( 'label' => t('Posted Order'), - 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '?order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''), + 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''), 'sel'=>$postord_active, ), array( 'label' => t('Personal'), - 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&conv=1', + 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&conv=1', 'sel' => $conv_active, ), array( 'label' => t('New'), - 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '/new' . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : ''), + 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '/new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''), 'sel' => $new_active, ), array( 'label' => t('Starred'), - 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&star=1', + 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&star=1', 'sel'=>$starred_active, ), array( 'label' => t('Bookmarks'), - 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&bmark=1', + 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&bmark=1', 'sel'=>$bookmarked_active, ), // array( @@ -256,8 +256,6 @@ function network_content(&$a, $update = 0) { nav_set_selected('network'); - $_SESSION['return_url'] = $a->query_string; - $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); $x = array( -- cgit v1.2.3 From 21887a36fde1f287c73c7cc3a57ac9ba2ec2135b Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 14:53:14 -0800 Subject: [PRIVACY] privacy issue bug #314 --- mod/display.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index f510f793d..4f2e5ff9a 100755 --- a/mod/display.php +++ b/mod/display.php @@ -34,7 +34,7 @@ function display_content(&$a) { $contact = null; $remote_contact = false; - +dbg(1); if(remote_user()) { $contact_id = $_SESSION['visitor_id']; $groups = init_groups_visitor($contact_id); @@ -87,6 +87,9 @@ function display_content(&$a) { $sql_extra = permissions_sql($a->profile['uid'],$remote_contact,$groups); + if(! local_user() && ! remote_user()) + $sql_extra .= " and `item`.`private` = 0 "; + $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, @@ -135,7 +138,7 @@ function display_content(&$a) { } } - +dbg(0); return $o; } -- cgit v1.2.3 From a464e4d33fbca9c02cd99abab092d43b631aa780 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 15:15:59 -0800 Subject: search should be ok, but a little extra security won't hurt --- mod/search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/search.php b/mod/search.php index fe09b671f..386592ea1 100755 --- a/mod/search.php +++ b/mod/search.php @@ -127,7 +127,7 @@ function search_content(&$a) { FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid` WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0 - AND (( `wall` = 1 AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `user`.`hidewall` = 0 ) + AND (( `wall` = 1 AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0 ) OR `item`.`uid` = %d ) AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 $search_alg -- cgit v1.2.3 From 7431bd950937929a21b7d158564a8f9a80d07c5f Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 15:28:27 -0800 Subject: fix html reshares when editplain in use --- mod/share.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'mod') diff --git a/mod/share.php b/mod/share.php index bba527342..f6c025e3c 100755 --- a/mod/share.php +++ b/mod/share.php @@ -16,10 +16,18 @@ function share_init(&$a) { $o = ''; - $o .= '♲ ' . $r[0]['author-name'] . '
'; - if($r[0]['title']) - $o .= '' . $r[0]['title'] . '
'; - $o .= bbcode($r[0]['body'], true); - echo $o . '
'; + if(local_user() && intval(get_pconfig(local_user(),'system','plaintext'))) { + $o .= '♲ [url=' . $r[0]['author-link'] . ']' . $r[0]['author-name'] . '[/url]'; + if($r[0]['title']) + $o .= '[b]' . $r[0]['title'] . '[/b]' . "\n"; + $o .= $r[0]['body'] . "\n"; + } + else { + $o .= '♲ ' . $r[0]['author-name'] . '
'; + if($r[0]['title']) + $o .= '' . $r[0]['title'] . '
'; + $o .= bbcode($r[0]['body'], true) . '
'; + } + echo $o; killme(); } -- cgit v1.2.3 From 39a49d51e370f6421a065cd78594e849ef92ff73 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 16:28:52 -0800 Subject: remove stray debugging --- mod/display.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index 4f2e5ff9a..00f8b503a 100755 --- a/mod/display.php +++ b/mod/display.php @@ -34,7 +34,7 @@ function display_content(&$a) { $contact = null; $remote_contact = false; -dbg(1); + if(remote_user()) { $contact_id = $_SESSION['visitor_id']; $groups = init_groups_visitor($contact_id); @@ -138,7 +138,7 @@ dbg(1); } } -dbg(0); + return $o; } -- cgit v1.2.3 From 88cd5800cf2e22f365bc38f567fcc1627e9278a7 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 17:21:14 -0800 Subject: [privacy] rework latest fix --- mod/display.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index 00f8b503a..f510f793d 100755 --- a/mod/display.php +++ b/mod/display.php @@ -87,9 +87,6 @@ function display_content(&$a) { $sql_extra = permissions_sql($a->profile['uid'],$remote_contact,$groups); - if(! local_user() && ! remote_user()) - $sql_extra .= " and `item`.`private` = 0 "; - $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, -- cgit v1.2.3 From 7ad2dd65654f6b1cb17ae98e65c3e95528d29e30 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 17:52:00 -0800 Subject: fix photos after permissions_sql change --- mod/display.php | 2 +- mod/profile.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index f510f793d..f428149e8 100755 --- a/mod/display.php +++ b/mod/display.php @@ -85,7 +85,7 @@ function display_content(&$a) { $o .= status_editor($a,$x,0,true); - $sql_extra = permissions_sql($a->profile['uid'],$remote_contact,$groups); + $sql_extra = item_permissions_sql($a->profile['uid'],$remote_contact,$groups); $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, diff --git a/mod/profile.php b/mod/profile.php index 74e1a2302..1a701f407 100755 --- a/mod/profile.php +++ b/mod/profile.php @@ -159,7 +159,7 @@ function profile_content(&$a, $update = 0) { * Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups */ - $sql_extra = permissions_sql($a->profile['profile_uid'],$remote_contact,$groups); + $sql_extra = item_permissions_sql($a->profile['profile_uid'],$remote_contact,$groups); if($update) { -- cgit v1.2.3 From 03b5e3aa0c99ce6c290156ddccc9cba6744f245d Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 7 Mar 2012 21:12:31 -0800 Subject: reworked fix from unary for bug #323 (due to incorrect use of array_key_exists()) --- mod/network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/network.php b/mod/network.php index 8da1561a0..27c6e315b 100755 --- a/mod/network.php +++ b/mod/network.php @@ -470,7 +470,7 @@ function network_content(&$a, $update = 0) { if(count($r)) { foreach($r as $rr) - if(! array_key_exists($rr['item_id'],$parents_arr)) + if(! in_array($rr['item_id'],$parents_arr)) $parents_arr[] = $rr['item_id']; $parents_str = implode(', ', $parents_arr); -- cgit v1.2.3 From 3878b58f0d19a60cb51b65e2c4b02ccb242ba73b Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 9 Mar 2012 00:47:10 -0800 Subject: bug #324 - tinymce used for mail even if editplain being used. --- mod/message.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mod') diff --git a/mod/message.php b/mod/message.php index 4b494e906..91db5baef 100755 --- a/mod/message.php +++ b/mod/message.php @@ -129,10 +129,16 @@ function message_content(&$a) { $o .= $header; + $plaintext = false; + if(intval(get_pconfig(local_user(),'system','plaintext'))) + $plaintext = true; + + $tpl = get_markup_template('msg-header.tpl'); $a->page['htmlhead'] .= replace_macros($tpl, array( '$baseurl' => $a->get_baseurl(), + '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$nickname' => $a->user['nickname'], '$linkurl' => t('Please enter a link URL:') )); -- cgit v1.2.3