We now use memcache if configured and installed.
This commit is contained in:
parent
deb2fee2f0
commit
ee5ada6991
13 changed files with 339 additions and 130 deletions
|
|
@ -149,17 +149,23 @@ function get_profiledata_by_nick($nickname, $uid = 0, $profile = 0) {
|
|||
|
||||
if($profile) {
|
||||
$profile_int = intval($profile);
|
||||
$r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `contact`.`addr`, `user`.* FROM `profile`
|
||||
INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
|
||||
WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d AND `contact`.`self` = 1 LIMIT 1",
|
||||
$r = q("SELECT `contact`.`id` AS `contact_id`, `profile`.`uid` AS `profile_uid`, `profile`.*,
|
||||
`contact`.`avatar-date` AS picdate, `contact`.`addr`, `user`.*
|
||||
FROM `profile`
|
||||
INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` AND `contact`.`self`
|
||||
INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
|
||||
WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d LIMIT 1",
|
||||
dbesc($nickname),
|
||||
intval($profile_int)
|
||||
);
|
||||
}
|
||||
if((!$r) && (!count($r))) {
|
||||
$r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `contact`.`addr`, `user`.* FROM `profile`
|
||||
INNER JOIN `contact` ON `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
|
||||
WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 AND `contact`.`self` = 1 LIMIT 1",
|
||||
$r = q("SELECT `contact`.`id` AS `contact_id`, `profile`.`uid` AS `profile_uid`, `profile`.*,
|
||||
`contact`.`avatar-date` AS picdate, `contact`.`addr`, `user`.*
|
||||
FROM `profile`
|
||||
INNER JOIN `contact` ON `contact`.`uid` = `profile`.`uid` AND `contact`.`self`
|
||||
INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
|
||||
WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` LIMIT 1",
|
||||
dbesc($nickname)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue