Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once __DIR__ . '/config/init.php';
- $Template = realpath(__DIR__ . '/templates/' . TEMPLATE);
- $request_uri = getURL();
- $request_path = $request_uri;
- $ADS_NETWORK = 'DEFAULT';
- if ($Ads = $db->where('ads_url', $request_path)->getOne('adschanger', 'ads_network')) {
- if ($Ads['ads_network'] != 'OFF') {
- $ADS_NETWORK = $Ads['ads_network'];
- }
- } else {
- $ADS_NETWORK = DEFAULT_ADS;
- }
- $AppProtocol = (APP_HTTPS == 1) ? 'https://' : 'http://';
- $endRoute = ROUTE_END;
- $AdsPath = __DIR__ . '/templates/ads/' . $ADS_NETWORK;
- $categoryExp = '/\/(category|album)\/([a-z0-9-]+)' . $endRoute . '$/'; // category Expression
- $catExp_page = '/\/(category|album)\/([0-9]+)\/([a-z0-9-]+)' . $endRoute . '$/';
- $artistExp = '/\/artist\/([a-z0-9-]+)' . $endRoute . '$/i';
- $artistExp_page = '/artist\/([0-9]+)\/([a-z0-9-]+)' . $endRoute . '$/';
- $allcollectionlist = '/\/(artists)\/([0-9]+)\/([a-z0-9-]+)' . $endRoute . '$/';
- $fileExp = '/\/music\/([a-z0-9-]+)' . $endRoute . '$/';
- $downloadPageExp = "/\/download\/([a-z0-9-]+)$/"; // Download Page Lang Code;
- $searchPageExp = "/\/search\/list$/"; // Download Page Lang Code;
- $PageExp = "/\/page\/([a-z0-9-]+)$/"; // Page Lang Code;
- $speExp_page = '/\/musics\/([0-9]+)\/([a-z0-9-]+)' . $endRoute . '$/';
- $homeExp = '/' . BASE_URL . '$/i';
- $output = array();
- $output2 = array();
- if (preg_match($homeExp, $request_path, $output)) {
- require __DIR__ . '/controller/Home.php';
- } else if (preg_match($categoryExp, $request_path, $output) || preg_match($catExp_page, $request_path, $output2)) {
- require __DIR__ . '/controller/Category.php';
- } else if (preg_match($fileExp, $request_path, $output)) {
- require __DIR__ . '/controller/File.php';
- } else if (preg_match($artistExp, $request_path, $output) || preg_match($artistExp_page, $request_path, $output2)) {
- require __DIR__ . '/controller/Artist.php';
- } else if (preg_match($speExp_page, $request_path, $output)) {
- require __DIR__ . '/controller/AllSongs.php';
- } else if (preg_match($allcollectionlist, $request_path, $output)) {
- require __DIR__ . '/controller/AllCollection.php';
- } else if (preg_match($searchPageExp, $request_path, $output)) {
- require __DIR__ . '/controller/Search.php';
- } else if (preg_match($downloadPageExp, $request_path, $output)) {
- require __DIR__ . '/controller/DownloadFile.php';
- } else if (preg_match($PageExp, $request_path, $output)) {
- require __DIR__ . '/controller/Page.php';
- } else {
- if (ERROR_PAGE == true) {
- require __DIR__ . '/controller/ErrorPage.php';
- } else {
- Redirect(APP_URL);
- }
- }
- $db->disconnect();
Add Comment
Please, Sign In to add comment