PDA

View Full Version : Show PHP & MySQL Version Info in Admin Panel


Marshalus
03-29-2002, 10:00 PM
One of my admins wanted a way to keep track of what versions of software we run on our server are at, so I threw together this little hack.

It's really very simple, and only requires one code hack in admin/index.php.

In admin/index.php find:
<tr class="secondalt">
<td>Useful Links</td>
<td><select onchange="jumpto(this.options[this.selectedIndex].value)">
<option>&raquo; Useful Links &laquo;</option>
<option value="http://www.vbulletin.com/">vBulletin Home Page</option>
<option value="http://www.vbulletin.com/members/">vBulletin Members' Area</option>
<option value="http://www.vbulletin.com/forum/">vBulletin Support Forums</option>
<option value="http://www.vbulletin.com/manual/">vBulletin Online Manual</option>
<option value="http://www.php.net/">PHP Home Page</option>
<option value="http://www.php.net/manual/">PHP Online Manual</option>
<option value="http://www.mysql.com/">MySQL Home Page</option>
<option value="http://www.mysql.com/documentation/">MySQL Documentation</option>
</select></td>
</tr>
</form>

Directly under that place:
<tr class="firstalt">
<td>PHP Version</td>
<td><?php echo 'v' . phpversion(); ?></td>
</tr>
<tr class="secondalt">
<td>MySQL Version</td>
<td><?php echo 'v' . mysql_get_server_info(); ?></td>
</tr>

Save and reupload, and thats it.

Works with all versions of vBulletin but requires PHP v4.0.5 to display the MySQL server info. If you have that version (which you shouldn't, get 4.1.2 if you can) then just remove the second section of the code. PHP version information will load on all copies of PHP.

Disclamer, if you break it, it's not my fault.

Admin
03-30-2002, 05:29 AM
You can already access this info from /admin/index.php?s=&action=phpinfo

Neo
03-30-2002, 06:40 AM
firefly.. do you think there should be a disclaimer before you post a hack?

Marshalus
03-31-2002, 04:32 AM
The disclamer was a joke.

Thomas P
04-05-2002, 04:26 PM
I've to admin I like it! :)
So you can see at the first glance in the CP if your hoster has updated any of both versions, i.e. php or mysql.
Thx,
-Tom

Mathiau
05-01-2002, 07:41 AM
nice nice, since i am the admin, and got remote access to our server, i can know as well if any one was trying to mess with MY forum! :D and decapitate em!

and if i do break it, i will be breaking someone :)

thnx m8!

claussen
11-07-2002, 07:05 AM
very good idea. quick, easy, and useful.

Thank you.