aboutsummaryrefslogtreecommitdiffstats
path: root/mod/profile.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/profile.php')
-rw-r--r--mod/profile.php19
1 files changed, 7 insertions, 12 deletions
diff --git a/mod/profile.php b/mod/profile.php
index 1b5bfa40c..af8f684b3 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -9,21 +9,16 @@ function profile_init(&$a) {
$blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
- if($a->argc > 1)
- $which = $a->argv[1];
+ if(argc() > 1)
+ $which = argv(1);
else {
- $r = q("select nickname from user where blocked = 0 and account_expired = 0 and verified = 1 order by rand() limit 1");
- if(count($r)) {
- goaway($a->get_baseurl() . '/profile/' . $r[0]['nickname']);
- }
- else {
- logger('profile error: mod_profile ' . $a->query_string, LOGGER_DEBUG);
- notice( t('Requested profile is not available.') . EOL );
- $a->error = 404;
- return;
- }
+ logger('profile error: mod_profile ' . $a->query_string, LOGGER_DEBUG);
+ notice( t('Requested profile is not available.') . EOL );
+ $a->error = 404;
+ return;
}
+
$profile = 0;
if((local_user()) && ($a->argc > 2) && ($a->argv[2] === 'view')) {
$which = $a->user['nickname'];