[php]
.....
//month archiv [Code from 1.0.2 by Day]
$count = getsetting("motditems", 5);
$m = $_GET["month"];
if ($m > ""){
$sql = "SELECT " . db_prefix("motd") . ".*,name AS motdauthorname FROM " . db_prefix("motd") . " LEFT JOIN " . db_prefix("accounts") . " ON " . db_prefix("accounts") . ".acctid = " . db_prefix("motd") . ".motdauthor WHERE motddate >= '{$m}-01' AND motddate <= '{$m}-31' ORDER BY motddate DESC";
$result = db_query($sql);
}else{
$sql = "SELECT " . db_prefix("motd") . ".*,name AS motdauthorname FROM " . db_prefix("motd") . " LEFT JOIN " . db_prefix("accounts") . " ON " . db_prefix("accounts") . ".acctid = " . db_prefix("motd") . ".motdauthor ORDER BY motddate DESC limit $count";
$result = db_query($sql);
}
for ($i=0;$i<db_num_rows($result);$i++){
$row = db_fetch_assoc($result);
if (!isset($session['user']['lastmotd']))
$session['user']['lastmotd']=0;
if ($row['motdauthorname']=="")
$row['motdauthorname']="`@Green Dragon Staff`0";
if ($row['motdtype']==0){
motditem($row['motdtitle'].' '.($session[user][superuser]>=3?"`b[<a href='motd.php?op=del&id=$row[motditem]' onClick=\"return confirm('Bist du sicher, dass dieser Eintrag gelöscht werden soll?');\">Del</a>]":"`b"), $row['motdbody'],
$row['motdauthorname'], $row['motddate']);
}else{
pollitem($row['motditem'], $row['motdtitle'].' '.($session[user][superuser]>=3?"`b[<a href='motd.php?op=del&id=$row[motditem]' onClick=\"return confirm('Bist du sicher, dass dieser Eintrag gelöscht werden soll?');\">Del</a>]":"`b"), $row['motdbody'],
$row['motdauthorname'], $row['motddate']);
}
}
output('`6');
$result = db_query("SELECT mid(motddate,1,7) AS d, count(*) AS c FROM ".db_prefix("motd")." GROUP BY d ORDER BY d DESC");
$row = db_fetch_assoc($result);
rawoutput("<form action='motd.php' method='GET'>");
rawoutput('MoTD Archiv: ');
rawoutput("<select name='month' onChange='this.form.submit();' >");
rawoutput("<option value=''>--Current--</option>");
while ($row = db_fetch_assoc($result)){
$time = strtotime("{$row['d']}-01");
$m = date("M",$time);
rawoutput ("<option value='{$row['d']}'>$m".date(", Y",$time)." ({$row['c']})</option>");
}
rawoutput("</select>");
rawoutput("<input type='submit' value='>' class='button'>");
rawoutput("</form>");
//end
...
[/php]
Beim aufrufen der Motd kommt der Fehler :
Fatal error: Call to undefined function: db_prefix() in /www/htdocs/w0059430/motd.php on line 171
Link zum Source :
http://logd.nexus7.info/source.php
Hoffe ihr könnt helfen