Quote:
Originally Posted by chrisjp88
BTW. The maker of this mod hasn't posted since January, 7 months ago. I'm guessing he doesn't have an interest in vb anymore.
I've been spending ages looking at all the files it uses, and can't find anywhere where it says to NOT use QUOTE tags.
The thing is it's such a HUGE flaw. So many news articles contain quotes, it's a must have. Does anybody know of a smilar script without such a flaw?
|
Quote:
Originally Posted by got haggis?
i have the same problem..also using 3.5.4
edit: duh, one page back (23) there is the answer that solved this.
Now, where can i modify <fieldset> so it doesn't span across the entire page.
|
Well, the problem is basically that the standard code that calls the BBCode parser and this will handle all the standard tags, but not some of the ones that require a template definitions for a forum. These include QUOTE and CODE.
To be honest this makes sense, as the template you probably use on your forum probably will not match the one you will use on your news page.
What I did was to simply process QUOTE tages (I'm not interested in CODE) ones prior to the BBCode parser call. Viola!
Here's my modified code (Due to BBCodes on these forums cocking stuff up I've changed the stuff below so QUOTE=ETOUQ)
Code:
// Load Template
$NewsTemplate = LoadTemplate("news.html");
// Collect Data
$NewestNews = $db->query("
select t.*,p.pagetext
from ".TABLE_PREFIX."thread t
left join ".TABLE_PREFIX."post p on(p.postid=t.firstpostid)
where t.forumid = $Forum
order by dateline desc
limit 0,$Amount");
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
while($News = $db->fetch_array($NewestNews)){
$neils_text = $News['pagetext'];
// Convert QUOTE tag
$convert_from = array("[ETOUQ]", "[/ETOUQ]",);
$convert_to = array("<DIV CLASS=news-quote>", "</DIV>");
$neils_text = str_replace($convert_from, $convert_to, $neils_text);
// Convert BBCodes
$neils_text = $bbcode_parser->do_parse(unhtmlspecialchars($neils_text), true, true, true);
$Data .= ParseTemplate($NewsTemplate,
array(
'threadid' => $News['threadid'],
'threadname' => $News['title'],
'postusername' => $News['postusername'],
'post' => $neils_text,
'comments' => vb_number_format($News['replycount']),
'postdate' => date( "l j-M-Y", $News['dateline']),
)
);
}
This isn't all my code - I've also put in stuff so I can ignore a thread, and also put a "more break" in so you could post a 10 page story, but put in a "more break" about 12 lines in, so the news page only displays upto that point. I'm also doing an "all news stories" thing as well...
For all my posting no one really helped me, so I hope this helps you!
ps: If you don't want to allow HTML conversion, then I guess you could disable that in the do_parse call, and instead replace the QUOTE tags with something else prior to the do_parse call, and then replace them again back to the HTML format afterwards... Just as long as you don't leave the QUOTE tags in there in their standard BBCode form before the do_parse call you'll be fine