function delete_search()
 {
     global $config, $lang, $conn;
     require_once $config['basepath'] . '/include/misc.inc.php';
     $misc = new misc();
     $display = '';
     $status = login::loginCheck('Member');
     if ($status === true) {
         if (!isset($_GET['searchID'])) {
             $display .= '<a href="' . $config['baseurl'] . '/index.php">' . $lang['perhaps_you_were_looking_something_else'] . '</a>';
         } elseif ($_GET['searchID'] == '') {
             $display .= '<a href="' . $config['baseurl'] . '/index.php">' . $lang['perhaps_you_were_looking_something_else'] . '</a>';
         } elseif ($_GET['searchID'] != '') {
             $userID = $misc->make_db_safe($_SESSION['userID']);
             $searchID = $misc->make_db_safe($_GET['searchID']);
             $sql = "DELETE FROM " . $config['table_prefix'] . "usersavedsearches WHERE usersavedsearches_id = {$searchID} AND userdb_id = {$userID}";
             $recordSet = $conn->Execute($sql);
             if ($recordSet === false) {
                 $misc->log_error($sql);
             }
             $display .= "<br />{$lang['search_deleted_from_favorites']}";
             $display .= memberssearch::view_saved_searches();
             return $display;
         }
     } else {
         $display = $status;
     }
 }
예제 #2
0
 function replace_user_action()
 {
     global $lang, $config;
     require_once $config['basepath'] . '/include/login.inc.php';
     $login = new login();
     switch ($_GET['action']) {
         case 'index':
             $_GET['PageID'] = 1;
             require_once $config['basepath'] . '/include/page_display.inc.php';
             $search = new page_display();
             $data = $search->display();
             break;
         case 'member_login':
             $data = $login->display_login('Member');
             break;
         case 'search_step_2':
             require_once $config['basepath'] . '/include/search.inc.php';
             $search = new search_page();
             $data = $search->create_searchpage();
             break;
         case 'searchpage':
             require_once $config['basepath'] . '/include/search.inc.php';
             $search = new search_page();
             $data = $search->create_search_page_logic();
             break;
         case 'searchresults':
             require_once $config['basepath'] . '/include/search.inc.php';
             $search = new search_page();
             $data = $search->search_results();
             break;
         case 'listingview':
             require_once $config['basepath'] . '/include/listing.inc.php';
             $listing = new listing_pages();
             $data = $listing->listing_view();
             break;
         case 'addtofavorites':
             require_once $config['basepath'] . '/include/members_favorites.inc.php';
             $listing = new membersfavorites();
             $data = $listing->addtofavorites();
             break;
         case 'view_favorites':
             require_once $config['basepath'] . '/include/members_favorites.inc.php';
             $listing = new membersfavorites();
             $data = $listing->view_favorites();
             break;
         case 'view_saved_searches':
             require_once $config['basepath'] . '/include/members_search.inc.php';
             $listing = new memberssearch();
             $data = $listing->view_saved_searches();
             break;
         case 'save_search':
             require_once $config['basepath'] . '/include/members_search.inc.php';
             $listing = new memberssearch();
             $data = $listing->save_search();
             break;
         case 'delete_search':
             require_once $config['basepath'] . '/include/members_search.inc.php';
             $listing = new memberssearch();
             $data = $listing->delete_search();
             break;
         case 'delete_favorites':
             require_once $config['basepath'] . '/include/members_favorites.inc.php';
             $listing = new membersfavorites();
             $data = $listing->delete_favorites();
             break;
         case 'page_display':
             require_once $config['basepath'] . '/include/page_display.inc.php';
             $search = new page_display();
             $data = $search->display();
             break;
         case 'calculator':
             require_once $config['basepath'] . '/include/calculators.inc.php';
             $calc = new calculators();
             $data = $calc->start_calc();
             break;
         case 'view_listing_image':
             require_once $config['basepath'] . '/include/images.inc.php';
             $image = new image_handler();
             $data = $image->view_image('listing');
             break;
         case 'view_user_image':
             require_once $config['basepath'] . '/include/images.inc.php';
             $image = new image_handler();
             $data = $image->view_image('userimage');
             break;
         case 'rss_featured_listings':
             require_once $config['basepath'] . '/include/rss.inc.php';
             $rss = new rss();
             $data = $rss->rss_view('featured');
             break;
         case 'rss_lastmodified_listings':
             require_once $config['basepath'] . '/include/rss.inc.php';
             $rss = new rss();
             $data = $rss->rss_view('lastmodified');
             break;
         case 'view_user':
             require_once $config['basepath'] . '/include/user.inc.php';
             $user = new user();
             $data = $user->view_user();
             break;
         case 'view_users':
             require_once $config['basepath'] . '/include/user.inc.php';
             $user = new user();
             $data = $user->view_users();
             break;
         case 'edit_profile':
             require_once $config['basepath'] . '/include/user_manager.inc.php';
             if (!isset($_GET['user_id'])) {
                 $_GET['user_id'] = 0;
             }
             $user_managment = new user_managment();
             $data = $user_managment->edit_member_profile($_GET['user_id']);
             break;
         case 'signup':
             if (isset($_GET['type'])) {
                 require_once $config['basepath'] . '/include/user_manager.inc.php';
                 $listing = new user_managment();
                 $data = $listing->user_signup($_GET['type']);
             }
             break;
         case 'show_vtour':
             if (isset($_GET['listingID'])) {
                 require_once $config['basepath'] . '/include/vtour.inc.php';
                 $vtour = new vtours();
                 $data = $vtour->show_vtour($_GET['listingID']);
             } else {
                 $data = 'No Listing ID';
             }
             break;
         case 'contact_friend':
             require_once $config['basepath'] . '/include/contact.inc.php';
             $contact = new contact();
             if (isset($_GET['listing_id'])) {
                 $data = $contact->ContactFriendForm($_GET['listing_id']);
             }
             break;
         case 'contact_agent':
             require_once $config['basepath'] . '/include/contact.inc.php';
             $contact = new contact();
             if (isset($_GET['listing_id']) && isset($_GET['agent_id'])) {
                 $data = $contact->ContactAgentForm($_GET['listing_id'], $_GET['agent_id']);
             } elseif (isset($_GET['listing_id'])) {
                 $data = $contact->ContactAgentForm($_GET['listing_id'], 0);
             } elseif (isset($_GET['agent_id'])) {
                 $data = $contact->ContactAgentForm(0, $_GET['agent_id']);
             } else {
                 $data = '';
             }
             break;
         case 'create_vcard':
             require_once $config['basepath'] . '/include/user.inc.php';
             $user = new user();
             if (isset($_GET['user'])) {
                 $data = $user->create_vcard($_GET['user']);
             }
             break;
         case 'create_download':
             require_once $config['basepath'] . '/include/files.inc.php';
             $files = new file_handler();
             if (isset($_GET['ID']) && isset($_GET['file_id']) && isset($_GET['type'])) {
                 $data = $files->create_download($_GET['ID'], $_GET['file_id'], $_GET['type']);
             } elseif (isset($_POST['ID']) && isset($_POST['file_id']) && isset($_POST['type'])) {
                 $data = $files->create_download($_POST['ID'], $_POST['file_id'], $_POST['type']);
             }
             break;
         case 'blog_index':
             require_once $config['basepath'] . '/include/blog_display.inc.php';
             $blog = new blog_display();
             $data = $blog->disply_blog_index();
             break;
         case 'blog_view_article':
             require_once $config['basepath'] . '/include/blog_display.inc.php';
             $blog = new blog_display();
             $data = $blog->display();
             break;
         case 'verify_email':
             require_once $config['basepath'] . '/include/user_manager.inc.php';
             $user_manager = new user_managment();
             $data = $user_manager->verify_email();
             break;
         default:
             $addon_name = array();
             if (preg_match("/^addon_(.\\S*?)_.*/", $_GET['action'], $addon_name)) {
                 $file = $config['basepath'] . '/addons/' . $addon_name[1] . '/addon.inc.php';
                 if (file_exists($file)) {
                     include_once $file;
                     $function_name = $addon_name[1] . '_run_action_user_template';
                     $data = $function_name();
                 } else {
                     $data = $lang['addon_doesnt_exist'];
                 }
             } else {
                 $data = '';
             }
             break;
     }
     // End switch ($_GET['action'])
     return $data;
 }