|
|||||||
| Freebies Want to give something away for free? We all like freebies. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Here's a free addon for all GeN4 0.92 owners,
it shows current online members of your sites with countryflags, it has a popup tooltip which shows the country name. example is on WinnerBux.com ![]() (note: tooltip requires: Jquery, VTIP to be installed download: http://www.vertigo-project.com/projects/vtip]here) How to make it work: Open your index.php page or whatever page you want to put it on 1) add in the PHP code below under: if(!defined('GEN4_PROCESS')) { exit(); } Code:
$result = mysql_query("SELECT * FROM users WHERE lastaction >= unix_timestamp() - 60*5");
$countryvisitors = '';
$tnum = '0';
while($row = mysql_fetch_array( $result )) {
$tnum = $tnum + 1;
if ($tnum == 7)
// Number of Users to show per row.
{
$countryvisitors = $countryvisitors . '<br />';
$tnum = '0';
}
$ip = $row['lastip'];
$ip_number = sprintf("%u", ip2long($ip));
$country = mysql_query("SELECT `country_code` FROM `ip2country` WHERE `begin_ip_num`<='$ip_number' AND `end_ip_num`>='$ip_number'")
or die(mysql_error());
$countryname = mysql_query("SELECT `country_name` FROM `ip2country` WHERE `begin_ip_num`<='$ip_number' AND `end_ip_num`>='$ip_number'")
or die(mysql_error());
$countryname = mysql_fetch_array($countryname);
$countryname = strtolower($countryname['country_name']);
$country = mysql_fetch_array($country);
$country = strtolower($country['country_code']);
$country = "flags/{$country}.png";
if ($country == 'flags/.png') {
$country = 'flags/earth.png';
$countryname = 'earth';
}
$countryvisitors = $countryvisitors . '<img src="forum/'. $country . '" align="absmiddle" class="vtip" title="' . $countryname . '" vspace="5" hspace="5">" . $row['username']
. '<br />';
}
<b>Online members ({$online}):</b><br />{$countryvisitors}<br /> or just {$countryvisitors} for names & flags without header. 3. Upload attached earth.png to forum/flags to show earth flag for members whose location cannot be determined. Enjoy!
Last edited by Stefan; 08-28-2010 at 05:55 PM. |
|
|||
|
Thanks for the contribution
.
|
![]() |
| Tags |
| countries, flags, gen4, members, online |
| Thread Tools | |
| Display Modes | |
|
|
|||||