hardcore-punk
Dünngsöchter


Dabei seit: 01.11.04
Beiträge: 4.591
Fähigkeiten: WBB3 Fortgeschritten; WBB2 Profi; WBB Lite 2 Anfänger; WBB Lite 1 Profi Herkunft: Im tiefsten Wald von Österreich Forenversion: 2.3; Lite 1.0
 |
|
Heyho, brauch kurz mal eure Hilfe, weil ich nichtmehr so recht weiterkomme, irgendwie bin ich anscheinend zu blöd, dass ohne Fehlermeldungen hinzubekommen
Problembeschreibung:
Hab jetzt für mein Projekt eine neue Startseite aufgebaut, welche u.a. News aus einem Forum (bzw. dem Newsforum) ausliest. Nun hab ich das Problem, dass die News ohne irgendwelcher Formatierungen und BB-Codes dargestellt werden.
Hab schon ein wenig herumprobiert, allerdings war das meist dann ziemlich umständlich aufgebaut, und machte schlußendlich auch wieder nur Fehler...
Code und Demo hab ich Euch angehängt, bin dankbar für jede Hilfe.
| php: |
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:
|
<?php
$filename="punkrock-news.php";
require('./global.php');
require('./acp/lib/class_parse.php');
$limit = "8";
$length = "1000000000000000000000000";
$usableboards="13";
$result=$db->query("SELECT * FROM bb".$n."_posts p, bb".$n."_threads t WHERE p.visible=1 AND closed!=3 AND p.threadid=t.threadid AND t.starttime=p.posttime AND boardid IN (".$usableboards.") ORDER BY t.starttime DESC LIMIT $limit");
while ($row=$db->fetch_array($result)) {
$topic = $row['topic'];
$prefix = $row['prefix'];
$starter = $row['starter'];
$lastposttime = date("D, d M Y ",$row['starttime']);
$lastposttime2 = date("Y-m-dTH:i:s+01:00",$row['starttime']);
$threadid = $row['threadid'];
$threadlink = "$url2board/thread.php?threadid=".$row['threadid'];
$message=textwrap($row['message']);
if(strlen($message) > $length){ $message = "".substr($message, 0, $length);$message.=" ...";}
else $description="<b><u>$lastposttime - $prefix $topic ($starter)</u></b><br />$message<br />[<a href=\"$threadlink\">zum Beitrag</a>]";
eval ("\$template_bit .= \"".$tpl->get("punkrock-news_bit")."\";");
}
eval("\$tpl->output(\"".$tpl->get("punkrock-news")."\");");
?>
|
|
Link zum Forum oder Screenshot:
http://www.punkrock-forum.com/punkrock-news.php
__________________
***
***
|
|
30.03.09 15:09 |
E-Mail
WWW
Finden
Als Freund hinzufügen
|
|
Agi
TEAM - PHP Freak

Dabei seit: 22.11.04
Beiträge: 2.628
Fähigkeiten: WBB3 Profi Forenversion: 3.1
 |
|
Du müsstest die Nachricht parsen lassen.
Probiers mal damit:
| php: |
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:
34:
35:
|
<?php
$filename="punkrock-news.php";
require('./global.php');
require('./acp/lib/class_parse.php');
$limit = "8";
$length = "1000000000000000000000000";
$usableboards="13";
$parse = &new parse($docensor, 75, 1, $highlight, $usecode[1]);
$allow = array();
$allow[0] = '0'; //* smilies umwandeln
$allow[1] = '0'; //* html umwandeln
$allow[2] = '1'; //* bbcodes umwandeln
$allow[3] = '1'; //* grafiken umwandeln
$result=$db->query("SELECT * FROM bb".$n."_posts p, bb".$n."_threads t WHERE p.visible=1 AND closed!=3 AND p.threadid=t.threadid AND t.starttime=p.posttime AND boardid IN (".$usableboards.") ORDER BY t.starttime DESC LIMIT $limit");
while ($row=$db->fetch_array($result)) {
$topic = $row['topic'];
$prefix = $row['prefix'];
$starter = $row['starter'];
$lastposttime = date("D, d M Y ",$row['starttime']);
$lastposttime2 = date("Y-m-dTH:i:s+01:00",$row['starttime']);
$threadid = $row['threadid'];
$threadlink = "$url2board/thread.php?threadid=".$row['threadid'];
$message=$parse->doparse($row['message'], $allow[0], $allow[1], $allow[2], $allow[3]);
if(strlen($message) > $length){ $message = "".substr($message, 0, $length);$message.=" ...";}
else $description="<b><u>$lastposttime - $prefix $topic ($starter)</u></b><br />$message<br />[<a href=\"$threadlink\">zum Beitrag</a>]";
eval ("\$template_bit .= \"".$tpl->get("punkrock-news_bit")."\";");
}
eval("\$tpl->output(\"".$tpl->get("punkrock-news")."\");");
?> |
|
__________________
|
|
30.03.09 15:33 |
Finden
Als Freund hinzufügen
|
|
|