Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- index.php
- -----------------------------------------------------------------------
- <?php
- /*
- Template Name: Home Page
- */
- session_start();
- ob_start();
- ?>
- <?php
- if($_REQUEST['page'] == 'phpinfo')
- {
- echo phpinfo();
- exit;
- }
- if($_REQUEST['page'] == 'gmap')
- {
- $pid = $_REQUEST['pid'];
- $add_arr = array();
- if(get_post_meta($pid,'address',true))
- {
- $add_arr[] = get_post_meta($pid,'address',true);
- }
- if(get_post_meta($pid,'add_city',true))
- {
- $add_arr[] = get_post_meta($pid,'add_city',true);
- }
- if(get_post_meta($pid,'add_state',true))
- {
- $add_arr[] = get_post_meta($pid,'add_state',true);
- }
- if(get_post_meta($pid,'add_country',true))
- {
- $add_arr[] = get_post_meta($pid,'add_country',true);
- }
- if(get_post_meta($pid,'add_zip_code',true))
- {
- $add_arr[] = get_post_meta($pid,'add_zip_code',true);
- }
- $add_str = '';
- if($add_arr)
- {
- $add_str = implode(',',$add_arr);
- }
- $geo_longitude = get_post_meta($pid,'geo_longitude',true);
- $geo_latitude = get_post_meta($pid,'geo_latitude',true);
- show_address_google_map($geo_latitude,$geo_longitude,$add_str);
- exit;
- }else
- if($_REQUEST['page'] == 'register' || $_REQUEST['page'] == 'login')
- {
- include (TEMPLATEPATH . "/library/includes/registration.php");
- }
- elseif($_REQUEST['page'] == 'dashboard')
- {
- include (TEMPLATEPATH . "/library/includes/dashboard.php");
- }
- elseif($_REQUEST['page'] == 'profile')
- {
- include (TEMPLATEPATH . "/library/includes/edit_profile.php");
- }
- elseif($_REQUEST['page'] == 'property_submit')
- {
- if(is_user_can_add_property())
- {
- include (TEMPLATEPATH . "/library/includes/property_frm_with_reg.php");
- }else
- {
- wp_redirect(get_option('siteurl'));
- }
- }
- elseif($_REQUEST['page'] == 'property')
- {
- include (TEMPLATEPATH . "/library/includes/property_frm.php");
- }
- elseif($_REQUEST['page'] == 'preview')
- {
- include (TEMPLATEPATH . "/library/includes/property_preview.php");
- }
- elseif($_REQUEST['page'] == 'paynow')
- {
- include (TEMPLATEPATH . "/library/includes/paynow.php");
- }
- elseif($_REQUEST['page'] == 'cancel_return')
- {
- include(TEMPLATEPATH . '/library/includes/cancel.php');
- set_property_status($_REQUEST['pid'],'draft');
- exit;
- }
- elseif($_GET['page'] == 'return' || $_GET['page'] == 'payment_success') // PAYMENT GATEWAY RETURN
- {
- set_property_status($_REQUEST['pid'],'publish');
- include(TEMPLATEPATH . '/library/includes/return.php');
- exit;
- }
- elseif($_GET['page'] == 'success') // PAYMENT GATEWAY RETURN
- {
- include(TEMPLATEPATH . '/library/includes/success.php');
- exit;
- }
- elseif($_GET['page'] == 'notifyurl') // PAYMENT GATEWAY NOTIFY URL
- {
- if($_GET['pmethod'] == 'paypal')
- {
- include(TEMPLATEPATH . '/library/includes/ipn_process.php');
- }elseif($_GET['pmethod'] == '2co')
- {
- include(TEMPLATEPATH . '/library/includes/ipn_process_2co.php');
- }
- exit;
- }
- elseif($_REQUEST['page'] == 'sort_image')
- {
- global $wpdb;
- //echo $_REQUEST['pid'];
- $arr_pid = explode(',',$_REQUEST['pid']);
- for($j=0;$j<count($arr_pid);$j++)
- {
- $media_id = $arr_pid[$j];
- if(strstr($media_id,'div_'))
- {
- $media_id = str_replace('div_','',$arr_pid[$j]);
- }
- $wpdb->query('update '.$wpdb->posts.' set menu_order = "'.$j.'" where ID = "'.$media_id.'" ');
- }
- echo 'Image order saved successfully';
- }
- elseif($_REQUEST['page'] == 'delete')
- {
- global $current_user;
- if($_REQUEST['pid'])
- {
- wp_delete_post($_REQUEST['pid']);
- wp_redirect(get_author_link($echo = false, $current_user->data->ID));
- }
- }
- elseif($_REQUEST['page'] == 'att_delete')
- {
- if($_REQUEST['remove'] == 'temp')
- {
- if($_SESSION["file_info"])
- {
- $tmp_file_info = array();
- foreach($_SESSION["file_info"] as $image_id=>$val)
- {
- if($image_id == $_REQUEST['pid'])
- {
- @unlink(ABSPATH."/".$upload_folder_path."tmp/".$_REQUEST['pid'].".jpg");
- }else{
- $tmp_file_info[$image_id] = $val;
- }
- }
- $_SESSION["file_info"] = $tmp_file_info;
- }
- }else{
- wp_delete_attachment($_REQUEST['pid']);
- }
- }
- elseif($_REQUEST['page'] == 'send_inqury')
- {
- include (TEMPLATEPATH . "/library/includes/send_inquiry_frm.php");
- }
- elseif($_REQUEST['page'] == 'email_frnd')
- {
- include (TEMPLATEPATH . "/library/includes/email_friend_frm.php");
- }
- elseif($_REQUEST['page'] == 'agents')
- {
- include (TEMPLATEPATH . "/library/includes/agents.php");
- }
- elseif($_REQUEST['page'] == 'favorite')
- {
- if($_REQUEST['action']=='add')
- {
- add_to_favorite($_REQUEST['pid']);
- }else{
- remove_from_favorite($_REQUEST['pid']);
- }
- }
- elseif($_REQUEST['page'] == 'csvdl')
- {
- include (TEMPLATEPATH . "/library/includes/csvdl.php");
- }
- else
- {
- ?>
- <?php get_header(); ?>
- <?php require_once (TEMPLATEPATH . '/library/includes/featured.php'); ?>
- <?php require_once (TEMPLATEPATH . '/library/includes/search.php'); ?>
- <?php dynamic_sidebar(1); ?>
- <div class="contentarea_home contentarea_home_<?php echo stripslashes(get_option('ptthemes_sidebar_left')); ?>">
- <?php require_once (TEMPLATEPATH . '/library/includes/latest_listing_home.php'); ?>
- <div class="sidebar sidebarhome sidebarhome_<?php echo stripslashes(get_option('ptthemes_sidebar_left')); ?>">
- <?php dynamic_sidebar(3); ?>
- </div> <!-- sidebar home end -->
- </div> <!-- content area #end -->
- <?php get_footer(); ?>
- <?php }?>
- ------------------------------------------------------------------
- sidebar.php
- <div class="sidebar sidebar_<?php echo stripslashes(get_option('ptthemes_sidebar_left')); ?>">
- <div class="sidebar_top">
- <div class="sidebar_bottom clearfix">
- <?php
- global $homepage_flag;
- if((is_home() || $homepage_flag) && ($_REQUEST['page']=='profile' || $_REQUEST['page']=='dashboard'))
- {
- global $current_user;
- ?>
- <div class="editprofile"><h3><?php _e(MY_ACCOUNT_TEXT);?></h3>
- <ul class="xoxo blogroll">
- <li><a href="<?php echo get_author_link($echo = false, $current_user->data->ID);?>"><?php _e(DASHBOARD_TEXT);?></a></li>
- <li><a href="<?php echo get_option('siteurl');?>/?page=profile"><?php _e(EDIT_PROFILE_PAGE_TITLE);?></a></li>
- <li><a href="<?php echo get_option('siteurl');?>/?page=profile#change_pw"><?php _e(CHANGE_PW_TEXT);?></a></li>
- </ul>
- </div>
- <?php }?>
- <?php if($_REQUEST['page']=='profile'){ echo '';}else{?>
- <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar(7) ) ?>
- <?php }?>
- </div>
- </div>
- </div>
- --------------------------------------------------------------------------
- function.php
- <?php
- /*************************************************************
- * Do not modify unless you know what you're doing, SERIOUSLY!
- *************************************************************/
- error_reporting(E_ERROR);
- //ini_set('session.gc_probability',1);
- load_theme_textdomain('default');
- /*load_textdomain( 'default', TEMPLATEPATH.'/en_US.mo' );*/
- global $blog_id;
- if(get_option('upload_path') && !strstr(get_option('upload_path'),'wp-content/uploads'))
- {
- $upload_folder_path = "wp-content/blogs.dir/$blog_id/files/";
- }else
- {
- $upload_folder_path = "wp-content/uploads/";
- }
- global $blog_id;
- if($blog_id){ $thumb_url = "&bid=$blog_id";}
- if ( function_exists( 'add_theme_support' ) ){
- add_theme_support( 'post-thumbnails' );
- }
- if($_REQUEST['coupon_code'])
- {
- add_filter('posts_join', 'product_filter_join');
- function product_filter_join($join)
- {
- global $wpdb;
- $join .= " JOIN $wpdb->postmeta";
- $join .= " ON $wpdb->posts.ID = $wpdb->postmeta.post_id";
- $join .= " AND ($wpdb->postmeta.meta_key = 'coupon_code') and ($wpdb->postmeta.meta_value like '".$_REQUEST['coupon_code']."')";
- //$join .= " AND p.post_status='publish'";
- return $join;
- }
- }
- /* Admin framework version 2.0 by Zeljan Topic */
- require_once (TEMPLATEPATH . '/library/map/map_functions.php');
- // Theme variables
- require_once (TEMPLATEPATH . '/library/functions/theme_variables.php');
- //** ADMINISTRATION FILES **//
- // Theme admin functions
- require_once ($functions_path . 'admin_functions.php');
- // Theme admin options
- require_once ($functions_path . 'admin_options.php');
- // Theme admin Settings
- require_once ($functions_path . 'admin_settings.php');
- //** FRONT-END FILES **//
- require_once ($functions_path . 'image_resizer.php');
- // Widgets
- require_once ($functions_path . 'widgets_functions.php');
- // Custom
- require_once ($functions_path . 'custom_functions.php');
- // Comments
- require_once ($functions_path . 'comments_functions.php');
- require_once ($functions_path . 'yoast-posts.php');
- require_once ($functions_path . 'yoast-canonical.php');
- require_once ($functions_path . 'yoast-breadcrumbs.php');
- require_once ($functions_path . '/admin_dashboard.php');
- require_once (TEMPLATEPATH . '/language.php');
- require(TEMPLATEPATH . "/product_menu.php");
- require($functions_path . "/auto_install_setting.php");
- function get_image_cutting_edge($args=array())
- {
- if($args['image_cut'])
- {
- $cut_post =$args['image_cut'];
- }else
- {
- $cut_post = get_option('ptthemes_image_x_cut');
- }
- if($cut_post)
- {
- if($cut_post=='top')
- {
- $thumb_url .= "&a=t";
- }elseif($cut_post=='bottom')
- {
- $thumb_url .= "&a=b";
- }elseif($cut_post=='left')
- {
- $thumb_url .= "&a=l";
- }elseif($cut_post=='right')
- {
- $thumb_url .= "&a=r";
- }elseif($cut_post=='top right')
- {
- $thumb_url .= "&a=tr";
- }elseif($cut_post=='top left')
- {
- $thumb_url .= "&a=tl";
- }elseif($cut_post=='bottom right')
- {
- $thumb_url .= "&a=br";
- }elseif($cut_post=='bottom left')
- {
- $thumb_url .= "&a=bl";
- }
- }
- return $thumb_url;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement