Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki

change {{NUMBEROFARTICLES}}

 

 

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded


grimm.otzberg at freenet

May 2, 2008, 10:46 AM

Post #1 of 4 (72 views)
Permalink
change {{NUMBEROFARTICLES}}

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!! :-(

Steffen Grimm
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


grimm.otzberg at freenet

May 5, 2008, 6:25 AM

Post #2 of 4 (52 views)
Permalink
change {{NUMBEROFARTICLES}} [In reply to]

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}}. They all have the size 5Bytes (because of the template - {{W}}) 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!! :-(

Steffen Grimm
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


emufarmers at gmail

Aug 19, 2008, 1:07 PM

Post #3 of 4 (68 views)
Permalink
Re: change {{NUMBEROFARTICLES}} [In reply to]

On Fri, May 2, 2008 at 1:46 PM, Steffen Grimm <grimm.otzberg[at]freenet.de>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 = "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>.
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


grimm.otzberg at freenet

Aug 20, 2008, 3:55 AM

Post #4 of 4 (62 views)
Permalink
Re: change {{NUMBEROFARTICLES}} [In reply to]

----- original Nachricht --------

Betreff: Re: [Mediawiki-l] change {{NUMBEROFARTICLES}}
Gesendet: Di 19 Aug 2008 22:08:17 CEST
Von: "Benjamin Lees"<emufarmers[at]gmail.com>

> On Fri, May 2, 2008 at 1:46 PM, Steffen Grimm
> <grimm.otzberg[at]freenet.de>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>.
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l[at]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.
http://office.freenet.de/dienste/emailoffice/produktuebersicht/power/mail/index.html


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.