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', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
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`),
}
}
- $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')) {
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));
`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']),
) ENGINE=MyISAM DEFAULT CHARSET=utf8"
);
-
- return UPDATE_FAILED;
+ if($r)
+ return UPDATE_SUCCESS;
+ }
+
+ 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;
}
- if(!$r) 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`)");
+
- // KEY `mention` (`mention`)
- 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`)");
++ set_config('system', 'maintenance', 0);
++
++ if(!$r)
++ return UPDATE_FAILED;
++
+ return UPDATE_SUCCESS;
+}