aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-12-11 04:16:58 -0800
committerFriendika <info@friendika.com>2010-12-11 04:16:58 -0800
commit6b5a83b9b8c3c4fe0e58c92994c3a53e8f3cb175 (patch)
tree03870eac7d723ddb02b6e2c43cbd60acb9cb124d /mod
parent18823fe54694579ff4d61c2670b55ccd4e060957 (diff)
downloadvolse-hubzilla-6b5a83b9b8c3c4fe0e58c92994c3a53e8f3cb175.tar.gz
volse-hubzilla-6b5a83b9b8c3c4fe0e58c92994c3a53e8f3cb175.tar.bz2
volse-hubzilla-6b5a83b9b8c3c4fe0e58c92994c3a53e8f3cb175.zip
profile load optimisation
Diffstat (limited to 'mod')
-rw-r--r--mod/dfrn_request.php1
-rw-r--r--mod/display.php1
-rw-r--r--mod/profile.php48
-rw-r--r--mod/profile_photo.php1
-rw-r--r--mod/profiles.php1
-rw-r--r--mod/settings.php1
-rw-r--r--mod/viewcontacts.php1
7 files changed, 0 insertions, 54 deletions
diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php
index 60106661c..ce422aa9f 100644
--- a/mod/dfrn_request.php
+++ b/mod/dfrn_request.php
@@ -6,7 +6,6 @@ function dfrn_request_init(&$a) {
if($a->argc > 1)
$which = $a->argv[1];
- require_once('mod/profile.php');
profile_init($a,$which);
return;
diff --git a/mod/display.php b/mod/display.php
index 369161619..1049b28a0 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -5,7 +5,6 @@ function display_content(&$a) {
$o = '<div id="live-display"></div>' . "\r\n";
- require_once('mod/profile.php');
profile_init($a);
$item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
diff --git a/mod/profile.php b/mod/profile.php
index a431f4bdd..b40617d03 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -1,53 +1,5 @@
<?php
-if(! function_exists('profile_load')) {
-function profile_load(&$a, $username, $profile = 0) {
- if(remote_user()) {
- $r = q("SELECT `profile-id` FROM `contact` WHERE `id` = %d LIMIT 1",
- intval($_SESSION['visitor_id']));
- if(count($r))
- $profile = $r[0]['profile-id'];
- }
-
- $r = null;
-
- if($profile) {
- $profile_int = intval($profile);
- $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)
- );
- }
-
- if(($r === false) || (! count($r))) {
- notice( t('No profile') . EOL );
- $a->error = 404;
- return;
- }
-
- $a->profile = $r[0];
-
- $a->page['template'] = 'profile';
-
- $a->page['title'] = $a->profile['name'];
- $_SESSION['theme'] = $a->profile['theme'];
-
- if(! (x($a->page,'aside')))
- $a->page['aside'] = '';
- $a->page['aside'] .= contact_block();
-
- return;
-}}
-
function profile_init(&$a) {
if($a->argc > 1)
diff --git a/mod/profile_photo.php b/mod/profile_photo.php
index 39808776b..64093b2de 100644
--- a/mod/profile_photo.php
+++ b/mod/profile_photo.php
@@ -8,7 +8,6 @@ function profile_photo_init(&$a) {
return;
}
- require_once("mod/profile.php");
profile_load($a,$a->user['nickname']);
}
diff --git a/mod/profiles.php b/mod/profiles.php
index 604eb2f62..e675af2e4 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -327,7 +327,6 @@ function profiles_content(&$a) {
return;
}
- require_once('mod/profile.php');
profile_load($a,$a->user['nickname'],$r[0]['id']);
require_once('include/profile_selectors.php');
diff --git a/mod/settings.php b/mod/settings.php
index 7ed7ad32e..a8e02ea40 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -3,7 +3,6 @@
function settings_init(&$a) {
if(local_user()) {
- require_once("mod/profile.php");
profile_load($a,$a->user['nickname']);
}
}
diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php
index 562b60c25..bd73b2ffb 100644
--- a/mod/viewcontacts.php
+++ b/mod/viewcontacts.php
@@ -2,7 +2,6 @@
function viewcontacts_init(&$a) {
- require_once("mod/profile.php");
profile_load($a,$a->argv[1]);
}