Advertisement
sshuvro58

Untitled

Dec 23rd, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.68 KB | None | 0 0
  1. index.php
  2. -----------------------------------------------------------------------
  3. <?php
  4. /*
  5. Template Name: Home Page
  6. */
  7. session_start();
  8. ob_start();
  9. ?>
  10. <?php
  11. if($_REQUEST['page'] == 'phpinfo')
  12. {
  13. echo phpinfo();
  14. exit;
  15. }
  16. if($_REQUEST['page'] == 'gmap')
  17. {
  18. $pid = $_REQUEST['pid'];
  19. $add_arr = array();
  20. if(get_post_meta($pid,'address',true))
  21. {
  22. $add_arr[] = get_post_meta($pid,'address',true);
  23. }
  24. if(get_post_meta($pid,'add_city',true))
  25. {
  26. $add_arr[] = get_post_meta($pid,'add_city',true);
  27. }
  28. if(get_post_meta($pid,'add_state',true))
  29. {
  30. $add_arr[] = get_post_meta($pid,'add_state',true);
  31. }
  32. if(get_post_meta($pid,'add_country',true))
  33. {
  34. $add_arr[] = get_post_meta($pid,'add_country',true);
  35. }
  36. if(get_post_meta($pid,'add_zip_code',true))
  37. {
  38. $add_arr[] = get_post_meta($pid,'add_zip_code',true);
  39. }
  40. $add_str = '';
  41. if($add_arr)
  42. {
  43. $add_str = implode(',',$add_arr);
  44. }
  45. $geo_longitude = get_post_meta($pid,'geo_longitude',true);
  46. $geo_latitude = get_post_meta($pid,'geo_latitude',true);
  47. show_address_google_map($geo_latitude,$geo_longitude,$add_str);
  48. exit;
  49. }else
  50. if($_REQUEST['page'] == 'register' || $_REQUEST['page'] == 'login')
  51. {
  52. include (TEMPLATEPATH . "/library/includes/registration.php");
  53. }
  54. elseif($_REQUEST['page'] == 'dashboard')
  55. {
  56. include (TEMPLATEPATH . "/library/includes/dashboard.php");
  57. }
  58. elseif($_REQUEST['page'] == 'profile')
  59. {
  60. include (TEMPLATEPATH . "/library/includes/edit_profile.php");
  61. }
  62. elseif($_REQUEST['page'] == 'property_submit')
  63. {
  64. if(is_user_can_add_property())
  65. {
  66. include (TEMPLATEPATH . "/library/includes/property_frm_with_reg.php");
  67. }else
  68. {
  69. wp_redirect(get_option('siteurl'));
  70. }
  71. }
  72. elseif($_REQUEST['page'] == 'property')
  73. {
  74. include (TEMPLATEPATH . "/library/includes/property_frm.php");
  75. }
  76. elseif($_REQUEST['page'] == 'preview')
  77. {
  78. include (TEMPLATEPATH . "/library/includes/property_preview.php");
  79. }
  80. elseif($_REQUEST['page'] == 'paynow')
  81. {
  82. include (TEMPLATEPATH . "/library/includes/paynow.php");
  83. }
  84. elseif($_REQUEST['page'] == 'cancel_return')
  85. {
  86. include(TEMPLATEPATH . '/library/includes/cancel.php');
  87. set_property_status($_REQUEST['pid'],'draft');
  88. exit;
  89. }
  90. elseif($_GET['page'] == 'return' || $_GET['page'] == 'payment_success') // PAYMENT GATEWAY RETURN
  91. {
  92. set_property_status($_REQUEST['pid'],'publish');
  93. include(TEMPLATEPATH . '/library/includes/return.php');
  94. exit;
  95. }
  96. elseif($_GET['page'] == 'success') // PAYMENT GATEWAY RETURN
  97. {
  98. include(TEMPLATEPATH . '/library/includes/success.php');
  99. exit;
  100. }
  101. elseif($_GET['page'] == 'notifyurl') // PAYMENT GATEWAY NOTIFY URL
  102. {
  103. if($_GET['pmethod'] == 'paypal')
  104. {
  105. include(TEMPLATEPATH . '/library/includes/ipn_process.php');
  106. }elseif($_GET['pmethod'] == '2co')
  107. {
  108. include(TEMPLATEPATH . '/library/includes/ipn_process_2co.php');
  109. }
  110. exit;
  111. }
  112. elseif($_REQUEST['page'] == 'sort_image')
  113. {
  114. global $wpdb;
  115. //echo $_REQUEST['pid'];
  116. $arr_pid = explode(',',$_REQUEST['pid']);
  117. for($j=0;$j<count($arr_pid);$j++)
  118. {
  119. $media_id = $arr_pid[$j];
  120. if(strstr($media_id,'div_'))
  121. {
  122. $media_id = str_replace('div_','',$arr_pid[$j]);
  123. }
  124. $wpdb->query('update '.$wpdb->posts.' set menu_order = "'.$j.'" where ID = "'.$media_id.'" ');
  125. }
  126. echo 'Image order saved successfully';
  127. }
  128. elseif($_REQUEST['page'] == 'delete')
  129. {
  130. global $current_user;
  131. if($_REQUEST['pid'])
  132. {
  133. wp_delete_post($_REQUEST['pid']);
  134. wp_redirect(get_author_link($echo = false, $current_user->data->ID));
  135. }
  136.  
  137. }
  138. elseif($_REQUEST['page'] == 'att_delete')
  139. {
  140. if($_REQUEST['remove'] == 'temp')
  141. {
  142.  
  143. if($_SESSION["file_info"])
  144. {
  145. $tmp_file_info = array();
  146. foreach($_SESSION["file_info"] as $image_id=>$val)
  147. {
  148. if($image_id == $_REQUEST['pid'])
  149. {
  150. @unlink(ABSPATH."/".$upload_folder_path."tmp/".$_REQUEST['pid'].".jpg");
  151. }else{
  152. $tmp_file_info[$image_id] = $val;
  153. }
  154.  
  155. }
  156. $_SESSION["file_info"] = $tmp_file_info;
  157. }
  158.  
  159.  
  160. }else{
  161. wp_delete_attachment($_REQUEST['pid']);
  162. }
  163. }
  164. elseif($_REQUEST['page'] == 'send_inqury')
  165. {
  166. include (TEMPLATEPATH . "/library/includes/send_inquiry_frm.php");
  167. }
  168. elseif($_REQUEST['page'] == 'email_frnd')
  169. {
  170. include (TEMPLATEPATH . "/library/includes/email_friend_frm.php");
  171. }
  172. elseif($_REQUEST['page'] == 'agents')
  173. {
  174. include (TEMPLATEPATH . "/library/includes/agents.php");
  175. }
  176. elseif($_REQUEST['page'] == 'favorite')
  177. {
  178. if($_REQUEST['action']=='add')
  179. {
  180. add_to_favorite($_REQUEST['pid']);
  181. }else{
  182. remove_from_favorite($_REQUEST['pid']);
  183. }
  184. }
  185.  
  186. elseif($_REQUEST['page'] == 'csvdl')
  187. {
  188.  
  189. include (TEMPLATEPATH . "/library/includes/csvdl.php");
  190. }
  191. else
  192. {
  193. ?>
  194. <?php get_header(); ?>
  195. <?php require_once (TEMPLATEPATH . '/library/includes/featured.php'); ?>
  196. <?php require_once (TEMPLATEPATH . '/library/includes/search.php'); ?>
  197. <?php dynamic_sidebar(1); ?>
  198.  
  199. <div class="contentarea_home contentarea_home_<?php echo stripslashes(get_option('ptthemes_sidebar_left')); ?>">
  200. <?php require_once (TEMPLATEPATH . '/library/includes/latest_listing_home.php'); ?>
  201. <div class="sidebar sidebarhome sidebarhome_<?php echo stripslashes(get_option('ptthemes_sidebar_left')); ?>">
  202. <?php dynamic_sidebar(3); ?>
  203. </div> <!-- sidebar home end -->
  204. </div> <!-- content area #end -->
  205. <?php get_footer(); ?>
  206. <?php }?>
  207.  
  208. ------------------------------------------------------------------
  209. sidebar.php
  210.  
  211. <div class="sidebar sidebar_<?php echo stripslashes(get_option('ptthemes_sidebar_left')); ?>">
  212. <div class="sidebar_top">
  213. <div class="sidebar_bottom clearfix">
  214.  
  215. <?php
  216. global $homepage_flag;
  217. if((is_home() || $homepage_flag) && ($_REQUEST['page']=='profile' || $_REQUEST['page']=='dashboard'))
  218. {
  219. global $current_user;
  220. ?>
  221. <div class="editprofile"><h3><?php _e(MY_ACCOUNT_TEXT);?></h3>
  222. <ul class="xoxo blogroll">
  223. <li><a href="<?php echo get_author_link($echo = false, $current_user->data->ID);?>"><?php _e(DASHBOARD_TEXT);?></a></li>
  224. <li><a href="<?php echo get_option('siteurl');?>/?page=profile"><?php _e(EDIT_PROFILE_PAGE_TITLE);?></a></li>
  225. <li><a href="<?php echo get_option('siteurl');?>/?page=profile#change_pw"><?php _e(CHANGE_PW_TEXT);?></a></li>
  226. </ul>
  227. </div>
  228. <?php }?>
  229.  
  230. <?php if($_REQUEST['page']=='profile'){ echo '';}else{?>
  231. <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar(7) ) ?>
  232. <?php }?>
  233. </div>
  234. </div>
  235. </div>
  236.  
  237. --------------------------------------------------------------------------
  238. function.php
  239.  
  240. <?php
  241. /*************************************************************
  242. * Do not modify unless you know what you're doing, SERIOUSLY!
  243. *************************************************************/
  244. error_reporting(E_ERROR);
  245. //ini_set('session.gc_probability',1);
  246.  
  247. load_theme_textdomain('default');
  248. /*load_textdomain( 'default', TEMPLATEPATH.'/en_US.mo' );*/
  249.  
  250. global $blog_id;
  251. if(get_option('upload_path') && !strstr(get_option('upload_path'),'wp-content/uploads'))
  252. {
  253. $upload_folder_path = "wp-content/blogs.dir/$blog_id/files/";
  254. }else
  255. {
  256. $upload_folder_path = "wp-content/uploads/";
  257. }
  258. global $blog_id;
  259. if($blog_id){ $thumb_url = "&amp;bid=$blog_id";}
  260.  
  261. if ( function_exists( 'add_theme_support' ) ){
  262. add_theme_support( 'post-thumbnails' );
  263. }
  264.  
  265. if($_REQUEST['coupon_code'])
  266. {
  267. add_filter('posts_join', 'product_filter_join');
  268. function product_filter_join($join)
  269. {
  270. global $wpdb;
  271.  
  272. $join .= " JOIN $wpdb->postmeta";
  273. $join .= " ON $wpdb->posts.ID = $wpdb->postmeta.post_id";
  274. $join .= " AND ($wpdb->postmeta.meta_key = 'coupon_code') and ($wpdb->postmeta.meta_value like '".$_REQUEST['coupon_code']."')";
  275. //$join .= " AND p.post_status='publish'";
  276. return $join;
  277. }
  278. }
  279.  
  280. /* Admin framework version 2.0 by Zeljan Topic */
  281.  
  282. require_once (TEMPLATEPATH . '/library/map/map_functions.php');
  283.  
  284. // Theme variables
  285. require_once (TEMPLATEPATH . '/library/functions/theme_variables.php');
  286.  
  287. //** ADMINISTRATION FILES **//
  288.  
  289. // Theme admin functions
  290. require_once ($functions_path . 'admin_functions.php');
  291.  
  292. // Theme admin options
  293. require_once ($functions_path . 'admin_options.php');
  294.  
  295. // Theme admin Settings
  296. require_once ($functions_path . 'admin_settings.php');
  297.  
  298.  
  299. //** FRONT-END FILES **//
  300. require_once ($functions_path . 'image_resizer.php');
  301.  
  302. // Widgets
  303. require_once ($functions_path . 'widgets_functions.php');
  304.  
  305. // Custom
  306. require_once ($functions_path . 'custom_functions.php');
  307.  
  308. // Comments
  309. require_once ($functions_path . 'comments_functions.php');
  310.  
  311. require_once ($functions_path . 'yoast-posts.php');
  312. require_once ($functions_path . 'yoast-canonical.php');
  313. require_once ($functions_path . 'yoast-breadcrumbs.php');
  314.  
  315.  
  316. require_once ($functions_path . '/admin_dashboard.php');
  317. require_once (TEMPLATEPATH . '/language.php');
  318.  
  319. require(TEMPLATEPATH . "/product_menu.php");
  320.  
  321. require($functions_path . "/auto_install_setting.php");
  322.  
  323. function get_image_cutting_edge($args=array())
  324. {
  325. if($args['image_cut'])
  326. {
  327. $cut_post =$args['image_cut'];
  328. }else
  329. {
  330. $cut_post = get_option('ptthemes_image_x_cut');
  331. }
  332. if($cut_post)
  333. {
  334. if($cut_post=='top')
  335. {
  336. $thumb_url .= "&amp;a=t";
  337. }elseif($cut_post=='bottom')
  338. {
  339. $thumb_url .= "&amp;a=b";
  340. }elseif($cut_post=='left')
  341. {
  342. $thumb_url .= "&amp;a=l";
  343. }elseif($cut_post=='right')
  344. {
  345. $thumb_url .= "&amp;a=r";
  346. }elseif($cut_post=='top right')
  347. {
  348. $thumb_url .= "&amp;a=tr";
  349. }elseif($cut_post=='top left')
  350. {
  351. $thumb_url .= "&amp;a=tl";
  352. }elseif($cut_post=='bottom right')
  353. {
  354. $thumb_url .= "&amp;a=br";
  355. }elseif($cut_post=='bottom left')
  356. {
  357. $thumb_url .= "&amp;a=bl";
  358. }
  359. }
  360. return $thumb_url;
  361. }
  362. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement