]> git.mxchange.org Git - friendica.git/commitdiff
no profile after returning from visitor mode with a selected profile
authorMike Macgirvin <mike@macgirvin.com>
Sat, 18 Sep 2010 01:26:20 +0000 (18:26 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Sat, 18 Sep 2010 01:26:20 +0000 (18:26 -0700)
put bottom margin on non-profile pages as well

mod/profile.php
view/default.php

index 5efb28ea752a769e5a1adfa9ca83f213bf70eee4..c42291d963885ce9b06791b50a821e1878a871dc 100644 (file)
@@ -10,18 +10,24 @@ function profile_load(&$a, $username, $profile = 0) {
                        $profile = $r[0]['profile-id'];
        } 
 
+       $r = null;
+
        if($profile) {
                $profile_int = intval($profile);
-               $sql_which = " AND `profile`.`id` = $profile_int ";
+               $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` 
+                       LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
+                       WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d LIMIT 1",
+                       dbesc($username),
+                       intval($profile_int)
+               );
+       }
+       if(! count($r)) {       
+               $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` 
+                       LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
+                       WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 LIMIT 1",
+                       dbesc($username)
+               );
        }
-       else
-               $sql_which = " AND `profile`.`is-default` = 1 "; 
-
-       $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` 
-               LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
-               WHERE `user`.`nickname` = '%s' $sql_which LIMIT 1",
-               dbesc($username)
-       );
 
        if(($r === false) || (! count($r))) {
                notice( t('No profile') . EOL );
index 25d8ea1dcff3a62532a2936853f43f1ab88b8922..47adf4a76952a48b9c1f71ef16d3e9d1200daa9c 100644 (file)
@@ -8,7 +8,9 @@
        <header><?php echo $page['header']; ?></header>\r
        <nav><?php echo $page['nav']; ?></nav>\r
        <aside><?php echo $page['aside']; ?></aside>\r
-       <section><?php echo $page['content']; ?></section>\r
+       <section><?php echo $page['content']; ?>\r
+               <div id="page-footer"></div>\r
+       </section>\r
        <footer><?php echo $page['footer']; ?></footer>\r
 </body>\r
 </html>\r