Warning: session_start() [function.session-start]: open(/tmp/sess_5e351b15e3feb43f6f795fcd3c1933ea, O_RDWR) failed: Read-only file system (30) in /www/weirdsilence/weirdsilence.net/www/index.php on line 30
Weird Silence » punBB modded to show country of poster
   News      Software      Tools      Forum      Downloads      Links      About  
Login
punBB modded to show country of poster
2005/01/21 17:48 by lars
We've modded punBB to show the country of the poster, using our IP-to-country tool. We added these 16 lines of code after line 201 in viewtopic.php:

// IP to country start
require_once( '/path/to/ip2c.php' );
if ( !empty( $cur_post['poster_ip'] ) )
{
$ipc = new ip2country();
$ipc->init( '/path/to/ip2cntry.dat' );
$idx = $ipc->lookup( $cur_post['poster_ip'] );
if ( $idx != IP2C_IP_NOT_FOUND )
{
$ccode = $ipc->idx2country( $idx );
$user_info[] = '<dd><img src="/path/to/flags/' .
strtolower( $ccode ) . '.gif" style="width: 16px; height: 12px;" alt="' .
$ccode . '" />';
}
unset( $ipc );
}
// IP to country stop

Remember to change the /path/to.

This requires our ip to country for PHP, and the world.small flag-pack from ip-to-country.webhosting.info!


<< Back


MySQL: 0.0000 s, 0 request(s), PHP: 0.0201 s, total: 0.0201 s, document retrieved from cache.
Get Firefox!
Etomite »

« Etomite Parse Error »

Etomite encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
 
PHP error debug
  Error: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) 
  Error type/ Nr.: Warning - 2 
  File: /www/weirdsilence/weirdsilence.net/www/index.php 
  Line: 118 
  Line 118 source: if(@!$this->rs = mysql_connect($this->dbConfig['host'], $this->dbConfig['user'], $this->dbConfig['pass'])) {  
 
Parser timing
  MySQL: 0.0000 s s(0 Requests)
  PHP: 0.0308 s s 
  Total: 0.0308 s s