aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/apps.php14
-rw-r--r--mod/dfrn_notify.php55
-rw-r--r--mod/display.php3
-rw-r--r--mod/item.php11
-rw-r--r--mod/network.php36
-rw-r--r--mod/photos.php9
-rw-r--r--mod/profile.php10
-rw-r--r--mod/update_network.php2
8 files changed, 70 insertions, 70 deletions
diff --git a/mod/apps.php b/mod/apps.php
new file mode 100644
index 000000000..1d08d2e7f
--- /dev/null
+++ b/mod/apps.php
@@ -0,0 +1,14 @@
+<?php
+
+
+function apps_content(&$a) {
+
+ $o .= '<h3>' . t('Applications') . '</h3>';
+
+ if($a->apps)
+ $o .= $a->apps;
+
+
+ return $o;
+
+} \ No newline at end of file
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index b8d86ad24..cd7b0cff0 100644
--- a/mod/dfrn_notify.php
+++ b/mod/dfrn_notify.php
@@ -173,22 +173,10 @@ function dfrn_notify_post(&$a) {
require_once('bbcode.php');
if($importer['notify-flags'] & NOTIFY_MAIL) {
- // generate a mime boundary
- $msg['mimeboundary'] =rand(0,9)."-"
- .rand(10000000000,9999999999)."-"
- .rand(10000000000,9999999999)."=:"
- .rand(10000,99999);
-
// name of the automated email sender
$msg['notificationfromname'] = t('Administrator');
// noreply address to send from
$msg['notificationfromemail'] = t('noreply') . '@' . $a->get_hostname();
- // message headers
- $msg['headers'] =
- "From: {$msg['notificationfromname']} <{$msg['notificationfromemail']}>\n" .
- "Reply-To: {$msg['notificationfromemail']}\n" .
- "MIME-Version: 1.0\n" .
- "Content-Type: multipart/alternative; boundary=\"{$msg['mimeboundary']}\"";
// text version
// process the message body to display properly in text mode
@@ -208,7 +196,7 @@ function dfrn_notify_post(&$a) {
// 4) decode any encoded html tags
$msg['htmlversion']
= html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), "<br />\n",$msg['body']))));
-
+
// load the template for private message notifications
$tpl = load_view_file('view/mail_received_html_body_eml.tpl');
$email_html_body_tpl = replace_macros($tpl,array(
@@ -238,32 +226,17 @@ function dfrn_notify_post(&$a) {
'$mimeboundary' => $msg['mimeboundary'], // mime message divider
'$hostname' => $a->get_hostname() // name of this host
));
-
- // load the template for private message notifications
- $tpl = load_view_file('view/mail_received_eml.tpl');
-
- // import the data into the template
- $email_tpl = replace_macros($tpl, array(
- '$siteurl' => $a->get_baseurl(), // descriptive url of this site
- '$email' => $importer['email'], // email address to send to
- '$from' => $msg['from-name'], // name of the person sending the message
- '$title' => stripslashes($msg['title']), // subject of the message
- '$mimeboundary' => $msg['mimeboundary'], // mime message divider
- '$hostname' => $a->get_hostname(), // name of this host
- '$htmlbody' => chunk_split(base64_encode($email_html_body_tpl)),
- '$textbody' => chunk_split(base64_encode($email_text_body_tpl))
- ));
-
- logger("message headers: " . $msg['headers']);
- logger("message body: " . $mail_tpl);
-
-
- // send the message
- $res = mail(
- $importer['email'], // send to address
- t('New mail received at ') . $a->config['sitename'], // subject
- $email_tpl, // message body
- $msg['headers'] // message headers
+
+ // use the EmailNotification library to send the message
+ require_once("include/EmailNotification.php");
+ EmailNotification::sendTextHtmlEmail(
+ $msg['notificationfromname'],
+ $msg['notificationfromemail'],
+ $msg['notificationfromemail'],
+ $importer['email'],
+ t('New mail received at ') . $a->config['sitename'],
+ $email_html_body_tpl,
+ $email_text_body_tpl
);
}
xml_status(0);
@@ -411,7 +384,7 @@ function dfrn_notify_post(&$a) {
'$email' => $importer['email'],
'$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id,
'$from' => $from,
- '$body' => strip_tags(bbcode(stripslashes($datarray['body'])))
+ '$body' => html_entity_decode(strip_tags(bbcode(stripslashes($datarray['body']))), ENT_QUOTES, 'UTF-8')
));
$res = mail($importer['email'], $from . t(' commented on an item at ') . $a->config['sitename'],
@@ -477,7 +450,7 @@ function dfrn_notify_post(&$a) {
'$email' => $importer['email'],
'$from' => $from,
'$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r,
- '$body' => strip_tags(bbcode(stripslashes($datarray['body'])))
+ '$body' => html_entity_decode(strip_tags(bbcode(stripslashes($datarray['body']))), ENT_QUOTES, 'UTF-8')
));
$res = mail($importer['email'], $from . t(" commented on an item at ")
diff --git a/mod/display.php b/mod/display.php
index 03003f3c0..bdf6a6f97 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -153,7 +153,8 @@ function display_content(&$a) {
}
if($item['last-child']) {
$comment = replace_macros($cmnt_tpl,array(
- '$return_path' => '', // $_SESSION['return_url'],
+ '$return_path' => '',
+ '$jsreload' => $_SESSION['return_url'],
'$type' => 'wall-comment',
'$id' => $item['item_id'],
'$parent' => $item['parent'],
diff --git a/mod/item.php b/mod/item.php
index cbdd11eb9..8c6b181c0 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -496,10 +496,17 @@ function item_post(&$a) {
}
}
- if((x($_POST,'return')) && strlen($_POST['return']))
+ logger('post_complete');
+ if((x($_POST,'return')) && strlen($_POST['return'])) {
+ logger('return: ' . $_POST['return']);
goaway($a->get_baseurl() . "/" . $_POST['return'] );
-
+ }
$json = array('success' => 1);
+ if(x($_POST,'jsreload') && strlen($_POST['jsreload']))
+ $json['reload'] = $a->get_baseurl() . '/' . $_POST['jsreload'];
+
+ logger('post_json: ' . print_r($json,true), LOGGER_DEBUG);
+
echo json_encode($json);
killme();
// NOTREACHED
diff --git a/mod/network.php b/mod/network.php
index 3658c601e..79a2f2b38 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -39,22 +39,22 @@ function network_content(&$a, $update = 0) {
$group = 0;
$nouveau = false;
+ require_once('include/acl_selectors.php');
- if(! $update) {
- $o .= '<script> $(document).ready(function() { $(\'#nav-network-link\').addClass(\'nav-selected\'); });</script>';
+ if(($a->argc > 2) && $a->argv[2] === 'new')
+ $nouveau = true;
- if(($a->argc > 2) && $a->argv[2] === 'new')
+ if($a->argc > 1) {
+ if($a->argv[1] === 'new')
$nouveau = true;
-
- // pull out the group here because the updater might have different args
- if($a->argc > 1) {
- if($a->argv[1] === 'new')
- $nouveau = true;
- else {
- $group = intval($a->argv[1]);
- $group_acl = array('allow_gid' => '<' . $group . '>');
- }
+ else {
+ $group = intval($a->argv[1]);
+ $group_acl = array('allow_gid' => '<' . $group . '>');
}
+ }
+
+ if(! $update) {
+ $o .= '<script> $(document).ready(function() { $(\'#nav-network-link\').addClass(\'nav-selected\'); });</script>';
$_SESSION['return_url'] = $a->cmd;
@@ -68,7 +68,6 @@ function network_content(&$a, $update = 0) {
'$nickname' => $a->user['nickname']
));
- require_once('include/acl_selectors.php');
$tpl = load_view_file("view/jot.tpl");
@@ -106,10 +105,10 @@ function network_content(&$a, $update = 0) {
// filtering by group and also you aren't writing a comment (the last
// criteria is discovered in javascript).
- if($a->pager['start'] == 0 && $a->argc == 1) {
$o .= '<div id="live-network"></div>' . "\r\n";
- $o .= "<script> var profile_uid = " . $_SESSION['uid'] . "; </script>\r\n";
- }
+ $o .= "<script> var profile_uid = " . $_SESSION['uid']
+ . "; var netargs = '" . substr($a->cmd,8)
+ . "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
}
@@ -134,6 +133,8 @@ function network_content(&$a, $update = 0) {
intval($_SESSION['uid'])
);
if(! count($r)) {
+ if($update)
+ killme();
notice( t('No such group') . EOL );
goaway($a->get_baseurl() . '/network');
return; // NOTREACHED
@@ -340,7 +341,8 @@ function network_content(&$a, $update = 0) {
if($item['last-child']) {
$comment = replace_macros($cmnt_tpl,array(
- '$return_path' => '', // $_SESSION['return_url'],
+ '$return_path' => '',
+ '$jsreload' => '', // $_SESSION['return_url'],
'$type' => 'net-comment',
'$id' => $item['item_id'],
'$parent' => $item['parent'],
diff --git a/mod/photos.php b/mod/photos.php
index ebfe714a7..d4835ba5e 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -1049,7 +1049,8 @@ function photos_content(&$a) {
if($can_post || can_write_wall($a,$owner_uid)) {
if($link_item['last-child']) {
$o .= replace_macros($cmnt_tpl,array(
- '$return_path' => '', // $return_url,
+ '$return_path' => '',
+ '$jsreload' => $return_url,
'$type' => 'wall-comment',
'$id' => $link_item['id'],
'$parent' => $link_item['id'],
@@ -1088,7 +1089,8 @@ function photos_content(&$a) {
if($can_post || can_write_wall($a,$owner_uid)) {
if($link_item['last-child']) {
$o .= replace_macros($cmnt_tpl,array(
- '$return_path' => $return_url,
+ '$return_path' => '',
+ '$jsreload' => $return_url,
'$type' => 'wall-comment',
'$id' => $link_item['id'],
'$parent' => $link_item['id'],
@@ -1116,7 +1118,8 @@ function photos_content(&$a) {
if($item['last-child']) {
$comment = replace_macros($cmnt_tpl,array(
- '$return_path' => $return_url,
+ '$return_path' => '',
+ '$jsreload' => $return_url,
'$type' => 'wall-comment',
'$id' => $item['item_id'],
'$parent' => $item['parent'],
diff --git a/mod/profile.php b/mod/profile.php
index 0723d64fb..46d13298e 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -82,7 +82,6 @@ function profile_content(&$a, $update = 0) {
$is_owner = ((local_user()) && (local_user() == $a->profile['profile_uid']) ? true : false);
-
if(! $update) {
if(x($_GET,'tab'))
$tab = notags(trim($_GET['tab']));
@@ -161,11 +160,11 @@ function profile_content(&$a, $update = 0) {
// This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
// because browser prefetching might change it on us. We have to deliver it with the page.
- if($tab === 'posts' && (! $a->pager['start'])) {
+ if($tab === 'posts') {
$o .= '<div id="live-profile"></div>' . "\r\n";
- $o .= "<script> var profile_uid = " . $a->profile['profile_uid'] . "; </script>\r\n";
+ $o .= "<script> var profile_uid = " . $a->profile['profile_uid']
+ . "; var netargs = ''; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
}
-
}
// Construct permissions
@@ -293,7 +292,8 @@ function profile_content(&$a, $update = 0) {
}
if($item['last-child']) {
$comment = replace_macros($cmnt_tpl,array(
- '$return_path' => '', // $_SESSION['return_url'],
+ '$return_path' => '',
+ '$jsreload' => '', // $_SESSION['return_url'],
'$type' => 'wall-comment',
'$id' => $item['item_id'],
'$parent' => $item['parent'],
diff --git a/mod/update_network.php b/mod/update_network.php
index 35e968dba..cf9f11f58 100644
--- a/mod/update_network.php
+++ b/mod/update_network.php
@@ -3,7 +3,7 @@
// See update_profile.php for documentation
require_once('mod/network.php');
-
+require_once('include/group.php');
function update_network_content(&$a) {