PDA

View Full Version : Mapping theme from forum to site


Namelles One
05-07-2009, 06:59 AM
I have made a comment system to my news site - when people want to comment, they click on button, enter captcha and forum bot makes theme, where people can leave comments to this news.

And now I want to show this comments near news on my site, show current theme in linear mode outside of forum.

How I can do it?..

Lynne
05-07-2009, 02:17 PM
You have to query the database for the comments, I would guess.

Namelles One
05-08-2009, 04:58 AM
Query - I can do it, 5 minutes, not more))

But how can I show posts of this thread as in forum? With avatars on left, with all buttons?

Like this, maybe, http://www.igromania.ru/HardwareNews/9222/MSI_gotovit_modifikaciyu_Radeon_HD_4890.htm

Don't read russian text of news, only look at comments.

Lynne
05-08-2009, 05:05 AM
After you do the query, in the while loop you have that goes through the results, you may eval a template that has the avatar and buttons you want. ie.

while ($query_result = $vbulletin->db->fetch_array($my_query))
{
eval('$results .= "' . fetch_template('comment_postbit') . '" . ", ";');
}

Namelles One
05-14-2009, 11:15 AM
Some interesting thing...

$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list('', true));
echo $bbcode_parser->parse(unhtmlspecialchars($Thread['pagetext']),0,false);

Tags like [img] are parsing okey, but, for example, [quote] tags don't parsing and text in it crops. What is it? How can I do correct parsing?

Lynne
05-14-2009, 02:47 PM
Can you post an image? I don't know what you mean about text being cropped.

I used the following lines in something I wrote that parses the tags:
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());

$previewmessage = $bbcode_parser->parse($message['pagetext'], 'socialmessage', $message['disablesmilies'] ? 0 : 1)

You may want to take a look at the API, or just read the code, regarding the vB_BbCodeParser class.

Namelles One
05-14-2009, 03:37 PM
I read code of vB_BbCodeParser today.

Text with [quote] go throw the parser == parser return nothing. Why? Maybe something with templates? Why parser do not return HTML code for this tag?

[IMG], [URL] and some other parses well.

Lynne
05-14-2009, 03:47 PM
Well, I used the code I posted and quote tags parsed just fine for me. (I don't have unhtmlspecialchars in my code. You may not need that.)

Namelles One
05-14-2009, 07:18 PM
unhtmlspecialchars - okey, it was only testing.

Tomorrow I wil test your code and write here. Thanks)

--------------- Added 1242370197 at 1242370197 ---------------

I don't know what and why, but it works.

$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list('',true));
$bbcode_parser->do_parse($Thread['pagetext']);