aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-11-06 14:40:19 -0700
committerFriendika <info@friendika.com>2010-11-06 14:40:19 -0700
commit05236adf0f1dd821c14ae0ffed2aaa08b9c606a2 (patch)
treedd45b42e0ab5850f4981b08c10e72da4381060e8
parent964ca0e07995de67c65c7916e1c8ce9706edb9da (diff)
downloadvolse-hubzilla-05236adf0f1dd821c14ae0ffed2aaa08b9c606a2.tar.gz
volse-hubzilla-05236adf0f1dd821c14ae0ffed2aaa08b9c606a2.tar.bz2
volse-hubzilla-05236adf0f1dd821c14ae0ffed2aaa08b9c606a2.zip
notification email on follow activities
-rw-r--r--include/items.php20
-rw-r--r--mod/photos.php2
-rw-r--r--view/follow_notify_eml.tpl14
-rw-r--r--view/request_notify_eml.tpl2
4 files changed, 36 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php
index 323117e6c..133d1299b 100644
--- a/include/items.php
+++ b/include/items.php
@@ -1045,6 +1045,26 @@ function new_follower($importer,$contact,$datarray,$item) {
dbesc(datetime_convert())
);
}
+ $r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
+ intval($importer['uid'])
+ );
+ if(count($r)) {
+ if(($r[0]['notify-flags'] & NOTIFY_INTRO) && ($r[0]['page-flags'] == PAGE_NORMAL)) {
+ $email_tpl = load_view_file('view/follow_notify_eml.tpl');
+ $email = replace_macros($email_tpl, array(
+ '$requestor' => ((strlen($name)) ? $name : t('[Name Withheld]')),
+ '$url' => $url,
+ '$myname' => $r[0]['username'],
+ '$siteurl' => $a->get_baseurl(),
+ '$sitename' => $a->config['sitename']
+ ));
+ $res = mail($r[0]['email'],
+ t("You have a new follower at ") . $a->config['sitename'],
+ $email,
+ 'From: ' . t('Administrator') . '@' . $_SERVER[SERVER_NAME] );
+
+ }
+ }
}
}
diff --git a/mod/photos.php b/mod/photos.php
index f3eccd127..91642229d 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -1025,7 +1025,7 @@ function photos_content(&$a) {
$a->set_pager_total(count($r));
- $r = q("SELECT `resource-id`, `id`, `filename`, `album`, max(`scale`) AS `scale` FROM `photo`
+ $r = q("SELECT `resource-id`, `id`, `filename`, `album`, max(`scale`) AS `scale` FROM `photo`
WHERE `uid` = %d AND `album` != '%s'
$sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d",
intval($a->data['user']['uid']),
diff --git a/view/follow_notify_eml.tpl b/view/follow_notify_eml.tpl
new file mode 100644
index 000000000..ae758c9a8
--- /dev/null
+++ b/view/follow_notify_eml.tpl
@@ -0,0 +1,14 @@
+
+Dear $myname,
+
+You have a new follower at $sitename - '$requestor'.
+
+You may visit their profile at $url.
+
+Please login to your site to approve or ignore/cancel the request.
+
+$siteurl
+
+Regards,
+
+ $sitename administrator \ No newline at end of file
diff --git a/view/request_notify_eml.tpl b/view/request_notify_eml.tpl
index aec3f270b..9eef7a61e 100644
--- a/view/request_notify_eml.tpl
+++ b/view/request_notify_eml.tpl
@@ -1,7 +1,7 @@
Dear $myname,
-You have just received a personal introduction at $sitename
+You have just received a connection request at $sitename
from '$requestor'.