On Fri, May 2, 2008 at 1:46 PM, Steffen Grimm grimm.otzberg@freenet.dewrote:
Hello, I've got a wiki abot a special theme. All pages, which doesn,t apply to the wiki are linked to wikipedia (with a template) But I want, that these pages aren't counted in {{NUMBEROFARTICLES}}. I've got pages in other namespaces, which should be counted, too. This variable isn't working right, so I decided to change the code:
<? include ('dbpass.php'); @mysql_connect($dbhost, $dbuser, $dbpass); @$x=mysql_select_db($dbdata); if (empty($x)) { echo "Fehler beim Verbinden mit dem Datenbankserver<br>"; exit; } $sql = "SELECT page_namespace FROM page WHERE page_namespace = 0 OR page_namespace = 4;"; $result = mysql_query($sql); $a = 0; while ($resuld = mysql_fetch_array($result, MYSQL_NUM)) { $a++; } $sql = "SELECT page_namespace FROM page WHERE page_is_redirect > 0;"; $result = mysql_query($sql); $c = 0; while ($resuld = mysql_fetch_array($result, MYSQL_NUM)) { $c++; } $sql = "SELECT page_namespace FROM page WHERE page_len = 5;"; $result = mysql_query($sql); $d = 0; while ($resuld = mysql_fetch_array($result, MYSQL_NUM)) { $d++; } $summe = $a + $b; $summe -= $c + $d; ?>
This code is working allright, but I don't know where to place it. Must I put it to initStats.inc in the maintenance-folder, or in SpecialStatistics.php? Please help me!! :-(
Just change $wgContentNamespaces < http://www.mediawiki.org/wiki/Manual:$wgContentNamespaces%3E.