Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > General Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
How To: Add A "Comment On This News (3 Comments)" to a webpage.
nogerorob
Join Date: Jun 2004
Posts: 82

 

Portland, OR
Show Printable Version Email this Page Subscription
nogerorob nogerorob is offline 07-21-2004, 10:00 PM

Hello,

If you have a website that you would like to connect your content directly to discussions on your bulletin board, you might enjoy this little hack. Basically it lets your users get directly into commenting on your content, and see immediatly how many people have commented so far.

It doesn't require any editing of vBulletin, to see it in action, check out my main page.


---------------------------------------------------------------

First you need to create a forum thread about the web page you have created. It helps to have a short blurb from the article or news item and a link back to the page in the first post.

See here for an example. You can also see how I?ve organized a Forum Section for News, Articles and Davespeak to reflect different content areas on my site.

I?ve attached two files:

commentLine.php goes in some directory on your server. I put mine in a /SharedCode/php/ dir, but anywhere is fine. The only modification needed in this file is the chdir($_SERVER["DOCUMENT_ROOT"]."/forums/"); to whatever your forums directory is. i.e. /boards/ or /forum/.


example_content.php file is an example of how to use the commentLine.php script on one of your html pages.



Here are the changes that need to be made each time you want to place a Comment On This line:
1. Change the /PATH_TO_COMMENTLINE.PHP/ enter the path from the root of your public_html dir to the commentLine.php directory.

i.e.: "/ServerScripts/php/commentLine.php") ?>

2. In the PHP code at the bottom:
A. Change X to the thread ID of the forum you create on your vBulletin forum.

B. Change the URL to the the thread you create in your vBulletin forum.

C. Change "News" to whatever the above content is describing, article, forum, study, etc.
To see how I use this script, check out one of my pages

I don't know if this requires a database query, which might be important if your webpages are getting tons of page views. It is only calling one function from vB.

Rob
Attached Files
File Type: php commentLine.php (1.1 KB, 106 views)
File Type: php example_content.php (568 Bytes, 81 views)
Reply With Quote
  #12  
Old 08-13-2004, 12:06 AM
Yanks1343 Yanks1343 is offline
 
Join Date: Jun 2004
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This sounds great, but how do I get it to display the post on the main page?

I'd like to display the 3 newest topics..
Reply With Quote
  #13  
Old 08-13-2004, 02:20 AM
nogerorob nogerorob is offline
 
Join Date: Jun 2004
Location: Portland, OR
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Let me see if I can figure this out. I'll give it a shot.

rob
Reply With Quote
  #14  
Old 08-14-2004, 10:57 AM
Vixion Vixion is offline
 
Join Date: Jul 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, I thought YEAH! But I visited you website, and I noticed the following thing;

The 'news' is still posted in a PHP file, included into the main webpage. Isn't there a way, that you can 'insert' the first post of your forum to the news. So you don't ran into problems with no comments, and creating comment page.
Reply With Quote
  #15  
Old 08-14-2004, 03:34 PM
nogerorob nogerorob is offline
 
Join Date: Jun 2004
Location: Portland, OR
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see, so the first comment in the thread would be the content that's inserted into the webpage?

I think this would not be difficult to do, the concern would be making sure that the first post had the proper html/css tags so that when it is inserted into your main page it displays properly.

You can see I am including a php file that contains tables, external style sheet markup and an image. I'm not sure how well this would display in a vB thread. Maybe I'll try it this afternoon.

Would you want the entire contents of the article to be at the head of the thread, or just a summary? In order to refer to a single include from the main page it either has to be complete in the head of the thread.

r
Reply With Quote
  #16  
Old 12-22-2004, 03:28 AM
kkiely kkiely is offline
 
Join Date: Feb 2004
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry to jump in the middle of this discussion but Imay be able to clarify. I believe people are looking for the comments to come ON the page of the article. This hack can be done - because I already have about 5 requests for it out (including a $100 reward), here https://vborg.vbsupport.ru/showthread.php?t=72007.

An example of what I am lookign for is here
http://www.camcorderinfo.com/content...der-review.htm

SCROLL TO THE BOTTOM OF THE PAGE
Reply With Quote
  #17  
Old 12-22-2004, 05:41 AM
nogerorob nogerorob is offline
 
Join Date: Jun 2004
Location: Portland, OR
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You want it to display the past five newest replies to a given thread? Like the past 5 comments?

Kind of like what IMDB does? (scroll to bottom)

I can do this. Let me work on it.

Rob
Reply With Quote
  #18  
Old 05-02-2005, 03:39 PM
firstimecaller's Avatar
firstimecaller firstimecaller is offline
 
Join Date: Feb 2004
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

are there any more options for this type of system to add comments to existing article/news/story pages? I have lots of articles that exist on their own in separate sections of my site. I'd just like to add the ability to comment on them but this hack seems overly simple. TIA
Reply With Quote
  #19  
Old 05-04-2005, 12:30 AM
nogerorob nogerorob is offline
 
Join Date: Jun 2004
Location: Portland, OR
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Heh, easy on the "overly simple" stuff.

You can use this code to add to existing pages. You simply need to create the corresponding threads, or use the threadID from an old discussion on the particular aritcle / news item.

See it in action: www.weeklydavespeak.com.

r

ps. as a brief aside, I haven't done the last 5 replies hack yet--but I still intend to.
Reply With Quote
  #20  
Old 05-04-2005, 01:13 AM
kkiely kkiely is offline
 
Join Date: Feb 2004
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what I am looking for is where the comment are shown under the actual story - not the way IMDB does it but the way TechIMO does it. They actually use a commercial program called ReviewPost which is only $100. Considering I have posted a paid request for a hack here and on rent-a-coder for $100 and got no interest I think I will buy reviewpost until a VB hack comes out.

http://www.techimo.com/newsapp/index.pl?photo=13877

Their front page still has the format of "ARTICLE TITLE (3 comments)"
Reply With Quote
  #21  
Old 05-06-2005, 02:23 PM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if a page is included the global.php it will basicly add 5 queries if I am right.

then why don't you just make it like a vbulletin page, that way it's easier to change the look (by editing the template). also easier to make the page become more complex.
Reply With Quote
Reply


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 08:46 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.07766 seconds
  • Memory Usage 2,313KB
  • Queries Executed 26 (?)
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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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_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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete