omegacoder
Forum Replies Created
-
ok, I replaced “wpmu_delete_user” with “wpmu_delete_user” roughly located at line 135 in “inactive-user-deleter.php and it worked!
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
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
im using wordpress 3.42 on multisite and events manager 5.29
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 gonerepeat 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
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?
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?
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
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!
thanks it is working now! thanks alot
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’); }
I’ve discovered that the qTranslate plugin I’m using is causing the problem.
when i visited the url:
https://www.mywebsite.com/zh/members/admin/events/my-events/?action=edit
it works, however, when I use the proper url on my subsite:
https://www.mywebsite.com/cn/members/admin/events/my-events/?action=edit
the chinese translation don’t work
using
https://www.mywebsitecom/cn/zh/members/admin/events/my-events/?action=edit
works alsoWhen 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!
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 filesdo you know what could be the issue causing this?
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.
https://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
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