diff --git a/boot.php b/boot.php index 105180c231..100662a8f8 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' ); @@ -73,6 +73,14 @@ define ( 'HOOK_HOOK', 0); define ( 'HOOK_FILE', 1); define ( 'HOOK_FUNCTION', 2); +/** + * DB update return values + */ + +define ( 'UPDATE_SUCCESS', 0); +define ( 'UPDATE_FAILED', 1); + + /** * * page/profile types @@ -658,32 +666,29 @@ if(! function_exists('check_config')) { // call the specific update -// global $db; -// $db->excep(TRUE); -// try { -// $db->beginTransaction(); - $func = 'update_' . $x; - $func($a); -// $db->commit(); -// } catch(Exception $ex) { -// $db->rollback(); -// //send the administrator an e-mail -// $email_tpl = get_intltext_template("update_fail_eml.tpl"); -// $email_tpl = replace_macros($email_tpl, array( -// '$sitename' => $a->config['sitename'], -// '$siteurl' => $a->get_baseurl(), -// '$update' => $x, -// '$error' => $ex->getMessage())); -// $subject=sprintf(t('Update Error at %s'), $a->get_baseurl()); + $func = 'update_' . $x; + $retval = $func($a); + if($retval) { + //send the administrator an e-mail + $email_tpl = get_intltext_template("update_fail_eml.tpl"); + $email_msg = replace_macros($email_tpl, array( + '$sitename' => $a->config['sitename'], + '$siteurl' => $a->get_baseurl(), + '$update' => $x, + '$error' => sprintf( t('Update %s failed. See error logs.'), $x) + )); + $subject=sprintf(t('Update Error at %s'), $a->get_baseurl()); -// mail($a->config['admin_email'], $subject, $text, -// 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" -// . 'Content-type: text/plain; charset=UTF-8' . "\n" -// . 'Content-transfer-encoding: 8bit' ); -// //try the logger -// logger('update failed: '.$ex->getMessage().EOL); -// } -// $db->excep(FALSE); + 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); @@ -725,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']; + } } } diff --git a/database.sql b/database.sql index 78b26922bd..80a9197fa5 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/include/Contact.php b/include/Contact.php index 537850e007..2523fc0231 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) ); diff --git a/mod/profiles.php b/mod/profiles.php index 7a33a03e44..3a52c8fa5e 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[] = '[color=#ff0000]♥[/color] ' . 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'] . ''; diff --git a/update.php b/update.php index 2758f59066..3c2ecebb6b 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ -
+ \ No newline at end of file diff --git a/view/theme/diabook/nav.tpl b/view/theme/diabook/nav.tpl index ce27400f64..f611de0043 100644 --- a/view/theme/diabook/nav.tpl +++ b/view/theme/diabook/nav.tpl @@ -136,7 +136,7 @@ - +
$langselector
diff --git a/view/theme/diabook/style-wide.css b/view/theme/diabook/style-wide.css index f8dced3e69..71ed4e4720 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 9150ea8cf8..e70c72cb2b 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 c45db9884d..9a1ac0f68a 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 }); +$(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;"); + }); ';