Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. public function addTpl() {
  2. global $zip;
  3.  
  4. if(!isset($_GET['url']) || empty($_GET['url'])) {
  5. $_GET['url'] = 'index';
  6. }
  7.  
  8. $front = '_zip/_templates/_front/'. $zip['Template']['Front'];
  9. $back = '_zip/_templates/_back/'. $zip['Template']['Back'];
  10.  
  11. if(strpos($_GET['url'], 'backend') !== false) {
  12. if(file_exists($back . '/')) {
  13. if(file_exists($back . '/index.php')) {
  14. ob_start();
  15. include($back . '/index.php');
  16. $this->tpl .= ob_get_contents();
  17. ob_end_clean();
  18. } else {
  19. if($zip['Template']['Front'] == 'Refresh/multi-page') {
  20. ob_start();
  21. include($back . '/404.php');
  22. $this->tpl .= ob_get_contents();
  23. ob_end_clean();
  24. } else {
  25. die(zipError('File Not Found', 'The file <b>' . secure($_GET['url']) . '</b> could not be found. Please re-check the URL; If you were directed here using a link, please report that link <b><a href="mailto:IntactDev@gmail.com">here<a/>.</b>'));
  26. }
  27. }
  28. } else {
  29. die(zipError('Template Not Found', 'The template <b>' . $zip['Template']['Front'] . '</b> could not be found. Please check your configuration file for a mistake.'));
  30. }
  31. } else {
  32. if(file_exists($front. '/')) {
  33. if(file_exists($front. '/' . secure($_GET['url']) . '.php')) {
  34. ob_start();
  35. include($front. '/' . secure($_GET['url']) . '.php');
  36. $this->tpl .= ob_get_contents();
  37. ob_end_clean();
  38. } else {
  39. if($zip['Template']['Front'] == 'Refresh/multi-page') {
  40. ob_start();
  41. include($front. '/404.php');
  42. $this->tpl .= ob_get_contents();
  43. ob_end_clean();
  44. } else {
  45. die(zipError('File Not Found', 'The file <b>' . secure($_GET['url']) . '</b> could not be found. Please re-check the URL; If you were directed here using a link, please report that link <b><a href="mailto:IntactDev@gmail.com">here<a/>.</b>'));
  46. }
  47. }
  48. } else {
  49. die(zipError('Template Not Found', 'The template <b>' . $zip['Template']['Front'] . '</b> could not be found. Please check your configuration file for a mistake.'));
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement