Jeśli mamy jakiś problem, i potrzebujemy komuś podać dane na temat serwera etc. a nie wiemy, lub po prostu nie chce nam się lekiem jest ta modyfikacja. Dodaje nam stronę, na której są wszelkie informacje o forum np. nasze.
Tworzymy sobie w katalogu głównym forum plik .php, nazwijmy go info.php. Wklejamy do niego następującą treść.
Od teraz każdy będzie wiedział jakie mamy wtyczki, wersje php, mysql etc.
Tworzymy sobie w katalogu głównym forum plik .php, nazwijmy go info.php. Wklejamy do niego następującą treść.
Kod: Zaznacz cały
<?php
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'info.php');
require_once "./global.php";
?>
<html xml:lang="pl" lang="pl" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Diagnostyka</title>
<?php
echo $headerinclude;
echo "</head><body>";
echo $header;
echo "<table border=\"0\" cellspacing=\"{$theme['borderwidth']}\" cellpadding=\"{$theme['tablespace']}\" class=\"tborder\">
<tr>
<td class=\"thead\" colspan=\"2\"><strong>Info i reksio-cs.pl</strong></td>
</tr>";
$gd_version = gd_info();
$diags = array(
'Wersja MyBB' => $mybb->version,
'Adres forum' => $mybb->settings['bburl'],
'Domena ciasteczek' => $mybb->settings['cookiedomain'],
'Sciezka ciastek' => $mybb->settings['cookiepath'],
'Prefix ciastek' => $mybb->settings['cookieprefix'],
'Kompresja gzip' => $mybb->settings['gzipoutput'],
'Adresy ala seo?' => $mybb->settings['seourls'],
'UID admina' => $config['super_admins'],
'Typ cache' => $config['cache_store'],
'Format bazy' => $config['database']['encoding'],
'Aktywne pluginy' => plugin_list(),
'Wersja GD' => $gd_version['GD Version'],
'Wersja PHP' => phpversion(),
'Wersja MySQL' => find_SQL_Version(),
'Prawa do pliku ustawien' => substr(decoct(fileperms("inc/settings.php")),3),
'Prawa do configu' => substr(decoct(fileperms("inc/config.php")),3),
'Chmody uploadu)' => substr(decoct(fileperms("uploads")),2),
'Chmody uploadu avatarow' => substr(decoct(fileperms("uploads/avatars")),2),
'Chmod folderu cache(tylko gdy typ cache "files")' => substr(decoct(fileperms("cache")),2),
);
foreach ($diags as $key => $value)
{
echo "<tr><td class=\"trow1\">".$key."</td><td class=\"trow2\">".$value."</td></tr>";
}
echo "</table>";
echo "<div align=\"center\"><a href=\"http://www.reksio-cs.pl/\" title=\"serwery cs\">Serwery CS</a></div>";
echo $footer;
echo"</body>
</html>";
function find_SQL_Version() {
$output = shell_exec('mysql -V');
preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);
return $version[0];
}
function plugin_list(){
global $cache;
$pluginlist = $cache->read("plugins");
if(is_array($pluginlist['active']))
{
foreach($pluginlist['active'] as $plugin)
{
$plist .= $plugin.", ";
}
$plist = rtrim($plist,", ");
}
return $plist;
}
?>Od teraz każdy będzie wiedział jakie mamy wtyczki, wersje php, mysql etc.