Location: PHPKode > projects > Automated Tutorials Script > TG Client/inc/pagehead.php
<?php
	
	$categoryList = xml2array(file_get_contents($config['category_xml_url']));
	$tutorialListArray = xml2array(file_get_contents($config['tutorial_xml_url'] . "&category=" . $_GET['category'] . "&subcategory=" . $_GET['subcategory'] . "&rpp=" . $config['tpp'] . "&page=" . $_GET['page']));
	
	//printArray($categoryList);
	//printArray($tutorialListArray);
	$currentPage = $_SERVER['PHP_SELF'];
	$CP = strrchr($currentPage, "/");
	$currentPage = substr($CP, 1, strlen($CP) - 5);
	$currentPage = "S_CURRENT" . strtoupper($currentPage);
	
	$tpl->assignGlobal($currentPage, "id='current'");
	$tpl->assignGlobal("CURRENTCATEGORY", $_GET['category']);
	$tpl->assignGlobal("T_SITETITLE", $config['site_title']);
	
	foreach($categoryList['categorylist'] as $categories)
	{
		foreach($categories as $category)
		{
			$simpleCategoryArray[$category['id']] = $category['name'];
			$complexCategoryArray[$category['id']]['name'] = $category['name'];
			
			$tpl->newBlock("CATEORYLIST");
			$tpl->assign("CATEGORYID", $category['id']);
			$tpl->assign("CATEGORYNAME", $category['name']);
			
			foreach($category['subcategories'] as $subcategoriesArray)
			{
				foreach($subcategoriesArray as $subcategories)
				{
					foreach($subcategories as $subcategory)
					{
						$simpleSubCategoryArray[$subcategory['id']] = $subcategory['name'];
						$complexCategoryArray[$category['id']]['subcategory'][$subcategory['id']] = $subcategory['name'];
						
						$tpl->newBlock("SUBCATEORYLIST");
						$tpl->assign("CATEGORYID", $category['id']);
						$tpl->assign("SUBCATEGORYID", $subcategory['id']);
						$tpl->assign("SUBCATEGORYNAME", $subcategory['name']);
					}
				}
			}
		}
	}
	
	//printArray($complexCategoryArray);
	
?>
Return current item: Automated Tutorials Script