aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/admin.php4
-rw-r--r--mod/dfrn_notify.php10
-rw-r--r--mod/item.php5
-rw-r--r--mod/match.php17
-rw-r--r--mod/message.php16
-rw-r--r--mod/network.php2
-rw-r--r--mod/photo.php7
-rw-r--r--mod/photos.php14
-rw-r--r--mod/ping.php2
-rw-r--r--mod/profperm.php13
-rw-r--r--mod/pubsub.php13
-rw-r--r--mod/search.php2
-rw-r--r--mod/tagmatch.php52
13 files changed, 127 insertions, 30 deletions
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."),
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index 23bdd7388..9e9809950 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 `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.
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),
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 .= '<div class="profile-match-wrapper"><div class="profile-match-photo">';
- $o .= '<a href="' . $jj->url . '">' . '<img src="' . $jj->photo . '" alt="' . $jj->name . '" title="' . $jj->name . '[' . $jj->tags . ']' . '" /></a></div>';
- $o .= '<div class="profile-match-break"></div>';
- $o .= '<div class="profile-match-name"><a href="' . $jj->url . '" title="' . $jj->name . '[' . $jj->url .']' . '">' . $jj->name . '</a></div>';
- $o .= '<div class="profile-match-end"></div></div>';
+
+ $o .= replace_macros($tpl,array(
+ '$url' => $jj->url,
+ '$name' => $jj->name,
+ '$photo' => $jj->photo,
+ '$tags' => $jj->tags
+ ));
}
- $o .= '<div id="profile-match-wrapper-end"></div>';
}
else {
info( t('No matches') . EOL);
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;
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 .= '<ul id="saved-search-ul">' . "\r\n";
foreach($r as $rr) {
- $o .= '<li class="saved-search-li clear"><a href="network/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="network/?f&search=' . $rr['term'] . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
+ $o .= '<li class="saved-search-li clear"><a href="network/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="network/?f&search=' . urlencode($rr['term']) . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
}
$o .= '</ul>';
}
diff --git a/mod/photo.php b/mod/photo.php
index 3994620f8..a5a5a1dc1 100644
--- a/mod/photo.php
+++ b/mod/photo.php
@@ -128,7 +128,14 @@ 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));
echo $data;
killme();
// NOTREACHED
diff --git a/mod/photos.php b/mod/photos.php
index 90d51000e..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,6 +581,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'])));
@@ -892,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))),
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 = '<note href="%s" name="%s" url="%s" photo="%s" date="%s">%s</note>';
return sprintf ( $notsxml,
- $href, $name, $url, $photo, $date, $message
+ xmlify($href), xmlify($name), xmlify($url), xmlify($photo), xmlify($date), xmlify($message)
);
}
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 .= '<div id="prof-update-wrapper">';
if($change)
$o = '';
-
- $o .= '<div id="prof-members">';
+
+ $o .= '<div id="prof-members-title">';
$o .= '<h3>' . t('Visible To') . '</h3>';
+ $o .= '</div>';
+ $o .= '<div id="prof-members">';
$textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false);
@@ -123,9 +125,12 @@ function profperm_content(&$a) {
}
$o .= '</div><div id="prof-members-end"></div>';
$o .= '<hr id="prof-separator" />';
- $o .= '<div id="prof-all-contacts">';
- $o .= '<h3>' . t("All Contacts \x28with secure profile access\x29") . '</h3>';
+ $o .= '<div id="prof-all-contcts-title">';
+ $o .= '<h3>' . t("All Contacts \x28with secure profile access\x29") . '</h3>';
+ $o .= '</div>';
+ $o .= '<div id="prof-all-contacts">';
+
$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())
diff --git a/mod/pubsub.php b/mod/pubsub.php
index b2f006927..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),
@@ -132,11 +137,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();
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 .= '<h3>' . t('Saved Searches') . '</h3>' . "\r\n";
$o .= '<ul id="saved-search-ul">' . "\r\n";
foreach($r as $rr) {
- $o .= '<li class="saved-search-li clear"><a href="search/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="search/?f&search=' . $rr['term'] . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
+ $o .= '<li class="saved-search-li clear"><a href="search/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="search/?f=&search=' . $rr['term'] . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
}
$o .= '</ul></div>' . "\r\n";
}
diff --git a/mod/tagmatch.php b/mod/tagmatch.php
new file mode 100644
index 000000000..8023fa433
--- /dev/null
+++ b/mod/tagmatch.php
@@ -0,0 +1,52 @@
+<?php
+
+
+function tagmatch_content(&$a) {
+
+ $search = notags(trim($_REQUEST['search']));
+
+ $o = '';
+
+ $o .= '<h2>' . t('Tag Match') . ' - ' . $search . '</h2>';
+
+ if($search) {
+
+ $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=' . $p . '&search=' . urlencode($search));
+
+//TODO fallback local search if global dir not available.
+// else
+// $x = post_url($a->get_baseurl() . '/lsearch', $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 .= '<div class="clear"></div>';
+ $o .= paginate($a);
+ return $o;
+}