----- original Nachricht --------
Betreff: Re: [Mediawiki-l] change {{NUMBEROFARTICLES}}
Gesendet: Di 19 Aug 2008 22:08:17 CEST
Von: "Benjamin Lees"<emufarmers(a)gmail.com>
On Fri, May 2, 2008 at 1:46 PM, Steffen Grimm
<grimm.otzberg(a)freenet.de>wrote;wrote:
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 = " 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 = " page WHERE page_is_redirect > 0;";
$result = mysql_query($sql);
$c = 0;
while ($resuld = mysql_fetch_array($result, MYSQL_NUM)) {
$c++;
}
$sql = " 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>gt;.
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
--- original Nachricht Ende ----
Thank you, but I want to count all pages with a size bigger than 5 Bytes (because of the
redirecting-template
Unbegrenzter Speicher, Top-Spamschutz, 120 SMS und eigene E-MailDomain inkl.