anpera.net
https://anpera.homeip.net/phpbb3/

motd...
https://anpera.homeip.net/phpbb3/viewtopic.php?f=25&t=2527
Seite 1 von 1

Autor:  Taikun14 [ Do 04 Mai, 2006 14:04 ]
Betreff des Beitrags:  motd...

[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='&gt;' 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

Autor:  Garlant [ Do 04 Mai, 2006 14:58 ]
Betreff des Beitrags: 

Dies ist der Falsche Bereich und wie wäre es, wenn du dir die Zeile 171, mal genauer anschaust? :)
[php] Zeile 171:
$result = db_query("SELECT mid(motddate,1,7) AS d, count(*) AS c FROM ".db_prefix("motd")." GROUP BY d ORDER BY d DESC"); [/php]

Ersetze diesen query, bitte einfach durch:
[php]
$result = db_query("SELECT mid(motddate,1,7) AS d, count(*) AS c FROM motd GROUP BY d ORDER BY d DESC"); [/php]

Autor:  Taikun14 [ Do 04 Mai, 2006 15:22 ]
Betreff des Beitrags: 

kommt immer noch der gleiche fehler ...

Autor:  Garlant [ Do 04 Mai, 2006 15:26 ]
Betreff des Beitrags: 

Hättest auch selbst auf die Idee kommen können den gleichen Fehler weiter oben zu beheben. Aber bitte dann kaue ich dir das vor*grml* :!:

Suche:
[php]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);
} [/php]
Ersetze mit:
[php]if ($m > ""){
$sql = "SELECT motd.*,name AS motdauthorname FROM motd LEFT JOIN accounts ON accounts.acctid = motd.motdauthor WHERE motddate >= '{$m}-01' AND motddate <= '{$m}-31' ORDER BY motddate DESC";
$result = db_query($sql);
}else{
$sql = "SELECT motd.*,name AS motdauthorname FROM motd LEFT JOIN accounts ON accounts.acctid = motd.motdauthor ORDER BY motddate DESC limit $count";
$result = db_query($sql);
} [/php]

Garlant

Autor:  Taikun14 [ Do 04 Mai, 2006 16:15 ]
Betreff des Beitrags: 

jo thx funzt jetzt. Sorry das ich mich so dumm anstelle :P
EDIT:

Problem beim motd schreiben ...

INSERT INTO motd (motdtitle,motdbody,motddate,motdprefix,motdauthor) VALUES ("....","....",now(),"")

Column count doesn't match value count at row 1

EDIT:
FIXED

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/