H6D Posted April 21, 2014 Share Posted April 21, 2014 (edited) I am working on a site for someone and altered the quick search widget (that came with the plugin) in the footer. It searches by country, which then populates states, which when chosen populates city choices. The only page it will function correctly is on the members page of the plugin. Will not work on any other page. Can someone please take a look at my code and see where I went wrong? wp_search_wiget_form.php Edited April 21, 2014 by H6D Quote Link to comment https://forums.phpfreaks.com/topic/287906-quick-search-widget/ Share on other sites More sharing options...
H6D Posted April 21, 2014 Author Share Posted April 21, 2014 <?php /* Copyright (C) www.DatingSolutions.biz - All Rights Reserved! Author - MyAllenMedia, LLC WordPress Dating Plugin contact@datingsolutions.biz */ global $wpdb; global $current_user; get_currentuserinfo(); $user_id=$current_user->ID; // print session USER_ID // table name $dsp_country_table = $wpdb->prefix .DSP_COUNTRY_TABLE; // table name global $wp_query; $page_id = $wp_query->post->ID; //fetch post query string id $posts_table = $wpdb->prefix ."posts"; $dsp_general_settings = $wpdb->prefix .DSP_GENERAL_SETTINGS_TABLE; $member_page_title_ID= $wpdb->get_row("SELECT setting_value FROM $dsp_general_settings WHERE setting_name='member_page_id'"); $member_pageid=$member_page_title_ID->setting_value; $post_page_title_ID= $wpdb->get_row("SELECT * FROM $posts_table WHERE ID='$member_pageid'"); $member_page_id=$post_page_title_ID->ID; // Print Site root link $root_link=get_bloginfo('url')."/".$post_page_title_ID->post_name."/"; $dsp_general_settings_table = $wpdb->prefix .DSP_GENERAL_SETTINGS_TABLE; $check_couples_mode= $wpdb->get_row("SELECT * FROM $dsp_general_settings_table WHERE setting_name = 'couples'"); ?> <?php // if member is login then this menu will be display if ( is_user_logged_in() ) { // CHECK MEMBER LOGIN ?> <form name="frmquicksearch" id="frmquicksearch" method="GET" action="<?php echo get_bloginfo('url');?>/<?php echo $post_page_title_ID->post_name?>"> <input type="hidden" name="pid" value="5" /> <input type="hidden" name="pagetitle" value="search_result" /> <? } else { ?> <form name="frmquicksearch" id="frmquicksearch" method="GET" action="<?php echo get_bloginfo('url');?>/<?php echo $post_page_title_ID->post_name?>"> <input type="hidden" name="pgurl" value="g_search_result" /> <? } ?> <input type="hidden" name="Pictues_only" value="P" /> <div class="sinder-bar-form"> <span><?=language_code('DSP_COUNTRY');?></span> <br> <select name="cmbCountry" id="cmbCountry_id"> <option value="0"><?=language_code('DSP_SELECT_COUNTRY');?></option> <?php $strCountries = $wpdb->get_results("SELECT * FROM $dsp_country_table ORDER BY country_id"); foreach ($strCountries as $rdoCountries) { echo "<option value='" . $rdoCountries->name . "' >" . $rdoCountries->name . "</option>"; } ?> </select> <br> <span><?=language_code('DSP_TEXT_STATE');?></span> <!--onChange="Show_state(this.value);"--> <div id="state_change"> <select name="cmbState" id="cmbState_id" style="width:110px;"> <option value="0"><?=language_code('DSP_SELECT_STATE');?></option> </select> </div> <!-- End City combo--> <span><?=language_code('DSP_CITY');?></span> <!--onChange="Show_state(this.value);"--> <div id="city_change"> <select name="cmbCity" id="cmbCity_id"> <option value="0"><?=language_code('DSP_SELECT_CITY');?></option> </select> </div> <!-- End city combo--> <p><input name="submit" type="submit" class="dsp_submit_button" value="<?=language_code('DSP_SEARCH_BUTTON');?>" /></p> </div> </form> Quote Link to comment https://forums.phpfreaks.com/topic/287906-quick-search-widget/#findComment-1476826 Share on other sites More sharing options...
QuickOldCar Posted April 22, 2014 Share Posted April 22, 2014 Is nothing obvious to me why it would. in wp-config.php you can either edit or add these lines to show errors and try to debug it. define('WP_DEBUG_DISPLAY', true);ini_set('display_errors',1); Quote Link to comment https://forums.phpfreaks.com/topic/287906-quick-search-widget/#findComment-1476896 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.