From 3fdbb8b4ce3c328a859afd215d123bf9c7b62a12 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 13 Feb 2013 17:33:58 -0800 Subject: mod_common - use channel_id rather than channel_address --- mod/common.php | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/mod/common.php b/mod/common.php index bd2a0eef7..87dd9e63a 100644 --- a/mod/common.php +++ b/mod/common.php @@ -4,26 +4,20 @@ require_once('include/socgraph.php'); function common_init(&$a) { - if(argc() > 1) - $which = argv(1); + if(argc() > 1 && intval(argv(1))) + $channel_id = intval(argv(1)); else { - notice( t('Requested profile is not available.') . EOL ); + notice( t('No channel.') . EOL ); $a->error = 404; return; } - $profile = 0; - $channel = $a->get_channel(); + $x = q("select channel_address from channel where channel_id = %d limit 1", + intval($channel_id) + }; - if((local_user()) && (argc() > 2) && (argv(2) === 'view')) { - $which = $channel['channel_address']; - $profile = argv(1); - } - - // Run profile_load() here to make sure the theme is set before - // we start loading content - - profile_load($a,$which,$profile); + if($x) + profile_load($a,$x[0]['channel_address'],0); } -- cgit v1.2.3