Примечание:
это функция не пхп, а постгрехи...
Код: Выделить всё
##############################################################
## MOD Title: PostgreSQL DB Size
## MOD Author: [R: R@m$e$ :U] < Ramses@phpBBGuru.net > (Ramses) http://Ramses.phpBBGuru.net
## MOD Description: Show size of DB(PostgreSQL) in admin...
## By default showed "Not avaible
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: ~5 Minutes
## Files To Edit:
## admin/index.php
## Included Files:
## n/a
##
## License: http://opensource.org/licenses/gpl-license.php GNU Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## Find bug or write new translation? Please write me...
##
##############################################################
## MOD History:
##
## 2005-10-08 - Version 1.0.0
## - Initial release...
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
admin/index.php
#
#-----[ FIND ]------------------------------------------
#
<?
#
#-----[ AFTУR, ADD ]------------------------------------------
#
/*** -= PostgreSQL DB Size v1.0.0 by [R: R@m$e$ :U] =- ***/
#
#-----[ FIND ]------------------------------------------
#
else
{
$dbsize = $lang['Not_available'];
}
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] PostgreSQL DB Size
else if ( preg_match("/^postgres/", SQL_LAYER) )
{
$sql = "SELECT database_size('$dbname') as dbsize";
if( $result = $db->sql_query($sql) )
{
$dbsize = ( $row = $db->sql_fetchrow($result) ) ? intval($row['dbsize']) : $lang['Not_available'];
}
else
{
$dbsize = $lang['Not_available'];
}
}
// [end] PostgreSQL DB Size
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM