getRandomId();
header('Location: ?'.Util::$typeStrings[$type].'='.$typeId);
die();
case 'latest-comments':
$menu = 2;
$lv = array(
array(
'file' => 'commentpreview',
'data' => [],
'params' => []
)
);
break;
case 'latest-screenshots':
$menu = 3;
$lv[] = array(
'file' => 'screenshot',
'data' => [],
'params' => []
);
break;
case 'latest-videos':
$menu = 11;
$lv[] = array(
'file' => 'video',
'data' => [],
'params' => []
);
break;
case 'latest-articles':
$menu = 1;
$lv = [];
break;
case 'latest-additions':
$menu = 0;
$extraText = '';
break;
case 'unrated-comments':
$menu = 5;
$lv[] = array(
'file' => 'commentpreview',
'data' => [],
'params' => []
);
break;
case 'missing-screenshots':
$menu = 13;
$cnd = [[['cuFlags', CUSTOM_HAS_SCREENSHOT, '&'], 0]];
if (!User::isInGroup(U_GROUP_STAFF))
$cnd[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
foreach (Util::$typeClasses as $classStr)
{
$typeObj = new $classStr($cnd);
if (!$typeObj->error)
{
$typeObj->addGlobalsToJScript(GLOBALINFO_SELF | GLOBALINFO_RELATED);
$lv[] = array(
'file' => (new ReflectionProperty($typeObj, 'brickFile'))->getValue(),
'data' => $typeObj->getListviewData(),
'params' => ['tabs' => '$myTabs']
);
}
}
break;
case 'most-comments':
if ($pageParam && !in_array($pageParam, [1, 7, 30]))
header('Location: ?most-comments=1'.($_rss ? '&rss' : null));
if (in_array($pageParam, [7, 30]))
{
$subMenu = $pageParam;
$_title = sprintf(Lang::$main['mostComments'][1], $pageParam);
}
else
{
$subMenu = 1;
$_title = Lang::$main['mostComments'][0];
}
$menu = 12;
$lv[] = array(
'file' => 'commentpreview',
'data' => [],
'params' => []
);
break;
default:
$smarty->error();
}
if (strstr($pageCall, 'latest') || $pageCall == 'most-comments')
{
if ($_rss)
{
header("Content-Type: application/rss+xml; charset=ISO-8859-1");
$xml = "\n".
"\n\t\n".
"\t\t".CFG_NAME_SHORT.' - '.Lang::$main['utilities'][$menu] . ($_title ? Lang::$colon . $_title : null)."\n".
"\t\t".HOST_URL.'?'.$pageCall . ($pageParam ? '='.$pageParam : null)."\n".
"\t\t".CFG_NAME."\n".
"\t\t".implode('-', str_split(User::$localeString, 2))."\n".
"\t\t".CFG_TTL_RSS."\n".
// Sat, 31 Aug 2013 15:33:16 -0500
"\t\n";
/*
generate - 's here
*/
$xml .= '
';
die($xml);
}
else
$h1Links = '';
}
array_push($_path, $menu);
if ($subMenu)
array_push($_path, $subMenu);
// menuId 8: Utilities g_initPath()
// tabId 1: Tools g_initHeader()
$smarty->updatePageVars(array(
'name' => Lang::$main['utilities'][$menu] . ($_title ? Lang::$colon . $_title : null),
'h1Links' => $h1Links,
'title' => Lang::$main['utilities'][$menu] . ($_title ? ' - ' . $_title : null),
'path' => json_encode($_path, JSON_NUMERIC_CHECK),
'tab' => 1
));
$smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $lv);
// load the page
$smarty->display('list-page-generic.tpl');
?>