" . $t_wrote . " $2", $Text); diff --git a/include/diaspora.php b/include/diaspora.php index a8e02e509..92f3500f2 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -451,7 +451,7 @@ function diaspora_request($importer,$xml) { // perhaps we were already sharing with this person. Now they're sharing with us. // That makes us friends. - if($contact['rel'] == CONTACT_IS_FOLLOWER) { + if($contact['rel'] == CONTACT_IS_FOLLOWER && $importer['page-flags'] != PAGE_COMMUNITY) { q("UPDATE `contact` SET `rel` = %d, `writable` = 1 WHERE `id` = %d AND `uid` = %d LIMIT 1", intval(CONTACT_IS_FRIEND), intval($contact['id']), @@ -619,6 +619,18 @@ function diaspora_request($importer,$xml) { return; } +function diaspora_post_allow($importer,$contact) { + if(($contact['blocked']) || ($contact['readonly'])) + return false; + if($contact['rel'] == CONTACT_IS_SHARING || $contact['rel'] == CONTACT_IS_FRIEND) + return true; + if($contact['rel'] == CONTACT_IS_FOLLOWER) + if($importer['page-flags'] == PAGE_COMMUNITY) + return true; + return false; +} + + function diaspora_post($importer,$xml) { $a = get_app(); @@ -629,7 +641,7 @@ function diaspora_post($importer,$xml) { if(! $contact) return; - if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) { + if(! diaspora_post_allow($importer,$contact)) { logger('diaspora_post: Ignoring this author.'); return 202; } @@ -748,7 +760,7 @@ function diaspora_reshare($importer,$xml) { if(! $contact) return; - if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) { + if(! diaspora_post_allow($importer,$contact)) { logger('diaspora_reshare: Ignoring this author: ' . $diaspora_handle . ' ' . print_r($xml,true)); return 202; } @@ -900,7 +912,7 @@ function diaspora_asphoto($importer,$xml) { if(! $contact) return; - if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) { + if(! diaspora_post_allow($importer,$contact)) { logger('diaspora_asphoto: Ignoring this author.'); return 202; } @@ -1001,7 +1013,7 @@ function diaspora_comment($importer,$xml,$msg) { return; } - if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) { + if(! diaspora_post_allow($importer,$contact)) { logger('diaspora_comment: Ignoring this author.'); return 202; } @@ -1446,7 +1458,7 @@ function diaspora_photo($importer,$xml,$msg) { return; } - if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) { + if(! diaspora_post_allow($importer,$contact)) { logger('diaspora_photo: Ignoring this author.'); return 202; } @@ -1503,7 +1515,7 @@ function diaspora_like($importer,$xml,$msg) { return; } - if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) { + if(! diaspora_post_allow($importer,$contact)) { logger('diaspora_like: Ignoring this author.'); return 202; } diff --git a/include/enotify.php b/include/enotify.php index a8e6e3de6..1eb3b5476 100755 --- a/include/enotify.php +++ b/include/enotify.php @@ -28,18 +28,18 @@ function notification($params) { $subject = sprintf( t('New mail received at %s'),$sitename); $preamble = sprintf( t('%s sent you a new private message at %s.'),$params['source_name'],$sitename); - $epreamble = sprintf( t('%s sent you a private message.'),'[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); + $epreamble = sprintf( t('%s sent you %s.'),'[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]', '[url=$itemlink]' . t('a private message') . '[/url]'); $sitelink = t('Please visit %s to view and/or reply to your private messages.'); - $tsitelink = sprintf( $sitelink, $siteurl . '/message' ); - $hsitelink = sprintf( $sitelink, '' . $sitename . ''); - $itemlink = $siteurl . '/message'; + $tsitelink = sprintf( $sitelink, $siteurl . '/message/' . $params['item']['id'] ); + $hsitelink = sprintf( $sitelink, '' . $sitename . ''); + $itemlink = $siteurl . '/message/' . $params['item']['id']; } if($params['type'] == NOTIFY_COMMENT) { $subject = sprintf( t('%s commented on an item at %s'), $params['source_name'], $sitename); $preamble = sprintf( t('%s commented on an item/conversation you have been following.'), $params['source_name']); - $epreamble = sprintf( t('%s commented on an item/conversation you have been following.'), '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); + $epreamble = sprintf( t('%s commented in %s.'), '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]', '[url=$itemlink]' . t('a watched conversation') . '[/url]'); $sitelink = t('Please visit %s to view and/or reply to the conversation.'); $tsitelink = sprintf( $sitelink, $siteurl ); @@ -49,7 +49,7 @@ function notification($params) { if($params['type'] == NOTIFY_WALL) { $preamble = $subject = sprintf( t('%s posted to your profile wall at %s') , $params['source_name'], $sitename); - $epreamble = sprintf( t('%s posted to your profile wall') , '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); + $epreamble = sprintf( t('%s posted to %s') , '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]', '[url=$itemlink]' . t('your profile wall.') . '[/url]'); $sitelink = t('Please visit %s to view and/or reply to the conversation.'); $tsitelink = sprintf( $sitelink, $siteurl ); @@ -59,7 +59,7 @@ function notification($params) { if($params['type'] == NOTIFY_TAGSELF) { $preamble = $subject = sprintf( t('%s tagged you at %s') , $params['source_name'], $sitename); - $epreamble = sprintf( t('%s tagged you') , '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); + $epreamble = sprintf( t('%s %s.') , '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]', '[url=' . $params['link'] . ']' . t('tagged you') . '[/url]'); $sitelink = t('Please visit %s to view and/or reply to the conversation.'); $tsitelink = sprintf( $sitelink, $siteurl ); @@ -69,7 +69,7 @@ function notification($params) { if($params['type'] == NOTIFY_TAGSHARE) { $preamble = $subject = sprintf( t('%s tagged your post at %s') , $params['source_name'], $sitename); - $epreamble = sprintf( t('%s tagged your post') , '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); + $epreamble = sprintf( t('%s tagged %s') , '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]', '[url=$itemlink]' . t('your post') . '[/url]' ); $sitelink = t('Please visit %s to view and/or reply to the conversation.'); $tsitelink = sprintf( $sitelink, $siteurl ); @@ -80,7 +80,7 @@ function notification($params) { if($params['type'] == NOTIFY_INTRO) { $subject = sprintf( t('Introduction received at %s'), $sitename); $preamble = sprintf( t('You\'ve received an introduction from \'%s\' at %s'), $params['source_name'], $sitename); - $epreamble = sprintf( t('You\'ve received an introduction from %s'), '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); + $epreamble = sprintf( t('You\'ve received %s from %s.'), '[url=$itemlink]' . t('an introduction') . '[/url]' , '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); $body = sprintf( t('You may visit their profile at %s'),$params['source_link']); $sitelink = t('Please visit %s to approve or reject the introduction.'); @@ -92,7 +92,8 @@ function notification($params) { if($params['type'] == NOTIFY_SUGGEST) { $subject = sprintf( t('Friend suggestion received at %s'), $sitename); $preamble = sprintf( t('You\'ve received a friend suggestion from \'%s\' at %s'), $params['source_name'], $sitename); - $epreamble = sprintf( t('You\'ve received a friend suggestion for %s from %s'), + $epreamble = sprintf( t('You\'ve received %s for %s from %s.'), + '[url=$itemlink]' . t('a friend suggestion') . '[/url]', '[url=' . $params['item']['url'] . ']' . $params['item']['name'] . '[/url]', '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); $body = t('Name:') . ' ' . $params['item']['name'] . "\n"; @@ -115,15 +116,27 @@ function notification($params) { require_once('include/html2bbcode.php'); + do { + $dups = false; + $hash = random_string(); + $r = q("SELECT `id` FROM `notify` WHERE `hash` = '%s' LIMIT 1", + dbesc($hash)); + if(count($r)) + $dups = true; + } while($dups == true); + + + + // create notification entry in DB - $r = q("insert into notify (name,url,photo,date,msg,uid,link,type,verb,otype) + $r = q("insert into notify (hash,name,url,photo,date,uid,link,type,verb,otype) values('%s','%s','%s','%s','%s',%d,'%s',%d,'%s','%s')", + dbesc($hash), dbesc($params['source_name']), dbesc($params['source_link']), dbesc($params['source_photo']), dbesc(datetime_convert()), - dbesc($epreamble), intval($params['uid']), dbesc($itemlink), intval($params['type']), @@ -131,6 +144,25 @@ function notification($params) { dbesc($params['otype']) ); + $r = q("select id from notify where hash = '%s' and uid = %d limit 1", + dbesc($hash), + intval($params['uid']) + ); + if($r) + $notify_id = $r[0]['id']; + else + return; + + $itemlink = $a->get_baseurl() . '/notify/view/' . $notify_id; + $msg = replace_macros($epreamble,array('$itemlink' => $itemlink)); + $r = q("update notify set msg = '%s' where id = %d and uid = %d limit 1", + dbesc($msg), + intval($notify_id), + intval($params['uid']) + ); + + + // send email notification if notification preferences permit require_once('bbcode.php'); diff --git a/include/html2bbcode.php b/include/html2bbcode.php index 4297ff2f9..d8f1a24f1 100755 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -204,7 +204,7 @@ function html2bbcode($message) node2bbcode($doc, 'a', array('href'=>'/(.+)/'), '[url=$1]', '[/url]'); - node2bbcode($doc, 'img', array('src'=>'/(.+)/', 'width'=>'/(\d+)/', 'height'=>'/(\d+)/'), '[img$2x$3]$1', '[/img]'); + node2bbcode($doc, 'img', array('src'=>'/(.+)/', 'width'=>'/(\d+)/', 'height'=>'/(\d+)/'), '[img=$2x$3]$1', '[/img]'); node2bbcode($doc, 'img', array('src'=>'/(.+)/'), '[img]$1', '[/img]'); diff --git a/include/items.php b/include/items.php index f4837449d..347826042 100755 --- a/include/items.php +++ b/include/items.php @@ -1551,8 +1551,9 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) } $force_parent = false; - if($contact['network'] === NETWORK_OSTATUS) { - $force_parent = true; + if($contact['network'] === NETWORK_OSTATUS || stristr($contact['url'],'twitter.com')) { + if($contact['network'] === NETWORK_OSTATUS) + $force_parent = true; if(strlen($datarray['title'])) unset($datarray['title']); $r = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d", @@ -1700,7 +1701,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) if(! is_array($contact)) return; - if($contact['network'] === NETWORK_OSTATUS || stristr($permalink,'twitter.com')) { + if($contact['network'] === NETWORK_OSTATUS || stristr($contact['url'],'twitter.com')) { if(strlen($datarray['title'])) unset($datarray['title']); $datarray['last-child'] = 1; @@ -2040,13 +2041,12 @@ function local_delivery($importer,$data) { } if($is_reply) { - $community = false; if($importer['page-flags'] == PAGE_COMMUNITY) { $sql_extra = ''; $community = true; - logger('local_delivery: community reply'); + logger('local_delivery: possible community reply'); } else $sql_extra = " and contact.self = 1 and item.wall = 1 "; @@ -2054,7 +2054,9 @@ function local_delivery($importer,$data) { // was the top-level post for this reply written by somebody on this site? // Specifically, the recipient? - $r = q("select `item`.`id`, `item`.`uri`, `item`.`tag`, + $is_a_remote_comment = false; + + $r = q("select `item`.`id`, `item`.`uri`, `item`.`tag`, `item`.`forum_mode`,`item`.`origin`,`item`.`wall`, `contact`.`name`, `contact`.`url`, `contact`.`thumb` from `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uri` = '%s' AND `item`.`parent-uri` = '%s' @@ -2065,16 +2067,29 @@ function local_delivery($importer,$data) { dbesc($parent_uri), intval($importer['importer_uid']) ); + if($r && count($r)) + $is_a_remote_comment = true; - if($r && count($r)) { + // Does this have the characteristics of a community comment? + // If it's a reply to a wall post on a community page it's a + // valid community comment. Also forum_mode makes it valid for sure. + // If neither, it's not. + if($is_a_remote_comment && $community) { + if((! $r[0]['forum_mode']) && (! $r[0]['wall'])) { + $is_a_remote_comment = false; + logger('local_delivery: not a community reply'); + } + } + + if($is_a_remote_comment) { logger('local_delivery: received remote comment'); $is_like = false; // remote reply to our post. Import and then notify everybody else. $datarray = get_atom_elements($feed,$item); - // TODO: make this next part work against both delivery threads of a community post + // TODO: make this next part work against both delivery threads of a community post // if((! link_compare($datarray['author-link'],$importer['url'])) && (! $community)) { // logger('local_delivery: received relay claiming to be from ' . $importer['url'] . ' however comment author url is ' . $datarray['author-link'] ); @@ -2188,6 +2203,7 @@ function local_delivery($importer,$data) { } } + return 0; // NOTREACHED } diff --git a/include/nav.php b/include/nav.php index 95dd37ba6..511ca07fc 100755 --- a/include/nav.php +++ b/include/nav.php @@ -116,7 +116,8 @@ function nav(&$a) { if($_SESSION['page_flags'] == PAGE_NORMAL) { $nav['introductions'] = array('notifications/intros', t('Introductions'), "", t('Friend Requests')); $nav['notifications'] = array('notifications', t('Notifications'), "", t('Notifications')); - $nav['notifications']['all']=array('notifications/network', t('See all notifications', "", "")); + $nav['notifications']['all']=array('notifications/system', t('See all notifications'), "", ""); + $nav['notifications']['mark'] = array('', t('Mark all system notifications seen'), '',''); } @@ -148,7 +149,7 @@ function nav(&$a) { $banner = get_config('system','banner'); if($banner === false) - $banner .= 'Friendica'; + $banner .= 'Friendica'; $tpl = get_markup_template('nav.tpl'); diff --git a/include/poller.php b/include/poller.php index 0ea0c9231..3e7a1e9b4 100755 --- a/include/poller.php +++ b/include/poller.php @@ -194,8 +194,8 @@ function poller_run($argv, $argc){ $update = true; break; } -// if((! $update) && (! $force)) -// continue; + if((! $update) && (! $force)) + continue; } // Check to see if we are running out of memory - if so spawn a new process and kill this one @@ -349,7 +349,7 @@ function poller_run($argv, $argc){ || ($contact['network'] === NETWORK_DIASPORA) || ($contact['network'] === NETWORK_FEED) ) { - // Upgrading DB fields from an older Friendika version + // Upgrading DB fields from an older Friendica version // Will only do this once per notify-enabled OStatus contact // or if relationship changes diff --git a/include/template_processor.php b/include/template_processor.php index 25f7703a2..0d476f0e6 100755 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -10,7 +10,7 @@ var $done = false; var $d = false; var $lang = null; - + var $debug=false; private function _preg_error(){ switch(preg_last_error()){ @@ -160,6 +160,30 @@ return $s; } + private function _str_replace($str){ + #$this->search,$this->replace, + $searchs = $this->search; + foreach($searchs as $search){ + $search = "|".preg_quote($search)."(\|[a-zA-Z0-9_]*)*|"; + $m = array(); + if (preg_match_all($search, $str,$m)){ + foreach ($m[0] as $match){ + $toks = explode("|",$match); + $val = $this->_get_var($toks[0]); + for($k=1; $k
(.*?)<\/pre>/ism','smile_encode',$s);
+ $s = preg_replace_callback('/(.*?)<\/code>/ism','smile_encode',$s);
+
$texts = array(
'<3',
'</3',
@@ -759,7 +771,7 @@ function smilies($s, $sample = false) {
'',
'',
'~friendika ',
- '~friendica ',
+ '~friendica ',
'Diaspora',
);
@@ -776,11 +788,23 @@ function smilies($s, $sample = false) {
else {
$s = str_replace($params['texts'],$params['icons'],$params['string']);
}
-
+
+ $s = preg_replace_callback('/(.*?)<\/pre>/ism','smile_decode',$s);
+ $s = preg_replace_callback('/(.*?)<\/code>/ism','smile_decode',$s);
+
return $s;
}}
+function smile_encode($m) {
+ return(str_replace($m[1],base64url_encode($m[1]),$m[0]));
+}
+
+function smile_decode($m) {
+ return(str_replace($m[1],base64url_decode($m[1]),$m[0]));
+}
+
+
if(! function_exists('day_translate')) {
diff --git a/js/fk.autocomplete.js b/js/fk.autocomplete.js
index 85b51baeb..509466bd9 100755
--- a/js/fk.autocomplete.js
+++ b/js/fk.autocomplete.js
@@ -1,5 +1,5 @@
/**
- * Friendika people autocomplete
+ * Friendica people autocomplete
*
* require jQuery, jquery.textareas
*/
diff --git a/js/main.js b/js/main.js
index 4cb278ee8..3a10ae468 100755
--- a/js/main.js
+++ b/js/main.js
@@ -89,6 +89,7 @@
/* notifications template */
var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
var notifications_all = unescape($('').append( $("#nav-notifications-see-all").clone() ).html()); //outerHtml hack
+ var notifications_mark = unescape($('').append( $("#nav-notifications-mark-all").clone() ).html()); //outerHtml hack
var notifications_empty = unescape($("#nav-notifications-menu").html());
/* nav update event */
@@ -117,7 +118,7 @@
$("#nav-notifications-linkmenu").addClass("on");
nnm = $("#nav-notifications-menu");
- nnm.html(notifications_all);
+ nnm.html(notifications_all + notifications_mark);
//nnm.attr('popup','true');
eNotif.children("note").each(function(){
@@ -518,6 +519,14 @@ function checkboxhighlight(box) {
}
}
+function notifyMarkAll() {
+ $.get('notify/mark/all', function(data) {
+ if(timer) clearTimeout(timer);
+ timer = setTimeout(NavUpdate,1000);
+ });
+}
+
+
function setupFieldRichtext(){
tinyMCE.init({
theme : "advanced",
diff --git a/library/OAuth1.php b/library/OAuth1.php
index 3b211b146..0db6fabcb 100755
--- a/library/OAuth1.php
+++ b/library/OAuth1.php
@@ -289,7 +289,7 @@ class OAuthRequest {
}
}
- // fix for friendika redirect system
+ // fix for friendica redirect system
$http_url = substr($http_url, 0, strpos($http_url,$parameters['q'])+strlen($parameters['q']));
unset( $parameters['q'] );
diff --git a/mod/contacts.php b/mod/contacts.php
index 418cddf17..c8edea151 100755
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -451,29 +451,17 @@ function contacts_content(&$a) {
$a->set_pager_total($r[0]['total']);
- $tpl = get_markup_template("contacts-top.tpl");
- $o .= replace_macros($tpl,array(
- '$header' => t('Contacts') . (($nets) ? ' - ' . network_to_name($nets) : ''),
- '$tabs' => $t,
- '$total' => $r[0]['total'],
- '$search' => $search_hdr,
- '$desc' => t('Search your contacts'),
- '$finding' => (strlen($search) ? '' . t('Finding: ') . "'" . $search . "'" . '
' : ""),
- '$submit' => t('Find'),
- '$cmd' => $a->cmd
- ));
-
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `pending` = 0 $sql_extra $sql_extra2 ORDER BY `name` ASC LIMIT %d , %d ",
intval($_SESSION['uid']),
intval($a->pager['start']),
intval($a->pager['itemspage'])
);
- if(count($r)) {
+ $contacts = array();
- $tpl = get_markup_template("contact_template.tpl");
+ if(count($r)) {
foreach($r as $rr) {
if($rr['self'])
@@ -505,24 +493,40 @@ function contacts_content(&$a) {
}
- $o .= replace_macros($tpl, array(
- '$img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']),
- '$edit_hover' => t('Edit contact'),
- '$contact_photo_menu' => contact_photo_menu($rr),
- '$id' => $rr['id'],
- '$alt_text' => $alt_text,
- '$dir_icon' => $dir_icon,
- '$thumb' => $rr['thumb'],
- '$name' => $rr['name'],
- '$username' => $rr['name'],
- '$sparkle' => $sparkle,
- '$url' => $url
- ));
+ $contacts[] = array(
+ 'img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']),
+ 'edit_hover' => t('Edit contact'),
+ 'photo_menu' => contact_photo_menu($rr),
+ 'id' => $rr['id'],
+ 'alt_text' => $alt_text,
+ 'dir_icon' => $dir_icon,
+ 'thumb' => $rr['thumb'],
+ 'name' => $rr['name'],
+ 'username' => $rr['name'],
+ 'sparkle' => $sparkle,
+ 'url' => $url,
+ 'item' => $rr,
+ );
}
- $o .= '';
+
}
- $o .= paginate($a);
+
+ $tpl = get_markup_template("contacts-template.tpl");
+ $o .= replace_macros($tpl,array(
+ '$header' => t('Contacts') . (($nets) ? ' - ' . network_to_name($nets) : ''),
+ '$tabs' => $t,
+ '$total' => $r[0]['total'],
+ '$search' => $search_hdr,
+ '$desc' => t('Search your contacts'),
+ '$finding' => (strlen($search) ? t('Finding: ') . "'" . $search . "'" : ""),
+ '$submit' => t('Find'),
+ '$cmd' => $a->cmd,
+ '$contacts' => $contacts,
+ '$paginate' => paginate($a),
+
+ ));
+
return $o;
}
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
old mode 100755
new mode 100644
index abacd9906..5a24f0089
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -252,7 +252,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
$message = unxmlify($xml->message); // human readable text of what may have gone wrong.
switch($status) {
case 0:
- notice( t("Confirmation completed successfully.") . EOL);
+ info( t("Confirmation completed successfully.") . EOL);
if(strlen($message))
notice( t('Remote site reported: ') . $message . EOL);
break;
diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php
index ceec83e90..bc159137d 100755
--- a/mod/dfrn_request.php
+++ b/mod/dfrn_request.php
@@ -677,7 +677,7 @@ function dfrn_request_content(&$a) {
'$no' => t('No'),
'$add_note' => t('Add a personal note:'),
'$page_desc' => $page_desc,
- '$friendika' => t('Friendica'),
+ '$friendica' => t('Friendica'),
'$statusnet' => t('StatusNet/Federated Social Web'),
'$diaspora' => t('Diaspora'),
'$diasnote' => t('- please share from your own site as noted above'),
diff --git a/mod/dirfind.php b/mod/dirfind.php
index 801018276..75b1c4976 100755
--- a/mod/dirfind.php
+++ b/mod/dirfind.php
@@ -27,7 +27,7 @@ function dirfind_content(&$a) {
$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));
+ $x = fetch_url('http://dir.friendica.com/lsearch?f=' . $p . '&search=' . urlencode($search));
//TODO fallback local search if global dir not available.
// else
diff --git a/mod/group.php b/mod/group.php
index ca163902c..c896362ca 100755
--- a/mod/group.php
+++ b/mod/group.php
@@ -68,7 +68,7 @@ function group_content(&$a) {
return;
}
- // Switch to text mod interface if we have more than 'n' contacts or group members
+ // Switch to text mode interface if we have more than 'n' contacts or group members
$switchtotext = get_pconfig(local_user(),'system','groupedit_image_limit');
if($switchtotext === false)
diff --git a/mod/match.php b/mod/match.php
index 3645a419d..1ae7848a6 100755
--- a/mod/match.php
+++ b/mod/match.php
@@ -31,7 +31,7 @@ function match_content(&$a) {
$params['p'] = $a->pager['page'];
if(strlen(get_config('system','directory_submit_url')))
- $x = post_url('http://dir.friendika.com/msearch', $params);
+ $x = post_url('http://dir.friendica.com/msearch', $params);
else
$x = post_url($a->get_baseurl() . '/msearch', $params);
diff --git a/mod/notifications.php b/mod/notifications.php
index 635639d89..5831c1b7a 100755
--- a/mod/notifications.php
+++ b/mod/notifications.php
@@ -67,6 +67,11 @@ function notifications_content(&$a) {
$o = '';
$tabs = array(
+ array(
+ 'label' => t('System'),
+ 'url'=>$a->get_baseurl() . '/notifications/system',
+ 'sel'=> (($a->argv[1] == 'system') ? 'active' : ''),
+ ),
array(
'label' => t('Network'),
'url'=>$a->get_baseurl() . '/notifications/network',
@@ -295,6 +300,36 @@ function notifications_content(&$a) {
'$notif_content' => $notif_content,
));
+ } else if (($a->argc > 1) && ($a->argv[1] == 'system')) {
+
+ $notif_tpl = get_markup_template('notifications.tpl');
+
+ $not_tpl = get_markup_template('notify.tpl');
+ require_once('include/bbcode.php');
+
+ $r = q("SELECT * from notify where uid = %d and seen = 0 order by date desc",
+ intval(local_user())
+ );
+
+ if (count($r) > 0) {
+ foreach ($r as $it) {
+ $notif_content .= replace_macros($not_tpl,array(
+ '$item_link' => $a->get_baseurl().'/notify/view/'. $it['id'],
+ '$item_image' => $it['photo'],
+ '$item_text' => strip_tags(bbcode($it['msg'])),
+ '$item_when' => relative_date($it['date'])
+ ));
+ }
+ } else {
+ $notif_content .= t('No more system notifications.');
+ }
+
+ $o .= replace_macros($notif_tpl,array(
+ '$notif_header' => t('System'),
+ '$tabs' => $tabs,
+ '$notif_content' => $notif_content,
+ ));
+
} else if (($a->argc > 1) && ($a->argv[1] == 'personal')) {
$notif_tpl = get_markup_template('notifications.tpl');
diff --git a/mod/notify.php b/mod/notify.php
new file mode 100644
index 000000000..229020f4a
--- /dev/null
+++ b/mod/notify.php
@@ -0,0 +1,39 @@
+argc > 2 && $a->argv[1] === 'view' && intval($a->argv[2])) {
+ $r = q("select * from notify where id = %d and uid = %d limit 1",
+ intval($a->argv[2]),
+ intval(local_user())
+ );
+ if(count($r)) {
+ q("update notify set seen = 1 where id = %d and uid = %d limit 1",
+ intval($a->argv[2]),
+ intval(local_user())
+ );
+ goaway($r[0]['link']);
+ }
+
+ goaway($a->get_baseurl());
+ }
+
+ if($a->argc > 2 && $a->argv[1] === 'mark' && $a->argv[2] === 'all' ) {
+ $r = q("update notify set seen = 1 where uid = %d",
+ intval(local_user())
+ );
+ $j = json_encode(array('result' => ($r) ? 'success' : 'fail'));
+ echo $j;
+ killme();
+ }
+
+}
+
+
+function notify_content(&$a) {
+ if(! local_user())
+ return login();
+}
\ No newline at end of file
diff --git a/mod/photos.php b/mod/photos.php
index 466fe44d3..e40ae0d74 100755
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -98,7 +98,7 @@ EOT;
function photos_post(&$a) {
- logger('mod-photos: photos_post: begin' , 'LOGGER_DEBUG');
+ logger('mod-photos: photos_post: begin' , LOGGER_DEBUG);
logger('mod_photos: REQUEST ' . print_r($_REQUEST,true), LOGGER_DATA);
@@ -571,7 +571,7 @@ function photos_post(&$a) {
$album = notags(trim($_REQUEST['album']));
$newalbum = notags(trim($_REQUEST['newalbum']));
- logger('mod/photos.php: photos_post(): album= ' . $album . ' newalbum= ' . $newalbum , 'LOGGER_DEBUG');
+ logger('mod/photos.php: photos_post(): album= ' . $album . ' newalbum= ' . $newalbum , LOGGER_DEBUG);
if(! strlen($album)) {
if(strlen($newalbum))
@@ -643,13 +643,13 @@ function photos_post(&$a) {
return;
}
- logger('mod/photos.php: photos_post(): loading the contents of ' . $src , 'LOGGER_DEBUG');
+ logger('mod/photos.php: photos_post(): loading the contents of ' . $src , LOGGER_DEBUG);
$imagedata = @file_get_contents($src);
$ph = new Photo($imagedata);
if(! $ph->is_valid()) {
- logger('mod/photos.php: photos_post(): unable to process image' , 'LOGGER_DEBUG');
+ logger('mod/photos.php: photos_post(): unable to process image' , LOGGER_DEBUG);
notice( t('Unable to process image.') . EOL );
@unlink($src);
$foo = 0;
@@ -669,7 +669,7 @@ function photos_post(&$a) {
$r = $ph->store($page_owner_uid, $visitor, $photo_hash, $filename, $album, 0 , 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
if(! $r) {
- logger('mod/photos.php: photos_post(): image store failed' , 'LOGGER_DEBUG');
+ logger('mod/photos.php: photos_post(): image store failed' , LOGGER_DEBUG);
notice( t('Image upload failed.') . EOL );
killme();
}
diff --git a/mod/ping.php b/mod/ping.php
old mode 100755
new mode 100644
index db68332bd..2898042a3
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -5,12 +5,20 @@ require_once("include/datetime.php");
function ping_init(&$a) {
header("Content-type: text/xml");
+
echo "
";
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
if(local_user()){
+ $z = q("select * from notify where seen = 0 and uid = %d
+ order by date desc",
+ intval(local_user())
+ );
+
+
+
$tags = array();
$comments = array();
$likes = array();
@@ -90,22 +98,20 @@ function ping_init(&$a) {
}
- $intros1 = q("SELECT COUNT(`intro`.`id`) AS `total`, `intro`.`id`, `intro`.`datetime`,
+ $intros1 = q("SELECT `intro`.`id`, `intro`.`datetime`,
`fcontact`.`name`, `fcontact`.`url`, `fcontact`.`photo`
FROM `intro` LEFT JOIN `fcontact` ON `intro`.`fid` = `fcontact`.`id`
WHERE `intro`.`uid` = %d AND `intro`.`blocked` = 0 AND `intro`.`ignore` = 0 AND `intro`.`fid`!=0",
intval(local_user())
);
- $intros2 = q("SELECT COUNT(`intro`.`id`) AS `total`, `intro`.`id`, `intro`.`datetime`,
+ $intros2 = q("SELECT `intro`.`id`, `intro`.`datetime`,
`contact`.`name`, `contact`.`url`, `contact`.`photo`
FROM `intro` LEFT JOIN `contact` ON `intro`.`contact-id` = `contact`.`id`
WHERE `intro`.`uid` = %d AND `intro`.`blocked` = 0 AND `intro`.`ignore` = 0 AND `intro`.`contact-id`!=0",
intval(local_user())
);
- $intro = $intros1[0]['total'] + $intros2[0]['total'];
- if ($intros1[0]['total']==0) $intros1=Array();
- if ($intros2[0]['total']==0) $intros2=Array();
+ $intro = count($intros1) + count($intros2);
$intros = $intros1+$intros2;
@@ -143,6 +149,22 @@ function ping_init(&$a) {
$tot = $mail+$intro+$register+count($comments)+count($likes)+count($dislikes)+count($friends)+count($posts)+count($tags);
echo ' ';
+
+ require_once('include/bbcode.php');
+
+ if(count($z)) {
+ foreach($z as $zz) {
+ echo xmlize($a->get_baseurl() . '/notify/' . $zz['id'], $zz['name'],$zz['url'],$zz['photo'],relative_date($zz['date']), bbcode($zz['msg']));
+
+ }
+ }
+
+
+
+
+
+/*
+
if ($intro>0){
foreach ($intros as $i) {
echo xmlize( $a->get_baseurl().'/notifications/intros/'.$i['id'], $i['name'], $i['url'], $i['photo'], relative_date($i['datetime']), t("{0} wants to be your friend") );
@@ -196,6 +218,8 @@ function ping_init(&$a) {
};
}
+*/
+
echo " ";
}
echo " ";
diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php
index cd8d100ed..10c980d93 100755
--- a/mod/viewcontacts.php
+++ b/mod/viewcontacts.php
@@ -1,4 +1,5 @@
' . t('View Contacts') . '';
-
$r = q("SELECT COUNT(*) as `total` FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 ",
intval($a->profile['uid'])
@@ -41,7 +40,7 @@ function viewcontacts_content(&$a) {
return $o;
}
- $tpl = get_markup_template("viewcontact_template.tpl");
+ $contacts = array();
foreach($r as $rr) {
if($rr['self'])
@@ -56,19 +55,26 @@ function viewcontacts_content(&$a) {
if($is_owner && ($rr['network'] === NETWORK_DFRN) && ($rr['rel']))
$url = 'redir/' . $rr['id'];
- $o .= replace_macros($tpl, array(
- '$id' => $rr['id'],
- '$alt_text' => sprintf( t('Visit %s\'s profile [%s]'), $rr['name'], $rr['url']),
- '$thumb' => $rr['thumb'],
- '$name' => substr($rr['name'],0,20),
- '$username' => $rr['name'],
- '$url' => $url
- ));
+ $contacts[] = array(
+ 'id' => $rr['id'],
+ 'img_hover' => sprintf( t('Visit %s\'s profile [%s]'), $rr['name'], $rr['url']),
+ 'thumb' => $rr['thumb'],
+ 'name' => substr($rr['name'],0,20),
+ 'username' => $rr['name'],
+ 'url' => $url,
+ 'sparkle' => '',
+ 'item' => $rr,
+ );
}
- $o .= '';
- $o .= paginate($a);
+ $tpl = get_markup_template("viewcontact_template.tpl");
+ $o .= replace_macros($tpl, array(
+ '$title' => t('View Contacts'),
+ '$contacts' => $contacts,
+ '$paginate' => paginate($a),
+ ));
+
return $o;
}
diff --git a/mod/wall_upload.php b/mod/wall_upload.php
index 278c21354..64f174a78 100755
--- a/mod/wall_upload.php
+++ b/mod/wall_upload.php
@@ -101,10 +101,24 @@ function wall_upload_post(&$a) {
$basename = basename($filename);
- if(local_user() && intval(get_pconfig(local_user(),'system','plaintext')))
- echo "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.jpg[/img][/url]\n\n";
- else
- echo '
";
+
+/* mod Waitman Gobble NO WARRANTY */
+
+//if we get the signal then return the image url info in BBCODE, otherwise this outputs the info and bails (for the ajax image uploader on wall post)
+ if ($_REQUEST['hush']!='yeah') {
+
+ /*existing code*/
+ if(local_user() && intval(get_pconfig(local_user(),'system','plaintext')))
+ echo "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.jpg[/img][/url]\n\n";
+ else
+ echo '
";
+ /*existing code*/
+
+ } else {
+ $m = '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.jpg[/img][/url]";
+ return($m);
+ }
+/* mod Waitman Gobble NO WARRANTY */
killme();
// NOTREACHED
diff --git a/update.php b/update.php
index 24138450a..16c1d7848 100755
--- a/update.php
+++ b/update.php
@@ -1,6 +1,6 @@
/strings.php
diff --git a/view/admin_remoteupdate.tpl b/view/admin_remoteupdate.tpl
index 41ecfaf85..874c6e626 100755
--- a/view/admin_remoteupdate.tpl
+++ b/view/admin_remoteupdate.tpl
@@ -62,7 +62,7 @@
- Friendika Update
+ Friendica Update
@@ -81,7 +81,7 @@
{{ if $canwrite }}
{{ else }}
- Your friendika installation is not writable by web server.
+ Your friendica installation is not writable by web server.
{{ if $canftp }}
You can try to update via FTP
{{ inc field_input.tpl with $field=$ftphost }}{{ endinc }}
diff --git a/view/auto_request.tpl b/view/auto_request.tpl
index 377da25c5..204fcf247 100755
--- a/view/auto_request.tpl
+++ b/view/auto_request.tpl
@@ -4,7 +4,7 @@
$page_desc
-- $friendika
+- $friendica
- $diaspora $diasnote
- $statusnet
diff --git a/view/contact_template.tpl b/view/contact_template.tpl
index e1a080b67..d6f114d6e 100755
--- a/view/contact_template.tpl
+++ b/view/contact_template.tpl
@@ -1,23 +1,25 @@
-
-
-
+
+
+
-
- $name
+ $contact.name
+ $contact.item.url
+ $contact.item.network|network_to_name
+
-
+
diff --git a/view/contacts-top.tpl b/view/contacts-template.tpl
similarity index 71%
rename from view/contacts-top.tpl
rename to view/contacts-template.tpl
index fca3efd54..ecb342bf4 100755
--- a/view/contacts-top.tpl
+++ b/view/contacts-template.tpl
@@ -1,6 +1,6 @@
$header{{ if $total }} ($total){{ endif }}
-$finding
+{{ if $finding }}$finding
{{ endif }}