From 097c1f8da774c82f441f370f391f93acc2025ccd Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 29 Sep 2011 21:20:19 -0700 Subject: do not poll for abandoned accounts --- mod/admin.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index da561d554..ebef1ccb9 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -177,6 +177,8 @@ function admin_page_site_post(&$a){ $register_policy = ((x($_POST,'register_policy')) ? intval(trim($_POST['register_policy'])) : 0); + $abandon_days = ((x($_POST,'abandon_days')) ? intval(trim($_POST['abandon_days'])) : 0); + $register_text = ((x($_POST,'register_text')) ? notags(trim($_POST['register_text'])) : ''); $allowed_sites = ((x($_POST,'allowed_sites')) ? notags(trim($_POST['allowed_sites'])) : ''); @@ -215,6 +217,7 @@ function admin_page_site_post(&$a){ set_config('system','maximagesize', $maximagesize); set_config('config','register_policy', $register_policy); + set_config('system','account_abandon_days', $abandon_days); set_config('config','register_text', $register_text); set_config('system','allowed_sites', $allowed_sites); set_config('system','allowed_email', $allowed_email); @@ -314,6 +317,7 @@ function admin_page_site(&$a) { '$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."), + '$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."), -- cgit v1.2.3 From 0508ccf50fc6f64af40ad97e3a573a0d489630f2 Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 30 Sep 2011 17:47:33 -0700 Subject: restore photo cache --- mod/photo.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mod') diff --git a/mod/photo.php b/mod/photo.php index 3994620f8..fcc75a513 100644 --- a/mod/photo.php +++ b/mod/photo.php @@ -129,6 +129,8 @@ function photo_init(&$a) { } header("Content-type: image/jpeg"); + header("Expires: " . gmdate("D, d M Y H:i:s", time() + (3600*24)) . " GMT"; + header("Cache-Control: max-age=" . (3600*24)); echo $data; killme(); // NOTREACHED -- cgit v1.2.3 From 8fb2d02d3d32fd5876625036a774520d87f5ead4 Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 30 Sep 2011 18:00:32 -0700 Subject: typo last checkin --- mod/photo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/photo.php b/mod/photo.php index fcc75a513..71c345fc5 100644 --- a/mod/photo.php +++ b/mod/photo.php @@ -129,7 +129,7 @@ function photo_init(&$a) { } header("Content-type: image/jpeg"); - header("Expires: " . gmdate("D, d M Y H:i:s", time() + (3600*24)) . " GMT"; + header("Expires: " . gmdate("D, d M Y H:i:s", time() + (3600*24)) . " GMT"); header("Cache-Control: max-age=" . (3600*24)); echo $data; killme(); -- cgit v1.2.3 From f4c961b90676dad0a6773e52e4bd08b33c9b68c6 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 1 Oct 2011 02:22:48 -0700 Subject: override pragma --- mod/photo.php | 5 +++++ mod/photos.php | 3 +++ 2 files changed, 8 insertions(+) (limited to 'mod') diff --git a/mod/photo.php b/mod/photo.php index 71c345fc5..a5a5a1dc1 100644 --- a/mod/photo.php +++ b/mod/photo.php @@ -128,6 +128,11 @@ function photo_init(&$a) { } } + if(function_exists('header_remove')) { + header_remove('Pragma'); + header_remove('pragma'); + } + header("Content-type: image/jpeg"); header("Expires: " . gmdate("D, d M Y H:i:s", time() + (3600*24)) . " GMT"); header("Cache-Control: max-age=" . (3600*24)); diff --git a/mod/photos.php b/mod/photos.php index 90d51000e..b6be8d025 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -585,6 +585,9 @@ function photos_post(&$a) { else $visible = 0; + if(intval($_REQUEST,'not_visible')) + $visible = 0; + $str_group_allow = perms2str(((is_array($_REQUEST['group_allow'])) ? $_REQUEST['group_allow'] : explode(',',$_REQUEST['group_allow']))); $str_contact_allow = perms2str(((is_array($_REQUEST['contact_allow'])) ? $_REQUEST['contact_allow'] : explode(',',$_REQUEST['contact_allow']))); $str_group_deny = perms2str(((is_array($_REQUEST['group_deny'])) ? $_REQUEST['group_deny'] : explode(',',$_REQUEST['group_deny']))); -- cgit v1.2.3 From 0ad9e7b5f4f72f789363ae1a1836e43d5707bf0a Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 1 Oct 2011 06:20:41 -0700 Subject: option to not post photos to status stream --- mod/photos.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'mod') diff --git a/mod/photos.php b/mod/photos.php index b6be8d025..1321af192 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -92,15 +92,11 @@ EOT; function photos_post(&$a) { - logger('mod/photos.php: photos_post(): begin' , 'LOGGER_DEBUG'); + logger('mod-photos: photos_post(): begin' , 'LOGGER_DEBUG'); - foreach($_REQUEST AS $key => $val) { - logger('mod/photos.php: photos_post(): $_REQUEST key: ' . $key . ' val: ' . $val , 'LOGGER_DEBUG'); - } - foreach($_FILES AS $key => $val) { - logger('mod/photos.php: photos_post(): $_FILES key: ' . $key . ' val: ' . $val , 'LOGGER_DEBUG'); - } + logger('mod_photos: REQUEST ' . print_r($_REQUEST,true), LOGGER_DATA); + logger('mod_photos: FILES ' . print_r($_FILES,true), LOGGER_DATA); $can_post = false; $visitor = 0; @@ -585,7 +581,7 @@ function photos_post(&$a) { else $visible = 0; - if(intval($_REQUEST,'not_visible')) + if(intval($_REQUEST['not_visible'])) $visible = 0; $str_group_allow = perms2str(((is_array($_REQUEST['group_allow'])) ? $_REQUEST['group_allow'] : explode(',',$_REQUEST['group_allow']))); @@ -895,6 +891,7 @@ function photos_content(&$a) { '$nickname' => $a->data['user']['nickname'], '$newalbum' => t('New album name: '), '$existalbumtext' => t('or existing album name: '), + '$nosharetext' => t('Do not show a status post for this upload'), '$albumselect' => template_escape($albumselect), '$permissions' => t('Permissions'), '$aclselect' => (($visitor) ? '' : template_escape(populate_acl($a->user, $celeb))), -- cgit v1.2.3 From c72883f06822658491134d41a3b8ab83d9984b86 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 2 Oct 2011 01:21:51 -0700 Subject: malformed xml in ping --- mod/ping.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/ping.php b/mod/ping.php index 30f1dc837..544a42e14 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -114,7 +114,7 @@ function ping_init(&$a) { function xmlize($href, $name, $url, $photo, $date, $message){ $notsxml = '%s'; return sprintf ( $notsxml, - $href, $name, $url, $photo, $date, $message + xmlify($href), xmlify($name), xmlify($url), xmlify($photo), xmlify($date), xmlify($message) ); } -- cgit v1.2.3 From da53ebf4b3431559d2383dd9e0651de44e9714e8 Mon Sep 17 00:00:00 2001 From: Devlon Duthie Date: Sun, 2 Oct 2011 20:37:47 -0500 Subject: added activetab var to message.php for templates (testbubble only) added logic to photo header to make tab 'sticky' (active class for styling) (testbubble only) css fix for avatars in wallitems --- mod/message.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/message.php b/mod/message.php index 1bee45d48..d4772d026 100644 --- a/mod/message.php +++ b/mod/message.php @@ -45,13 +45,21 @@ function message_content(&$a) { $myprofile = $a->get_baseurl() . '/profile/' . $a->user['nickname']; - + if (($a->argc > 1) && ($a->argv[1] === 'new')) { + $tab = 'new'; + } else if ($a->argc == 2 && $a->argv[1] === 'sent') { + $tab = 'sent'; + } else { + $tab = 'inbox'; + } + $tpl = get_markup_template('mail_head.tpl'); $header = replace_macros($tpl, array( '$messages' => t('Messages'), '$inbox' => t('Inbox'), '$outbox' => t('Outbox'), - '$new' => t('New Message') + '$new' => t('New Message'), + '$activetab' => $tab )); @@ -90,6 +98,8 @@ function message_content(&$a) { if(($a->argc > 1) && ($a->argv[1] === 'new')) { + $o .= $header; + $tpl = get_markup_template('msg-header.tpl'); $a->page['htmlhead'] .= replace_macros($tpl, array( @@ -114,7 +124,6 @@ function message_content(&$a) { '$upload' => t('Upload photo'), '$insert' => t('Insert web link'), '$wait' => t('Please wait') - )); return $o; @@ -248,7 +257,6 @@ function message_content(&$a) { '$upload' => t('Upload photo'), '$insert' => t('Insert web link'), '$wait' => t('Please wait') - )); return $o; -- cgit v1.2.3 From f84c208ac577cb43d24a8a33bbcb865677e1c7ae Mon Sep 17 00:00:00 2001 From: Devlon Duthie Date: Mon, 3 Oct 2011 01:45:27 -0500 Subject: broke 'find similar' matches content into a tpl in core, added an extended tpl to testbubble that lists the profile tags --- mod/match.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'mod') diff --git a/mod/match.php b/mod/match.php index 5dd80fe3e..eea2dad4f 100644 --- a/mod/match.php +++ b/mod/match.php @@ -22,6 +22,7 @@ function match_content(&$a) { $params = array(); $tags = trim($r[0]['pub_keywords'] . ' ' . $r[0]['prv_keywords']); + if($tags) { $params['s'] = $tags; if($a->pager['page'] != 1) @@ -40,15 +41,17 @@ function match_content(&$a) { } if(count($j->results)) { + + $tpl = get_markup_template('match.tpl'); foreach($j->results as $jj) { - - $o .= '
'; - $o .= '' . '' . $jj->name . '
'; - $o .= '
'; - $o .= ''; - $o .= '
'; + + $o .= replace_macros($tpl,array( + '$url' => $jj->url, + '$name' => $jj->name, + '$photo' => $jj->photo, + '$tags' => $jj->tags + )); } - $o .= '
'; } else { info( t('No matches') . EOL); -- cgit v1.2.3 From 60147d893cc367b56d23971c2483deeb91a19759 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 3 Oct 2011 01:58:01 -0700 Subject: ?f did not have = after it --- 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 396b50738..034794e17 100644 --- a/mod/search.php +++ b/mod/search.php @@ -13,7 +13,7 @@ function search_saved_searches() { $o .= '

' . t('Saved Searches') . '

' . "\r\n"; $o .= '' . "\r\n"; } -- cgit v1.2.3 From 70911731313d58458e48a50e76c4b3b8a4d2c934 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 3 Oct 2011 02:39:19 -0700 Subject: removing another potential way a post could have a zero parent. --- mod/item.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index e5d4eea82..b8c0683aa 100644 --- a/mod/item.php +++ b/mod/item.php @@ -779,6 +779,11 @@ function item_post(&$a) { } } + // fallback so that parent always gets set to non-zero. + + if(! $parent) + $parent = $post_id; + $r = q("UPDATE `item` SET `parent` = %d, `parent-uri` = '%s', `plink` = '%s', `changed` = '%s', `last-child` = 1, `visible` = 1 WHERE `id` = %d LIMIT 1", intval($parent), -- cgit v1.2.3 From 8edab8067390a5f565f6abb889ec8dd1b18583d4 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 3 Oct 2011 05:10:15 -0700 Subject: add tagmatch --- mod/tagmatch.php | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 mod/tagmatch.php (limited to 'mod') diff --git a/mod/tagmatch.php b/mod/tagmatch.php new file mode 100644 index 000000000..b2313694b --- /dev/null +++ b/mod/tagmatch.php @@ -0,0 +1,54 @@ +' . t('Tag Match') . ' - ' . notags($search) . ''; + + + if($search) { + $params['s'] = $search; + if($a->pager['page'] != 1) + $params['p'] = $a->pager['page']; + + if(strlen(get_config('system','directory_submit_url'))) + $x = fetch_url('http://dir.friendika.com/lsearch?f=&search=' . urlencode($search)); +// else +// $x = post_url($a->get_baseurl() . '/msearch', $params); + + $j = json_decode($x); + + if($j->total) { + $a->set_pager_total($j->total); + $a->set_pager_itemspage($j->items_page); + } + + if(count($j->results)) { + + $tpl = get_markup_template('match.tpl'); + foreach($j->results as $jj) { + + $o .= replace_macros($tpl,array( + '$url' => $jj->url, + '$name' => $jj->name, + '$photo' => $jj->photo, + '$tags' => $jj->tags + )); + } + } + else { + info( t('No matches') . EOL); + } + + } + + $o .= '
'; + $o .= paginate($a); + return $o; +} -- cgit v1.2.3 From dfd5cc57c2134067dc6229b8583b5e808f160004 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 3 Oct 2011 14:47:18 -0700 Subject: tagmatch available to anon, add paging variable to query --- mod/tagmatch.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'mod') diff --git a/mod/tagmatch.php b/mod/tagmatch.php index b2313694b..8023fa433 100644 --- a/mod/tagmatch.php +++ b/mod/tagmatch.php @@ -3,24 +3,22 @@ function tagmatch_content(&$a) { - $search = $_REQUEST['search']; + $search = notags(trim($_REQUEST['search'])); $o = ''; - if(! local_user()) - return; - - $o .= '

' . t('Tag Match') . ' - ' . notags($search) . '

'; + $o .= '

' . t('Tag Match') . ' - ' . $search . '

'; if($search) { - $params['s'] = $search; - if($a->pager['page'] != 1) - $params['p'] = $a->pager['page']; + + $p = (($a->pager['page'] != 1) ? '&p=' . $a->pager['page'] : ''); if(strlen(get_config('system','directory_submit_url'))) - $x = fetch_url('http://dir.friendika.com/lsearch?f=&search=' . urlencode($search)); + $x = fetch_url('http://dir.friendika.com/lsearch?f=' . $p . '&search=' . urlencode($search)); + +//TODO fallback local search if global dir not available. // else -// $x = post_url($a->get_baseurl() . '/msearch', $params); +// $x = post_url($a->get_baseurl() . '/lsearch', $params); $j = json_decode($x); -- cgit v1.2.3 From 07b09300a9aa6f10941b07dd289539b675d1e6ec Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 03:06:34 -0700 Subject: improve feed import performance --- mod/pubsub.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/pubsub.php b/mod/pubsub.php index b2f006927..0c506db00 100644 --- a/mod/pubsub.php +++ b/mod/pubsub.php @@ -132,11 +132,11 @@ function pubsub_post(&$a) { require_once('include/items.php'); - consume_feed($xml,$importer,$contact,$feedhub,1); + consume_feed($xml,$importer,$contact,$feedhub,1,1); // do it a second time so that any children find their parents. - consume_feed($xml,$importer,$contact,$feedhub,1); + consume_feed($xml,$importer,$contact,$feedhub,1,2); hub_post_return(); -- cgit v1.2.3 From 4a5079f8fb73f65820229783d2ef0e9374e3a743 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 05:19:25 -0700 Subject: urlescape saved search terms --- 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 371a35402..f0e9e4441 100644 --- a/mod/network.php +++ b/mod/network.php @@ -137,7 +137,7 @@ function saved_searches($search) { if(count($r)) { $o .= ''; } -- cgit v1.2.3 From f7d055687eb8e87368023a94a613b027458cdd83 Mon Sep 17 00:00:00 2001 From: Devlon Duthie Date: Tue, 4 Oct 2011 11:10:57 -0500 Subject: - moved the header for profile permissions out of the scrolling div - tweaks to the testbubble theme's nav --- mod/profperm.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/profperm.php b/mod/profperm.php index 33479cad1..8d09c429c 100644 --- a/mod/profperm.php +++ b/mod/profperm.php @@ -109,9 +109,11 @@ function profperm_content(&$a) { $o .= '
'; if($change) $o = ''; - - $o .= '
'; + + $o .= '
'; $o .= '

' . t('Visible To') . '

'; + $o .= '
'; + $o .= '
'; $textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false); @@ -123,9 +125,12 @@ function profperm_content(&$a) { } $o .= '
'; $o .= '
'; - $o .= '
'; - $o .= '

' . t("All Contacts \x28with secure profile access\x29") . '

'; + $o .= '
'; + $o .= '

' . t("All Contacts \x28with secure profile access\x29") . '

'; + $o .= '
'; + $o .= '
'; + $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 AND `network` = 'dfrn' ORDER BY `name` ASC", intval(local_user()) -- cgit v1.2.3 From 7b648e6da85ece5b402dfce6d546f5711bc63bea Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 18:53:56 -0700 Subject: performance enhancements --- mod/pubsub.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/pubsub.php b/mod/pubsub.php index 0c506db00..93d50ef90 100644 --- a/mod/pubsub.php +++ b/mod/pubsub.php @@ -69,8 +69,13 @@ function pubsub_init(&$a) { // We must initiate an unsubscribe request with a verify_token. // Don't allow outsiders to unsubscribe us. - if(($hub_mode === 'unsubscribe') && (! strlen($hub_verify))) - hub_return(false, ''); + if($hub_mode === 'unsubscribe') { + if(! strlen($hub_verify)) { + logger('pubsub: bogus unsubscribe'); + hub_return(false, ''); + } + logger('pubsub: unsubscribe success'); + } $r = q("UPDATE `contact` SET `subhub` = %d WHERE `id` = %d LIMIT 1", intval($subscribe), -- cgit v1.2.3 From 159d06df828d3837a0bcb80add338efffa984cfb Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 21:43:21 -0700 Subject: notification issue after last checkin --- mod/dfrn_notify.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 23bdd7388..c7ad61ecc 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -450,7 +450,15 @@ function dfrn_notify_post(&$a) { } if($is_reply) { - if($feed->get_item_quantity() == 1) { + + // was the top-level post for this reply written by somebody on this site? Specifically, the recipient? + + $r = q("select `id` from `item` where `uri` = '%s' and AND `uid` = %d LIMIT 1", + dbesc($parent_uri), + intval($importer['importer_uid']) + ) + if($r && count($r)) { + logger('dfrn_notify: received remote comment'); $is_like = false; // remote reply to our post. Import and then notify everybody else. -- cgit v1.2.3 From c2d70d005bc967e19c0da23d1490bf64e3582c10 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 21:45:15 -0700 Subject: and a typo fix --- mod/dfrn_notify.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index c7ad61ecc..1ec825786 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -456,7 +456,7 @@ function dfrn_notify_post(&$a) { $r = q("select `id` from `item` where `uri` = '%s' and AND `uid` = %d LIMIT 1", dbesc($parent_uri), intval($importer['importer_uid']) - ) + ); if($r && count($r)) { logger('dfrn_notify: received remote comment'); -- cgit v1.2.3 From 6ff221d5a16ed9ca18a3fe8399b1588d5234fcc5 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 21:53:33 -0700 Subject: another typo --- mod/dfrn_notify.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 1ec825786..9e9809950 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -453,7 +453,7 @@ function dfrn_notify_post(&$a) { // was the top-level post for this reply written by somebody on this site? Specifically, the recipient? - $r = q("select `id` from `item` where `uri` = '%s' and AND `uid` = %d LIMIT 1", + $r = q("select `id` from `item` where `uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($parent_uri), intval($importer['importer_uid']) ); -- cgit v1.2.3