Viewing 15 replies - 1 through 15 (of 18 total)
  • Same problem here, I’m not able to see the plugin activated even after activate it.

    Thanks !

    Plugin Author Eyal Fitoussi

    (@ninjew)

    Hi,
    I know of this issue and I already fixed it in the coming versions of GEO my WP and GEO my WP Current Location Forms.

    However, even without the add-on being marked as active it is still working, correct ?

    Sorry but no, it is not working, when I want to create a form, I’m having the message : “You need to activate some add-ons in order to create form”

    Thanks for the help !

    Plugin Author Eyal Fitoussi

    (@ninjew)

    That is because you must activate at least on of the two free add-ons that comes with the plugin.

    Go to GEO my WP- > add-ons and activate either Post Types locator add-on or Members Locator add-on or both. Depends of what you need.

    I need to create a form that send me by mail the location of a user, do you think it’s possible with this plugin ?

    Thank you so much.

    I activate “Post Types Locator” and “Members Locator” but “Current Location Forms” is not available even after several installation.

    Plugin Author Eyal Fitoussi

    (@ninjew)

    That is not the purpose of the Current Location Forms”.

    The Current Locations Form add-on is meant to work with the Curren Location widget and shortcode.

    Using the widget or shortcode you can place a link says ” Get my current location” in the sidebar or anywhere on the page. Once a user click on that link a form will popup which will allow the user to either enter his location manually or get his current location by clicking on a button. This popup form is the “Current Location” form. GEO my WP comes with a default simple popup form while The Current Location Forms add-on comes with a more nicer form.

    If you go to this page you will see in the left sidebar on the top the link says “get my current location”. Click on that and you will see the popup form.

    As per your request, there is an action hook that being executed each time that form is submitted. So using this hook you can write a simple function that will email you the location of the user ( using wp_mail ).

    Would that be good for you?

    Hello Eyal,

    Everything is allright with the buddypress plugin and I can now have the localistion of the user in my widget part, but for getting the location in a mail, I’m trying hard since 2 days but I think it’s getting over my capacity…

    I just don’t knw how to use the hook to write the function that will email me the location.

    I just need to get a button that send by mail the location (adress and map) of a logged user.
    If you’re up to, I can pay you to do this !

    Plugin Author Eyal Fitoussi

    (@ninjew)

    It is actually pretty simple.

    The action hook is:

    do_action( 'gmw_user_current_location_submitted' , $location, $user_id );

    The hook pass the user’s location and the user ID.

    The $location that passes is an array which provides you ( if found ) with the location fields; street, city, state, state_long, country, country_long, zip code, lat ( latitude ), lng ( longitude ) and address.

    So with a simple function that uses wp_mail you can use email yourself the location each time a user submit it.

    You can copy paste the script below into the functions.php file of your theme ( and change the email address to yours ):

    function gmw_email_users_location( $location, $user_id ) {
            //continue only if user is logged in
    	if ( !$user_id )
    		return;
    
            //add line to the message with the user id and the address
    	$message = "The user with ID {$user_id} submitted a location at {$location['address']}.";
    
            //add link to google map
    	$message .= " http://maps.google.com/?q=".str_replace( ' ', '+', $location['address']);
    
            //send the email
    	wp_mail( 'info@geomywp.com', 'User Location', $message, '', '' );
    }
    add_action('gmw_user_current_location_submitted', 'gmw_email_users_location', 10, 2 );

    Eyal you’re the best ! I’ll try this method today or this night and I’ll tell you if it’s good !

    Thanks again again and again !

    Yeeeeeeeeeaaaaaaaaaaaaaaaaaaaah !!! Eyal, Eyal, Eyal !!
    You are my wizard, I just have 1 little question :
    1) can I get the user name and mail instead of the user ID

    Everything is great now, thanks to you, if you ever need me for something, just ask ! jucotel@gmail.com 😉

    Thanks again for everything.

    Plugin Author Eyal Fitoussi

    (@ninjew)

    You are welcome, I am glad I could help :).

    Getting the user’s information is also easy. using get_userdata( $user_id ) you can get any of the user’s information that you want and you can edit the message above as you wish with the new user information.

    Just whatever information you add to the function make sure you add it below the lines:

    if ( !$user_id )
        return;

    Thank you Eyal for your time !

    Ok, I’m trying to add email and username in your function but I think I missed up sommething, this is my version of your function :

    function gmw_email_users_location( $location, $user_id ) {
    //continue only if user is logged in
    if ( !$user_id )
    return;

    //add line to the message with the user id and the address
    $message = ” L’utilisateur ID {$user_id} {$user_email} {$user_name} Vous envoi sa position pour le récuperer !
    Il se trouve : {$location[‘address’]}.”;

    //add link to google map
    $message .= “
    Affichez la carte : http://maps.google.com/?q=”.str_replace( ‘ ‘, ‘+’, $location[‘address’]);

    //send the email
    wp_mail( ‘jucotel@gmail.com’, ‘User Location’, $message, ”, ” );
    }
    add_action(‘gmw_user_current_location_submitted’, ‘gmw_email_users_location’, 10, 2 );

    I also have a question about the target mail (jucotel@gmail.com), do you think I can use a custom profile field from budypress to get a dedicated target email for each user ?

    function gmw_email_users_location( $location, $user_id ) {
    //continue only if user is logged in
    if ( !$user_id )
    return;</p>
    <p>//add line to the message with the user id and the address
    $message = " L'utilisateur ID {$user_id} {$user_email} {$user_name} Vous envoi sa position pour le récuperer !
    Il se trouve : {$location['address']}.";</p>
    <p>//add link to google map
    $message .= "
    Affichez la carte : http://maps.google.com/?q=".str_replace( ' ', '+', $location['address']);</p>
    <p>//send the email
    wp_mail( 'jucotel@gmail.com', 'User Location', $message, '', '' );
    }
    add_action('gmw_user_current_location_submitted', 'gmw_email_users_location', 10, 2 );
    
    Plugin Author Eyal Fitoussi

    (@ninjew)

    You need to get the user data using the get_userdata() function before you can display it.

    The script below should do:

    function gmw_email_users_location( $location, $user_id ) {
    
    	//continue only if user is logged in
    	if ( !$user_id )
    	    return;
    
            //get the user data
            $user_info = get_userdata( $user_id );
    
           //add line to the message with the user id and the address
    	$message = " L'utilisateur ID {$user_id} {$user_info->user_email} {$user_info->user_login} Vous envoi sa position pour le récuperer ! Il se trouve : {$location['address']}.";
    
    	//add link to google map
    	$message .= " Affichez la carte : http://maps.google.com/?q=".str_replace( ' ', '+', $location['address']);
    
    	//send the email
    	wp_mail( 'jucotel@gmail.com', 'User Location', $message, '', '' );
    }
    add_action( 'gmw_user_current_location_submitted', 'gmw_email_users_location', 10, 2 );

    And you can definitely use an email from a custom field or so. All you need to do is get the email from the custom field into a variable and used that variable in the place of the email address.

    Example:

    $target_email = get_post_meta( ....here we are getting the custom field );

    and the wp_mail function will be:

    wp_mail(  $target_email, 'User Location', $message, '', '' );
Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Not activated in add-ons screen’ is closed to new replies.