-<?
-
+<?php
+/**
+ * @package MediaWiki
+ * @subpackage Maintenance
+ * @todo document
+ */
$textsourcefile_web = "http://meta.wikipedia.org/w/index.php?title=PortalText&action=raw" ;
$textsourcefile = "t.txt" ;
#$articlecountfile_web = "http://magnusmanske.de/wikipedia/num.txt" ;
if ( isset ( $HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"] ) )
$userlang = $HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"] ;
-else $userlang = "" ;
+else $userlang = '' ;
# Update local files
if ( isset ( $_GET["update"] ) )
copy ( $articlecountfile_web , $articlecountfile ) ;
}
-# Reads a file into a string
+/**
+ * Reads a file into a string
+ */
function readafile ( $filename )
{
$handle = fopen($filename, "r");
return $contents ;
}
-# Parsing statistics file
+/** Parsing statistics file */
function get_numbers ( $filename )
{
$r = array () ;
}
return $r ;
}
-
-# Make shades for pref. language(s)
+
+/** Make shades for pref. language(s) */
function getshades ( $l )
{
$r = array () ;
$y = explode ( ";" , $x ) ;
if ( count ( $y ) == 2 ) $weight = array_pop ( explode ( "=" , $y[1] ) ) ;
else $weight = "1.0" ;
-
+
$lang = array_shift ( $y ) ;
$lang = explode ( "-" , $lang ) ;
$lang = trim ( strtolower ( array_shift ( $lang ) ) ) ;
$t = explode ( "\n" , $t ) ;
foreach ( $t AS $x )
{
- $y = explode ( ":" , $x , 2 ) ;
+ $y = explode ( ':' , $x , 2 ) ;
if ( count ( $y ) == 2 )
{
$language = trim ( strtolower ( $y[0] ) ) ; # language id
}
if ( $count != 0 ) $l .= "</tr>" ;
$l .= "</table>" ;
-
+
print "<html><head></head><body>" ;
print $l ;
print "</body></html>" ;