From: Michael Vogel Date: Sun, 17 Feb 2013 11:35:40 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=93143702ed5fe88c0fce77d778d86ec651d4331e;p=friendica.git Merge remote-tracking branch 'upstream/master' Conflicts: boot.php database.sql library/fancybox/jquery.fancybox-1.3.4.css mod/search.php update.php --- 93143702ed5fe88c0fce77d778d86ec651d4331e diff --cc boot.php index fa968ce42e,609c2002a9..d77e653f14 --- a/boot.php +++ b/boot.php @@@ -12,9 -12,10 +12,9 @@@ require_once('library/Mobile_Detect/Mob require_once('include/features.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); - define ( 'FRIENDICA_VERSION', '3.1.1589' ); + define ( 'FRIENDICA_VERSION', '3.1.1612' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); --define ( 'DB_UPDATE_VERSION', 1159 ); - ++define ( 'DB_UPDATE_VERSION', 1161 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --cc database.sql index da0d8c3aae,6a4782fb89..f2c558241a --- a/database.sql +++ b/database.sql @@@ -590,8 -589,7 +590,9 @@@ CREATE TABLE IF NOT EXISTS `item` KEY `uid_commented` (`uid`, `commented`), KEY `uid_created` (`uid`, `created`), KEY `uid_unseen` (`uid`, `unseen`), + KEY `mention` (`mention`), + KEY `resource-id` (`resource-id`), + KEY `event_id` (`event-id`), FULLTEXT KEY `title` (`title`), FULLTEXT KEY `body` (`body`), FULLTEXT KEY `allow_cid` (`allow_cid`), diff --cc mod/photo.php index c92ab387b0,93db82a641..497dcd7506 --- a/mod/photo.php +++ b/mod/photo.php @@@ -169,13 -169,13 +169,16 @@@ function photo_init(&$a) } } - $ph = new Photo($data, $mimetype); - if($ph->is_valid()) { - if(isset($customres) && $customres > 0 && $customres < 500) { - $ph->scaleImageSquare($customres); - if(isset($customres) && $customres > 0 && $customres < 500) { ++ // Resize only if its not a GIF ++ if ($mime != "image/gif") { + $ph = new Photo($data, $mimetype); + if($ph->is_valid()) { - $ph->scaleImageSquare($customres); ++ if(isset($customres) && $customres > 0 && $customres < 500) { ++ $ph->scaleImageSquare($customres); ++ } + $data = $ph->imageString(); + $mimetype = $ph->getType(); } - $data = $ph->imageString(); - $mimetype = $ph->getType(); } if(function_exists('header_remove')) { diff --cc mod/search.php index b368deb49d,2753c2e1e5..93feebdd9a --- a/mod/search.php +++ b/mod/search.php @@@ -159,15 -146,14 +159,15 @@@ function search_content(&$a) if( (! get_config('alt_pager', 'global')) && (! get_pconfig(local_user(),'system','alt_pager')) ) { $r = q("SELECT distinct(`item`.`uri`) as `total` - FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid` + FROM $sql_table LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid` WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0 AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0) - OR `item`.`uid` = %d ) + OR ( `item`.`uid` = %d )) AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 - $sql_extra group by `item`.`uri` ", + $sql_extra ", intval(local_user()) ); +// $sql_extra group by `item`.`uri` ", if(count($r)) $a->set_pager_total(count($r)); @@@ -182,14 -168,15 +182,14 @@@ `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`, - `user`.`nickname` + `user`.`nickname`, `user`.`uid`, `user`.`hidewall` - FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` + FROM $sql_table LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid` WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0 AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0 ) - OR `item`.`uid` = %d ) + OR ( `item`.`uid` = %d )) AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 $sql_extra - group by `item`.`uri` ORDER BY `received` DESC LIMIT %d , %d ", intval(local_user()), intval($a->pager['start']), diff --cc update.php index 2ab2f300c0,b70e7b8ce1..89b55cdb9c --- a/update.php +++ b/update.php @@@ -1390,25 -1380,25 +1380,53 @@@ function update_1157() ) ENGINE=MyISAM DEFAULT CHARSET=utf8" ); + if($r) + return UPDATE_SUCCESS; - - return UPDATE_FAILED; + } + + function update_1158() { + set_config('system', 'maintenance', 1); + + // Wait for 15 seconds for current requests to + // clear before locking up the database + sleep(15); + + $r = q("CREATE INDEX event_id ON item(`event-id`)"); + set_config('system', 'maintenance', 0); + if($r) return UPDATE_SUCCESS; return UPDATE_FAILED; } +function update_1159() { + $r = q("ALTER TABLE `term` ADD `aid` int(10) unsigned NOT NULL DEFAULT '0', + ADD `uid` int(10) unsigned NOT NULL DEFAULT '0', + ADD INDEX (`uid`), + ADD INDEX (`aid`)"); + - if(!$r) return UPDATE_FAILED; ++ if(!$r) ++ return UPDATE_FAILED; ++ ++ require_once('include/tags.php'); ++ update_items(); ++ + return UPDATE_SUCCESS; +} + +function update_1160() { ++ set_config('system', 'maintenance', 1); ++ ++ // Wait for 15 seconds for current requests to ++ // clear before locking up the database ++ sleep(15); ++ + $r = q("ALTER TABLE `item` ADD `mention` TINYINT(1) NOT NULL DEFAULT '0', ADD INDEX (`mention`)"); - // KEY `mention` (`mention`) - if(!$r) return UPDATE_FAILED; ++ set_config('system', 'maintenance', 0); ++ ++ if(!$r) ++ return UPDATE_FAILED; ++ + return UPDATE_SUCCESS; +}