Merge pull request #861 from iAmShorty/blockfinder-update
[FIX Blockfinder Stats] Working with public and private settings
This commit is contained in:
commit
1e34018e7f
@ -6,21 +6,24 @@ if (!defined('SECURITY')) die('Hacking attempt');
|
|||||||
// Grab Block Finder
|
// Grab Block Finder
|
||||||
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
||||||
$debug->append('No cached version available, fetching from backend', 3);
|
$debug->append('No cached version available, fetching from backend', 3);
|
||||||
|
|
||||||
$getBlocksSolvedbyAccount = $statistics->getBlocksSolvedbyAccount();
|
$getBlocksSolvedbyAccount = $statistics->getBlocksSolvedbyAccount();
|
||||||
$smarty->assign("BLOCKSSOLVEDBYACCOUNT", $getBlocksSolvedbyAccount);
|
$smarty->assign("BLOCKSSOLVEDBYACCOUNT", $getBlocksSolvedbyAccount);
|
||||||
|
|
||||||
|
if(isset($_SESSION['USERDATA']['id'])){
|
||||||
|
$getBlocksSolvedbyWorker = $statistics->getBlocksSolvedbyWorker($_SESSION['USERDATA']['id']);
|
||||||
|
$smarty->assign("BLOCKSSOLVEDBYWORKER", $getBlocksSolvedbyWorker);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$debug->append('Using cached page', 3);
|
$debug->append('Using cached page', 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Public / private page detection
|
||||||
if ($setting->getValue('acl_blockfinder_statistics')) {
|
if ($setting->getValue('acl_blockfinder_statistics')) {
|
||||||
$smarty->assign("CONTENT", "finder.tpl");
|
$smarty->assign("CONTENT", "finder.tpl");
|
||||||
} else if ($user->isAuthenticated()) {
|
} else if ($user->isAuthenticated()) {
|
||||||
$getBlocksSolvedbyWorker = $statistics->getBlocksSolvedbyWorker($_SESSION['USERDATA']['id']);
|
|
||||||
$smarty->assign("BLOCKSSOLVEDBYWORKER", $getBlocksSolvedbyWorker);
|
|
||||||
$smarty->assign("CONTENT", "finder.tpl");
|
$smarty->assign("CONTENT", "finder.tpl");
|
||||||
} else {
|
} else {
|
||||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Block Finders are currently disabled. Please try again later.', 'TYPE' => 'errormsg');
|
|
||||||
$smarty->assign("CONTENT", "default.tpl");
|
$smarty->assign("CONTENT", "default.tpl");
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user