Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 05-07-2009, 06:59 AM
Namelles One Namelles One is offline
 
Join Date: Oct 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?..
Reply With Quote
  #2  
Old 05-07-2009, 02:17 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You have to query the database for the comments, I would guess.
Reply With Quote
  #3  
Old 05-08-2009, 04:58 AM
Namelles One Namelles One is offline
 
Join Date: Oct 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 05-08-2009, 05:05 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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') . '" . ", ";');
        } 
Reply With Quote
  #5  
Old 05-14-2009, 11:15 AM
Namelles One Namelles One is offline
 
Join Date: Oct 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #6  
Old 05-14-2009, 02:47 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 05-14-2009, 03:37 PM
Namelles One Namelles One is offline
 
Join Date: Oct 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 05-14-2009, 03:47 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.)
Reply With Quote
  #9  
Old 05-14-2009, 07:18 PM
Namelles One Namelles One is offline
 
Join Date: Oct 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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']); 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:27 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03951 seconds
  • Memory Usage 2,244KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete