Title: omegacoder's Replies | WordPress.org

---

# omegacoder

  [  ](https://wordpress.org/support/users/omegacoder/)

 *   [Profile](https://wordpress.org/support/users/omegacoder/)
 *   [Topics Started](https://wordpress.org/support/users/omegacoder/topics/)
 *   [Replies Created](https://wordpress.org/support/users/omegacoder/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/omegacoder/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/omegacoder/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/omegacoder/engagements/)
 *   [Favorites](https://wordpress.org/support/users/omegacoder/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 54 total)

1 [2](https://wordpress.org/support/users/omegacoder/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/omegacoder/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/omegacoder/replies/page/4/?output_format=md)
[→](https://wordpress.org/support/users/omegacoder/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Inactive User Deleter] plugin doesn't delete any users when "delete all marked users" is selected](https://wordpress.org/support/topic/plugin-doesnt-delete-any-users-when-delete-all-marked-users-is-selected/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-doesnt-delete-any-users-when-delete-all-marked-users-is-selected/#post-3406231)
 * ok, I replaced “wpmu_delete_user” with “wpmu_delete_user” roughly located at 
   line 135 in “inactive-user-deleter.php and it worked!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] all comment types appearing on individual events categories list page](https://wordpress.org/support/topic/all-comment-types-appearing-on-individual-events-categories-list-page/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/all-comment-types-appearing-on-individual-events-categories-list-page/#post-3281103)
 * thanks for the tip, although I took the quick fix dirty hack way and used the
   depreated is_taxonomy(‘event-categories’)
 * I’ve used it to test whether the user is visiting an event cateory page, and 
   if so don’t display any comments or pings at all (I don’t want any comments appearing
   on individual event category pages, wouldn’t make much sense) e.g.
 *     ```
       if(!is_taxonomy('event-cateories')):
   
       // continue to display comments, pings etc
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] all comment types appearing on individual events categories list page](https://wordpress.org/support/topic/all-comment-types-appearing-on-individual-events-categories-list-page/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/all-comment-types-appearing-on-individual-events-categories-list-page/#post-3281042)
 * I tried this on a new test install with only buddypress and events manager plugin
   installed and am having the same issue. in this way, i’ve tested on the default
   buddypress theme. as this only happens on individual event category pages
 * perhaps can someone can set something up to check that this isn’t an events manager
   plugin. and in the case it isn’t and a problem with my own site, where abouts
   should I look into the code to resolve type of problem? I’ve had a quick look
   and I think the meat of the code is in the wordpress core
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] all comment types appearing on individual events categories list page](https://wordpress.org/support/topic/all-comment-types-appearing-on-individual-events-categories-list-page/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/all-comment-types-appearing-on-individual-events-categories-list-page/#post-3281006)
 * im using wordpress 3.42 on multisite and events manager 5.29
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] events listings search filter – restrict filter options](https://wordpress.org/support/topic/events-listings-search-filter-restrict-filter-options/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/events-listings-search-filter-restrict-filter-options/#post-3270660)
 * ok, I just found out the cause of my problem. two reasons
 * problem of english locations appearing on my subsite (chinese)
    1) I was posting
   english name locations on my subsite (chinese). once I removed these, the english
   locations names were gone
 * repeat of same location names, e.g. i had two 北京 locations appearing in the
   search filter.
    2)i noticed that one of them had a spacing prefix infront which
   meant the SQL query counted it as two distinct results, i.e. i had “北京” and”
   北京” in the database entry for location_town. i.e in the query:
 * SELECT DISTINCT location_town FROM “.EM_LOCATIONS_TABLE.” WHERE location_town
   IS NOT NULL AND location_town != ” AND location_country=%s $cond AND location_status
   =1 ORDER BY location_town
 * as you can see, the query will not count the above two locations as the distinct,
   hence they will both show up in the location town search filter field.
 * therefore when posting new locations, have to double check that no prefix spacing
   is included before approving events as the system will not do it for you
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] events listings search filter – restrict filter options](https://wordpress.org/support/topic/events-listings-search-filter-restrict-filter-options/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/events-listings-search-filter-restrict-filter-options/#post-3270658)
 * thanks. i hadn’t touched these settings previously as they seemed to make sense
   for my requirements.
 * it’s strange that on my main site (english), it only shows towns/cities created
   on that site, however for my subsite (chinese), it will show both cities/towns
   from this subsite and those from main site (english)
 * I don’t know what to do from here. what do you think I should do to resolve this
   issue?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] events listings search filter – restrict filter options](https://wordpress.org/support/topic/events-listings-search-filter-restrict-filter-options/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/events-listings-search-filter-restrict-filter-options/#post-3270650)
 * I’ve got events manager installed as a network with the following multisite options
   on events manager on wp-admin/network:
 * Enable global tables mode? N
 * Display global locations on main blog? N
 * not sure by what you mean by checking locations on main blog?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] how to create a search filter for locations](https://wordpress.org/support/topic/how-to-create-a-search-filter-for-locations/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/how-to-create-a-search-filter-for-locations/#post-3221641)
 * ok, here is the solution I used. Users can search for locations name, address
   and town:
    ** in classes/em-locations.php, I added two functions:
 *     ```
       function search_locations($q){
       			global $wpdb;
       			$q = rawurldecode($q);
   
       			$results = array();
   
       				$location_cond = (is_user_logged_in() && !current_user_can('read_others_locations')) ? "AND location_owner=".get_current_user_id() : '';
       				if( !is_user_logged_in() && get_option('dbem_events_anonymous_submissions') ){
       					if( !user_can(get_option('dbem_events_anonymous_user'),'read_private_locations') ){
       						$location_cond = " AND location_private=0";
       					}
       				}elseif( is_user_logged_in() && !current_user_can('read_private_locations') ){
       				    $location_cond = " AND location_private=0";
       				}elseif( !is_user_logged_in() ){
       					$location_cond = " AND location_private=0";
       				}
       				$term = (isset($_REQUEST['term'])) ? '%'.$_REQUEST['term'].'%' : '%'.$q.'%';
       				$sql = $wpdb->prepare("
       					SELECT
       						location_id AS <code>id</code>,
       						Concat( location_name )  AS <code>label</code>,
       						location_name AS <code>value</code>,
       						location_address AS <code>address</code>,
       						location_town AS <code>town</code>,
       						location_state AS <code>state</code>,
       						location_region AS <code>region</code>,
       						location_postcode AS <code>postcode</code>,
       						location_country AS <code>country</code>,
       						location_slug AS <code>slug</code>
       					FROM ".EM_LOCATIONS_TABLE."
       					WHERE ( <code>location_name</code> LIKE %s || <code>location_address</code> LIKE %s || <code>location_town</code> LIKE %s) AND location_status=1 $location_cond LIMIT 30
       				", $term, $term, $term);
       				$results_obj = $wpdb->get_results($sql);
   
       				// convert results from object to array type
       				$results_arr = self::toArray($results_obj);
   
       				return $results_arr;
   
       	}
   
       	  // convert results from object to array type
       	  function toArray($obj) {
       		if(is_object($obj)) $obj = (array) $obj;
       		if(is_array($obj)) {
       		  $new = array();
       		  foreach($obj as $key => $val) {
       			$new[$key] = self::toArray($val);
       		  }
       		}
       		else {
       		  $new = $obj;
       		}
       		return $new;
       	  }
       ```
   
 * **and in templates/templates/locations-list.php, I added the following code:**
 *     ```
       <form id="locations-dir-search" method="get" action="<?php echo site_url();?>/events/locations/">
       <input type="hidden" name="action" value="search_locations" />
       search locations <input type="text" id="locations_search" name="q" onblur="if(this.value=='')this.value='venue name, address, city'" onfocus="if(this.value=='venue name, address, city')this.value=''" value="venue name, address, city" />
       <input type="submit" value="search" />
       </form>
       <?php
       // if user searchs for location
       if( !empty($_REQUEST['action']) && $_REQUEST['action'] == "search_locations" && (!empty($_REQUEST['q'])) ){
       	//$q = rawurlencode($_REQUEST['q']);
       	$q = $_REQUEST['q'];
       	//print_r('<pre>');print_r( EM_Locations::search_locations($q) ); print_r('</pre>');
       	$locations = EM_Locations::search_locations($q);
       	if(!empty($locations))
       	{
       		for($i=0; $i<count($locations); $i++) {
       			echo '<a href="'.site_url().'/events/locations/'.$locations[$i]['slug'].'">'.$locations[$i]['value'] . '</a> ' . $locations[$i]['address'] . '<br/>';
       		}
       	}else{
       		echo 'No Locations';
       	}
       }else { // display default results of location list
       	echo EM_Locations::output(apply_filters('em_content_locations_args', $args));
       }
       ```
   
 * **Although, I didn’t have time to include the pagination feature that’s included
   in the EM_Locations:output function, and I simply limited the results to 30. 
   Perhaps someone will have the time to post solution here**
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] chinese translations for events manager plugin](https://wordpress.org/support/topic/chinese-translations-for-events-manager-plugin/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/chinese-translations-for-events-manager-plugin/#post-3228128)
 * I found that the problem was with using qTranslate, as there was some conflicts.
   I fixed thid and posted solution in another post earlier on. thanks for you help!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] upgraded to version 5.2.9 and {no_image}{/no_image} not working](https://wordpress.org/support/topic/upgraded-to-version-529-and-no_imageno_image-not-working/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/upgraded-to-version-529-and-no_imageno_image-not-working/#post-3190419)
 * thanks it is working now! thanks alot
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] some strings in Chinese translation .po file don't work](https://wordpress.org/support/topic/some-strings-in-chinese-translation-po-file-dont-work/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/some-strings-in-chinese-translation-po-file-dont-work/page/3/#post-3193292)
 * Anyway to get events manager plugin 5.3 translation files to with qTranslate 
   activated, you can try the following:
 * Replaced some code in plugins/events-manager/events-manager.php, on line 377:
 * replace:
 * load_plugin_textdomain(‘dbem’, false, dirname( plugin_basename( __FILE__ ) ).’/
   includes/langs’);
 * with:
 * if ( function_exists(‘qtrans_getLanguage’) ) { $locale = qtrans_getLanguage();
   load_textdomain(‘dbem’, realpath(dirname(__FILE__) . ‘/../..’) . ‘/plugins/events-
   manager/includes/langs/dbem-‘ . $locale . ‘.mo’); }
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] some strings in Chinese translation .po file don't work](https://wordpress.org/support/topic/some-strings-in-chinese-translation-po-file-dont-work/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/some-strings-in-chinese-translation-po-file-dont-work/page/2/#post-3193289)
 * I’ve discovered that the qTranslate plugin I’m using is causing the problem.
 * when i visited the url:
    **[http://www.mywebsite.com/zh/members/admin/events/my-events/?action=edit](http://www.mywebsite.com/zh/members/admin/events/my-events/?action=edit)**
   it works, however, when I use the proper url on my subsite: **[http://www.mywebsite.com/cn/members/admin/events/my-events/?action=edit](http://www.mywebsite.com/cn/members/admin/events/my-events/?action=edit)**
   the chinese translation don’t work using **[http://www.mywebsitecom/cn/zh/members/admin/events/my-events/?action=edit](http://www.mywebsitecom/cn/zh/members/admin/events/my-events/?action=edit)**
   works also
 * When I disable the qTranslate plugin then the chinese translation works. I find
   this strange since my other plugins language files work fine qTranslate activated,
   but events manager language translation seem to get intefered with qTranslate
   activated. So all along qTranslate was giving me problems in what should be a
   simple use of .po, .mo translation files!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] some strings in Chinese translation .po file don't work](https://wordpress.org/support/topic/some-strings-in-chinese-translation-po-file-dont-work/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/some-strings-in-chinese-translation-po-file-dont-work/page/2/#post-3193288)
 * I’ve updated to version 5.3 and I’ve checked the chinese translation .po file
   and it does contain the translations I need. However, the events manager plugin
   text on my website is still in english. My other plugins are displaying in chinese
   including buddypress, some custom plugins etc, so it’s just events manager plugin
   translations that is giving me problems
 * I’ve been trying several things including:
 * regenerating the .mo file
    making sure the plugin domain is ‘dbem’ in my translations(
   although I don’t believe I need to change any of this since they are from events
   manager 5.3 as is the .op, .mo files
 * do you know what could be the issue causing this?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] chinese translations for events manager plugin](https://wordpress.org/support/topic/chinese-translations-for-events-manager-plugin/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/chinese-translations-for-events-manager-plugin/#post-3228107)
 * thanks, I’ve just updated events manager to version 5.3 without problems. I’ve
   checked the .po file and indeed the translations are done.
 * Problem is: some of events manager parts are still in English. actually the same
   text as before.
 * I’m focusing on the add new events page i.e.
 * [http://www.mywebsite.com/cn/members/admin/events/my-events/?action=edit](http://www.mywebsite.com/cn/members/admin/events/my-events/?action=edit)
 * at first thought, I don’t know what to do. what could be causing this? you know,
   my system isn’t recognising the new .po, .mo files
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] how to create a search filter for locations](https://wordpress.org/support/topic/how-to-create-a-search-filter-for-locations/)
 *  Thread Starter [omegacoder](https://wordpress.org/support/users/omegacoder/)
 * (@omegacoder)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/how-to-create-a-search-filter-for-locations/#post-3221632)
 * I’ve checked out the html, it outputs part of the following:
 * <input id=”location-name” class=”ui-autocomplete-input” type=”text” value=”Shanghai”
   name=”location_name” autocomplete=”off” role=”textbox” aria-autocomplete=”list”
   aria-haspopup=”true” style=”background-color: rgb(255, 255, 255);”>
 * I’m not asking for a step-guide solution of course, but can you be more specific
   in what needs to be done to achieve what I need? you know, some pointers with
   maybe some pesudo code or examples? Thanks thanks

Viewing 15 replies - 1 through 15 (of 54 total)

1 [2](https://wordpress.org/support/users/omegacoder/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/omegacoder/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/omegacoder/replies/page/4/?output_format=md)
[→](https://wordpress.org/support/users/omegacoder/replies/page/2/?output_format=md)