vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   General Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=189)
-   -   How To: Add A "Comment On This News (3 Comments)" to a webpage. (https://vborg.vbsupport.ru/showthread.php?t=67469)

nogerorob 07-21-2004 10:00 PM

How To: Add A "Comment On This News (3 Comments)" to a webpage.
 
1 Attachment(s)
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

nogerorob 08-05-2004 04:49 AM

So, a fair number of people have checked this out--but no comments. Anyone find a use for this little thing?

It might be worth noting that this has helped get over 300 people registered in the first 9 days of the board.

rob

djr 08-05-2004 04:15 PM

I would be *VERY* interested in using this hack, but it misses two vital parts imho .. it would be more clever to insert the blurb of the article (the intro section) as the first post of a new thread in a designated forum and then automatically return the threadid (and any other needed variables) in the commentline.php. This would make THE perfect addition for any news site, without the need for a portal.

MGM 08-05-2004 10:22 PM

Quote:

Originally Posted by djr
I would be *VERY* interested in using this hack, but it misses two vital parts imho .. it would be more clever to insert the blurb of the article (the intro section) as the first post of a new thread in a designated forum and then automatically return the threadid (and any other needed variables) in the commentline.php. This would make THE perfect addition for any news site, without the need for a portal.

I agree... I've been looking for something like this for a while *adds thread to favorites* I'll check back and see if it can be done

MGM out

Highlander 08-08-2004 09:31 AM

hey that look good .. i use something llike this:
http://spieleplanet.com/board/view.php?pg=gamenews but in this kind of cms attachments and images are not able to show up ..

is yours dynamically?
i just need something what would read out a specific forumid and show up the first posts with the first attachment within posted in the post ..

in you example files i can only specify threadids ..

nogerorob 08-08-2004 04:10 PM

Hey there,

It is dynamic in that the number of replies is updated on the fly. It is not set up to read the most recent reply's subject or attachement if it exists. I could write this though. Could you be a little more clear--you want the last few posts in a specific thread, and their attachements?

rob

shawno 08-09-2004 05:34 AM

Rob,

Great hack. Just a question though - what happens the first time when no one has created a comment. Is the thread already created? Or does the first person who comes to comment have to enter a title for the thread?

Have to agree with 'DJR''s comments earlier as well.

Good stuff!

Later

Shawno

nogerorob 08-09-2004 05:40 AM

Hey Shawno,

You must create the thread first. On my site i have a special "news" forum where these are located. I disallow general users from creating new threads.

If no one has replied to the thread I've created, it says "Comment on this news (0 comments)"

What I've found is that if someone posts a thread in another forum that I end up developing into a news story, I can move the thread into the news forum, and merge it with the "official" news thread. I had to do this recently, it works like a charm.

Again, check out my main page to see how i'm using it.

r

shawno 08-09-2004 07:00 AM

Hey Rob,

Thanks for that. I think this little hack could be rather useful. Nice work.

Later

Shawno

nogerorob 08-09-2004 07:13 AM

You're more than welcome. Please post feel free to post a link if you get a chance to implement it.

r


All times are GMT. The time now is 02:09 PM.

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.01196 seconds
  • Memory Usage 1,738KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete