WordPress.org

Ready to get started?Download WordPress

Forums

Visitor Maps and Who's Online
[resolved] manual filter for country selection (3 posts)

  1. WP-Henne
    Member
    Posted 4 months ago #

    Hello,
    I try an additional entry 'DE' for the display of visits from Germany for filter-selection, but i don't finished yet.

    In class-wo-been.php i added:
    line33
    $show_arr[] = array('id' => 'de', 'text' => esc_attr( __( 'DE', 'visitor-maps' ) ));
    change line40
    if ( isset($_GET['show']) && in_array($_GET['show'], array('none','all','bots','guests','de')) ) {

    And now i need to select only de ;-)

    May you can give me a hint how I can solve this?

    Thx & regards,
    Henry

    https://wordpress.org/plugins/visitor-maps/

  2. WP-Henne
    Member
    Posted 4 months ago #

    Hello, i found a solution, but it's near working then fine ;-)

    i changed this

    $whos_online_arr = $wpdb->get_results("SELECT
            session_id,
            ip_address,
            user_id,
            name,
            nickname,
            country_name,
            country_code,
            city_name,
            state_name,
            state_code,
            latitude,
            longitude,
            last_page_url,
            http_referer,
            user_agent,
            hostname,
            time_entry,
            time_last_click,
            num_visits
                FROM " . $wo_table_wo . "
                ORDER BY ".$sort_by_ar[$sort_by]." ".$order_ar[$order]."

    into

    if ($show != "de") {
           $whos_online_arr = $wpdb->get_results("SELECT
            session_id,
            ip_address,
            user_id,
            name,
            nickname,
            country_name,
            country_code,
            city_name,
            state_name,
            state_code,
            latitude,
            longitude,
            last_page_url,
            http_referer,
            user_agent,
            hostname,
            time_entry,
            time_last_click,
            num_visits
                FROM " . $wo_table_wo . "
                ORDER BY ".$sort_by_ar[$sort_by]." ".$order_ar[$order]." $limit", ARRAY_A);
    } else {
           $whos_online_arr = $wpdb->get_results("SELECT
            session_id,
            ip_address,
            user_id,
            name,
            nickname,
            country_name,
            country_code,
            city_name,
            state_name,
            state_code,
            latitude,
            longitude,
            last_page_url,
            http_referer,
            user_agent,
            hostname,
            time_entry,
            time_last_click,
            num_visits
                FROM " . $wo_table_wo . "
    	    WHERE country_code = 'DE'
                ORDER BY ".$sort_by_ar[$sort_by]." ".$order_ar[$order]." $limit", ARRAY_A);
    }

    It works for me but if someone fix, please do.

    Regards,
    Henry

  3. WP-Henne
    Member
    Posted 3 months ago #

    Hello again,

    i've updated some code in class-wo-been.php - the change above destroys the view and the counter is not correct.
    And the user logged in will filtered out :-)

    For this reason, i've change one mistake in original script: if selected bots "no", the counter even displays all users. I've fixed this also.

    If some interested, i'll share the changes here.

    Regards,
    Henry

Reply

You must log in to post.

About this Plugin

About this Topic