Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /***************** DO NOT EDIT THIS FILE *************************
- ******************************************************************
- INFORMATION:
- ------------
- This is a core theme file, you should not need to edit
- this file directly. Code changes maybe lost during updates.
- ------------------------------------------------------------------
- ******************************************************************/
- /* =============================================================================
- HAND FILE UPLOADS V7 // NOT PRETTY I KNOW :(
- ========================================================================== */
- if(isset($_FILES['pptfileupload'])){
- $path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
- $path_parts = pathinfo($path);
- $p = str_replace("wp-content","",$path_parts['dirname']);
- $p = str_replace("themes","",$p);
- $p = str_replace("PPT","",$p);
- $p = str_replace("directorypress","",$p);
- $p = str_replace("template_","",$p);
- $p = str_replace("\\\\","",$p);
- $p = str_replace("////","",$p);
- require( $p.'/wp-config.php' );
- $responce = premiumpress_upload($_FILES['pptfileupload']);
- echo $responce;
- die();
- }
- global $PPT,$ThemeDesign, $PPTDesign, $user_ID, $userdata; get_currentuserinfo();
- /* =============================================================================
- MOBILE DETECT
- ========================================================================== */
- if(get_option('ppt_mobile') == 1 && $PPTMobile->_check() != false){
- die($PPTMobile->start());
- }
- /* =============================================================================
- LOAD HOME PAGE
- ========================================================================== */
- if(is_home() && !isset($_GET['s']) && !isset($_GET['search-class']) ){
- $GLOBALS['flag-home'] = 1; // sometimes WP doesnt always get the home page
- /* ================ LOAD TEMPLATE FILE =========================== */
- if(strtolower(PREMIUMPRESS_SYSTEM) == "shopperpress"){
- $DHOME = get_option("display_default_homepage");
- }else{ $DHOME = 0; }
- $THEMEN = get_option('theme');
- $hookContent = premiumpress_pagecontent("homepage"); /* HOOK V7 */
- if(strlen($hookContent) > 20 ){ // HOOK DISPLAYS CONTENT
- get_header();
- echo $hookContent;
- get_footer();
- }elseif(file_exists(str_replace("functions/","",THEME_PATH)."/themes/".$THEMEN."/_homepage.php") && $DHOME != 1 ){
- include(str_replace("functions/","",THEME_PATH)."/themes/".$THEMEN.'/_homepage.php');
- }else{
- include("template_".strtolower(PREMIUMPRESS_SYSTEM)."/_homepage.php");
- }
- }elseif( is_archive() && get_post_type() == 'article_type' ) {
- include("template_".strtolower(PREMIUMPRESS_SYSTEM)."/_archivepage.php");
- }
- /* =============================================================================
- GALLERY PAGE - BUILD CUSTOM QUERY
- ========================================================================== */
- elseif(!is_single() && !is_page() ){
- $GLOBALS['GALLERYPAGE'] = 1; // set flag
- $query_string = $PPT->BuildSearchString($query_string);
- if(strpos($query_string, "store=") === false) { }else{ }
- if(strpos($query_string, "taxonomy=article") === false && strpos($query_string, "article=") === false ) {
- if(strpos($query_string, "taxonomy=faq") === false && strpos($query_string, "faq=") === false) {
- }else{ $GLOBALS['setflag_faq']=1; }
- }else{ $GLOBALS['setflag_article']=1; } // STRIPS TYPE POST FOR ARTICLES
- /* =============================================================================
- CUSTOM QUERY (SHOULD REALLY BUILT NEW QUERY BUT WILL REUSE THIS ONE)
- ========================================================================== */
- if(isset($GLOBALS['limitSearch']) && is_numeric($GLOBALS['limitSearch']) ){ $query_string .= "&posts_per_page=".$GLOBALS['limitSearch']; }
- $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- if( $_GET['total_post'] != '' ) {
- $query_string .= "&posts_per_page=".$_GET['total_post'];
- }
- else {
- $query_string .= "&posts_per_page=10";
- }
- $query_string = str_replace("Enter a keyword..","",$query_string); // removed default search box value
- $posts = query_posts($query_string."&paged=".$paged);
- $GLOBALS['query_data'] = $posts;
- $GLOBALS['query_string'] = $query_string;
- if(strpos($GLOBALS['query_string'], "tag=") !== false ) {
- $GLOBALS['tag_search'] = true;
- }
- /* =============================================================================
- STORE THE TOTAL AMOUNT FOUND
- ========================================================================== */
- $total_posts = (int) $wp_query->found_posts;
- $GLOBALS['query_total'] = $total_posts;
- $GLOBALS['query_total_num'] = $total_posts;
- /* ================ LOAD TEMPLATE FILE =========================== */
- $hookContent = premiumpress_pagecontent("gallerypage"); /* HOOK V7 */
- if(strlen($hookContent) > 20 ){ // HOOK DISPLAYS CONTENT
- get_header();
- echo $hookContent;
- get_footer();
- }elseif(file_exists(str_replace("functions/","",THEME_PATH)."/themes/".get_option('theme')."/_gallerypage.php")){
- include(str_replace("functions/","",THEME_PATH)."/themes/".get_option('theme').'/_gallerypage.php');
- }else{
- include("template_".strtolower(PREMIUMPRESS_SYSTEM)."/_gallerypage.php");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement