• Resolved WP-Henne

    (@wp-henne)


    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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter WP-Henne

    (@wp-henne)

    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

    Thread Starter WP-Henne

    (@wp-henne)

    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘manual filter for country selection’ is closed to new replies.