From b4d38f6eed93b944b58f36c454a1f483d7db74ac Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 23 Feb 2012 16:50:29 -0800 Subject: implement firehose notify in ping, strip links so notify popup displays correctly in all themes --- mod/ping.php | 253 +++++++++++++++++++++++++++-------------------------------- 1 file changed, 114 insertions(+), 139 deletions(-) (limited to 'mod') diff --git a/mod/ping.php b/mod/ping.php index 2898042a3..358125347 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -12,13 +12,14 @@ function ping_init(&$a) { $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">"; if(local_user()){ + $firehose = intval(get_pconfig(local_user(),'system','notify_full')); + $z = q("select * from notify where seen = 0 and uid = %d order by date desc", intval(local_user()) ); - $tags = array(); $comments = array(); $likes = array(); @@ -32,72 +33,48 @@ function ping_init(&$a) { `pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink` FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent` WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND - `item`.`deleted` = 0 AND `item`.`uid` = %d AND `item`.`wall` = 0 + `item`.`deleted` = 0 AND `item`.`uid` = %d ORDER BY `item`.`created` DESC", intval(local_user()) ); - - $network = count($r); - foreach ($r as $it) { - switch($it['verb']){ - case ACTIVITY_TAG: - $obj = parse_xml_string($xmlhead.$it['object']); - $it['tname'] = $obj->content; - $tags[] = $it; - break; - case ACTIVITY_LIKE: - $likes[] = $it; - break; - case ACTIVITY_DISLIKE: - $dislikes[] = $it; - break; - case ACTIVITY_FRIEND: - $obj = parse_xml_string($xmlhead.$it['object']); - $it['fname'] = $obj->title; - $friends[] = $it; - break; - default: - if ($it['parent']!=$it['id']) { - $comments[] = $it; - } else { - $posts[] = $it; - } - } - } - $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, - `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object`, - `pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink` - FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent` - WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND - `item`.`deleted` = 0 AND `item`.`uid` = %d AND `item`.`wall` = 1", - intval(local_user()) - ); - $home = count($r); - foreach ($r as $it) { - switch($it['verb']){ - case ACTIVITY_TAG: - $obj = parse_xml_string($xmlhead.$it['object']); - $it['tname'] = $obj->content; - $tags[] = $it; - break; - case ACTIVITY_LIKE: - $likes[] = $it; - break; - case ACTIVITY_DISLIKE: - $dislikes[] = $it; - break; - case ACTIVITY_FRIEND: - $obj = parse_xml_string($xmlhead.$it['object']); - $it['fname'] = $obj->title; - $friends[] = $it; - break; - default: - if ($it['parent']!=$it['id']) $comments[] = $it; + if(count($r)) { + + foreach ($r as $it) { + + if($it['wall']) + $home ++; + else + $network ++; + + switch($it['verb']){ + case ACTIVITY_TAG: + $obj = parse_xml_string($xmlhead.$it['object']); + $it['tname'] = $obj->content; + $tags[] = $it; + break; + case ACTIVITY_LIKE: + $likes[] = $it; + break; + case ACTIVITY_DISLIKE: + $dislikes[] = $it; + break; + case ACTIVITY_FRIEND: + $obj = parse_xml_string($xmlhead.$it['object']); + $it['fname'] = $obj->title; + $friends[] = $it; + break; + default: + if ($it['parent']!=$it['id']) { + $comments[] = $it; + } else { + if(! $it['wall']) + $posts[] = $it; + } + } } } - $intros1 = q("SELECT `intro`.`id`, `intro`.`datetime`, `fcontact`.`name`, `fcontact`.`url`, `fcontact`.`photo` FROM `intro` LEFT JOIN `fcontact` ON `intro`.`fid` = `fcontact`.`id` @@ -122,11 +99,13 @@ function ping_init(&$a) { intval(local_user()), dbesc($myurl) ); - $mail = $mails[0]['total']; + if($mails) + $mail = $mails[0]['total']; if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()){ $regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) as `total` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1"); - $register = $regs[0]['total']; + if($regs) + $register = $regs[0]['total']; } else { $register = "0"; } @@ -135,11 +114,10 @@ function ping_init(&$a) { function xmlize($href, $name, $url, $photo, $date, $message){ $notsxml = '%s'; return sprintf ( $notsxml, - xmlify($href), xmlify($name), xmlify($url), xmlify($photo), xmlify($date), xmlify($message) - ); + xmlify($href), xmlify($name), xmlify($url), xmlify($photo), xmlify($date), xmlify($message) + ); } - echo "$intro $mail $network @@ -147,95 +125,92 @@ function ping_init(&$a) { if ($register!=0) echo "$register"; $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($firehose) { + echo ' '; + } + else { + echo ' '; + if(count($z)) { + foreach($z as $zz) { + echo xmlize($a->get_baseurl() . '/notify/view' . $zz['id'], $zz['name'],$zz['url'],$zz['photo'],relative_date($zz['date']), strip_tags(bbcode($zz['msg']))); + } } } + if($firehose) { + 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") ); + }; + } + if ($mail>0){ + foreach ($mails as $i) { + echo xmlize( $a->get_baseurl().'/message/'.$i['id'], $i['from-name'], $i['from-url'], $i['from-photo'], relative_date($i['created']), t("{0} sent you a message") ); + }; + } + if ($register>0){ + foreach ($regs as $i) { + echo xmlize( $a->get_baseurl().'/admin/users/', $i['name'], $i['url'], $i['micro'], relative_date($i['created']), t("{0} requested registration") ); + }; + } + if (count($comments)){ + foreach ($comments as $i) { + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} commented %s's post"), $i['pname'] ) ); + }; + } + if (count($likes)){ + foreach ($likes as $i) { + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} liked %s's post"), $i['pname'] ) ); + }; + } + if (count($dislikes)){ + foreach ($dislikes as $i) { + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} disliked %s's post"), $i['pname'] ) ); + }; + } + if (count($friends)){ + foreach ($friends as $i) { + echo xmlize($a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'],$i['author-name'],$i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} is now friends with %s"), $i['fname'] ) ); + }; + } + if (count($posts)){ + foreach ($posts as $i) { + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} posted") ) ); + }; + } + if (count($tags)){ + foreach ($tags as $i) { + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} tagged %s's post with #%s"), $i['pname'], $i['tname'] ) ); + }; + } - - -/* - - 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") ); - }; - } - if ($mail>0){ - foreach ($mails as $i) { - echo xmlize( $a->get_baseurl().'/message/'.$i['id'], $i['from-name'], $i['from-url'], $i['from-photo'], relative_date($i['created']), t("{0} sent you a message") ); - }; - } - if ($register>0){ - foreach ($regs as $i) { - echo xmlize( $a->get_baseurl().'/admin/users/', $i['name'], $i['url'], $i['micro'], relative_date($i['created']), t("{0} requested registration") ); - }; - } - - if (count($comments)){ - foreach ($comments as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} commented %s's post"), $i['pname'] ) ); - }; - } - if (count($likes)){ - foreach ($likes as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} liked %s's post"), $i['pname'] ) ); - }; - } - if (count($dislikes)){ - foreach ($dislikes as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} disliked %s's post"), $i['pname'] ) ); - }; - } - if (count($friends)){ - foreach ($friends as $i) { - echo xmlize($a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'],$i['author-name'],$i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} is now friends with %s"), $i['fname'] ) ); - }; - } - if (count($posts)){ - foreach ($posts as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} posted") ) ); - }; - } - if (count($tags)){ - foreach ($tags as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} tagged %s's post with #%s"), $i['pname'], $i['tname'] ) ); - }; - } - - if (count($cit)){ - foreach ($cit as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), t("{0} mentioned you in a post") ); - }; + if (count($cit)){ + foreach ($cit as $i) { + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), t("{0} mentioned you in a post") ); + }; + } } -*/ - echo " "; } echo " "; - if(x($_SESSION,'sysmsg')){ - foreach ($_SESSION['sysmsg'] as $m){ - echo "".xmlify($m).""; - } - unset($_SESSION['sysmsg']); + if(x($_SESSION,'sysmsg')){ + foreach ($_SESSION['sysmsg'] as $m){ + echo "".xmlify($m).""; } - if(x($_SESSION,'sysmsg_info')){ - foreach ($_SESSION['sysmsg_info'] as $m){ - echo "".xmlify($m).""; - } - unset($_SESSION['sysmsg_info']); + unset($_SESSION['sysmsg']); + } + if(x($_SESSION,'sysmsg_info')){ + foreach ($_SESSION['sysmsg_info'] as $m){ + echo "".xmlify($m).""; } + unset($_SESSION['sysmsg_info']); + } echo " "; echo" -- cgit v1.2.3 From 65ddefe9c5db4f5af9495377cd7e4463e8f68ef6 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 23 Feb 2012 17:37:03 -0800 Subject: system notifications to notify module, untranslated string in notifications.tpl --- mod/notifications.php | 8 ++++---- mod/notify.php | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/notifications.php b/mod/notifications.php index 5831c1b7a..99031a1d5 100755 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -295,7 +295,7 @@ function notifications_content(&$a) { } $o .= replace_macros($notif_tpl,array( - '$notif_header' => t('Notifications'), + '$notif_header' => t('Network Notifications'), '$tabs' => $tabs, '$notif_content' => $notif_content, )); @@ -325,7 +325,7 @@ function notifications_content(&$a) { } $o .= replace_macros($notif_tpl,array( - '$notif_header' => t('System'), + '$notif_header' => t('System Notifications'), '$tabs' => $tabs, '$notif_content' => $notif_content, )); @@ -420,7 +420,7 @@ function notifications_content(&$a) { } $o .= replace_macros($notif_tpl,array( - '$notif_header' => t('Notifications'), + '$notif_header' => t('Personal Notifications'), '$tabs' => $tabs, '$notif_content' => $notif_content, )); @@ -501,7 +501,7 @@ function notifications_content(&$a) { } $o .= replace_macros($notif_tpl,array( - '$notif_header' => t('Notifications'), + '$notif_header' => t('Home Notifications'), '$tabs' => $tabs, '$notif_content' => $notif_content, )); diff --git a/mod/notify.php b/mod/notify.php index 229020f4a..e6a7a8859 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -36,4 +36,36 @@ function notify_init(&$a) { function notify_content(&$a) { if(! local_user()) return login(); + + $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 Notifications'), + '$tabs' => '', // $tabs, + '$notif_content' => $notif_content, + )); + + return $o; + + } \ No newline at end of file -- cgit v1.2.3 From 44c23cda8edcde0ad6f904b8333f563b6d5ebc39 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 23 Feb 2012 20:29:09 -0800 Subject: theme shakeup commences - themes are now administered in admin panel. --- mod/admin.php | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- mod/follow.php | 5 ++ mod/settings.php | 20 +++++-- 3 files changed, 197 insertions(+), 7 deletions(-) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index 028ed8624..d9864dc6a 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -6,14 +6,19 @@ require_once("include/remoteupdate.php"); function admin_post(&$a){ + + if(!is_site_admin()) { return; } + // do not allow a page manager to access the admin panel at all. if(x($_SESSION,'submanage') && intval($_SESSION['submanage'])) return; + + // urls if ($a->argc > 1){ switch ($a->argv[1]){ @@ -66,6 +71,7 @@ function admin_content(&$a) { 'site' => Array($a->get_baseurl()."/admin/site/", t("Site") , "site"), 'users' => Array($a->get_baseurl()."/admin/users/", t("Users") , "users"), 'plugins'=> Array($a->get_baseurl()."/admin/plugins/", t("Plugins") , "plugins"), + 'themes' => Array($a->get_baseurl()."/admin/themes/", t("Themes") , "themes"), 'update' => Array($a->get_baseurl()."/admin/update/", t("Update") , "update") ); @@ -108,6 +114,9 @@ function admin_content(&$a) { case 'plugins': $o = admin_page_plugins($a); break; + case 'themes': + $o = admin_page_themes($a); + break; case 'logs': $o = admin_page_logs($a); break; @@ -564,7 +573,7 @@ function admin_page_plugins(&$a){ '$info' => get_plugin_info($plugin), '$admin_form' => $admin_form, - + '$function' => $plugins, '$readme' => $readme )); } @@ -593,11 +602,177 @@ function admin_page_plugins(&$a){ '$page' => t('Plugins'), '$submit' => t('Submit'), '$baseurl' => $a->get_baseurl(), - + '$function' => 'plugins', '$plugins' => $plugins )); } +function toggle_theme(&$themes,$th,&$result) { + for($x = 0; $x < count($themes); $x ++) { + if($themes[$x]['name'] === $th) { + if($themes[$x]['allowed']) { + $themes[$x]['allowed'] = 0; + $result = 0; + } + else { + $themes[$x]['allowed'] = 1; + $result = 1; + } + } + } +} + +function theme_status($themes,$th) { + for($x = 0; $x < count($themes); $x ++) { + if($themes[$x]['name'] === $th) { + if($themes[$x]['allowed']) { + return 1; + } + else { + return 0; + } + } + } + return 0; +} + + + +function rebuild_theme_table($themes) { + $o = ''; + if(count($themes)) { + foreach($themes as $th) { + if($th['allowed']) { + if(strlen($o)) + $o .= ','; + $o .= $th['name']; + } + } + } + return $o; +} + + +/* + * Themes admin page + */ + +function admin_page_themes(&$a){ + + $allowed_themes_str = get_config('system','allowed_themes'); + $allowed_themes_raw = explode(',',$allowed_themes_str); + $allowed_themes = array(); + if(count($allowed_themes_raw)) + foreach($allowed_themes_raw as $x) + if(strlen(trim($x))) + $allowed_themes[] = trim($x); + + $themes = array(); + $files = glob('view/theme/*'); + if($files) { + foreach($files as $file) { + $f = basename($file); + $is_experimental = intval(file_exists($file . '/experimental')); + $is_unsupported = 1-(intval(file_exists($file . '/unsupported'))); + $is_allowed = intval(in_array($f,$allowed_themes)); + $themes[] = array('name' => $f, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed); + } + } + + if(! count($themes)) { + notice( t('No themes found.')); + return; + } + + /** + * Single theme + */ + + if ($a->argc == 3){ + $theme = $a->argv[2]; + if(! is_dir("view/theme/$theme")){ + notice( t("Item not found.") ); + return; + } + + if (x($_GET,"a") && $_GET['a']=="t"){ + + // Toggle theme status + + toggle_theme($themes,$theme,$result); + $s = rebuild_theme_table($themes); + if($result) + info( sprintf('Theme %s enabled.',$theme)); + else + info( sprintf('Theme %s disabled.',$theme)); + + set_config('system','allowed_themes',$s); + goaway($a->get_baseurl() . '/admin/themes' ); + return; // NOTREACHED + } + + // display plugin details + require_once('library/markdown.php'); + + if (theme_status($themes,$theme)) { + $status="on"; $action= t("Disable"); + } else { + $status="off"; $action= t("Enable"); + } + + $readme=Null; + if (is_file("view/$theme/README.md")){ + $readme = file_get_contents("view/$theme/README.md"); + $readme = Markdown($readme); + } else if (is_file("view/$theme/README")){ + $readme = "
". file_get_contents("view/$theme/README") ."
"; + } + + $admin_form=""; + + $t = get_markup_template("admin_plugins_details.tpl"); + return replace_macros($t, array( + '$title' => t('Administration'), + '$page' => t('Themes'), + '$toggle' => t('Toggle'), + '$settings' => t('Settings'), + '$baseurl' => $a->get_baseurl(), + + '$plugin' => $theme, + '$status' => $status, + '$action' => $action, + '$info' => array('name' => $theme,'version' => '','description' => ''), + '$function' => 'themes', + '$admin_form' => $admin_form, + + '$readme' => $readme + )); + } + + + + /** + * List plugins + */ + + $xthemes = array(); + if($themes) { + foreach($themes as $th) { + $xthemes[] = array($th['name'],(($th['allowed']) ? "on" : "off"),array('name' => $th['name'],'version' => '','description' => '')); + } + } + + $t = get_markup_template("admin_plugins.tpl"); + return replace_macros($t, array( + '$title' => t('Administration'), + '$page' => t('Themes'), + '$submit' => t('Submit'), + '$baseurl' => $a->get_baseurl(), + '$function' => 'themes', + '$plugins' => $xthemes + )); +} + /** * Logs admin page diff --git a/mod/follow.php b/mod/follow.php index f8964885e..ae8cb200c 100755 --- a/mod/follow.php +++ b/mod/follow.php @@ -49,6 +49,11 @@ function follow_init(&$a) { goaway($_SESSION['return_url']); } } + + // This just confuses things, remove it + if($ret['network'] === NETWORK_DIASPORA) + $ret['url'] = str_replace('?absolute=true','',$ret['url']); + // do we have enough information? diff --git a/mod/settings.php b/mod/settings.php index 57a4e6db0..91f4325da 100755 --- a/mod/settings.php +++ b/mod/settings.php @@ -210,7 +210,7 @@ function settings_post(&$a) { } } - $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : ''); + $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : $a->user['theme']); $username = ((x($_POST,'username')) ? notags(trim($_POST['username'])) : ''); $email = ((x($_POST,'email')) ? notags(trim($_POST['email'])) : ''); $timezone = ((x($_POST,'timezone')) ? notags(trim($_POST['timezone'])) : ''); @@ -728,13 +728,23 @@ function settings_content(&$a) { $default_theme = get_config('system','theme'); if(! $default_theme) $default_theme = 'default'; + + $allowed_themes_str = get_config('system','allowed_themes'); + $allowed_themes_raw = explode(',',$allowed_themes_str); + $allowed_themes = array(); + if(count($allowed_themes_raw)) + foreach($allowed_themes_raw as $x) + if(strlen(trim($x))) + $allowed_themes[] = trim($x); + $themes = array(); $files = glob('view/theme/*'); - if($files) { - foreach($files as $file) { - $f = basename($file); - $is_experimental = file_exists($file . '/experimental'); + if($allowed_themes) { + foreach($allowed_themes as $th) { + $f = $th; + $is_experimental = file_exists('view/theme/' . $th . '/experimental'); + $unsupported = file_exists('view/theme/' . $th . '/unsupported'); if (!$is_experimental or ($is_experimental && (get_config('experimentals','exp_themes')==1 or get_config('experimentals','exp_themes')===false))){ $theme_name = (($is_experimental) ? sprintf("%s - \x28Experimental\x29", $f) : $f); $themes[$f]=$theme_name; -- cgit v1.2.3 From 6092567c977d9e28df9558db51bd5b3d269740e8 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 24 Feb 2012 23:44:55 -0800 Subject: notifications to zeros, bug in notify link --- mod/ping.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/ping.php b/mod/ping.php index 358125347..4260bbfb9 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -14,8 +14,8 @@ function ping_init(&$a) { $firehose = intval(get_pconfig(local_user(),'system','notify_full')); - $z = q("select * from notify where seen = 0 and uid = %d - order by date desc", + $z = q("select * from notify where uid = %d + order by seen asc, date desc limit 0, 50", intval(local_user()) ); @@ -135,7 +135,7 @@ function ping_init(&$a) { echo ' '; if(count($z)) { foreach($z as $zz) { - echo xmlize($a->get_baseurl() . '/notify/view' . $zz['id'], $zz['name'],$zz['url'],$zz['photo'],relative_date($zz['date']), strip_tags(bbcode($zz['msg']))); + echo xmlize($a->get_baseurl() . '/notify/view/' . $zz['id'], $zz['name'],$zz['url'],$zz['photo'],relative_date($zz['date']), ($zz['seen'] ? '' : '! ') .strip_tags(bbcode($zz['msg']))); } } } -- cgit v1.2.3 From 18bf5d14023d5f6ea4d490362b2825f7a71f951e Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 25 Feb 2012 00:30:14 -0800 Subject: theme info (like plugin info) --- mod/admin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index d9864dc6a..9073d079f 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -741,7 +741,7 @@ function admin_page_themes(&$a){ '$plugin' => $theme, '$status' => $status, '$action' => $action, - '$info' => array('name' => $theme,'version' => '','description' => ''), + '$info' => get_theme_info($theme), '$function' => 'themes', '$admin_form' => $admin_form, @@ -758,7 +758,7 @@ function admin_page_themes(&$a){ $xthemes = array(); if($themes) { foreach($themes as $th) { - $xthemes[] = array($th['name'],(($th['allowed']) ? "on" : "off"),array('name' => $th['name'],'version' => '','description' => '')); + $xthemes[] = array($th['name'],(($th['allowed']) ? "on" : "off"), get_theme_info($th['name'])); } } -- cgit v1.2.3 From 4839c235da1ce6ed61c71d0a9d28df14c01b567b Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 25 Feb 2012 03:28:07 -0800 Subject: theme seen,unseen notifications --- mod/ping.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'mod') diff --git a/mod/ping.php b/mod/ping.php index 4260bbfb9..c0e61434e 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -111,10 +111,10 @@ function ping_init(&$a) { } - function xmlize($href, $name, $url, $photo, $date, $message){ - $notsxml = '%s'; + function xmlize($href, $name, $url, $photo, $date, $seen, $message){ + $notsxml = '%s'; return sprintf ( $notsxml, - xmlify($href), xmlify($name), xmlify($url), xmlify($photo), xmlify($date), xmlify($message) + xmlify($href), xmlify($name), xmlify($url), xmlify($photo), xmlify($date), xmlify($seen), xmlify($message) ); } @@ -135,7 +135,7 @@ function ping_init(&$a) { echo ' '; if(count($z)) { foreach($z as $zz) { - echo xmlize($a->get_baseurl() . '/notify/view/' . $zz['id'], $zz['name'],$zz['url'],$zz['photo'],relative_date($zz['date']), ($zz['seen'] ? '' : '! ') .strip_tags(bbcode($zz['msg']))); + echo xmlize($a->get_baseurl() . '/notify/view/' . $zz['id'], $zz['name'],$zz['url'],$zz['photo'],relative_date($zz['date']), ($zz['seen'] ? 'notify-seen' : 'notify-unseen'), ($zz['seen'] ? '' : '→ ') .strip_tags(bbcode($zz['msg']))); } } } @@ -143,54 +143,54 @@ function ping_init(&$a) { if($firehose) { 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") ); + echo xmlize( $a->get_baseurl().'/notifications/intros/'.$i['id'], $i['name'], $i['url'], $i['photo'], relative_date($i['datetime']), 'notify-unseen',t("{0} wants to be your friend") ); }; } if ($mail>0){ foreach ($mails as $i) { - echo xmlize( $a->get_baseurl().'/message/'.$i['id'], $i['from-name'], $i['from-url'], $i['from-photo'], relative_date($i['created']), t("{0} sent you a message") ); + echo xmlize( $a->get_baseurl().'/message/'.$i['id'], $i['from-name'], $i['from-url'], $i['from-photo'], relative_date($i['created']), 'notify-unseen',t("{0} sent you a message") ); }; } if ($register>0){ foreach ($regs as $i) { - echo xmlize( $a->get_baseurl().'/admin/users/', $i['name'], $i['url'], $i['micro'], relative_date($i['created']), t("{0} requested registration") ); + echo xmlize( $a->get_baseurl().'/admin/users/', $i['name'], $i['url'], $i['micro'], relative_date($i['created']), 'notify-unseen',t("{0} requested registration") ); }; } if (count($comments)){ foreach ($comments as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} commented %s's post"), $i['pname'] ) ); + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), 'notify-unseen',sprintf( t("{0} commented %s's post"), $i['pname'] ) ); }; } if (count($likes)){ foreach ($likes as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} liked %s's post"), $i['pname'] ) ); + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), 'notify-unseen',sprintf( t("{0} liked %s's post"), $i['pname'] ) ); }; } if (count($dislikes)){ foreach ($dislikes as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} disliked %s's post"), $i['pname'] ) ); + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), 'notify-unseen',sprintf( t("{0} disliked %s's post"), $i['pname'] ) ); }; } if (count($friends)){ foreach ($friends as $i) { - echo xmlize($a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'],$i['author-name'],$i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} is now friends with %s"), $i['fname'] ) ); + echo xmlize($a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'],$i['author-name'],$i['author-link'], $i['author-avatar'], relative_date($i['created']), 'notify-unseen',sprintf( t("{0} is now friends with %s"), $i['fname'] ) ); }; } if (count($posts)){ foreach ($posts as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} posted") ) ); + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), 'notify-unseen',sprintf( t("{0} posted") ) ); }; } if (count($tags)){ foreach ($tags as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} tagged %s's post with #%s"), $i['pname'], $i['tname'] ) ); + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), 'notify-unseen',sprintf( t("{0} tagged %s's post with #%s"), $i['pname'], $i['tname'] ) ); }; } if (count($cit)){ foreach ($cit as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), t("{0} mentioned you in a post") ); + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), 'notify-unseen',t("{0} mentioned you in a post") ); }; } } -- cgit v1.2.3 From c90bac57271625d06d92dfb2b7499d0787c55e3c Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 25 Feb 2012 04:37:12 -0800 Subject: sysnotify count in wrong location, and wrong number --- mod/ping.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/ping.php b/mod/ping.php index c0e61434e..0f6f0a9d6 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -127,12 +127,20 @@ function ping_init(&$a) { $tot = $mail+$intro+$register+count($comments)+count($likes)+count($dislikes)+count($friends)+count($posts)+count($tags); require_once('include/bbcode.php'); - + $sysnotify = 0; + if($firehose) { echo ' '; } else { - echo ' '; + if(count($z)) { + foreach($z as $zz) { + if($zz['seen'] == 0) + $sysnotify ++; + } + } + + echo ' '; if(count($z)) { foreach($z as $zz) { echo xmlize($a->get_baseurl() . '/notify/view/' . $zz['id'], $zz['name'],$zz['url'],$zz['photo'],relative_date($zz['date']), ($zz['seen'] ? 'notify-seen' : 'notify-unseen'), ($zz['seen'] ? '' : '→ ') .strip_tags(bbcode($zz['msg']))); -- cgit v1.2.3 From 579738aff77ed0aa6da853b479720be9ea4953d2 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 25 Feb 2012 13:00:44 -0800 Subject: fixed link for toggling plugin from detail page --- mod/admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index 9073d079f..bcbf3e28f 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -573,7 +573,7 @@ function admin_page_plugins(&$a){ '$info' => get_plugin_info($plugin), '$admin_form' => $admin_form, - '$function' => $plugins, + '$function' => 'plugins', '$readme' => $readme )); } -- cgit v1.2.3 From 2c7da5d0de29cd7010bd6a34c0b6cfb79fe24466 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 25 Feb 2012 14:22:51 -0800 Subject: scale external images --- mod/item.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index 3035989f3..9e0768a65 100755 --- a/mod/item.php +++ b/mod/item.php @@ -400,6 +400,8 @@ function item_post(&$a) { $body = preg_replace('/\[\/code\]\s*\[code\]/ism',"\n",$body); + $body = scale_external_images($body,false); + /** * Look for any tags and linkify them */ -- cgit v1.2.3 From 2d5f8b4b485ff16f989f5bbe7a95b2d49e499094 Mon Sep 17 00:00:00 2001 From: "Abinoam P. Marques Jr" Date: Sat, 25 Feb 2012 13:10:33 -0800 Subject: mod/item.php pass 'parent' to notification --- mod/item.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index 9e0768a65..81d7c753b 100755 --- a/mod/item.php +++ b/mod/item.php @@ -755,7 +755,8 @@ function item_post(&$a) { 'source_link' => $datarray['author-link'], 'source_photo' => $datarray['author-avatar'], 'verb' => ACTIVITY_POST, - 'otype' => 'item' + 'otype' => 'item', + 'parent' => $parent, )); } -- cgit v1.2.3 From 5f7858a688a1b6877246933a6c4c72318c885109 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 26 Feb 2012 04:17:02 -0800 Subject: show experimental and unsupported theme status on theme admin page --- mod/admin.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index bcbf3e28f..0f600e312 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -711,7 +711,7 @@ function admin_page_themes(&$a){ return; // NOTREACHED } - // display plugin details + // display theme details require_once('library/markdown.php'); if (theme_status($themes,$theme)) { @@ -769,7 +769,9 @@ function admin_page_themes(&$a){ '$submit' => t('Submit'), '$baseurl' => $a->get_baseurl(), '$function' => 'themes', - '$plugins' => $xthemes + '$plugins' => $xthemes, + '$experimental' => t('[Experimental]'), + '$unsupported' => t('[Unsupported]') )); } -- cgit v1.2.3 From fd9c12128afba39d91b81371b240e0cd92f66469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Sun, 26 Feb 2012 20:39:37 +0000 Subject: should probably be a->user['hidewall'] instead of profile['hidewall'] --- mod/profile.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/profile.php b/mod/profile.php index eba9874a8..74e1a2302 100755 --- a/mod/profile.php +++ b/mod/profile.php @@ -107,7 +107,7 @@ function profile_content(&$a, $update = 0) { $is_owner = ((local_user()) && (local_user() == $a->profile['profile_uid']) ? true : false); - if($a->profile['hidewall'] && (! $is_owner) && (! $remote_contact)) { + if($a->user['hidewall'] && (! $is_owner) && (! $remote_contact)) { notice( t('Access to this profile has been restricted.') . EOL); return; } @@ -228,10 +228,12 @@ function profile_content(&$a, $update = 0) { intval($a->profile['profile_uid']), dbesc($parents_str) ); + + $items = conv_sort($items,'created'); + } else { + $items = array(); } - $items = conv_sort($items,'created'); - if($is_owner && ! $update) { $o .= get_birthdays(); $o .= get_events(); -- cgit v1.2.3 From 792abc3a24d13408d4e31a4137a8173e3039bd8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Sun, 26 Feb 2012 20:40:41 +0000 Subject: necessare fields not loaded from DB --- mod/acl.php | 4 +++- mod/ping.php | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/acl.php b/mod/acl.php index 98ca90ded..375c618c8 100755 --- a/mod/acl.php +++ b/mod/acl.php @@ -16,6 +16,8 @@ function acl_init(&$a){ if ($search!=""){ $sql_extra = "AND `name` LIKE '%%".dbesc($search)."%%'"; $sql_extra2 = "AND (`attag` LIKE '%%".dbesc($search)."%%' OR `name` LIKE '%%".dbesc($search)."%%' OR `nick` LIKE '%%".dbesc($search)."%%')"; + } else { + $sql_extra = $sql_extra2 = ""; } // count groups and contacts @@ -75,7 +77,7 @@ function acl_init(&$a){ if ($type=='' || $type=='c'){ - $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url` FROM `contact` + $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `notify` != '' $sql_extra2 ORDER BY `name` ASC ", diff --git a/mod/ping.php b/mod/ping.php index 0f6f0a9d6..7380ff7d0 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -26,9 +26,10 @@ function ping_init(&$a) { $dislikes = array(); $friends = array(); $posts = array(); - + $home = 0; + $network = 0; - $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, + $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`wall`, `item`.`author-name`, `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object`, `pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink` FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent` -- cgit v1.2.3 From b102a1d5ecda36a9a48a841f06df9ef5d33fa46a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B6=C3=9Fl?= Date: Sun, 26 Feb 2012 20:43:23 +0000 Subject: is not always defined; but if defined, then always of type integer --- mod/photo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/photo.php b/mod/photo.php index a5a5a1dc1..c4a93769a 100755 --- a/mod/photo.php +++ b/mod/photo.php @@ -119,7 +119,7 @@ function photo_init(&$a) { // NOTREACHED } - if(intval($customres) && $customres > 0 && $customres < 500) { + if(isset($customres) && $customres > 0 && $customres < 500) { require_once('include/Photo.php'); $ph = new Photo($data); if($ph->is_valid()) { -- cgit v1.2.3 From fe3dfbee5638dd2988bd8b126652b3138572f02c Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 26 Feb 2012 23:39:29 +0100 Subject: Mail: New options for actions after importing mails. --- mod/settings.php | 53 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 22 deletions(-) (limited to 'mod') diff --git a/mod/settings.php b/mod/settings.php index 91f4325da..90eb9dbd7 100755 --- a/mod/settings.php +++ b/mod/settings.php @@ -110,13 +110,15 @@ function settings_post(&$a) { if(($a->argc > 1) && ($a->argv[1] == 'connectors')) { if(x($_POST['imap-submit'])) { - $mail_server = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : ''); - $mail_port = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : ''); - $mail_ssl = ((x($_POST,'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : ''); - $mail_user = ((x($_POST,'mail_user')) ? $_POST['mail_user'] : ''); - $mail_pass = ((x($_POST,'mail_pass')) ? trim($_POST['mail_pass']) : ''); - $mail_replyto = ((x($_POST,'mail_replyto')) ? $_POST['mail_replyto'] : ''); - $mail_pubmail = ((x($_POST,'mail_pubmail')) ? $_POST['mail_pubmail'] : ''); + $mail_server = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : ''); + $mail_port = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : ''); + $mail_ssl = ((x($_POST,'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : ''); + $mail_user = ((x($_POST,'mail_user')) ? $_POST['mail_user'] : ''); + $mail_pass = ((x($_POST,'mail_pass')) ? trim($_POST['mail_pass']) : ''); + $mail_action = ((x($_POST,'mail_action')) ? trim($_POST['mail_action']) : ''); + $mail_movetofolder = ((x($_POST,'mail_movetofolder')) ? trim($_POST['mail_movetofolder']) : ''); + $mail_replyto = ((x($_POST,'mail_replyto')) ? $_POST['mail_replyto'] : ''); + $mail_pubmail = ((x($_POST,'mail_pubmail')) ? $_POST['mail_pubmail'] : ''); $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); @@ -142,11 +144,14 @@ function settings_post(&$a) { ); } $r = q("UPDATE `mailacct` SET `server` = '%s', `port` = %d, `ssltype` = '%s', `user` = '%s', + `action` = %d, `movetofolder` = '%s', `mailbox` = 'INBOX', `reply_to` = '%s', `pubmail` = %d WHERE `uid` = %d LIMIT 1", dbesc($mail_server), intval($mail_port), dbesc($mail_ssl), dbesc($mail_user), + intval($mail_action), + dbesc($mail_movetofolder), dbesc($mail_replyto), intval($mail_pubmail), intval(local_user()) @@ -218,8 +223,8 @@ function settings_post(&$a) { $openid = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url'])) : ''); $maxreq = ((x($_POST,'maxreq')) ? intval($_POST['maxreq']) : 0); $expire = ((x($_POST,'expire')) ? intval($_POST['expire']) : 0); - - + + $expire_items = ((x($_POST,'expire_items')) ? intval($_POST['expire_items']) : 0); $expire_notes = ((x($_POST,'expire_notes')) ? intval($_POST['expire_notes']) : 0); $expire_starred = ((x($_POST,'expire_starred')) ? intval($_POST['expire_starred']) : 0); @@ -561,23 +566,25 @@ function settings_content(&$a) { $r = null; } - $mail_server = ((count($r)) ? $r[0]['server'] : ''); - $mail_port = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : ''); - $mail_ssl = ((count($r)) ? $r[0]['ssltype'] : ''); - $mail_user = ((count($r)) ? $r[0]['user'] : ''); - $mail_replyto = ((count($r)) ? $r[0]['reply_to'] : ''); - $mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0); - $mail_chk = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00'); + $mail_server = ((count($r)) ? $r[0]['server'] : ''); + $mail_port = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : ''); + $mail_ssl = ((count($r)) ? $r[0]['ssltype'] : ''); + $mail_user = ((count($r)) ? $r[0]['user'] : ''); + $mail_replyto = ((count($r)) ? $r[0]['reply_to'] : ''); + $mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0); + $mail_action = ((count($r)) ? $r[0]['action'] : 0); + $mail_movetofolder = ((count($r)) ? $r[0]['movetofolder'] : ''); + $mail_chk = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00'); + - $tpl = get_markup_template("settings_connectors.tpl"); $o .= replace_macros($tpl, array( '$title' => t('Connector Settings'), '$tabs' => $tabs, - + '$diasp_enabled' => $diasp_enabled, '$ostat_enabled' => $ostat_enabled, - + '$h_imap' => t('Email/Mailbox Setup'), '$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."), '$imap_lastcheck' => array('imap_lastcheck', t('Last successful email check:'), $mail_chk,''), @@ -589,8 +596,10 @@ function settings_content(&$a) { '$mail_pass' => array('mail_pass', t('Email password:'), '', ''), '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), '', 'Optional'), '$mail_pubmail' => array('mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''), - '$submit' => t('Submit'), - + '$mail_action' => array('mail_action', t('Action after import:'), $mail_action, '', array(0=>t('None'), 1=>t('Delete'), 2=>t('Mark as seen'), 3=>t('Move to folder'))), + '$mail_movetofolder' => array('mail_movetofolder', t('Move to folder:'), $mail_movetofolder, ''), + '$submit' => t('Submit'), + '$settings_connectors' => $settings_connectors @@ -598,7 +607,7 @@ function settings_content(&$a) { return $o; } - + require_once('include/acl_selectors.php'); $p = q("SELECT * FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1", -- cgit v1.2.3 From a1861d1128aacc1ab98b33a1d035bfc27c9979f5 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 26 Feb 2012 16:29:06 -0800 Subject: tagging missing from wallwall and a couple of themes, star missing from dispy --- mod/tagger.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod') diff --git a/mod/tagger.php b/mod/tagger.php index 76ec3366c..3ff5d57aa 100755 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -134,6 +134,7 @@ EOT; $arr['target'] = $target; $arr['object-type'] = $objtype; $arr['object'] = $obj; + $arr['private'] = $item['private']; $arr['allow_cid'] = $item['allow_cid']; $arr['allow_gid'] = $item['allow_gid']; $arr['deny_cid'] = $item['deny_cid']; -- cgit v1.2.3 From 42d591d25761fda0206dc5ab96e7d9b0fc779b42 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Mon, 27 Feb 2012 18:48:59 +0100 Subject: revert 01a2791e3a to avoid random preg internal errors. fix contact_template --- mod/contacts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/contacts.php b/mod/contacts.php index c8edea151..ce352fe20 100755 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -504,8 +504,8 @@ function contacts_content(&$a) { 'name' => $rr['name'], 'username' => $rr['name'], 'sparkle' => $sparkle, - 'url' => $url, - 'item' => $rr, + 'itemurl' => $rr['url'], + 'network' => network_to_name($rr['network']), ); } -- cgit v1.2.3 From 2b730ae86d1b49edda74aa6cbb0f9ed3a008ed13 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 27 Feb 2012 18:46:11 -0800 Subject: clicking contact on contacts page broken link --- mod/contacts.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod') diff --git a/mod/contacts.php b/mod/contacts.php index ce352fe20..c99ac1452 100755 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -505,6 +505,7 @@ function contacts_content(&$a) { 'username' => $rr['name'], 'sparkle' => $sparkle, 'itemurl' => $rr['url'], + 'url' => $url, 'network' => network_to_name($rr['network']), ); } -- cgit v1.2.3 From 53412dacd4cb52f0c1162af7ba66aa01f71147b3 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 27 Feb 2012 23:27:16 -0800 Subject: update globaldir when page-type changes, add spam date field --- mod/settings.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/settings.php b/mod/settings.php index 90eb9dbd7..a9d00bc98 100755 --- a/mod/settings.php +++ b/mod/settings.php @@ -50,6 +50,8 @@ function settings_post(&$a) { return; } + $old_page_flags = $a->user['page-flags']; + if(($a->argc > 1) && ($a->argv[1] === 'oauth') && x($_POST,'remove')){ $key = $_POST['remove']; q("DELETE FROM tokens WHERE id='%s' AND uid=%d", @@ -375,7 +377,7 @@ function settings_post(&$a) { ); } - if($old_visibility != $net_publish) { + if(($old_visibility != $net_publish) || ($page_flags != $old_page_flags)) { // Update global directory in background $url = $_SESSION['my_url']; if($url && strlen(get_config('system','directory_submit_url'))) -- cgit v1.2.3 From 733f830be4b554c83361e877a5f1108767a815fc Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Tue, 28 Feb 2012 19:10:27 +0100 Subject: fix url and network display --- mod/viewcontacts.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php index 10c980d93..6b66f60d7 100755 --- a/mod/viewcontacts.php +++ b/mod/viewcontacts.php @@ -63,7 +63,8 @@ function viewcontacts_content(&$a) { 'username' => $rr['name'], 'url' => $url, 'sparkle' => '', - 'item' => $rr, + 'itemurl' => $rr['url'], + 'network' => network_to_name($rr['network']), ); } -- cgit v1.2.3 From 4dd4a2258235cfafc0d5a4f87d116755ebe52ead Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 28 Feb 2012 14:52:23 -0800 Subject: From Tobias H - catch some irregularities caused by cut/paste code --- mod/display.php | 8 ++++---- mod/network.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index d96be4333..f510f793d 100755 --- a/mod/display.php +++ b/mod/display.php @@ -74,11 +74,11 @@ function display_content(&$a) { $x = array( 'is_owner' => true, 'allow_location' => $a->user['allow_location'], - 'default_location' => $a->user['default_location'], + 'default_location' => $a->user['default-location'], 'nickname' => $a->user['nickname'], - 'lockstate' => ((($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'), - 'acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb), - 'bang' => (($group || $cid) ? '!' : ''), + 'lockstate' => ( (is_array($a->user)) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))) ? 'lock' : 'unlock'), + 'acl' => populate_acl($a->user, $celeb), + 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user() ); diff --git a/mod/network.php b/mod/network.php index 03a671b61..894ac48ed 100755 --- a/mod/network.php +++ b/mod/network.php @@ -263,7 +263,7 @@ function network_content(&$a, $update = 0) { $x = array( 'is_owner' => true, 'allow_location' => $a->user['allow_location'], - 'default_location' => $a->user['default_location'], + 'default_location' => $a->user['default-location'], 'nickname' => $a->user['nickname'], 'lockstate' => ((($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'), 'acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb), -- cgit v1.2.3 From 60ae0d8974ce9f0406978130e4feac84a332509b Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 28 Feb 2012 17:32:44 -0800 Subject: cleaned up mess created when both people request friendship and one approves as duplex --- mod/dfrn_confirm.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 5a24f0089..0bc3ea7df 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -107,7 +107,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { * */ - $r = q("SELECT * FROM `contact` WHERE ( ( `issued-id` != '' AND `issued-id` = '%s' ) OR ( `id` = %d AND `id` != 0 ) ) AND `uid` = %d LIMIT 1", + $r = q("SELECT * FROM `contact` WHERE ( ( `issued-id` != '' AND `issued-id` = '%s' ) OR ( `id` = %d AND `id` != 0 ) ) AND `uid` = %d AND `duplex` = 0 LIMIT 1", dbesc($dfrn_id), intval($cid), intval($uid) @@ -116,6 +116,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { if(! count($r)) { logger('dfrn_confirm: Contact not found in DB.'); notice( t('Contact not found.') . EOL ); + notice( t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL ); return; } @@ -631,6 +632,15 @@ function dfrn_confirm_post(&$a,$handsfree = null) { xml_status(3,$message); } + // It's possible that the other person also requested friendship. + // If it is a duplex relationship, ditch the issued-id if one exists. + + if($duplex) { + $r = q("UPDATE `contact` SET `issued-id` = '' WHERE `id` = %d LIMIT 1", + intval($dfrn_record) + ); + } + // We're good but now we have to scrape the profile photo and send notifications. -- cgit v1.2.3