Topic: Automatic version checking.
I think this is a must for the future, i see no downside except if this site is down you get a couple of seconds lag on the page.
open admin_index.php
find
<dt>PunBB version</dt>
<dd>
PunBB <?php echo $pun_config['o_cur_version'] ?> - <a href="admin_index.php?action=check_upgrade">Check for upgrade</a><br />
© Copyright 2002, 2003, 2004, 2005 Rickard Andersson
</dd>
replace with
<dt>PunBB version</dt>
<dd>
PunBB <?php echo $pun_config['o_cur_version'] ?><br />
<?php
if (!ini_get('allow_url_fopen'))
echo 'Unable to check for upgrade since \'allow_url_fopen\' is disabled on this system.<br />';
else {
$fp = @fopen('http://punbb.org/latest_version', 'r');
@stream_set_timeout($fp, 1);
$latest_version = trim(@fread($fp, 16));
@fclose($fp);
if ($latest_version == '')
echo 'Check for upgrade failed for unknown reasons.<br />';
$cur_version = str_replace(array('.', 'dev', 'beta', ' '), '', strtolower($pun_config['o_cur_version']));
$cur_version = (strlen($cur_version) == 2) ? intval($cur_version) * 10 : intval($cur_version);
$latest_version = str_replace('.', '', strtolower($latest_version));
$latest_version = (strlen($latest_version) == 2) ? intval($latest_version) * 10 : intval($latest_version);
if ($cur_version >= $latest_version)
echo 'You are running the latest version of PunBB.<br />';
else
echo '<strong style="color:red">A new version of PunBB has been released. You should download the latest version at <a href="http://punbb.org/">PunBB.org</a>.</strong><br />';
}
?>
© Copyright 2002, 2003, 2004, 2005 Rickard Andersson
</dd>
<dt>PunBB News</dt>
<dd>
<?php
if (!ini_get('allow_url_fopen'))
echo 'Unable to check for news since \'allow_url_fopen\' is disabled on this system.<br />';
else {
$fp = @fopen('http://punbb.org/forums/extern.php?action=new&fid=48&show=3', 'r');
@stream_set_timeout($fp, 1);
$news = trim(@fread($fp, 1000));
@fclose($fp);
if ($news != "")
echo "<ul>\n".$news."\n</ul>";
else
echo "News is currently unavailable.";
}
?>
</dd>
it will show a big red message if theres a new version and also show the latest 3 news items from this forum.