aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-07-03 01:50:39 -0700
committerfriendica <info@friendica.com>2013-07-03 01:50:39 -0700
commit8369a8a7559391ea6cb2757b5093bcf47aed0ed1 (patch)
tree9a9bc185f4e0b8c331eeff3a75eca976bd0656c4 /boot.php
parentfd74c5b2ce303ba7018b139c033c6f92ea134751 (diff)
downloadvolse-hubzilla-8369a8a7559391ea6cb2757b5093bcf47aed0ed1.tar.gz
volse-hubzilla-8369a8a7559391ea6cb2757b5093bcf47aed0ed1.tar.bz2
volse-hubzilla-8369a8a7559391ea6cb2757b5093bcf47aed0ed1.zip
progress on multiple profiles, doing it the old way. I don't think we're going to be able to do it the new way - way too complicated.
Diffstat (limited to 'boot.php')
-rwxr-xr-xboot.php23
1 files changed, 10 insertions, 13 deletions
diff --git a/boot.php b/boot.php
index db61a79ae..dc0ec48a5 100755
--- a/boot.php
+++ b/boot.php
@@ -1419,7 +1419,7 @@ function get_max_import_size() {
* Function : profile_load
* @parameter App $a
* @parameter string $nickname
- * @parameter int $profile
+ * @parameter string $profile
*
* Summary: Loads a profile into the page sidebar.
* The function requires a writeable copy of the main App structure, and the nickname
@@ -1436,7 +1436,7 @@ function get_max_import_size() {
*/
-function profile_load(&$a, $nickname, $profile = 0) {
+function profile_load(&$a, $nickname, $profile = '') {
$user = q("select channel_id from channel where channel_address = '%s' limit 1",
dbesc($nickname)
@@ -1468,22 +1468,19 @@ function profile_load(&$a, $nickname, $profile = 0) {
$r = null;
-
-
if($profile) {
- $profile_int = intval($profile);
- $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , channel.* FROM `profile`
- LEFT JOIN channel ON `profile`.`uid` = channel.channel_id
- WHERE channel.channel_address = '%s' AND `profile`.`id` = %d LIMIT 1",
+ $r = q("SELECT profile.uid AS profile_uid, profile.*, channel.* FROM profile
+ LEFT JOIN channel ON profile.uid = channel.channel_id
+ WHERE channel.channel_address = '%s' AND profile.profile_guid = '%s' LIMIT 1",
dbesc($nickname),
- intval($profile_int)
+ dbesc($profile)
);
}
- if(! ($r && count($r))) {
- $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `channel`.* FROM `profile`
- LEFT JOIN `channel` ON `profile`.`uid` = channel.channel_id
- WHERE channel.channel_address = '%s' AND `profile`.`is_default` = 1 LIMIT 1",
+ if(! $r) {
+ $r = q("SELECT profile.uid AS profile_uid, profile.*, channel.* FROM profile
+ LEFT JOIN channel ON profile.uid = channel.channel_id
+ WHERE channel.channel_address = '%s' AND profile.is_default = 1 LIMIT 1",
dbesc($nickname)
);
}