mod_common - use channel_id rather than channel_address
This commit is contained in:
parent
45c2076c67
commit
3fdbb8b4ce
@ -4,26 +4,20 @@ require_once('include/socgraph.php');
|
|||||||
|
|
||||||
function common_init(&$a) {
|
function common_init(&$a) {
|
||||||
|
|
||||||
if(argc() > 1)
|
if(argc() > 1 && intval(argv(1)))
|
||||||
$which = argv(1);
|
$channel_id = intval(argv(1));
|
||||||
else {
|
else {
|
||||||
notice( t('Requested profile is not available.') . EOL );
|
notice( t('No channel.') . EOL );
|
||||||
$a->error = 404;
|
$a->error = 404;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$profile = 0;
|
$x = q("select channel_address from channel where channel_id = %d limit 1",
|
||||||
$channel = $a->get_channel();
|
intval($channel_id)
|
||||||
|
};
|
||||||
|
|
||||||
if((local_user()) && (argc() > 2) && (argv(2) === 'view')) {
|
if($x)
|
||||||
$which = $channel['channel_address'];
|
profile_load($a,$x[0]['channel_address'],0);
|
||||||
$profile = argv(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run profile_load() here to make sure the theme is set before
|
|
||||||
// we start loading content
|
|
||||||
|
|
||||||
profile_load($a,$which,$profile);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user