Guest User

Untitled

a guest
Jan 2nd, 2024
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. <?php
  2. require_once __DIR__ . '/config/init.php';
  3. $Template = realpath(__DIR__ . '/templates/' . TEMPLATE);
  4. $request_uri = getURL();
  5. $request_path = $request_uri;
  6. $ADS_NETWORK = 'DEFAULT';
  7. if ($Ads = $db->where('ads_url', $request_path)->getOne('adschanger', 'ads_network')) {
  8. if ($Ads['ads_network'] != 'OFF') {
  9. $ADS_NETWORK = $Ads['ads_network'];
  10. }
  11. } else {
  12. $ADS_NETWORK = DEFAULT_ADS;
  13. }
  14. $AppProtocol = (APP_HTTPS == 1) ? 'https://' : 'http://';
  15. $endRoute = ROUTE_END;
  16. $AdsPath = __DIR__ . '/templates/ads/' . $ADS_NETWORK;
  17. $categoryExp = '/\/(category|album)\/([a-z0-9-]+)' . $endRoute . '$/'; // category Expression
  18. $catExp_page = '/\/(category|album)\/([0-9]+)\/([a-z0-9-]+)' . $endRoute . '$/';
  19.  
  20. $artistExp = '/\/artist\/([a-z0-9-]+)' . $endRoute . '$/i';
  21. $artistExp_page = '/artist\/([0-9]+)\/([a-z0-9-]+)' . $endRoute . '$/';
  22.  
  23. $allcollectionlist = '/\/(artists)\/([0-9]+)\/([a-z0-9-]+)' . $endRoute . '$/';
  24.  
  25. $fileExp = '/\/music\/([a-z0-9-]+)' . $endRoute . '$/';
  26. $downloadPageExp = "/\/download\/([a-z0-9-]+)$/"; // Download Page Lang Code;
  27. $searchPageExp = "/\/search\/list$/"; // Download Page Lang Code;
  28. $PageExp = "/\/page\/([a-z0-9-]+)$/"; // Page Lang Code;
  29.  
  30. $speExp_page = '/\/musics\/([0-9]+)\/([a-z0-9-]+)' . $endRoute . '$/';
  31. $homeExp = '/' . BASE_URL . '$/i';
  32. $output = array();
  33. $output2 = array();
  34. if (preg_match($homeExp, $request_path, $output)) {
  35. require __DIR__ . '/controller/Home.php';
  36. } else if (preg_match($categoryExp, $request_path, $output) || preg_match($catExp_page, $request_path, $output2)) {
  37. require __DIR__ . '/controller/Category.php';
  38. } else if (preg_match($fileExp, $request_path, $output)) {
  39. require __DIR__ . '/controller/File.php';
  40. } else if (preg_match($artistExp, $request_path, $output) || preg_match($artistExp_page, $request_path, $output2)) {
  41. require __DIR__ . '/controller/Artist.php';
  42. } else if (preg_match($speExp_page, $request_path, $output)) {
  43. require __DIR__ . '/controller/AllSongs.php';
  44. } else if (preg_match($allcollectionlist, $request_path, $output)) {
  45. require __DIR__ . '/controller/AllCollection.php';
  46. } else if (preg_match($searchPageExp, $request_path, $output)) {
  47. require __DIR__ . '/controller/Search.php';
  48. } else if (preg_match($downloadPageExp, $request_path, $output)) {
  49. require __DIR__ . '/controller/DownloadFile.php';
  50. } else if (preg_match($PageExp, $request_path, $output)) {
  51. require __DIR__ . '/controller/Page.php';
  52. } else {
  53. if (ERROR_PAGE == true) {
  54. require __DIR__ . '/controller/ErrorPage.php';
  55. } else {
  56. Redirect(APP_URL);
  57. }
  58. }
  59. $db->disconnect();
  60.  
Add Comment
Please, Sign In to add comment