Currently more chaos than helpful.
/actions/lastedited.php
<?php
//Declaration and the read in...
if($pages = $this->LoadRevisions($this->tag))
{
$this->context[++$this->current_context] = "";
$last_edited = $pages[0];
//Output
if ($this->GetResourceValue("LastEdited"))
$output .= $this->GetResourceValue("LastEdited").": ";
else
$output .= "Last edited by: ";
$output .= $this->Link($last_edited["user"]);
$output .= " <small>(".$last_edited["time"].")</small>";
print($output);
$this->current_context--;
} else {
print($this->GetResourceValue("ReadAccessDenied"));
}
?>
SkipPer /05.01.2005 09:37/ awesome men, mit Sprachvariable für die wakka.de.php kann mans sogar eindeutschen, der (css) Teil vielleicht mit Parameter, manche wollen es vielleicht linksbündig (grübel)
/actions/highscores.php
<?php
# highscores.php {{HighScores}}
# by Chris Tessmer
# 19 Dec 2002
# license: GPL
$str = 'SELECT Count(*) AS cnt, `name` FROM ';
$str .= $this->config["table_prefix"] . 'users, ' ;
$str .= $this->config["table_prefix"].'pages ';
$str .= "WHERE `name` = `owner` AND `latest` = 'Y' AND `comment_on` = '' GROUP BY name ORDER BY cnt DESC;";
$rankQuery = $this->Query( $str );
$str = 'SELECT COUNT(*) FROM '.$this->config["table_prefix"].'pages WHERE `latest` = \'Y\' AND `comment_on` = \'\' ';
$totalQuery = $this->Query( $str );
$total = mysql_result($totalQuery, 0);
print( "<blockquote><table>" );
$i = 0;
while( $row = mysql_fetch_array($rankQuery) )
{
$i++;
$str = '<tr>';
$str .= "<td>$i. </td>";
$str .= '<td>'. $this->Link("/".$row["name"]," ",$row["name"]).'</td>';
$str .= '<td> </td>';
$str .= '<td> </td>';
$str .= '<td>'.$row["cnt"].'</td>';
$str .= '<td> </td>';
$str .= '<td>'. round( ($row["cnt"]/$total)*100, 2).'% </td>';
$str .= '</tr>';
print( $str );
}
print( "</table></blockquote>" );
?>
Reason: Menu language of WackoWiki in your native / prefered language.
Collecting:
Um an die im Browser eingestellte Sprache zu kommen muss man ja den Header (der an den Server geschickt wird) auslesen:
<?
switch (substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)) {
case 'de':
header("location: .....de");
break;
case 'en':
header("location: ........com");
break;
case 'it':
header("location: ........it");
break;
case 'es':
header("location: ........es");
break;
default:
header("location: .....de");
}
?>
<?php
//Sprache auslesen und entsprechend umleiten
$languages = explode(",",$HTTP_ACCEPT_LANGUAGE);
foreach ($languages as $key => $langcode) {
if (preg_match("/^de/i",$langcode)) {
header ("Location: index_de.php"); //zur deutschen Sprache
exit;
}
if (preg_match("/^en/i",$langcode)) {
header ("Location: index_en.php"); // zur englischen Sprache
exit;
}
header ("Location: index_en.php"); // falls Sprache nicht gefunden zur default Sprache
exit;
?>
Thoughts / Brainstorm:
Process while contacting a wiki: