Madd Eye
Hallo zusammen ich bins mal wieder xD
mein Problem bezieht sich diesemal auf meienn Aktuellen Wbblite hack
Newssystem
die ausgabe läuft falsch ab
hier die falsche ausgabe:
Klick
und hier der code dazu:
news.php
php: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
|
<?php
$news="news.php";
$sid = $_REQUEST['sid'];
$pro_seite = 10;
require("./global.php");
$sql = "Select * From bb".$n."_news ORDER BY id desc limit ".$pro_seite;
$result = $db->query($sql) or die('Fehler bei der Selctierung: '.mysql_error());
while (list($id, $titel, $text)= $db->fetch_array($result))
{
eval("\$tpl->output(\"".$tpl->get("news")."\");");
}
?> |
|
news.tpl
code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
|
{!DOCTYPE}
<html>
<head>
<title>$master_board_name - News </title>
$headinclude
</head>
<body id="bg">
$header
<tr bgcolor="{tablecolora}" id="tablea">
<td><table cellpadding=0 cellspacing=0 border=0 width="100%">
<tr>
<td><smallfont><b><a href="news.php?sid=$session[hash]">$master_board_name</a> » News</b></font></td>
<td align="right"><smallfont><b>$usercbar</b></font></td>
</tr>
</table></td>
</tr>
</table><br>
<table cellpadding=4 cellspacing=1 border=0 width="{tableinwidth}" bgcolor="{tableinbordercolor}">
<tr id="tablea" bgcolor="{tablecolora}">
<td>
$titel
$text
</td>
</tr>
</table>
$footer
</body>
</html>
|
|
Was läuft schief?
Agi
Auf 2 Templates aufteilen.
php: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
|
<?php
$news="news.php";
$sid = $_REQUEST['sid'];
$pro_seite = 10;
require("./global.php");
$sql = "Select * From bb".$n."_news ORDER BY id desc limit ".$pro_seite;
$result = $db->query($sql) or die('Fehler bei der Selctierung: '.mysql_error());
while (list($id, $titel, $text)= $db->fetch_array($result))
{
eval("\$newsbit .= \"".$tpl->get("newsbit")."\";");
}
eval("\$tpl->output(\"".$tpl->get("news")."\");");
?> |
|
news.tpl
code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
|
{!DOCTYPE}
<html>
<head>
<title>$master_board_name - News </title>
$headinclude
</head>
<body id="bg">
$header
<tr bgcolor="{tablecolora}" id="tablea">
<td><table cellpadding=0 cellspacing=0 border=0 width="100%">
<tr>
<td><smallfont><b><a href="news.php?sid=$session[hash]">$master_board_name</a> » News</b></font></td>
<td align="right"><smallfont><b>$usercbar</b></font></td>
</tr>
</table></td>
</tr>
</table><br>
$newsbit
$footer
</body>
</html> |
|
newsbit.tpl
code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
|
<table cellpadding=4 cellspacing=1 border=0 width="{tableinwidth}" bgcolor="{tableinbordercolor}">
<tr id="tablea" bgcolor="{tablecolora}">
<td>
$titel
$text
</td>
</tr>
</table><br /> |
|
Sollte so eigentlich klappen.
Falls du den Inhalt des Bit-Templates nur 1x ausgeben willst, den Punkt vor dem = entfernen (eval("\$newsbit
= \"".$tpl->get("newsbit")."\";");
Madd Eye
Danek für die schnelle hilfe
Kannst du mir vllt auch mit dem hier helfen
ich komm mit dem Funktionen vom wbblite immer durcheinander
ich möche meine db updaten ich bekomm aber nur nen Fehler:
Code:
php: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
|
<?php
[..]
if($step==4){
$titel = $_POST["titel"];
$text = $_POST["text"];
$db->unbuffered_query("UPDATE bb".$n."_news WHERE titel = '".$titel."' SET titel='".$titel."', text='".$text."' ") OR die('Fehler beim überschreiben in die Datenbank: '.mysqlerror());
$titel = mysql_real_escape_string($titel);
$titel = mysql_real_escape_string($text);
eval("print(\"".gettemplate("news_edit")."\");");
}
?>
|
|
Fehler:
Zitat: |
Database error in WoltLab Burning Board: Invalid SQL: UPDATE bb1_news WHERE titel = 'Test2' SET titel='Test2', text=''
mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE titel = 'Test2' SET titel='Test2', text=''' at line 1
mysql error number: 1064
Date: 19.11.2008 @ 15:43
Script: /wbblite/acp/news.php
Referer: http://opaw.kilu.de/wbblite/acp/news.php |
Madd Eye
Also hab ich die mysql befehle nur vertauscht?
Danke das es so einfach geht xD
Maniac und Agi sind meine PHP Götter
Maniac_81
und du hast die maskierung falsch gehabt, diese muss vor den sql befehl und du hast ausserdem 2 mal die variable $title maskiert.
php: |
1:
2:
|
$titel = mysql_real_escape_string($titel);
$titel = mysql_real_escape_string($text); |
|