aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorMichael <icarus@dabo.de>2012-02-23 20:53:22 +0100
committerMichael <icarus@dabo.de>2012-02-23 20:53:22 +0100
commit0409b5cdba003b6ce90d5ad0181e81c06af95ab1 (patch)
treec677adb7c0e8140bdb1e115a95d1aa23fdf734ed /mod
parent311e35731c52102cbce3befc6343f179080ad38c (diff)
parent8cacff69858c2ad097bafb80c93405e79c311edf (diff)
downloadvolse-hubzilla-0409b5cdba003b6ce90d5ad0181e81c06af95ab1.tar.gz
volse-hubzilla-0409b5cdba003b6ce90d5ad0181e81c06af95ab1.tar.bz2
volse-hubzilla-0409b5cdba003b6ce90d5ad0181e81c06af95ab1.zip
Merge remote branch 'upstream/master'
Conflicts: include/bbcode.php
Diffstat (limited to 'mod')
-rwxr-xr-xmod/contacts.php62
-rw-r--r--[-rwxr-xr-x]mod/dfrn_confirm.php2
-rwxr-xr-xmod/dfrn_request.php2
-rwxr-xr-xmod/dirfind.php2
-rwxr-xr-xmod/group.php2
-rwxr-xr-xmod/match.php2
-rwxr-xr-xmod/notifications.php35
-rw-r--r--mod/notify.php39
-rwxr-xr-xmod/photos.php10
-rw-r--r--[-rwxr-xr-x]mod/ping.php34
-rwxr-xr-xmod/viewcontacts.php32
-rwxr-xr-xmod/wall_upload.php22
12 files changed, 183 insertions, 61 deletions
diff --git a/mod/contacts.php b/mod/contacts.php
index 418cddf17..c8edea151 100755
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -451,19 +451,7 @@ 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) ? '<h4>' . t('Finding: ') . "'" . $search . "'" . '</h4>' : ""),
- '$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']),
@@ -471,9 +459,9 @@ function contacts_content(&$a) {
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 .= '<div id="contact-edit-end"></div>';
+
}
- $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
index abacd9906..5a24f0089 100755..100644
--- 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
@@ -68,6 +68,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',
'sel'=> (($a->argv[1] == 'network') ? 'active' : ''),
@@ -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 @@
+<?php
+
+
+function notify_init(&$a) {
+ if(! local_user())
+ return;
+
+ if($a->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
index db68332bd..2898042a3 100755..100644
--- 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 "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<result>";
$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 ' <notif count="'.$tot.'">';
+
+ 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 " </notif>";
}
echo " <sysmsgs>";
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 @@
<?php
+require_once('include/contact_selectors.php');
function viewcontacts_init(&$a) {
@@ -22,8 +23,6 @@ function viewcontacts_content(&$a) {
return;
}
- $o .= '<h3>' . t('View Contacts') . '</h3>';
-
$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 .= '<div id="view-contact-end"></div>';
- $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 '<br /><br /><a href="' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '" ><img src="' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.jpg\" alt=\"$basename\" /></a><br /><br />";
+
+/* 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 '<br /><br /><a href="' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '" ><img src="' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.jpg\" alt=\"$basename\" /></a><br /><br />";
+ /*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