YourWBB


yourWBB » WoltLab Burning Board Generation 2 * » Alles von und für das WBB 2.3.x » [WBB 2.3.x] Allg. Fragen und Probleme » Formatierung und BB-Codes auf neuer Site verwenden » Hallo Gast [Anmelden|Registrieren]
Letzter Beitrag | Erster ungelesener Beitrag 1.081 Views | | Thema zu Favoriten hinzufügen

Neues Thema erstellen Antwort erstellen

Dieses Thema wurde als erledigt markiert. Thread erledigt

Zum Ende der Seite springen Formatierung und BB-Codes auf neuer Site verwenden
Autor
Beitrag « Vorheriges Thema | Nächstes Thema »
hardcore-punk hardcore-punk ist männlich
Dünngsöchter


images/avatars/avatar-4380.gif

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

 Formatierung und BB-Codes auf neuer Site verwenden Antworten Zitieren Editieren Melden       UP

Heyho, brauch kurz mal eure Hilfe, weil ich nichtmehr so recht weiterkomme, irgendwie bin ich anscheinend zu blöd, dass ohne Fehlermeldungen hinzubekommen Irre


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... cool

Code und Demo hab ich Euch angehängt, bin dankbar für jede Hilfe.
Blume

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

__________________
***

DOWNR!DERS LINZ
Downriders-Linz'Downhill'Freeride'Dirtjump'MTB

***

30.03.09 15:09 hardcore-punk ist offline E-Mail WWW Finden Als Freund hinzufügen Füge hardcore-punk in deine Kontaktliste ein AIM-Name von hardcore-punk: huemerdaniel YIM-Name von hardcore-punk: sportsitz MSN Passport-Profil von hardcore-punk anzeigen
Agi Agi ist männlich
TEAM - PHP Freak

images/avatars/avatar-5240.gif

Dabei seit: 22.11.04
Beiträge: 2.628
Fähigkeiten: WBB3 Profi
Forenversion: 3.1

Antworten Zitieren Editieren Melden       UP

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 Agi ist offline Finden Als Freund hinzufügen
hardcore-punk hardcore-punk ist männlich
Dünngsöchter


images/avatars/avatar-4380.gif

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

Themenstarter Thema begonnen von hardcore-punk
Antworten Zitieren Editieren Melden       UP

Sehr gut, Dankeschön Agi; funktioniert perfekt : Knutsch
:-)


Hab da eine Zeile vergessen, darum ist das bei nie was geworden ^^

__________________
***

DOWNR!DERS LINZ
Downriders-Linz'Downhill'Freeride'Dirtjump'MTB

***

30.03.09 15:46 hardcore-punk ist offline E-Mail WWW Finden Als Freund hinzufügen Füge hardcore-punk in deine Kontaktliste ein AIM-Name von hardcore-punk: huemerdaniel YIM-Name von hardcore-punk: sportsitz MSN Passport-Profil von hardcore-punk anzeigen
Baumstruktur | Brettstruktur
Gehe zu:

Neues Thema erstellen Antwort erstellen

yourWBB » WoltLab Burning Board Generation 2 * » Alles von und für das WBB 2.3.x » [WBB 2.3.x] Allg. Fragen und Probleme » Formatierung und BB-Codes auf neuer Site verwenden