From 263836ad543d7b78c962ff3de38654da4701ac8b Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 27 Apr 2012 13:29:07 -0400 Subject: [PATCH 001/111] Merge branch 'master', remote-tracking branch 'remotes/upstream/master' * remotes/upstream/master: put community back on the lower tab. It belongs with message streams * master: From d0d79196ba43a9826eff135ef5cb2096570fc568 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 27 Apr 2012 13:31:06 -0400 Subject: [PATCH 002/111] fix contact-friend stuff on profile sidebar Signed-off-by: Simon L'nu --- view/theme/dispy/dark/style.css | 3 ++- view/theme/dispy/dark/style.less | 26 +++++++++++++++++++++----- view/theme/dispy/light/style.css | 3 ++- view/theme/dispy/light/style.less | 26 +++++++++++++++++++++----- 4 files changed, 46 insertions(+), 12 deletions(-) diff --git a/view/theme/dispy/dark/style.css b/view/theme/dispy/dark/style.css index 3b0548be..55327941 100644 --- a/view/theme/dispy/dark/style.css +++ b/view/theme/dispy/dark/style.css @@ -103,6 +103,7 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm .vcard #profile-photo-wrapper{margin:20px;}.vcard #profile-photo-wrapper img{box-shadow:3px 3px 10px 0 #000;} #asidemain h4{font-size:1.2em;} #asidemain #viewcontacts{text-align:right;} +#asidemain #contact-block{width:99%;}#asidemain #contact-block .contact-block-content{width:99%;}#asidemain #contact-block .contact-block-content .contact-block-div{float:left;margin:0 5px 5px 0;width:50px;height:50px;padding:3px;position:relative;} .aprofile dt{background:#eec;color:#2e2f2e;font-weight:bold;box-shadow:1px 1px 5px 0 #000;margin:15px 0 5px;padding-left:5px;} #profile-extra-links ul{margin-left:0px;padding-left:0px;list-style:none;} #dfrn-request-link{background:#3465a4 url(dark/connect.png) no-repeat 95% center;border-radius:5px 5px 5px 5px;color:#eec;display:block;font-size:1.2em;padding:0.2em 0.5em;} @@ -217,7 +218,7 @@ div[id$="text"]{font-weight:bold;border-bottom:1px solid #ccc;} div[id$="wrapper"]{height:100%;margin-bottom:1em;}div[id$="wrapper"] br{clear:left;} .profile-match-wrapper{float:left;margin:0 5px 40px 0;width:120px;height:120px;padding:3px;position:relative;} .icon.drophide.profile-match-ignore{margin:0 6px 0 -3px;} -[id$="-end"],[class$="end"]{clear:both;margin:0 0 10px 0;} +[id$="-end"],[class$="-end"]{clear:both;margin:0 0 10px 0;} .profile-match-end{margin:0 0 5px 0;} .profile-match-name{font-weight:bold;margin:auto auto auto 23px;} .profile-match-connect{font-style:italic;margin:auto auto auto 23px;} diff --git a/view/theme/dispy/dark/style.less b/view/theme/dispy/dark/style.less index 96cdb82f..321cb761 100644 --- a/view/theme/dispy/dark/style.less +++ b/view/theme/dispy/dark/style.less @@ -693,10 +693,26 @@ nav #nav-notifications-linkmenu { */ #asidemain { - h4 { - font-size: 1.2em; } - #viewcontacts { - text-align: right; } } + h4 { + font-size: 1.2em; } + #viewcontacts { + text-align: right; + } + #contact-block { + width: 99%; + .contact-block-content { + width: 99%; + .contact-block-div { + float: left; + margin: 0 5px 5px 0; + width: 50px; + height: 50px; + padding: 3px; + position: relative; + } + } + } +} .aprofile dt { background: #eec; @@ -1400,7 +1416,7 @@ div { } -[id$="-end"], [class$="end"] { +[id$="-end"], [class$="-end"] { clear: both; margin: 0 0 10px 0; } diff --git a/view/theme/dispy/light/style.css b/view/theme/dispy/light/style.css index fc293def..08755561 100644 --- a/view/theme/dispy/light/style.css +++ b/view/theme/dispy/light/style.css @@ -103,6 +103,7 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm .vcard #profile-photo-wrapper{margin:20px;}.vcard #profile-photo-wrapper img{box-shadow:3px 3px 10px 0 #000;} #asidemain h4{font-size:1.2em;} #asidemain #viewcontacts{text-align:right;} +#asidemain #contact-block{width:99%;}#asidemain #contact-block .contact-block-content{width:99%;}#asidemain #contact-block .contact-block-content .contact-block-div{float:left;margin:0 5px 5px 0;width:50px;height:50px;padding:3px;position:relative;} .aprofile dt{background:transparent;color:#666666;font-weight:bold;box-shadow:1px 1px 5px 0 #000;margin:15px 0 5px;padding-left:5px;} #profile-extra-links ul{margin-left:0px;padding-left:0px;list-style:none;} #dfrn-request-link{background:#3465a4 url(light/connect.png) no-repeat 95% center;border-radius:5px 5px 5px 5px;color:#fff;display:block;font-size:1.2em;padding:0.2em 0.5em;} @@ -217,7 +218,7 @@ div[id$="text"]{font-weight:bold;border-bottom:1px solid #ccc;} div[id$="wrapper"]{height:100%;margin-bottom:1em;}div[id$="wrapper"] br{clear:left;} .profile-match-wrapper{float:left;margin:0 5px 40px 0;width:120px;height:120px;padding:3px;position:relative;} .icon.drophide.profile-match-ignore{margin:0 6px 0 -3px;} -[id$="-end"],[class$="end"]{clear:both;margin:0 0 10px 0;} +[id$="-end"],[class$="-end"]{clear:both;margin:0 0 10px 0;} .profile-match-end{margin:0 0 5px 0;} .profile-match-name{font-weight:bold;margin:auto auto auto 23px;} .profile-match-connect{font-style:italic;margin:auto auto auto 23px;} diff --git a/view/theme/dispy/light/style.less b/view/theme/dispy/light/style.less index f14284f3..f7c4135c 100644 --- a/view/theme/dispy/light/style.less +++ b/view/theme/dispy/light/style.less @@ -694,10 +694,26 @@ nav #nav-notifications-linkmenu { */ #asidemain { - h4 { - font-size: 1.2em; } - #viewcontacts { - text-align: right; } } + h4 { + font-size: 1.2em; } + #viewcontacts { + text-align: right; + } + #contact-block { + width: 99%; + .contact-block-content { + width: 99%; + .contact-block-div { + float: left; + margin: 0 5px 5px 0; + width: 50px; + height: 50px; + padding: 3px; + position: relative; + } + } + } +} .aprofile dt { background: transparent; @@ -1401,7 +1417,7 @@ div { } -[id$="-end"], [class$="end"] { +[id$="-end"], [class$="-end"] { clear: both; margin: 0 0 10px 0; } From fcbe78f9aa5885f858abebad076a0ff8c8ba15ae Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 27 Apr 2012 14:33:11 -0400 Subject: [PATCH 003/111] Merge branch 'master', remote-tracking branch 'remotes/upstream/master' * remotes/upstream/master: * master: From 64f3af49fa31ee566515cb878f5e5e48a0b4f6b3 Mon Sep 17 00:00:00 2001 From: Simon L'nu Date: Fri, 27 Apr 2012 14:33:56 -0400 Subject: [PATCH 004/111] remove extra netsearch-box and fix Signed-off-by: Simon L'nu --- view/theme/dispy/dark/style.css | 3 +-- view/theme/dispy/dark/style.less | 16 ++++++---------- view/theme/dispy/light/style.css | 3 +-- view/theme/dispy/light/style.less | 16 ++++++---------- 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/view/theme/dispy/dark/style.css b/view/theme/dispy/dark/style.css index 55327941..26a21bcf 100644 --- a/view/theme/dispy/dark/style.css +++ b/view/theme/dispy/dark/style.css @@ -108,7 +108,6 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm #profile-extra-links ul{margin-left:0px;padding-left:0px;list-style:none;} #dfrn-request-link{background:#3465a4 url(dark/connect.png) no-repeat 95% center;border-radius:5px 5px 5px 5px;color:#eec;display:block;font-size:1.2em;padding:0.2em 0.5em;} #wallmessage-link{color:#eee;display:block;font-size:1.2em;padding:0.2em 0.5em;} -#netsearch-box{margin:20px 0px 30px;width:150px;}#netsearch-box #search-submit{margin:5px 5px 0px 0px;} .ttright{margin:0px 0px 0px 0px;} .contact-block-div{width:50px;height:50px;float:left;} .contact-block-textdiv{width:150px;height:34px;float:left;} @@ -385,7 +384,7 @@ div[id$="wrapper"]{height:100%;margin-bottom:1em;}div[id$="wrapper"] br{clear:le #side-peoplefind-url{background-color:#2e2f2e;color:#eec;border:1px #999 solid;margin-right:3px;width:75%;}#side-peoplefind-url:hover,#side-peoplefind-url:focus{background-color:#efefef;color:#222;border:1px 333 solid;} .nets-ul{list-style-type:none;padding-left:0px;}.nets-ul li{margin:10px 0 0;} .nets-link,.nets-all{margin-left:0px;} -#netsearch-box{margin-top:20px;width:150px;}#netsearch-box #search-submit{margin:5px 0px 0px 0px;} +#netsearch-box{margin:20px 0px 30px;width:135px;}#netsearch-box #search-submit{margin:5px 5px 0px 0px;} #pending-update{float:right;color:#fff;font-weight:bold;background-color:#ff0000;padding:0 .3em;} .admin.linklist{border:0;padding:0;} .admin.link{list-style-position:inside;} diff --git a/view/theme/dispy/dark/style.less b/view/theme/dispy/dark/style.less index 321cb761..c56adf5a 100644 --- a/view/theme/dispy/dark/style.less +++ b/view/theme/dispy/dark/style.less @@ -743,12 +743,6 @@ nav #nav-notifications-linkmenu { font-size: 1.2em; padding: 0.2em 0.5em; } -#netsearch-box { - margin: 20px 0px 30px; - width: 150px; - #search-submit { - margin: 5px 5px 0px 0px; } } - .ttright { margin: 0px 0px 0px 0px; } @@ -2222,10 +2216,12 @@ div { margin-left: 0px; } #netsearch-box { - margin-top: 20px; - width: 150px; - #search-submit { - margin: 5px 0px 0px 0px; } } + margin: 20px 0px 30px; + width: 135px; + #search-submit { + margin: 5px 5px 0px 0px; + } +} /** * admin diff --git a/view/theme/dispy/light/style.css b/view/theme/dispy/light/style.css index 08755561..2c95d70d 100644 --- a/view/theme/dispy/light/style.css +++ b/view/theme/dispy/light/style.css @@ -108,7 +108,6 @@ nav #nav-notifications-linkmenu.on .icon.s22.notify,nav #nav-notifications-linkm #profile-extra-links ul{margin-left:0px;padding-left:0px;list-style:none;} #dfrn-request-link{background:#3465a4 url(light/connect.png) no-repeat 95% center;border-radius:5px 5px 5px 5px;color:#fff;display:block;font-size:1.2em;padding:0.2em 0.5em;} #wallmessage-link{color:#eee;display:block;font-size:1.2em;padding:0.2em 0.5em;} -#netsearch-box{margin:20px 0px 30px;width:150px;}#netsearch-box #search-submit{margin:5px 5px 0px 0px;} .ttright{margin:0px 0px 0px 0px;} .contact-block-div{width:50px;height:50px;float:left;} .contact-block-textdiv{width:150px;height:34px;float:left;} @@ -385,7 +384,7 @@ div[id$="wrapper"]{height:100%;margin-bottom:1em;}div[id$="wrapper"] br{clear:le #side-peoplefind-url{background-color:#e5e0cf;color:#666;border:1px #666 solid;margin-right:3px;width:75%;}#side-peoplefind-url:hover,#side-peoplefind-url:focus{background-color:#efefef;color:#222;border:1px 333 solid;} .nets-ul{list-style-type:none;padding-left:0px;}.nets-ul li{margin:10px 0 0;} .nets-link,.nets-all{margin-left:0px;} -#netsearch-box{margin-top:20px;width:150px;}#netsearch-box #search-submit{margin:5px 0px 0px 0px;} +#netsearch-box{margin:20px 0px 30px;width:135px;}#netsearch-box #search-submit{margin:5px 5px 0px 0px;} #pending-update{float:right;color:#fff;font-weight:bold;background-color:#ff0000;padding:0 .3em;} .admin.linklist{border:0;padding:0;} .admin.link{list-style-position:inside;} diff --git a/view/theme/dispy/light/style.less b/view/theme/dispy/light/style.less index f7c4135c..18151bc2 100644 --- a/view/theme/dispy/light/style.less +++ b/view/theme/dispy/light/style.less @@ -744,12 +744,6 @@ nav #nav-notifications-linkmenu { font-size: 1.2em; padding: 0.2em 0.5em; } -#netsearch-box { - margin: 20px 0px 30px; - width: 150px; - #search-submit { - margin: 5px 5px 0px 0px; } } - .ttright { margin: 0px 0px 0px 0px; } @@ -2223,10 +2217,12 @@ div { margin-left: 0px; } #netsearch-box { - margin-top: 20px; - width: 150px; - #search-submit { - margin: 5px 0px 0px 0px; } } + margin: 20px 0px 30px; + width: 135px; + #search-submit { + margin: 5px 5px 0px 0px; + } +} /** * admin From 731379fa25b52f6b8333a591bbc4b74cb7d2f74c Mon Sep 17 00:00:00 2001 From: Christian Vogeley Date: Fri, 27 Apr 2012 23:48:44 +0200 Subject: [PATCH 005/111] another attempt to fix lower tab behaviour on small screens, community back in tab area --- view/theme/cleanzero/nav.tpl | 46 +++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/view/theme/cleanzero/nav.tpl b/view/theme/cleanzero/nav.tpl index 4dacf385..9fe5ac0f 100644 --- a/view/theme/cleanzero/nav.tpl +++ b/view/theme/cleanzero/nav.tpl @@ -1,23 +1,14 @@ - - +
$langselector
diff --git a/view/theme/diabook/style-wide.css b/view/theme/diabook/style-wide.css index f8dced3e..71ed4e47 100644 --- a/view/theme/diabook/style-wide.css +++ b/view/theme/diabook/style-wide.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -974,7 +975,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1195,7 +1196,7 @@ aside #side-peoplefind-url { margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index 9150ea8c..e70c72cb 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -21,6 +21,7 @@ .admin.linklist { border: 0px; padding: 0px; + list-style: none; } .admin.link { @@ -974,7 +975,7 @@ ul.menu-popup .empty { background-color: #bdcdd4; } #nav-notifications-menu { - width: 400px; + width: 425px !important; max-height: 550px; overflow: auto; } @@ -1198,7 +1199,7 @@ aside #side-peoplefind-url { margin-right: 20px; } #login-submit-wrapper{ - padding-top: 120px; + margin-bottom: 12px; } aside #login-submit-button{ diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index c45db988..fa0d47ec 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -3,13 +3,13 @@ /* * Name: Diabook * Description: Diabook: report bugs and request here: http://pad.toktan.org/p/diabook or contact me : thomas_bierey@friendica.eu - * Version: (Version: 1.022) + * Version: (Version: 1.023) * Author: */ //print diabook-version for debugging -$diabook_version = "Diabook (Version: 1.022)"; +$diabook_version = "Diabook (Version: 1.023)"; $a->page['htmlhead'] .= sprintf('', $diabook_version); //change css on network and profilepages @@ -313,6 +313,20 @@ $autogrowJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.autogro $a->page['htmlhead'] .= sprintf('', $autogrowJS); //js scripts + +//check if community_home-plugin is activated and change css +$nametocheck = "communityhome"; +$r = q("select id from addon where name = '%s' and installed = 1", dbesc($nametocheck)); +if(count($r) == "1") { + +$a->page['htmlhead'] .= ' +'; +} + //comment-edit-wrapper on photo_view if ($a->argv[0].$a->argv[2] === "photos"."image"){ @@ -324,7 +338,6 @@ $a->page['htmlhead'] .= ' }); '; - } $a->page['htmlhead'] .= ' @@ -334,6 +347,10 @@ $a->page['htmlhead'] .= ' $("a.lightbox").fancybox(); // Select all links with lightbox class }); +$(document).ready(function() { + var footer_top = $(document).height() - 30; + $("div#footerbox").attr("style", "border-top: 1px solid #D2D2D2; width: 70%;right: 15%;position: absolute;top:"+footer_top+"px;"); + }); '; From 920d40acf43adb584a33555bfd73e2e5d5f1ebd0 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Sun, 29 Apr 2012 05:58:23 +0200 Subject: [PATCH 024/111] diabook-themes: small fix --- view/theme/diabook/footer.tpl | 2 +- view/theme/diabook/theme.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/view/theme/diabook/footer.tpl b/view/theme/diabook/footer.tpl index bae5e105..25058a7f 100644 --- a/view/theme/diabook/footer.tpl +++ b/view/theme/diabook/footer.tpl @@ -1,3 +1,3 @@ -
+ \ No newline at end of file diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index fa0d47ec..9a1ac0f6 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -347,7 +347,7 @@ $a->page['htmlhead'] .= ' $("a.lightbox").fancybox(); // Select all links with lightbox class }); -$(document).ready(function() { +$(window).load(function() { var footer_top = $(document).height() - 30; $("div#footerbox").attr("style", "border-top: 1px solid #D2D2D2; width: 70%;right: 15%;position: absolute;top:"+footer_top+"px;"); }); From b3a71e4327bbe618dbdd15428a4614f58b4e848c Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 28 Apr 2012 21:35:14 -0700 Subject: [PATCH 025/111] indicate successful updates --- boot.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index cfdadcd1..616e152f 100644 --- a/boot.php +++ b/boot.php @@ -671,7 +671,7 @@ if(! function_exists('check_config')) { if($retval) { //send the administrator an e-mail $email_tpl = get_intltext_template("update_fail_eml.tpl"); - $email_tpl = replace_macros($email_tpl, array( + $email_msg = replace_macros($email_tpl, array( '$sitename' => $a->config['sitename'], '$siteurl' => $a->get_baseurl(), '$update' => $x, @@ -679,13 +679,16 @@ if(! function_exists('check_config')) { )); $subject=sprintf(t('Update Error at %s'), $a->get_baseurl()); - mail($a->config['admin_email'], $subject, $text, + mail($a->config['admin_email'], $subject, $email_msg, 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" . 'Content-type: text/plain; charset=UTF-8' . "\n" . 'Content-transfer-encoding: 8bit' ); //try the logger logger('CRITICAL: Update Failed: '. $x); } + else + set_config('database','update_' . $x, 'success'); + } } set_config('system','build', DB_UPDATE_VERSION); @@ -727,9 +730,10 @@ if(! function_exists('check_config')) { foreach($installed as $i) { if(! in_array($i['name'],$plugins_arr)) { uninstall_plugin($i['name']); - } - else + } + else { $installed_arr[] = $i['name']; + } } } From 64060f82dc68d490f3d729f3fbe139527c831fd0 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 28 Apr 2012 21:56:17 -0700 Subject: [PATCH 026/111] toggle to archive unfriends, though render them useless --- include/Contact.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/Contact.php b/include/Contact.php index 537850e0..2523fc02 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -51,6 +51,21 @@ function user_remove($uid) { function contact_remove($id) { + + $r = q("select uid from contact where id = %d limit 1", + intval($id) + ); + if((! count($r)) || (! intval($r[0]['uid']))) + return; + + $archive = get_pconfig($r[0]['uid'], 'system','archive_removed_contacts'); + if($archive) { + q("update contact set `archive` = 1, `network` = 'none', `writable` = 0 where id = %d limit 1", + intval($id) + ); + return; + } + q("DELETE FROM `contact` WHERE `id` = %d LIMIT 1", intval($id) ); From 249a6814cd777e8eb9d4feb788058ec4683e9522 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Apr 2012 01:08:28 -0700 Subject: [PATCH 027/111] add db field for removed account, which will also be the first test of update error checking --- boot.php | 2 +- database.sql | 4 +++- update.php | 11 +++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index 616e152f..100662a8 100644 --- a/boot.php +++ b/boot.php @@ -11,7 +11,7 @@ require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_VERSION', '2.3.1326' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1139 ); +define ( 'DB_UPDATE_VERSION', 1140 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index 78b26922..80a9197f 100644 --- a/database.sql +++ b/database.sql @@ -1019,6 +1019,7 @@ CREATE TABLE IF NOT EXISTS `user` ( `pwdreset` char(255) NOT NULL, `maxreq` int(11) NOT NULL DEFAULT '10', `expire` int(10) unsigned NOT NULL DEFAULT '0', + `account_removed` tinyint(1) NOT NULL DEFAULT '0', `account_expired` tinyint(1) NOT NULL DEFAULT '0', `account_expires_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `expire_notification_sent` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -1036,7 +1037,8 @@ CREATE TABLE IF NOT EXISTS `user` ( KEY `blocked` (`blocked`), KEY `verified` (`verified`), KEY `unkmail` (`unkmail`), - KEY `cntunkmail` (`cntunkmail`) + KEY `cntunkmail` (`cntunkmail`), + KEY `account_removed` (`account_removed`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- diff --git a/update.php b/update.php index 2758f590..3c2ecebb 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ Date: Sun, 29 Apr 2012 01:42:48 -0700 Subject: [PATCH 028/111] enhanced profile reporting for single values --- mod/profiles.php | 66 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 15 deletions(-) diff --git a/mod/profiles.php b/mod/profiles.php index 7a33a03e..478aab8a 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -139,21 +139,49 @@ function profiles_post(&$a) { $changes = array(); + $value = ''; if($is_default) { - if($marital != $orig[0]['marital']) $changes[] = '♥ ' . t('Marital Status'); - if($withchanged) $changes[] = '♥ ' . t('Romantic Partner'); - if($work != $orig[0]['work']) $changes[] = t('Work/Employment'); - if($religion != $orig[0]['religion']) $changes[] = t('Religion'); - if($politic != $orig[0]['politic']) $changes[] = t('Political Views'); - if($gender != $orig[0]['gender']) $changes[] = t('Gender'); - if($sexual != $orig[0]['sexual']) $changes[] = t('Sexual Preference'); - if($homepage != $orig[0]['homepage']) $changes[] = t('Homepage'); - if($interest != $orig[0]['interest']) $changes[] = t('Interests'); + if($marital != $orig[0]['marital']) { + $changes[] = '♥ ' . t('Marital Status'); + $value = $marital; + } + if($withchanged) { + $changes[] = '♥ ' . t('Romantic Partner'); + $value = strip_tags($with); + } + if($work != $orig[0]['work']) { + $changes[] = t('Work/Employment'); + } + if($religion != $orig[0]['religion']) { + $changes[] = t('Religion'); + $value = $religion; + } + if($politic != $orig[0]['politic']) { + $changes[] = t('Political Views'); + $value = $politic; + } + if($gender != $orig[0]['gender']) { + $changes[] = t('Gender'); + $value = $gender; + } + if($sexual != $orig[0]['sexual']) { + $changes[] = t('Sexual Preference'); + $value = $sexual; + } + if($homepage != $orig[0]['homepage']) { + $changes[] = t('Homepage'); + $value = $homepage; + } + if($interest != $orig[0]['interest']) { + $changes[] = t('Interests'); + $value = $interest; + } if($address != $orig[0]['address'] || $locality != $orig[0]['locality'] || $region != $orig[0]['region'] - || $country_name != $orig[0]['country_name']) - $changes[] = t('Location'); + || $country_name != $orig[0]['country_name']) { + $changes[] = t('Location'); + } - profile_activity($changes); + profile_activity($changes,$value); } @@ -245,7 +273,7 @@ function profiles_post(&$a) { } -function profile_activity($changed) { +function profile_activity($changed, $value) { $a = get_app(); if(! local_user() || ! is_array($changed) || ! count($changed)) @@ -289,7 +317,7 @@ function profile_activity($changed) { foreach($changed as $ch) { if(strlen($changes)) { if ($z == ($t - 1)) - $changes .= ' and '; + $changes .= t(' and '); else $changes .= ', '; } @@ -299,7 +327,15 @@ function profile_activity($changed) { $prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . t('public profile') . '[/url]'; - $arr['body'] = sprintf( t('%1$s has an updated %2$s, changing %3$s.'), $A, $prof, $changes); + if($t == 1 && strlen($value)) { + $message = sprintf( t('%1$s changed %2$s to %3$s'), $A, $changes, $value); + $message .= "\n\n" . sprintf( t(' - Visit %1$s\'s %2$s'), $A, $prof); + } + else + $message = sprintf( t('%1$s has an updated %2$s, changing %3$s.'), $A, $prof, $changes); + + + $arr['body'] = $message; $arr['object'] = '' . ACTIVITY_OBJ_PROFILE . '' . $self[0]['name'] . '' . '' . $self[0]['url'] . '/' . $self[0]['name'] . ''; From 735f518fd8547fab37ca39c7717e8d89e07e3337 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Apr 2012 01:49:54 -0700 Subject: [PATCH 029/111] fix location change notification --- mod/profiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/profiles.php b/mod/profiles.php index 478aab8a..d640ba1b 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -177,7 +177,7 @@ function profiles_post(&$a) { $value = $interest; } if($address != $orig[0]['address'] || $locality != $orig[0]['locality'] || $region != $orig[0]['region'] - || $country_name != $orig[0]['country_name']) { + || $country_name != $orig[0]['country-name']) { $changes[] = t('Location'); } From def6f0b408680c4e5f209890bbf1ad6bf40b5add Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Apr 2012 02:11:33 -0700 Subject: [PATCH 030/111] the heart should really be red. --- mod/profiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/profiles.php b/mod/profiles.php index d640ba1b..3a52c8fa 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -142,7 +142,7 @@ function profiles_post(&$a) { $value = ''; if($is_default) { if($marital != $orig[0]['marital']) { - $changes[] = '♥ ' . t('Marital Status'); + $changes[] = '[color=#ff0000]♥[/color] ' . t('Marital Status'); $value = $marital; } if($withchanged) { From ab908469ae89cbc7ba3b45b25fd85668e51abaea Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Mon, 30 Apr 2012 02:00:41 +0200 Subject: [PATCH 031/111] close one menu (like the notifications menu) when another one is opened (like it is done when clicking somewhere else) (thx to ^mw) --- js/main.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/js/main.js b/js/main.js index ac238bf6..6a263244 100644 --- a/js/main.js +++ b/js/main.js @@ -73,7 +73,16 @@ setupFieldRichtext(); /* popup menus */ + function close_last_popup_menu() { + if(last_popup_menu) { + last_popup_menu.hide(); + last_popup_button.removeClass("selected"); + last_popup_menu = null; + last_popup_button = null; + } + } $('a[rel^=#]').click(function(e){ + close_last_popup_menu(); menu = $( $(this).attr('rel') ); e.preventDefault(); e.stopPropagation(); @@ -90,12 +99,7 @@ return false; }); $('html').click(function() { - if(last_popup_menu) { - last_popup_menu.hide(); - last_popup_button.removeClass("selected"); - last_popup_menu = null; - last_popup_button = null; - } + close_last_popup_menu(); }); // fancyboxes From e3fecb2557ad0ac2f156f9583683f7c9d998e212 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Apr 2012 17:34:54 -0700 Subject: [PATCH 032/111] improved db error logging --- boot.php | 2 +- include/dba.php | 26 +++-- util/messages.po | 253 ++++++++++++++++++++++++++--------------------- 3 files changed, 157 insertions(+), 124 deletions(-) diff --git a/boot.php b/boot.php index 100662a8..aefc694e 100644 --- a/boot.php +++ b/boot.php @@ -9,7 +9,7 @@ require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '2.3.1326' ); +define ( 'FRIENDICA_VERSION', '2.3.1327' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DB_UPDATE_VERSION', 1140 ); diff --git a/include/dba.php b/include/dba.php index 44a663ea..414f4ae7 100644 --- a/include/dba.php +++ b/include/dba.php @@ -74,23 +74,29 @@ class dba { if((! $this->db) || (! $this->connected)) return false; + + $this->error = ''; if($this->mysqli) $result = @$this->db->query($sql); else $result = @mysql_query($sql,$this->db); + if($this->mysqli) { + if($this->db->errno) + $this->error = $this->db->error; + } + elseif(mysql_errno($this->db)) + $this->error = mysql_error($this->db); + + if(strlen($this->error)) { + logger('dba: ' . $this->error); + } + if($this->debug) { $mesg = ''; - if($this->mysqli) { - if($this->db->errno) - logger('dba: ' . $this->db->error); - } - elseif(mysql_errno($this->db)) - logger('dba: ' . mysql_error($this->db)); - if($result === false) $mesg = 'false'; elseif($result === true) @@ -102,7 +108,9 @@ class dba { $mesg = mysql_num_rows($result) . ' results' . EOL; } - $str = 'SQL = ' . printable($sql) . EOL . 'SQL returned ' . $mesg . EOL; + $str = 'SQL = ' . printable($sql) . EOL . 'SQL returned ' . $mesg + . (($this->error) ? ' error: ' . $this->error : '') + . EOL; logger('dba: ' . $str ); } @@ -116,7 +124,7 @@ class dba { if($result === false) { logger('dba: ' . printable($sql) . ' returned false.'); if(file_exists('dbfail.out')) - file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . ' returned false' . "\n", FILE_APPEND); + file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . ' returned false' . "\n" . $this->error . "\n", FILE_APPEND); } if(($result === true) || ($result === false)) diff --git a/util/messages.po b/util/messages.po index f6e14962..535283b0 100644 --- a/util/messages.po +++ b/util/messages.po @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 2.3.1326\n" +"Project-Id-Version: 2.3.1327\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-04-28 10:00-0700\n" +"POT-Creation-Date: 2012-04-29 10:00-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -52,7 +52,7 @@ msgstr "" #: ../../mod/message.php:90 ../../mod/allfriends.php:9 #: ../../mod/nogroup.php:25 ../../mod/wall_upload.php:53 #: ../../mod/follow.php:8 ../../mod/common.php:9 ../../mod/display.php:138 -#: ../../mod/profiles.php:7 ../../mod/profiles.php:329 +#: ../../mod/profiles.php:7 ../../mod/profiles.php:365 #: ../../mod/delegate.php:6 ../../mod/suggest.php:28 ../../mod/invite.php:13 #: ../../mod/invite.php:81 ../../mod/dfrn_confirm.php:53 #: ../../addon/facebook/facebook.php:484 ../../include/items.php:3171 @@ -132,7 +132,7 @@ msgstr "" #: ../../mod/settings.php:744 ../../mod/settings.php:935 #: ../../mod/manage.php:109 ../../mod/group.php:85 ../../mod/admin.php:393 #: ../../mod/admin.php:572 ../../mod/admin.php:708 ../../mod/admin.php:907 -#: ../../mod/admin.php:995 ../../mod/profiles.php:498 ../../mod/invite.php:119 +#: ../../mod/admin.php:995 ../../mod/profiles.php:534 ../../mod/invite.php:119 #: ../../addon/facebook/facebook.php:574 ../../addon/yourls/yourls.php:76 #: ../../addon/ljpost/ljpost.php:93 ../../addon/nsfw/nsfw.php:57 #: ../../addon/planets/planets.php:158 @@ -220,7 +220,7 @@ msgid "link to source" msgstr "" #: ../../mod/events.php:296 ../../view/theme/diabook/theme.php:255 -#: ../../include/nav.php:52 ../../boot.php:1481 +#: ../../include/nav.php:52 ../../boot.php:1487 msgid "Events" msgstr "" @@ -270,7 +270,7 @@ msgid "Description:" msgstr "" #: ../../mod/events.php:395 ../../include/event.php:37 -#: ../../include/bb2diaspora.php:260 ../../boot.php:1083 +#: ../../include/bb2diaspora.php:260 ../../boot.php:1089 msgid "Location:" msgstr "" @@ -330,7 +330,7 @@ msgstr "" #: ../../mod/settings.php:884 ../../mod/settings.php:890 #: ../../mod/settings.php:926 ../../mod/settings.php:927 #: ../../mod/settings.php:928 ../../mod/settings.php:929 -#: ../../mod/register.php:532 ../../mod/profiles.php:475 +#: ../../mod/register.php:532 ../../mod/profiles.php:511 msgid "Yes" msgstr "" @@ -341,7 +341,7 @@ msgstr "" #: ../../mod/settings.php:884 ../../mod/settings.php:890 #: ../../mod/settings.php:926 ../../mod/settings.php:927 #: ../../mod/settings.php:928 ../../mod/settings.php:929 -#: ../../mod/register.php:533 ../../mod/profiles.php:476 +#: ../../mod/register.php:533 ../../mod/profiles.php:512 msgid "No" msgstr "" @@ -545,7 +545,7 @@ msgstr "" #: ../../mod/photos.php:1232 ../../mod/photos.php:1272 #: ../../mod/photos.php:1303 ../../include/conversation.php:554 -#: ../../boot.php:495 +#: ../../boot.php:503 msgid "Comment" msgstr "" @@ -1166,7 +1166,7 @@ msgid "is interested in:" msgstr "" #: ../../mod/match.php:58 ../../mod/suggest.php:59 -#: ../../include/contact_widgets.php:9 ../../boot.php:1027 +#: ../../include/contact_widgets.php:9 ../../boot.php:1033 msgid "Connect" msgstr "" @@ -1648,6 +1648,7 @@ msgstr "" #: ../../addon/facebook/facebook.php:650 #: ../../addon/facebook/facebook.php:1139 #: ../../addon/testdrive/testdrive.php:58 ../../include/items.php:2700 +#: ../../boot.php:683 msgid "Administrator" msgstr "" @@ -1657,7 +1658,7 @@ msgid "" "Password reset failed." msgstr "" -#: ../../mod/lostpass.php:83 ../../boot.php:809 +#: ../../mod/lostpass.php:83 ../../boot.php:815 msgid "Password Reset" msgstr "" @@ -2279,7 +2280,7 @@ msgstr "" msgid "Invalid contact." msgstr "" -#: ../../mod/notes.php:44 ../../boot.php:1486 +#: ../../mod/notes.php:44 ../../boot.php:1492 msgid "Personal Notes" msgstr "" @@ -2530,7 +2531,7 @@ msgstr "" #: ../../mod/profperm.php:103 ../../view/theme/diabook/theme.php:252 #: ../../include/profile_advanced.php:7 ../../include/profile_advanced.php:74 -#: ../../include/nav.php:50 ../../boot.php:1468 +#: ../../include/nav.php:50 ../../boot.php:1474 msgid "Profile" msgstr "" @@ -2702,7 +2703,7 @@ msgstr "" msgid "Choose a nickname: " msgstr "" -#: ../../mod/register.php:567 ../../include/nav.php:81 ../../boot.php:775 +#: ../../mod/register.php:567 ../../include/nav.php:81 ../../boot.php:781 msgid "Register" msgstr "" @@ -2745,7 +2746,7 @@ msgid "Access denied." msgstr "" #: ../../mod/fbrowser.php:23 ../../view/theme/diabook/theme.php:254 -#: ../../include/nav.php:51 ../../boot.php:1473 +#: ../../include/nav.php:51 ../../boot.php:1479 msgid "Photos" msgstr "" @@ -3451,7 +3452,7 @@ msgstr "" msgid "FTP Password" msgstr "" -#: ../../mod/profile.php:21 ../../boot.php:940 +#: ../../mod/profile.php:21 ../../boot.php:946 msgid "Requested profile is not available." msgstr "" @@ -3595,8 +3596,8 @@ msgstr "" msgid "Search This Site" msgstr "" -#: ../../mod/profiles.php:21 ../../mod/profiles.php:339 -#: ../../mod/profiles.php:453 ../../mod/dfrn_confirm.php:62 +#: ../../mod/profiles.php:21 ../../mod/profiles.php:375 +#: ../../mod/profiles.php:489 ../../mod/dfrn_confirm.php:62 msgid "Profile not found." msgstr "" @@ -3604,259 +3605,273 @@ msgstr "" msgid "Profile Name is required." msgstr "" -#: ../../mod/profiles.php:143 +#: ../../mod/profiles.php:145 msgid "Marital Status" msgstr "" -#: ../../mod/profiles.php:144 +#: ../../mod/profiles.php:149 msgid "Romantic Partner" msgstr "" -#: ../../mod/profiles.php:145 +#: ../../mod/profiles.php:153 msgid "Work/Employment" msgstr "" -#: ../../mod/profiles.php:146 +#: ../../mod/profiles.php:156 msgid "Religion" msgstr "" -#: ../../mod/profiles.php:147 +#: ../../mod/profiles.php:160 msgid "Political Views" msgstr "" -#: ../../mod/profiles.php:148 +#: ../../mod/profiles.php:164 msgid "Gender" msgstr "" -#: ../../mod/profiles.php:149 +#: ../../mod/profiles.php:168 msgid "Sexual Preference" msgstr "" -#: ../../mod/profiles.php:150 +#: ../../mod/profiles.php:172 msgid "Homepage" msgstr "" -#: ../../mod/profiles.php:151 +#: ../../mod/profiles.php:176 msgid "Interests" msgstr "" -#: ../../mod/profiles.php:154 +#: ../../mod/profiles.php:181 msgid "Location" msgstr "" -#: ../../mod/profiles.php:225 +#: ../../mod/profiles.php:253 msgid "Profile updated." msgstr "" -#: ../../mod/profiles.php:300 +#: ../../mod/profiles.php:320 +msgid " and " +msgstr "" + +#: ../../mod/profiles.php:328 msgid "public profile" msgstr "" -#: ../../mod/profiles.php:302 +#: ../../mod/profiles.php:331 +#, php-format +msgid "%1$s changed %2$s to %3$s" +msgstr "" + +#: ../../mod/profiles.php:332 +#, php-format +msgid " - Visit %1$s's %2$s" +msgstr "" + +#: ../../mod/profiles.php:335 #, php-format msgid "%1$s has an updated %2$s, changing %3$s." msgstr "" -#: ../../mod/profiles.php:358 +#: ../../mod/profiles.php:394 msgid "Profile deleted." msgstr "" -#: ../../mod/profiles.php:376 ../../mod/profiles.php:410 +#: ../../mod/profiles.php:412 ../../mod/profiles.php:446 msgid "Profile-" msgstr "" -#: ../../mod/profiles.php:395 ../../mod/profiles.php:437 +#: ../../mod/profiles.php:431 ../../mod/profiles.php:473 msgid "New profile created." msgstr "" -#: ../../mod/profiles.php:416 +#: ../../mod/profiles.php:452 msgid "Profile unavailable to clone." msgstr "" -#: ../../mod/profiles.php:474 +#: ../../mod/profiles.php:510 msgid "Hide your contact/friend list from viewers of this profile?" msgstr "" -#: ../../mod/profiles.php:497 +#: ../../mod/profiles.php:533 msgid "Edit Profile Details" msgstr "" -#: ../../mod/profiles.php:499 +#: ../../mod/profiles.php:535 msgid "View this profile" msgstr "" -#: ../../mod/profiles.php:500 +#: ../../mod/profiles.php:536 msgid "Create a new profile using these settings" msgstr "" -#: ../../mod/profiles.php:501 +#: ../../mod/profiles.php:537 msgid "Clone this profile" msgstr "" -#: ../../mod/profiles.php:502 +#: ../../mod/profiles.php:538 msgid "Delete this profile" msgstr "" -#: ../../mod/profiles.php:503 +#: ../../mod/profiles.php:539 msgid "Profile Name:" msgstr "" -#: ../../mod/profiles.php:504 +#: ../../mod/profiles.php:540 msgid "Your Full Name:" msgstr "" -#: ../../mod/profiles.php:505 +#: ../../mod/profiles.php:541 msgid "Title/Description:" msgstr "" -#: ../../mod/profiles.php:506 +#: ../../mod/profiles.php:542 msgid "Your Gender:" msgstr "" -#: ../../mod/profiles.php:507 +#: ../../mod/profiles.php:543 #, php-format msgid "Birthday (%s):" msgstr "" -#: ../../mod/profiles.php:508 +#: ../../mod/profiles.php:544 msgid "Street Address:" msgstr "" -#: ../../mod/profiles.php:509 +#: ../../mod/profiles.php:545 msgid "Locality/City:" msgstr "" -#: ../../mod/profiles.php:510 +#: ../../mod/profiles.php:546 msgid "Postal/Zip Code:" msgstr "" -#: ../../mod/profiles.php:511 +#: ../../mod/profiles.php:547 msgid "Country:" msgstr "" -#: ../../mod/profiles.php:512 +#: ../../mod/profiles.php:548 msgid "Region/State:" msgstr "" -#: ../../mod/profiles.php:513 +#: ../../mod/profiles.php:549 msgid " Marital Status:" msgstr "" -#: ../../mod/profiles.php:514 +#: ../../mod/profiles.php:550 msgid "Who: (if applicable)" msgstr "" -#: ../../mod/profiles.php:515 +#: ../../mod/profiles.php:551 msgid "Examples: cathy123, Cathy Williams, cathy@example.com" msgstr "" -#: ../../mod/profiles.php:516 ../../include/profile_advanced.php:43 +#: ../../mod/profiles.php:552 ../../include/profile_advanced.php:43 msgid "Sexual Preference:" msgstr "" -#: ../../mod/profiles.php:517 +#: ../../mod/profiles.php:553 msgid "Homepage URL:" msgstr "" -#: ../../mod/profiles.php:518 ../../include/profile_advanced.php:49 +#: ../../mod/profiles.php:554 ../../include/profile_advanced.php:49 msgid "Political Views:" msgstr "" -#: ../../mod/profiles.php:519 +#: ../../mod/profiles.php:555 msgid "Religious Views:" msgstr "" -#: ../../mod/profiles.php:520 +#: ../../mod/profiles.php:556 msgid "Public Keywords:" msgstr "" -#: ../../mod/profiles.php:521 +#: ../../mod/profiles.php:557 msgid "Private Keywords:" msgstr "" -#: ../../mod/profiles.php:522 +#: ../../mod/profiles.php:558 msgid "Example: fishing photography software" msgstr "" -#: ../../mod/profiles.php:523 +#: ../../mod/profiles.php:559 msgid "(Used for suggesting potential friends, can be seen by others)" msgstr "" -#: ../../mod/profiles.php:524 +#: ../../mod/profiles.php:560 msgid "(Used for searching profiles, never shown to others)" msgstr "" -#: ../../mod/profiles.php:525 +#: ../../mod/profiles.php:561 msgid "Tell us about yourself..." msgstr "" -#: ../../mod/profiles.php:526 +#: ../../mod/profiles.php:562 msgid "Hobbies/Interests" msgstr "" -#: ../../mod/profiles.php:527 +#: ../../mod/profiles.php:563 msgid "Contact information and Social Networks" msgstr "" -#: ../../mod/profiles.php:528 +#: ../../mod/profiles.php:564 msgid "Musical interests" msgstr "" -#: ../../mod/profiles.php:529 +#: ../../mod/profiles.php:565 msgid "Books, literature" msgstr "" -#: ../../mod/profiles.php:530 +#: ../../mod/profiles.php:566 msgid "Television" msgstr "" -#: ../../mod/profiles.php:531 +#: ../../mod/profiles.php:567 msgid "Film/dance/culture/entertainment" msgstr "" -#: ../../mod/profiles.php:532 +#: ../../mod/profiles.php:568 msgid "Love/romance" msgstr "" -#: ../../mod/profiles.php:533 +#: ../../mod/profiles.php:569 msgid "Work/employment" msgstr "" -#: ../../mod/profiles.php:534 +#: ../../mod/profiles.php:570 msgid "School/education" msgstr "" -#: ../../mod/profiles.php:539 +#: ../../mod/profiles.php:575 msgid "" "This is your public profile.
It may " "be visible to anybody using the internet." msgstr "" -#: ../../mod/profiles.php:549 ../../mod/directory.php:111 +#: ../../mod/profiles.php:585 ../../mod/directory.php:111 msgid "Age: " msgstr "" -#: ../../mod/profiles.php:584 +#: ../../mod/profiles.php:620 msgid "Edit/Manage Profiles" msgstr "" -#: ../../mod/profiles.php:585 ../../boot.php:1049 +#: ../../mod/profiles.php:621 ../../boot.php:1055 msgid "Change profile photo" msgstr "" -#: ../../mod/profiles.php:586 ../../boot.php:1050 +#: ../../mod/profiles.php:622 ../../boot.php:1056 msgid "Create New Profile" msgstr "" -#: ../../mod/profiles.php:597 ../../boot.php:1060 +#: ../../mod/profiles.php:633 ../../boot.php:1066 msgid "Profile Image" msgstr "" -#: ../../mod/profiles.php:599 ../../boot.php:1063 +#: ../../mod/profiles.php:635 ../../boot.php:1069 msgid "visible to everybody" msgstr "" -#: ../../mod/profiles.php:600 ../../boot.php:1064 +#: ../../mod/profiles.php:636 ../../boot.php:1070 msgid "Edit visibility" msgstr "" @@ -4457,7 +4472,7 @@ msgstr "" #: ../../addon/communityhome/communityhome.php:34 #: ../../addon/communityhome/twillingham/communityhome.php:28 #: ../../addon/communityhome/twillingham/communityhome.php:34 -#: ../../include/nav.php:64 ../../boot.php:796 +#: ../../include/nav.php:64 ../../boot.php:802 msgid "Login" msgstr "" @@ -5199,7 +5214,7 @@ msgid "Show More Settings saved." msgstr "" #: ../../addon/showmore/showmore.php:87 ../../include/conversation.php:466 -#: ../../boot.php:496 +#: ../../boot.php:504 msgid "show more" msgstr "" @@ -5503,7 +5518,7 @@ msgstr "" msgid "Set colour scheme" msgstr "" -#: ../../include/profile_advanced.php:17 ../../boot.php:1085 +#: ../../include/profile_advanced.php:17 ../../boot.php:1091 msgid "Gender:" msgstr "" @@ -5524,11 +5539,11 @@ msgstr "" msgid "Age:" msgstr "" -#: ../../include/profile_advanced.php:37 ../../boot.php:1088 +#: ../../include/profile_advanced.php:37 ../../boot.php:1094 msgid "Status:" msgstr "" -#: ../../include/profile_advanced.php:45 ../../boot.php:1090 +#: ../../include/profile_advanced.php:45 ../../boot.php:1096 msgid "Homepage:" msgstr "" @@ -6112,7 +6127,7 @@ msgstr "" msgid "Contacts not in any group" msgstr "" -#: ../../include/nav.php:46 ../../boot.php:795 +#: ../../include/nav.php:46 ../../boot.php:801 msgid "Logout" msgstr "" @@ -6120,7 +6135,7 @@ msgstr "" msgid "End this session" msgstr "" -#: ../../include/nav.php:49 ../../boot.php:1463 +#: ../../include/nav.php:49 ../../boot.php:1469 msgid "Status" msgstr "" @@ -6200,11 +6215,11 @@ msgstr "" msgid "Manage other pages" msgstr "" -#: ../../include/nav.php:138 ../../boot.php:1043 +#: ../../include/nav.php:138 ../../boot.php:1049 msgid "Profiles" msgstr "" -#: ../../include/nav.php:138 ../../boot.php:1043 +#: ../../include/nav.php:138 ../../boot.php:1049 msgid "Manage/edit profiles" msgstr "" @@ -6626,33 +6641,33 @@ msgid "" "form has been opened for too long (>3 hours) before submitting it." msgstr "" -#: ../../include/Contact.php:96 +#: ../../include/Contact.php:111 msgid "stopped following" msgstr "" -#: ../../include/Contact.php:188 ../../include/conversation.php:817 +#: ../../include/Contact.php:203 ../../include/conversation.php:817 msgid "View Status" msgstr "" -#: ../../include/Contact.php:189 ../../include/conversation.php:818 +#: ../../include/Contact.php:204 ../../include/conversation.php:818 msgid "View Profile" msgstr "" -#: ../../include/Contact.php:190 ../../include/conversation.php:819 +#: ../../include/Contact.php:205 ../../include/conversation.php:819 msgid "View Photos" msgstr "" -#: ../../include/Contact.php:191 ../../include/Contact.php:204 +#: ../../include/Contact.php:206 ../../include/Contact.php:219 #: ../../include/conversation.php:820 msgid "Network Posts" msgstr "" -#: ../../include/Contact.php:192 ../../include/Contact.php:204 +#: ../../include/Contact.php:207 ../../include/Contact.php:219 #: ../../include/conversation.php:821 msgid "Edit Contact" msgstr "" -#: ../../include/Contact.php:193 ../../include/Contact.php:204 +#: ../../include/Contact.php:208 ../../include/Contact.php:219 #: ../../include/conversation.php:822 msgid "Send PM" msgstr "" @@ -6879,70 +6894,80 @@ msgstr "" msgid "permissions" msgstr "" -#: ../../boot.php:494 +#: ../../boot.php:502 msgid "Delete this item?" msgstr "" -#: ../../boot.php:497 +#: ../../boot.php:505 msgid "show fewer" msgstr "" -#: ../../boot.php:774 +#: ../../boot.php:678 +#, php-format +msgid "Update %s failed. See error logs." +msgstr "" + +#: ../../boot.php:680 +#, php-format +msgid "Update Error at %s" +msgstr "" + +#: ../../boot.php:780 msgid "Create a New Account" msgstr "" -#: ../../boot.php:798 +#: ../../boot.php:804 msgid "Nickname or Email address: " msgstr "" -#: ../../boot.php:799 +#: ../../boot.php:805 msgid "Password: " msgstr "" -#: ../../boot.php:802 +#: ../../boot.php:808 msgid "Or login using OpenID: " msgstr "" -#: ../../boot.php:808 +#: ../../boot.php:814 msgid "Forgot your password?" msgstr "" -#: ../../boot.php:975 +#: ../../boot.php:981 msgid "Edit profile" msgstr "" -#: ../../boot.php:1035 +#: ../../boot.php:1041 msgid "Message" msgstr "" -#: ../../boot.php:1151 ../../boot.php:1227 +#: ../../boot.php:1157 ../../boot.php:1233 msgid "g A l F d" msgstr "" -#: ../../boot.php:1152 ../../boot.php:1228 +#: ../../boot.php:1158 ../../boot.php:1234 msgid "F d" msgstr "" -#: ../../boot.php:1197 ../../boot.php:1268 +#: ../../boot.php:1203 ../../boot.php:1274 msgid "[today]" msgstr "" -#: ../../boot.php:1209 +#: ../../boot.php:1215 msgid "Birthday Reminders" msgstr "" -#: ../../boot.php:1210 +#: ../../boot.php:1216 msgid "Birthdays this week:" msgstr "" -#: ../../boot.php:1261 +#: ../../boot.php:1267 msgid "[No description]" msgstr "" -#: ../../boot.php:1279 +#: ../../boot.php:1285 msgid "Event Reminders" msgstr "" -#: ../../boot.php:1280 +#: ../../boot.php:1286 msgid "Events this week:" msgstr "" From 0153d86b7f4e2913b1eb985a905f7eb94822b589 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Apr 2012 19:10:07 -0700 Subject: [PATCH 033/111] admin page to manage failed updates --- boot.php | 2 +- mod/admin.php | 66 +++++++++++++++++++++++++++++++++++++++-- view/admin_aside.tpl | 1 + view/failed_updates.tpl | 17 +++++++++++ 4 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 view/failed_updates.tpl diff --git a/boot.php b/boot.php index aefc694e..733d94b1 100644 --- a/boot.php +++ b/boot.php @@ -667,7 +667,7 @@ if(! function_exists('check_config')) { // call the specific update $func = 'update_' . $x; - $retval = $func($a); + $retval = $func(); if($retval) { //send the administrator an e-mail $email_tpl = get_intltext_template("update_fail_eml.tpl"); diff --git a/mod/admin.php b/mod/admin.php index 3b6d186d..b07ef851 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -61,6 +61,9 @@ function admin_post(&$a){ case 'logs': admin_page_logs_post($a); break; + case 'dbsync': + admin_page_dbsync_post($a); + break; case 'update': admin_page_remoteupdate_post($a); break; @@ -94,7 +97,8 @@ function admin_content(&$a) { 'users' => Array($a->get_baseurl(true)."/admin/users/", t("Users") , "users"), 'plugins'=> Array($a->get_baseurl(true)."/admin/plugins/", t("Plugins") , "plugins"), 'themes' => Array($a->get_baseurl(true)."/admin/themes/", t("Themes") , "themes"), - 'update' => Array($a->get_baseurl(true)."/admin/update/", t("Update") , "update") + 'dbsync' => Array($a->get_baseurl(true)."/admin/dbsync/", t('DB updates'), "dbsync"), + 'update' => Array($a->get_baseurl(true)."/admin/update/", t("Software Update") , "update") ); /* get plugins admin page */ @@ -142,6 +146,9 @@ function admin_content(&$a) { case 'logs': $o = admin_page_logs($a); break; + case 'dbsync': + $o = admin_page_dbsync($a); + break; case 'update': $o = admin_page_remoteupdate($a); break; @@ -435,6 +442,62 @@ function admin_page_site(&$a) { } +function admin_page_dbsync(&$a) { + + $o = ''; + + if($a->argc > 3 && intval($a->argv[3]) && $a->argv[2] === 'mark') { + set_config('database', 'update_' . intval($a->argv[3]), 'success'); + info( t('Update has been marked successful') . EOL); + goaway($a->get_baseurl(true) . '/admin/dbsync'); + } + + if($a->argc > 2 && intval($a->argv[2])) { + require_once('update.php'); + $func = 'update_' . intval($a->argv[2]); + if(function_exists($func)) { + $retval = $func(); + if($retval === UPDATE_FAILED) { + $o .= sprintf( t('Executing %s failed. Check system logs.'), $func); + } + elseif($retval === UPDATE_SUCCESS) { + $o .= sprintf( t('Update %s was successfully applied.', $func)); + set_config('database',$func, 'success'); + } + else + $o .= sprintf( t('Update %s did not return a status. Unknown if it succeeded.'), $func); + } + else + $o .= sprintf( t('Update function %s could not be found.'), $func); + return $o; + } + + $failed = array(); + $r = q("select * from config where `cat` = 'database' "); + if(count($r)) { + foreach($r as $rr) { + $upd = intval(substr($rr['k'],7)); + if($upd < 1139 || $rr['v'] === 'success') + continue; + $failed[] = $upd; + } + } + if(! count($failed)) + return '

' . t('No failed updates.') . '

'; + + $o = replace_macros(get_markup_template('failed_updates.tpl'),array( + '$base' => $a->get_baseurl(true), + '$banner' => t('Failed Updates'), + '$desc' => t('This does not include updates prior to 1139, which did not return a status.'), + '$mark' => t('Mark success (if update was manually applied)'), + '$apply' => t('Attempt to execute this update step automatically'), + '$failed' => $failed + )); + + return $o; + +} + /** * Users admin page * @@ -979,7 +1042,6 @@ readable."); $size = 5000000; $seek = fseek($fp,0-$size,SEEK_END); if($seek === 0) { - fgets($fp); // throw away the first partial line $data = escape_tags(fread($fp,$size)); while(! feof($fp)) $data .= escape_tags(fread($fp,4096)); diff --git a/view/admin_aside.tpl b/view/admin_aside.tpl index a3c98e2c..f25a1eb4 100644 --- a/view/admin_aside.tpl +++ b/view/admin_aside.tpl @@ -16,6 +16,7 @@ +