Viewing 15 Topics - 16 through 30 (of 32 total)
Author Posts
April 17, 2013 at 3:19 pm 2370
Tareq Hasan Tareq Hasan

This theme seems complicated and it’s using custom taxonomy for item locations. It’s saving the location info in wp_options table and I must say it’s BAD.

April 17, 2013 at 3:46 pm 2373
retroga_me retroga_me

That might be the custom taxonomy that refers to event-locations though. Could be wrong.

April 17, 2013 at 4:24 pm 2374
retroga_me retroga_me

They’re using the Nette Framework that’s being used over the WPLatte-framework. There’s a so-called .neon file apparently that holds all the metabox’s content. I’ll try and see if I can write to those fields somehow.

April 17, 2013 at 4:57 pm 2376
retroga_me retroga_me

Sorry to spam, but all I can find is the action hook add_meta_boxes that looks like what we need. Only thing is that I don’t know how to hook into it with the plugin.

http://pastebin.com/wNLR4h9i

April 17, 2013 at 5:07 pm 2378
Tareq Hasan Tareq Hasan

Can you share the theme with me?

April 17, 2013 at 5:29 pm 2383
retroga_me retroga_me

Sent it to [email protected] (it’s a paid theme)

April 18, 2013 at 2:08 am 2407
Tareq Hasan Tareq Hasan

This solution will work for you.

[php]
function wpufe_ait_integration( $post_id ) {

$def_lat = $def_long = 0;

if ( isset( $_POST[‘location’] ) ) {
list( $def_lat, $def_long ) = explode( ‘,’, $_POST[‘location’] );
}

$ait_dir_item = array (
‘address’ => isset( $_POST[‘address’] ) ? $_POST[‘address’] : ”,
‘gpsLatitude’ => $def_lat,
‘gpsLongitude’ => $def_long,
‘streetViewLatitude’ => ”,
‘streetViewLongitude’ => ”,
‘streetViewHeading’ => ‘0’,
‘streetViewPitch’ => ‘0’,
‘streetViewZoom’ => ‘0’,
‘telephone’ => isset( $_POST[‘telephone’] ) ? $_POST[‘telephone’] : ”,
’email’ => isset( $_POST[’email’] ) ? $_POST[’email’] : ”,
‘web’ => isset( $_POST[‘web’] ) ? $_POST[‘web’] : ”,
‘hoursMonday’ => isset( $_POST[‘hours_monday’] ) ? $_POST[‘hours_monday’] : ”,
‘hoursTuesday’ => isset( $_POST[‘hours_tuesday’] ) ? $_POST[‘hours_tuesday’] : ”,
‘hoursWednesday’ => isset( $_POST[‘hours_wednesday’] ) ? $_POST[‘hours_wednesday’] : ”,
‘hoursThursday’ => isset( $_POST[‘hoursThursday’] ) ? $_POST[‘hoursThursday’] : ”,
‘hoursFriday’ => isset( $_POST[‘hoursFriday’] ) ? $_POST[‘hoursFriday’] : ”,
‘hoursSaturday’ => isset( $_POST[‘hoursSaturday’] ) ? $_POST[‘hoursSaturday’] : ”,
‘hoursSunday’ => isset( $_POST[‘hoursSunday’] ) ? $_POST[‘hoursSunday’] : ”,
‘alternativeContent’ => isset( $_POST[‘alternativeContent’] ) ? $_POST[‘alternativeContent’] : ”,
);

update_post_meta( $post_id, ‘_ait-dir-item’, $ait_dir_item );
}

add_action( ‘wpuf_add_post_after_insert’, ‘wpufe_ait_integration’ );
add_action( ‘wpuf_edit_post_after_update’, ‘wpufe_ait_integration’ );
[/php]

You can’t use the themes default meta box, because it’s using kinda weird neon file. Just use the plugins default custom fields and use the to update your `_ait-dir-item` custom fields. All is needed to put the right `$_POST` value in that array. I am using the plugins google map and as it stores longitude and latitude in the same field, I am just exploding them and saving it to different array index. Hope that makes sense.

April 18, 2013 at 5:14 am 2415
retroga_me retroga_me

WOW! It works! Tareq my man. Just gimme a sign how much a sixpack of your favorite beverage costs and I’ll paypal it over straight away! I’ll let all other WP Directory users know immediately!

Thanks a LOT! 😀

April 18, 2013 at 8:22 am 2438
noomia noomia

Hey Retroga 🙂 !

I’m the same guys that had answered your post on ait themes support. So I’m happy you’ve found the right solution 🙂 !

Could you explain me in details ?

An other problem is that I have 150 agencies in a .csv and want to import them in WP Director. How can I do if I want to keep all the locations data etc… ?

 

Thanks

April 18, 2013 at 8:27 am 2440
Tareq Hasan Tareq Hasan

I helped you by testing the theme myself because you were gentle enough, not like yelling for support :).

I am not a fan of beverages, if you really want to donate, use this page, but that wouldn’t be necessary ;).

April 18, 2013 at 10:19 am 2446
retroga_me retroga_me

Hi Noomia,

All you have to do is put the php code Tareq posted here inside your wpuf-functions.php and use the plugin to add the form fields to the plugin form.

You can use the item-dir.neon file in the
wp-content/themes/directory/AIT/Framework/CustomTypes/dir-item/ directory
to check which metakeys and types of fields you can use. For the Google Maps functionality, use the WPUF Pro field and set it to the ‘location’  metakey, Tareq’s script will automatically put it in the right fields.

I’ve tested it and I can confirm it works, however (maybe unrelated) can’t get the registration forms to work properly using the shortcode. If you could test that too, we could exclude it being a theme error.

Cheers and thanks again!

July 18, 2013 at 8:48 am 6102
hmmcreative hmmcreative

Wonderful solution, works perfectly. Thank you! Is there any way with this ait-directory integration to enable auto-population of the user’s address on the google map with geolocation on the front end posting? In other words, instead of the user filling in the post address can the map detect their location and fill in the address and/or GPS for them?

July 18, 2013 at 2:24 pm 6107
Tareq Hasan Tareq Hasan

You could auto populate, in that case you’ve to depend on users browser and permission. It always doesn’t work correctly.

August 17, 2013 at 1:00 pm 7057
lwrkrol lwrkrol

Ok, I put this script in the wpuf-functions.php and it works great. The only thing I can not figure out is how to get the gmaps info.

In the backend you enter the address like broadway, new york and then press the find address button and it finds the right location on the map.

I created a form with the following fields:

address –> metakey = address
city –> no meta key since I use the taxonomy Location

So how do I get the right coordinates when I save the item. I would like to combine address and city, calculate the coordinates and then save it in the meta field location.

I have also tried a field with metakey ‘address’ ad then enter broadway, new york but then I still have to press the button ‘find address’in the backend.

Hope you can help

August 18, 2013 at 2:35 am 7085
Tareq Hasan Tareq Hasan

If you add google map field with meta key location, the latitude/longitude should be saved in location custom field. The google map field type is very basic, you can’t achieve all the functionalities out-of-the-box.

Viewing 15 Topics - 16 through 30 (of 32 total)