private function _GetPageTitle() { $page_title = 'TShirtShop: ' . 'Demo Product Catalog from Beginning PHP and MySQL E-Commerce'; if (isset($_GET['DepartmentId']) && isset($_GET['CategoryId'])) { $page_title = 'TShirtShop: ' . Catalog::GetDepartmentName($_GET['DepartmentId']) . ' - ' . Catalog::GetCategoryName($_GET['CategoryId']); if (isset($_GET['Page']) && (int) $_GET['Page'] > 1) { $page_title .= ' - Page ' . (int) $_GET['Page']; } } elseif (isset($_GET['DepartmentId'])) { $page_title = 'TShirtShop: ' . Catalog::GetDepartmentName($_GET['DepartmentId']); if (isset($_GET['Page']) && (int) $_GET['Page'] > 1) { $page_title .= ' - Page ' . (int) $_GET['Page']; } } elseif (isset($_GET['ProductId'])) { $page_title = 'TShirtShop: ' . Catalog::GetProductName($_GET['ProductId']); } elseif (isset($_GET['SearchResults'])) { $page_title = 'TShirtShop: "'; // Display the search string $page_title .= trim(str_replace('-', ' ', $_GET['SearchString'])) . '" ('; // Display "all-words search " or "any-words search" $all_words = isset($_GET['AllWords']) ? $_GET['AllWords'] : 'off'; $page_title .= ($all_words == 'on' ? 'all' : 'any') . '-words search'; // Display page number if (isset($_GET['Page']) && (int) $_GET['Page'] > 1) { $page_title .= ', page ' . (int) $_GET['Page']; } $page_title .= ')'; } else { if (isset($_GET['Page']) && (int) $_GET['Page'] > 1) { $page_title .= ' - Page ' . (int) $_GET['Page']; } } return $page_title; }
public static function ToCategory($departmentId, $categoryId, $page = 1) { $link = self::CleanUrlText(Catalog::GetDepartmentName($departmentId)) . '-d' . $departmentId . '/' . self::CleanUrlText(Catalog::GetCategoryName($categoryId)) . '-c' . $categoryId . '/'; if ($page > 1) { $link .= 'page-' . $page . '/'; } return self::Build($link); }