Quick way to get the phpBB version number
Article ID: 13
Written By: who_cares
Written On: Mon Apr 23, 2007 9:10 am
Description: A quick method to find the phpBB version number stored in the database
- link to this article on phpbb.com: Select All
[kb=quick-way-to-get-the-phpbb-version-number]Quick way to get the phpBB version number[/kb]
- link to this article on your own board: Select All
[url=http://www.phpbb.com/kb/article/quick-way-to-get-the-phpbb-version-number/]Knowledge Base - Quick way to get the phpBB version number[/url]
Overview- If your forum is hacked or just plain broken and someone in the support forum asks you what version of phpBB you have you can run this code in the phpBB folder to get the version number.
Instructions:- Save the code below as phpbbversion.php
- Then upload it to your forum's phpBB directory.
- Login to your forum as a board Admin.
- Now go to youdomain.com/phpbb_directory/phpbbversion.php (this is just an example URL).
- Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
if( $userdata['user_level'] != ADMIN )
{
die('Hacking attempt!');
}
$sql = "SELECT *
FROM " . CONFIG_TABLE . "
WHERE config_name = 'version'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'SQL error', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
die('You are running phpbb version: <b>2.' . $row['config_value'] . '</b>');
}
?>
- Delete the file once you are done with it.
- It is worth noting that this will only return the number stored in the database. This is not always 1005 effective, there are a number of ways this version can actually become wrong in relation to the version of the phpBB files you have.