Exemplo n.º 1
1
                            <form class="pull-right">

                                <div class="form-input">
                                    <div class="styled-select">
                                       <select name="country">
                                            <option value="">SELECT COUNTRY</option>
                                           <?php 
include "geoiploc.php";
$ip = $_SERVER["REMOTE_ADDR"];
foreach ($GLOBALS['geoipcountry'] as $key => $value) {
    ?>
                                                   <option value="<?php 
    echo $key;
    ?>
" <?php 
    if (getCountryFromIP($ip, "code") == $key) {
        echo 'selected';
    }
    ?>
><?php 
    echo $value;
    ?>
</option>     
                                                       
                                                       
                                                       <?php 
}
?>
                                        </select>
                                     
                                    </div>
Exemplo n.º 2
1
 public function getIPLocation()
 {
     $ip = $_SERVER['REMOTE_ADDR'];
     return getCountryFromIP($ip, " NamE ");
 }
Exemplo n.º 3
0
function convertip($ip)
{
    $return = '';
    if (preg_match("/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\$/", $ip)) {
        $iparray = explode('.', $ip);
        if ($iparray[0] == 10 || $iparray[0] == 127 || $iparray[0] == 192 && $iparray[1] == 168 || $iparray[0] == 172 && ($iparray[1] >= 16 && $iparray[1] <= 31)) {
            $return = '- LAN';
        } elseif ($iparray[0] > 255 || $iparray[1] > 255 || $iparray[2] > 255 || $iparray[3] > 255) {
            $return = '- Invalid IP Address';
        } else {
            include_once "data/ipdata/geoiploc.php";
            $return = getCountryFromIP($ip, " NamE ");
        }
    }
    return $return;
}
Exemplo n.º 4
0
    if ($email && DISP_ID == 1) {
        $now .= " (ID:" . $idhtml . " Heaven </span>)";
    } else {
        if (!$resto) {
            //holy hell there has to be a better way to do this. i swear ill think of it soon
            $idsalt = $mysql->result($mysql->query("select max(no) from " . SQLLOG), 0, 0);
            $idsalt = $idsalt + 1;
        } else {
            $idsalt = $resto;
        }
        $now .= " (ID:" . $idhtml . substr(crypt(md5($_SERVER["REMOTE_ADDR"] . PANEL_PASS . 'id' . date("Ymd", $time)), $idsalt), +3) . "</span>)";
    }
}
if (COUNTRY_FLAGS && file_exists('geoiploc.php')) {
    require_once CORE_DIR . "/regist/geoiploc.php";
    $country = getCountryFromIP($host, "CTRY");
    $now .= " <img src=" . CSS_PATH . "flags/" . strtolower($country) . ".png /> ";
}
$c_name = $name;
$c_email = $email;
if (strpos($email, 'sage') !== false || strpos($email, 'nokosage') !== false) {
    $sageThis = true;
}
if (strpos($email, 'nokosage') !== false || strpos($email, 'noko') !== false) {
    $noko = true;
}
require_once "tripcode.php";
//This DOES the trip processing.
//Text sanitizing
//Text plastic surgery (rorororor)
$email = $sanitize->CleanStr($email, 0);
Exemplo n.º 5
0
/**
 * Create WP ULike statistics with wp_ulike_stats class
 *
 * @author       	Alimir	 	
 * @since           2.0	
 * @updated         2.3	
 * @return			String
 */
function wp_ulike_statistics()
{
    global $wp_ulike_stats, $wp_ulike_class;
    $get_option = get_option('wp_ulike_statistics_screen');
    echo '<div class="wrap">';
    echo '<h2>' . __('WP ULike Statistics', WP_ULIKE_SLUG) . '</h2>';
    /*******************************************************
    	  Welcome Panel
    	*******************************************************/
    if ($get_option['welcome_panel'] == 1) {
        echo '<div id="welcome-panel" class="welcome-panel"><div class="welcome-panel-content">';
        echo '<h3>' . __('Welcome to WP ULike Statistics!', WP_ULIKE_SLUG) . '</h3>';
        echo '<p class="about-description">' . __('We have provided some useful statistics tools in this page:', WP_ULIKE_SLUG) . '</p>';
        echo '<div class="welcome-panel-column-container">';
        echo '
		<div class="welcome-panel-column">
			<h4>' . __('Get Started') . '</h4>
			<a class="button button-primary button-hero" href="admin.php?page=wp-ulike-about">' . __('About WP ULike', WP_ULIKE_SLUG) . '</a>
			<p class="hide-if-no-customize">' . __('or', WP_ULIKE_SLUG) . ', <a href="http://preview.alimir.ir/developer/wp-ulike/">' . __('Visit our homepage', WP_ULIKE_SLUG) . '</a></p>
		</div>
		<div class="welcome-panel-column">
			<h4>' . __('Other Tools', WP_ULIKE_SLUG) . '</h4>
			<ul>
				<li><a target="_blank" href="admin.php?page=wp-ulike-post-logs" class="welcome-icon welcome-view-site">' . __('Post Likes Logs', WP_ULIKE_SLUG) . '</a></li>
				<li><a target="_blank" href="admin.php?page=wp-ulike-comment-logs" class="welcome-icon welcome-view-site">' . __('Comment Likes Logs', WP_ULIKE_SLUG) . '</a></li>
				<li><a target="_blank" href="admin.php?page=wp-ulike-bp-logs" class="welcome-icon welcome-view-site">' . __('Activity Likes Logs', WP_ULIKE_SLUG) . '</a></li>
				<li><a target="_blank" href="admin.php?page=wp-ulike-bbpress-logs" class="welcome-icon welcome-view-site">' . __('Topics Likes Logs', WP_ULIKE_SLUG) . '</a></li>
			</ul>
		</div>
		<div class="welcome-panel-column welcome-panel-last">
			<h4>' . __('Documentation') . '</h4>
			<ul>
				<li><a  target="_blank" href="https://wordpress.org/support/plugin/wp-ulike" class="welcome-icon welcome-learn-more">' . __('Support', WP_ULIKE_SLUG) . '</a></li>
				<li><a  target="_blank" href="https://wordpress.org/plugins/wp-ulike/faq/" class="welcome-icon welcome-learn-more">' . __('FAQ', WP_ULIKE_SLUG) . '</a></li>
				<li><a  target="_blank" href="http://preview.alimir.ir/contact/" class="welcome-icon welcome-learn-more">' . __('Contact', WP_ULIKE_SLUG) . '</a></li>
				<li><a  target="_blank" href="https://github.com/Alimir/wp-ulike" class="welcome-icon welcome-learn-more">' . __('GitHub Repository', WP_ULIKE_SLUG) . '</a></li>
			</ul>
		</div>
	';
        echo '</div></div></div>';
    }
    /*******************************************************
    	  First Column
    	*******************************************************/
    $total_likes = 0;
    echo '
		<div class="postbox-container" id="right-log">
		<div class="metabox-holder">
		<div class="meta-box-sortables ui-sortable">';
    if (isset($get_option) && $get_option['summary_like_stats'] == 1) {
        $SummaryArr = array("posts" => array("id" => "posts_likes_stats", "type" => "ulike", "table" => "postmeta", "key" => "_liked", "dashicons" => "dashicons-admin-post", "title" => __('Posts Likes Summary', WP_ULIKE_SLUG)), "comments" => array("id" => "comments_likes_stats", "type" => "ulike_comments", "table" => "commentmeta", "key" => "_commentliked", "dashicons" => "dashicons-admin-comments", "title" => __('Comments Likes Summary', WP_ULIKE_SLUG)), "activities" => array("id" => "activities_likes_stats", "type" => "ulike_activities", "table" => "bp_activity_meta", "key" => "_activityliked", "dashicons" => "dashicons-groups", "title" => __('Activities Likes Summary', WP_ULIKE_SLUG)), "topics" => array("id" => "topics_likes_stats", "type" => "ulike_forums", "table" => "postmeta", "key" => "_topicliked", "dashicons" => "dashicons-admin-post", "title" => __('Topics Likes Summary', WP_ULIKE_SLUG)));
        foreach ($SummaryArr as $SummaryTotal) {
            $total_likes += $wp_ulike_stats->get_all_data_date($SummaryTotal["table"], $SummaryTotal["key"]);
        }
        echo '
			<div style="display: block;" class="postbox">
			<div class="handlediv" title="Click to toggle"><br></div>
			<h3 class="hndle"><span><i class="dashicons dashicons-chart-bar"></i> ' . __('Summary', WP_ULIKE_SLUG) . '</span></h3>
			<div class="inside">';
        foreach ($SummaryArr as $SummaryVal) {
            echo '<table class="widefat table-stats" id="summary-stats" width="100%"><tbody>';
            if ($get_option[$SummaryVal['id']] == 1) {
                if ($SummaryVal["id"] == 'posts_likes_stats') {
                    echo '
				<tr>
					<th><i class="dashicons dashicons-pressthis"></i> ' . __('Total Likes', WP_ULIKE_SLUG) . ':</th>
					<th colspan="2" id="th-colspan"><span>' . $total_likes . '</span></th>
				</tr>';
                }
                echo '

			<tr>
				<th colspan="3" style="text-align: center; font-weight:bold;"><br><hr>' . $SummaryVal["title"] . '<hr><br></th>
			</tr>			
			
			<tr>
				<th><i class="dashicons dashicons-star-filled"></i> ' . __('Today', WP_ULIKE_SLUG) . ':</th>
				<th class="th-center"><span>' . $wp_ulike_stats->get_data_date($SummaryVal["type"], 'today') . '</span></th>
			</tr>
			
			<tr>
				<th><i class="dashicons dashicons-star-empty"></i> ' . __('Yesterday', WP_ULIKE_SLUG) . ':</th>
				<th class="th-center"><span>' . $wp_ulike_stats->get_data_date($SummaryVal["type"], 'yesterday') . '</span></th>
			</tr>
			
			<tr>
				<th><i class="dashicons dashicons-calendar"></i> ' . __('Week', WP_ULIKE_SLUG) . ':</th>
				<th class="th-center"><span>' . $wp_ulike_stats->get_data_date($SummaryVal["type"], 'week') . '</span></th>
			</tr>
			
			<tr>
				<th><i class="dashicons dashicons-flag"></i> ' . __('Month', WP_ULIKE_SLUG) . ':</th>
				<th class="th-center"><span>' . $wp_ulike_stats->get_data_date($SummaryVal["type"], 'month') . '</span></th>
			</tr>
			
			<tr>
				<th><i class="dashicons dashicons-chart-area"></i> ' . __('Total', WP_ULIKE_SLUG) . ':</th>
				<th class="th-center"><span>' . $wp_ulike_stats->get_all_data_date($SummaryVal["table"], $SummaryVal["key"]) . '</span></th>
			</tr>';
            }
            echo '</tbody></table>';
        }
        echo '</div></div>';
    }
    if ($get_option['likers_map'] == 1) {
        echo '
		<div id="world_map" class="postbox">
			<div class="handlediv" title="Click to toggle"><br></div>
			<h3 class="hndle"><span><i class="dashicons dashicons-location-alt"></i> ' . __('Likers World Map', WP_ULIKE_SLUG) . '</span></h3>
			<div class="inside">
				<div class="main">
				<div>
					<div id="vmap" style="width: 100%; min-height: 250px;"></div>
				</div>
				</div>
			</div>
		</div>';
    }
    if ($get_option['top_likers'] == 1) {
        $get_top_likers = $wp_ulike_stats->get_top_likers();
        $top_users_counter = 1;
        echo '
		<div class="postbox">
		<div class="handlediv" title="Click to toggle"><br></div>
		<h3 class="hndle"><span><i class="dashicons dashicons-awards"></i> ' . __('Top Likers', WP_ULIKE_SLUG) . '</span></h3>
		<div class="inside">';
        foreach ($get_top_likers as $top_liker) {
            $get_top_user_id = stripslashes($top_liker->user_id);
            $get_top_user_info = get_userdata($get_top_user_id);
            $final_user_name = __('Guest User', WP_ULIKE_SLUG);
            if ($get_top_user_info != '') {
                $final_user_name = $get_top_user_info->display_name;
            }
            echo '
			<div class="log-latest">
			<div class="log-item">
			<div class="log-page-title">' . $top_users_counter++ . ' - ' . $final_user_name . '</div>
			<div class="right-div badge"><strong>' . $top_liker->SumUser . '</strong> ' . __('Like', WP_ULIKE_SLUG) . '</div>
			<div class="left-div"><i class="dashicons dashicons-location"></i> <em dir="ltr">' . $top_liker->ip . '</em> | ' . getCountryFromIP($top_liker->ip, "NamE") . '</div>
			</div>
			</div>
			';
        }
        echo '</div></div>';
    }
    if ($get_option['top_users'] == 1) {
        $get_top_users = $wp_ulike_class->get_top_users();
        $top_users_counter = 1;
        echo '
		<div class="postbox">
		<div class="handlediv" title="Click to toggle"><br></div>
		<h3 class="hndle"><span><i class="dashicons dashicons-awards"></i> ' . __('Top Users', WP_ULIKE_SLUG) . '</span></h3>
		<div class="inside">';
        if ($get_top_users) {
            foreach ($get_top_users as $top_user) {
                $get_top_user_id = stripslashes($top_user->user_id);
                $get_top_user_info = get_userdata($get_top_user_id);
                $final_user_name = __('Guest User', WP_ULIKE_SLUG);
                if ($get_top_user_info != '') {
                    $final_user_name = $get_top_user_info->display_name;
                }
                echo '
			<div class="log-latest">
			<div class="log-item log-item-half">
			<span class="left-div log-page-title">' . $top_users_counter++ . ' - ' . $final_user_name . '</span>
			<span class="right-div badge"><strong>' . $top_user->user_score . '</strong> ' . __('Like', WP_ULIKE_SLUG) . '</span>
			</div>
			</div>
			';
            }
        }
        echo '</div></div>';
    }
    echo '</div></div></div>';
    /*******************************************************
    	  Second Column
    	*******************************************************/
    if (isset($get_option)) {
        $ChartsArr = array("posts" => array("id" => "posts_likes_stats", "view_logs" => ' <a style="text-decoration:none;" href="?page=wp-ulike-post-logs" target="_blank"><i class="dashicons dashicons-visibility"></i> ' . __('View Logs', WP_ULIKE_SLUG) . '</a>', "title" => __('Posts Likes Stats', WP_ULIKE_SLUG) . ' - ' . sprintf(__('In The Last %s Days', WP_ULIKE_SLUG), $get_option['days_number']), "chart" => "chart1"), "comments" => array("id" => "comments_likes_stats", "view_logs" => ' <a style="text-decoration:none;" href="?page=wp-ulike-comment-logs" target="_blank"><i class="dashicons dashicons-visibility"></i> ' . __('View Logs', WP_ULIKE_SLUG) . '</a>', "title" => __('Comments Likes Stats', WP_ULIKE_SLUG) . ' - ' . sprintf(__('In The Last %s Days', WP_ULIKE_SLUG), $get_option['days_number']), "chart" => "chart2"), "activities" => array("id" => "activities_likes_stats", "view_logs" => ' <a style="text-decoration:none;" href="?page=wp-ulike-bp-logs" target="_blank"><i class="dashicons dashicons-visibility"></i> ' . __('View Logs', WP_ULIKE_SLUG) . '</a>', "title" => __('Activities Likes Stats', WP_ULIKE_SLUG) . ' - ' . sprintf(__('In The Last %s Days', WP_ULIKE_SLUG), $get_option['days_number']), "chart" => "chart3"), "topics" => array("id" => "topics_likes_stats", "view_logs" => ' <a style="text-decoration:none;" href="?page=wp-ulike-bbpress-logs" target="_blank"><i class="dashicons dashicons-visibility"></i> ' . __('View Logs', WP_ULIKE_SLUG) . '</a>', "title" => __('Topics Likes Stats', WP_ULIKE_SLUG) . ' - ' . sprintf(__('In The Last %s Days', WP_ULIKE_SLUG), $get_option['days_number']), "chart" => "chart4"));
        echo '
			<div class="postbox-container" id="left-log">
			<div class="metabox-holder">
			<div class="meta-box-sortables ui-sortable">';
        foreach ($ChartsArr as $ChartArr) {
            if ($get_option[$ChartArr['id']] == 1) {
                echo '
				<div id="' . $ChartArr['id'] . '" class="postbox">
					<div class="handlediv" title="Click to toggle"><br></div>
					<h3 class="hndle"><span><i class="dashicons dashicons-chart-line"></i> ' . $ChartArr['title'] . $ChartArr['view_logs'] . ' </span></h3>
					<div class="inside">
						<div class="main">
						<div>
							<canvas id="' . $ChartArr['chart'] . '"></canvas>
						</div>
						</div>
					</div>
				</div>';
            }
        }
        if ($get_option['piechart_stats'] == 1) {
            echo '
			<div id="piechart_stats" class="postbox">
				<div class="handlediv" title="Click to toggle"><br></div>
				<h3 class="hndle"><span><i class="dashicons dashicons-chart-pie"></i> ' . __('Likes Percent', WP_ULIKE_SLUG) . ' - ' . sprintf(__('In The Last %s Days', WP_ULIKE_SLUG), $get_option['days_number']) . ' </span></h3>
				<div class="inside">
					<div class="main">
					<div>
						<canvas id="piechart"></canvas>
					</div>
					</div>
				</div>
			</div>';
        }
        echo '</div></div></div>';
    }
    echo '</div>';
    //end wrap class
}
Exemplo n.º 6
0
 /**
  * Get Data Map
  *
  * @author       	Alimir
  * @since           2.3
  * @return			String
  */
 public function data_map()
 {
     $country_data = array();
     $return_val = $this->wpdb->get_results("\n\t\t\tSELECT T.user_ip AS get_user_ip , SUM(T.count_user_ip) get_count_user_ip\n\t\t\tFROM(\n\t\t\tSELECT ip AS user_ip, count(ip) AS count_user_ip\n\t\t\tFROM " . $this->wpdb->prefix . "ulike\n\t\t\tGROUP BY user_ip\n\t\t\tUNION ALL\n\t\t\tSELECT ip AS user_ip, count(ip) AS count_user_ip\n\t\t\tFROM " . $this->wpdb->prefix . "ulike_activities\n\t\t\tGROUP BY user_ip\n\t\t\tUNION ALL\n\t\t\tSELECT ip AS user_ip, count(ip) AS count_user_ip\n\t\t\tFROM " . $this->wpdb->prefix . "ulike_comments\n\t\t\tGROUP BY user_ip\n\t\t\tUNION ALL\n\t\t\tSELECT ip AS user_ip, count(ip) AS count_user_ip\n\t\t\tFROM " . $this->wpdb->prefix . "ulike_forums\n\t\t\tGROUP BY user_ip\n\t\t\t) AS T\n\t\t\tGROUP BY get_user_ip\n\t\t\t");
     foreach ($return_val as $return) {
         $country_data[strtolower(getCountryFromIP($return->get_user_ip, "code"))] += $return->get_count_user_ip;
     }
     return json_encode($country_data);
 }
Exemplo n.º 7
0
<?php

error_reporting(0);
include "geoiploc.php";
$id = $_GET['id'];
$country = getCountryFromIP("" . $_SERVER['REMOTE_ADDR'] . "", " NamE ");
$data .= "<pre>";
$data .= "Target   : " . $id . "<br>";
$data .= "Ip       : " . $_SERVER['REMOTE_ADDR'] . "<br>";
$data .= "Port     : " . $_SERVER['REMOTE_PORT'] . "<br>";
$data .= "Country  : " . $country . "<br>";
$data .= "Language : " . $_SERVER['HTTP_ACCEPT_LANGUAGE'] . "<br>";
print $data;
$netspeed = geoip_id_by_name('186.0.111.62');
echo 'El tipo de conexión es';
switch ($netspeed) {
    case GEOIP_DIALUP_SPEED:
        echo 'módem';
        break;
    case GEOIP_CABLEDSL_SPEED:
        echo 'cable o ADSL';
        break;
    case GEOIP_CORPORATE_SPEED:
        echo 'corporativo';
        break;
    case GEOIP_UNKNOWN_SPEED:
    default:
        echo 'desconocido';
}
Exemplo n.º 8
-1
function comprobarPais()
{
    require_once 'geoiploc.php';
    return getCountryFromIP($_SERVER['REMOTE_ADDR']);
}