vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Mapping theme from forum to site (https://vborg.vbsupport.ru/showthread.php?t=213064)

Namelles One 05-07-2009 06:59 AM

Mapping theme from forum to site
 
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...on_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.
PHP Code:

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

PHP Code:

$bbcode_parser =& new vB_BbCodeParser($vbulletinfetch_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:
PHP Code:

$bbcode_parser =& new vB_BbCodeParser($vbulletinfetch_tag_list());

$previewmessage $bbcode_parser->parse($message['pagetext'], 'socialmessage'$message['disablesmilies'] ? 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 [DATE]1242370197[/DATE] at [TIME]1242370197[/TIME] ---------------

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

PHP Code:

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



All times are GMT. The time now is 09:19 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00985 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete