document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2.  
  3. /***************** DO NOT EDIT THIS FILE *************************
  4. ******************************************************************
  5.  
  6. INFORMATION:
  7. ------------
  8.  
  9. This is a core theme file, you should not need to edit
  10. this file directly. Code changes maybe lost during updates.
  11.  
  12. ------------------------------------------------------------------
  13.  
  14. ******************************************************************/
  15.  
  16. /* =============================================================================
  17. HAND FILE UPLOADS V7 // NOT PRETTY I KNOW :(
  18. ========================================================================== */
  19.  
  20. if(isset($_FILES['pptfileupload'])){
  21.  
  22. $path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
  23. $path_parts = pathinfo($path);
  24. $p = str_replace("wp-content","",$path_parts['dirname']);
  25. $p = str_replace("themes","",$p);
  26. $p = str_replace("PPT","",$p);
  27. $p = str_replace("directorypress","",$p);
  28. $p = str_replace("template_","",$p);
  29. $p = str_replace("\\\\\\\\","",$p);
  30. $p = str_replace("////","",$p);
  31. require( $p.'/wp-config.php' );
  32. $responce = premiumpress_upload($_FILES['pptfileupload']);
  33. echo $responce;
  34. die();
  35. }
  36.  
  37. global $PPT,$ThemeDesign, $PPTDesign, $user_ID, $userdata; get_currentuserinfo();
  38.  
  39. /* =============================================================================
  40. MOBILE DETECT
  41. ========================================================================== */
  42.  
  43. if(get_option('ppt_mobile') == 1 && $PPTMobile->_check() != false){
  44. die($PPTMobile->start());
  45. }
  46.  
  47. /* =============================================================================
  48. LOAD HOME PAGE
  49. ========================================================================== */
  50.  
  51. if(is_home() && !isset($_GET['s']) && !isset($_GET['search-class']) ){
  52.  
  53.  
  54. $GLOBALS['flag-home'] = 1; // sometimes WP doesnt always get the home page
  55.  
  56.  
  57. /* ================ LOAD TEMPLATE FILE =========================== */
  58. if(strtolower(PREMIUMPRESS_SYSTEM) == "shopperpress"){
  59. $DHOME = get_option("display_default_homepage");
  60. }else{ $DHOME = 0; }
  61.  
  62. $THEMEN = get_option('theme');
  63.  
  64.  
  65. $hookContent = premiumpress_pagecontent("homepage"); /* HOOK V7 */
  66.  
  67. if(strlen($hookContent) > 20 ){ // HOOK DISPLAYS CONTENT
  68.  
  69. get_header();
  70.  
  71. echo $hookContent;
  72.  
  73. get_footer();
  74.  
  75. }elseif(file_exists(str_replace("functions/","",THEME_PATH)."/themes/".$THEMEN."/_homepage.php") && $DHOME != 1 ){
  76.  
  77. include(str_replace("functions/","",THEME_PATH)."/themes/".$THEMEN.'/_homepage.php');
  78.  
  79. }else{
  80.  
  81. include("template_".strtolower(PREMIUMPRESS_SYSTEM)."/_homepage.php");
  82.  
  83. }
  84. }elseif( is_archive() && get_post_type() == 'article_type' ) {
  85. include("template_".strtolower(PREMIUMPRESS_SYSTEM)."/_archivepage.php");
  86. }
  87.  
  88. /* =============================================================================
  89. GALLERY PAGE - BUILD CUSTOM QUERY
  90. ========================================================================== */
  91.  
  92. elseif(!is_single() && !is_page() ){
  93.  
  94. $GLOBALS['GALLERYPAGE'] = 1; // set flag
  95. $query_string = $PPT->BuildSearchString($query_string);
  96.  
  97. if(strpos($query_string, "store=") === false) { }else{ }
  98. if(strpos($query_string, "taxonomy=article") === false && strpos($query_string, "article=") === false ) {
  99. if(strpos($query_string, "taxonomy=faq") === false && strpos($query_string, "faq=") === false) {
  100. }else{ $GLOBALS['setflag_faq']=1; }
  101. }else{ $GLOBALS['setflag_article']=1; } // STRIPS TYPE POST FOR ARTICLES
  102.  
  103.  
  104. /* =============================================================================
  105. CUSTOM QUERY (SHOULD REALLY BUILT NEW QUERY BUT WILL REUSE THIS ONE)
  106. ========================================================================== */
  107.  
  108. if(isset($GLOBALS['limitSearch']) && is_numeric($GLOBALS['limitSearch']) ){ $query_string .= "&posts_per_page=".$GLOBALS['limitSearch']; }
  109. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  110.  
  111. if( $_GET['total_post'] != '' ) {
  112.  
  113. $query_string .= "&posts_per_page=".$_GET['total_post'];
  114. }
  115. else {
  116.  
  117. $query_string .= "&posts_per_page=10";
  118. }
  119. $query_string = str_replace("Enter a keyword..","",$query_string); // removed default search box value
  120. $posts = query_posts($query_string."&paged=".$paged);
  121.  
  122. $GLOBALS['query_data'] = $posts;
  123. $GLOBALS['query_string'] = $query_string;
  124.  
  125. if(strpos($GLOBALS['query_string'], "tag=") !== false ) {
  126. $GLOBALS['tag_search'] = true;
  127. }
  128.  
  129. /* =============================================================================
  130. STORE THE TOTAL AMOUNT FOUND
  131. ========================================================================== */
  132.  
  133. $total_posts = (int) $wp_query->found_posts;
  134.  
  135. $GLOBALS['query_total'] = $total_posts;
  136. $GLOBALS['query_total_num'] = $total_posts;
  137.  
  138. /* ================ LOAD TEMPLATE FILE =========================== */
  139.  
  140.  
  141. $hookContent = premiumpress_pagecontent("gallerypage"); /* HOOK V7 */
  142.  
  143. if(strlen($hookContent) > 20 ){ // HOOK DISPLAYS CONTENT
  144.  
  145. get_header();
  146.  
  147. echo $hookContent;
  148.  
  149. get_footer();
  150.  
  151. }elseif(file_exists(str_replace("functions/","",THEME_PATH)."/themes/".get_option('theme')."/_gallerypage.php")){
  152.  
  153. include(str_replace("functions/","",THEME_PATH)."/themes/".get_option('theme').'/_gallerypage.php');
  154.  
  155. }else{
  156.  
  157. include("template_".strtolower(PREMIUMPRESS_SYSTEM)."/_gallerypage.php");
  158.  
  159. }
  160.  
  161. }
  162.  
  163. ?>
');