The community page is speeded up.
Photos will be compressed before the output.
This commit is contained in:
parent
c9307eb96a
commit
5e077e541a
2 changed files with 10 additions and 9 deletions
|
@ -64,7 +64,8 @@ function community_content(&$a, $update = 0) {
|
|||
|
||||
}
|
||||
|
||||
$r = q("SELECT distinct(`item`.`uri`), `item`.*, `item`.`id` AS `item_id`,
|
||||
//$r = q("SELECT distinct(`item`.`uri`)
|
||||
$r = q("SELECT `item`.`uri`, `item`.*, `item`.`id` AS `item_id`,
|
||||
`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`,
|
||||
|
@ -75,13 +76,13 @@ function community_content(&$a, $update = 0) {
|
|||
AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''
|
||||
AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = ''
|
||||
AND `item`.`private` = 0 AND `item`.`wall` = 1 AND `user`.`hidewall` = 0
|
||||
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
||||
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`self`
|
||||
ORDER BY `received` DESC LIMIT %d, %d ",
|
||||
intval($a->pager['start']),
|
||||
intval($a->pager['itemspage'])
|
||||
|
||||
);
|
||||
// AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 group by `item`.`uri`
|
||||
// group by `item`.`uri`
|
||||
|
||||
if(! count($r)) {
|
||||
info( t('No results.') . EOL);
|
||||
|
|
|
@ -106,7 +106,7 @@ function photo_init(&$a) {
|
|||
intval($resolution)
|
||||
);
|
||||
if(count($r)) {
|
||||
|
||||
|
||||
$sql_extra = permissions_sql($r[0]['uid']);
|
||||
|
||||
// Now we'll see if we can access the photo
|
||||
|
@ -169,13 +169,13 @@ function photo_init(&$a) {
|
|||
}
|
||||
}
|
||||
|
||||
if(isset($customres) && $customres > 0 && $customres < 500) {
|
||||
$ph = new Photo($data, $mimetype);
|
||||
if($ph->is_valid()) {
|
||||
$ph = new Photo($data, $mimetype);
|
||||
if($ph->is_valid()) {
|
||||
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')) {
|
||||
|
|
Loading…
Reference in a new issue