Changeset 1375946
- Timestamp:
- 03/21/2016 10:43:36 PM (10 years ago)
- Location:
- geodigs/trunk
- Files:
-
- 3 edited
-
Router.php (modified) (34 diffs)
-
readme.txt (modified) (3 diffs)
-
shortcodes/featured-group.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
geodigs/trunk/Router.php
r1368746 r1375946 7 7 class Router { 8 8 static $listings_page; 9 9 10 10 static function init() { 11 11 if ( !is_admin() ) { … … 30 30 static function display_page( $posts ) { 31 31 global $wp_query; 32 32 33 33 // Removes link from title and comment section 34 34 $wp_query->found_posts = 0; … … 37 37 $wp_query->is_home = null; 38 38 $wp_query->is_singular = 1; 39 39 40 40 // Get first post and save its details 41 41 $page_data = ''; 42 42 $post_id = time(); 43 43 44 44 // By default always show the footer ( disclaimers ) 45 45 $show_footer = true; 46 46 47 47 // Figure out what kind of page to display 48 48 if ( isset( $wp_query->query_vars['gd_action'] ) ) { … … 51 51 User::require_login( $_SERVER['REQUEST_URI'] ); 52 52 $show_footer = false; 53 53 54 54 ob_start(); 55 55 include GD_DIR_INCLUDES . 'account-home.php'; … … 62 62 ob_end_clean(); 63 63 break; 64 64 65 65 case 'account-settings': 66 66 User::require_login( $_SERVER['REQUEST_URI'] ); … … 68 68 $page_data = self::display_account_settings_page(); 69 69 break; 70 70 71 71 case 'add-favorite': 72 72 User::require_login( $_SERVER['REQUEST_URI'] ); 73 73 User::add_favorite( $_GET['listing_id'] ); 74 74 break; 75 75 76 76 case 'advanced-search': 77 77 $show_footer = false; … … 82 82 ); 83 83 break; 84 84 85 85 case 'delete-favorite': 86 86 User::require_login( $_SERVER['REQUEST_URI'] ); 87 87 User::delete_favorite( $_GET['listing_id'] ); 88 88 break; 89 89 90 90 case 'details': 91 91 if ( isset( $wp_query->query_vars['gd_listing_id'] ) ) { 92 92 $listing_id = $wp_query->query_vars['gd_listing_id']; 93 93 94 94 if ( isset( $_SESSION['gd_user'] ) || gd_under_detail_view_limit( $listing_id ) == true ) { 95 95 $listing = API::call( 'GET', 'listings/' . $listing_id ); … … 110 110 else { 111 111 $_SESSION['gd_redirect_url'] = $_SERVER['REQUEST_URI']; 112 112 113 113 ob_start(); 114 114 include GD_DIR_INCLUDES . 'detail-view-count-reached.php'; 115 115 116 116 $page_data = array( 117 117 'content' => ob_get_contents(), … … 123 123 } 124 124 break; 125 125 126 126 case 'download-document': 127 127 global $wpdb; 128 128 129 129 $id = $wp_query->query_vars['doc_id']; 130 130 $query = $wpdb->prepare( "SELECT CONCAT( fileName, '.', extension ) AS fileName, size FROM `gd_ds_files` WHERE id = %s", $id ); 131 131 $file = $wpdb->get_row( $query ); 132 132 133 133 header( 'Content-Type: application/octet-stream' ); 134 134 header( 'Content-Disposition: attachment; filename="' . $file->fileName . '"' ); … … 139 139 readfile( DocumentStore::$path . $file->fileName ); 140 140 exit; 141 141 142 142 case 'favorites': 143 143 User::require_login( $_SERVER['REQUEST_URI'] ); 144 144 $page_data = self::display_favorites_page(); 145 145 break; 146 146 147 147 case 'forgot-password': 148 148 // Logs out the user if they are logged in but doesn't redirect them to the home page … … 151 151 $page_data = self::display_forgot_password_page(); 152 152 break; 153 153 154 154 case 'home-worth': 155 155 $show_footer = false; 156 156 157 157 ob_start(); 158 158 include GD_DIR_INCLUDES . 'home-worth-form.php'; … … 165 165 ob_end_clean(); 166 166 break; 167 167 168 168 case 'listing-alerts': 169 169 User::require_login( $_SERVER['REQUEST_URI'] ); 170 170 171 171 ob_start(); 172 172 173 173 include GD_DIR_INCLUDES . 'listing-alerts.php'; 174 174 … … 178 178 'title' => $page_title, 179 179 ); 180 180 181 181 ob_end_clean(); 182 182 break; 183 183 184 184 case 'login': 185 185 $show_footer = false; 186 186 187 187 // Logs out the user if they are logged in but doesn't redirect them to the home page 188 188 User::log_out( false ); 189 189 $page_data = self::display_login_page(); 190 190 break; 191 191 192 192 case 'log-out': 193 193 User::log_out(); 194 194 break; 195 195 196 196 case 'more-info': 197 197 //User::require_login( $_SERVER['REQUEST_URI'] ); 198 198 199 199 ob_start(); 200 200 201 201 include GD_DIR_INCLUDES . 'more-info-form.php'; 202 202 … … 207 207 'title' => 'More Information', 208 208 ); 209 209 210 210 ob_end_clean(); 211 211 break; 212 212 213 213 case 'more-info-requested': 214 214 //User::require_login( $_SERVER['REQUEST_URI'] ); 215 215 216 216 ob_start(); 217 217 218 218 include GD_DIR_INCLUDES . 'more-info-requested.php'; 219 219 … … 224 224 'title' => 'Request Sent', 225 225 ); 226 226 227 227 ob_end_clean(); 228 228 break; 229 229 230 230 case 'our-listings': 231 231 $page_data = array( … … 235 235 ); 236 236 break; 237 237 238 238 case 'proxy-api': 239 239 header( 'Content-Type: application/json' ); 240 240 241 241 switch ( urldecode( $wp_query->query_vars['api_action'] ) ) { 242 242 case 'get-statuses': 243 243 echo json_encode( API::call( "GET", "listings/statuses" ) ); 244 244 exit; 245 245 246 246 case 'get-styles': 247 247 echo json_encode( API::call( "GET", "listings/styles" ) ); 248 248 exit; 249 249 250 250 case 'get-types': 251 251 echo json_encode( API::call( "GET", "listings/types" ) ); 252 252 exit; 253 253 254 254 case 'get-sort': 255 255 echo json_encode( API::call( "GET", "listings/sort" ) ); … … 257 257 } 258 258 break; 259 259 260 260 case 'search': 261 261 $results = API::call( 'GET', 'listings', $_GET ); 262 262 263 263 $page_data = self::display_search_results( $results ); 264 264 break; 265 265 266 266 case 'signup': 267 267 // Logs out the user if they are logged in but doesn't redirect them to the home page … … 282 282 } 283 283 break; 284 284 285 285 default: 286 286 // Do nothing 287 287 break; 288 288 } 289 289 290 290 // Get footer 291 291 if ( $show_footer ) { … … 321 321 return $posts; 322 322 } 323 323 324 324 private static function display_favorites_page() { 325 325 $results = API::call( 'GET', 'favorites' ); … … 327 327 $show_pagination = false; // "Favorites" doesn't have pages 328 328 $show_count = false; // "Favorites" doesn't have pages 329 329 330 330 // Begin output of page 331 331 ob_start(); 332 332 333 333 include_once GD_DIR_INCLUDES . 'listings-results.php'; 334 334 335 335 $page_data = array( 336 336 'content' => ob_get_contents(), … … 338 338 'title' => 'Favorites', 339 339 ); 340 340 341 341 ob_end_clean(); 342 342 return $page_data; 343 343 } 344 344 345 345 private static function display_account_settings_page() { 346 346 ob_start(); … … 348 348 $content = ob_get_contents(); 349 349 ob_end_clean(); 350 350 351 351 $page_data = array( 352 352 'content' => $content, … … 357 357 return $page_data; 358 358 } 359 359 360 360 private static function display_forgot_password_page() { 361 362 361 362 363 363 $errors = array(); 364 364 365 365 // Send API call and figure out what page to display 366 366 if ( $_POST['email'] ) { 367 367 $forgot_pw_request = API::call( 'GET', 'forgot/' . $_POST['email'] ); 368 368 369 369 if ( isset( $forgot_pw_request->error ) ) { 370 370 $page_type = 'form'; … … 378 378 $page_type = 'form'; 379 379 } 380 380 381 381 // Output HTML 382 382 ob_start(); 383 383 384 384 include_once GD_DIR_INCLUDES . 'forgot-password.php'; 385 385 386 386 $page_data = array( 387 387 'content' => ob_get_contents(), … … 393 393 return $page_data; 394 394 } 395 396 private static function display_signup_page( $errors = array() ) { 395 396 private static function display_signup_page( $errors = array() ) { 397 397 $title = 'Sign Up'; 398 398 $description = 'GeoDigs User Sign Up Page'; … … 404 404 false 405 405 ); 406 406 407 407 $page_data = array( 408 408 'content' => $content, … … 410 410 'title' => $title, 411 411 ); 412 413 return $page_data; 414 } 415 416 private static function display_signup_success_page() { 412 413 return $page_data; 414 } 415 416 private static function display_signup_success_page() { 417 417 $title = 'Success'; 418 418 $description = 'GeoDigs User Sign Up Success Page'; … … 422 422 false 423 423 ); 424 424 425 425 $page_data = array( 426 426 'content' => $content, … … 428 428 'title' => $title, 429 429 ); 430 431 return $page_data; 432 } 433 430 431 return $page_data; 432 } 433 434 434 private static function display_login_page() { 435 435 if ( isset( $_POST['email'] ) && isset( $_POST['password'] ) ) { 436 436 // Encrypt password 437 437 $_POST['password'] = sha1( $_POST['password'] . 'geodigs' ); 438 438 439 439 $login_request = API::call( 'POST', 'users/login', $_POST ); 440 440 if ( isset( $login_request->error ) ) { … … 448 448 } 449 449 } 450 450 451 451 private static function create_login_form( $error = null ) { 452 452 $content = Templates::load( … … 457 457 false 458 458 ); 459 459 460 460 $page_data = array( 461 461 'content' => $content, … … 470 470 // Save our search link 471 471 $_POST['results_url'] = $_SERVER['REQUEST_URI']; 472 472 473 473 // Begin output of page 474 474 ob_start(); 475 475 476 476 include_once GD_DIR_INCLUDES . 'listings-results.php'; 477 477 478 478 $page_data = array( 479 479 'content' => ob_get_contents(), … … 481 481 'title' => 'Search Results', 482 482 ); 483 483 484 484 ob_end_clean(); 485 485 return $page_data; … … 494 494 return $classes; 495 495 } 496 496 497 497 static function remove_comments( $path ){ 498 498 global $wp_query; -
geodigs/trunk/readme.txt
r1374236 r1375946 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 9 10 GeoDigs allows you to connect with clients and help them find the perfect home through MetroListand IRES IDX MLS solutions.10 GeoDigs allows you to connect with clients and help them find the perfect home through REcolorado and IRES IDX MLS solutions. 11 11 12 12 == Description == … … 45 45 3. Enter your Geodigs Agent ID and Geodigs Agent Code 46 46 47 *How to edit templates* 48 1. Navigate from the Wordpress install directory to ``/wp-content/plugins/geodigs/templates/`` 49 2. Choose the template you would like to edit 50 3. Copy the file and place it into `/geodigs/templates/` following the same folder structure as in the plugin templates folder 51 4. Edit and save! 52 53 Ex: the listings detail page 54 -- Copy `/wp-content/plugins/geodigs/templates/listings/details.php` to `/geodigs/templates/listings/details.php` 55 47 56 == Frequently Asked Questions == 48 57 … … 54 63 55 64 = How can I get help if I run into any problems with GeoDigs? = 56 As a local support from the Boulder/Erie area, you’ll receive personalized, direct help from the New Media One team at all times. We will recognize you by name, and take the time needed to answer any questions you might have. Call us at 303.828.9882, or visit our main page at http://www.newmediaone.net.65 As a local support from the Boulder/Erie area, you’ll receive personalized, direct help from the New Media One team at all times. We will recognize you by name, and take the time needed to answer any questions you might have. Call us at (303) 997-320, or visit our main page at http://www.newmediaone.net. 57 66 58 67 = What services are included with GeoDigs? = 59 Geodigs uses MetroListand IRES IDX/MLS that are integrated to provide combined search results that will update every 15 minutes.68 Geodigs uses REcolorado and IRES IDX/MLS that are integrated to provide combined search results that will update every 15 minutes. 60 69 61 70 == Screenshots == -
geodigs/trunk/shortcodes/featured-group.php
r1368746 r1375946 26 26 $data['orderBy'] = $order[0]; 27 27 $data['orderByDirection'] = $order[1]; 28 $data['featured'] = true; 28 29 $data['mlsNumbers'] = serialize( $mlsNumbers ); 29 30 unset( $data['properties'] );
Note: See TracChangeset
for help on using the changeset viewer.