How To: Add A "Comment On This News (3 Comments)" to a webpage.
by
22 Jul 2004
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 http://www.weeklydavespeak.com. --------------------------------------------------------------- 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 http://www.weeklydavespeak.com/forums/index.php?t=11 for an example. You can also see how Ive organized a Forum Section for News, Articles and Davespeak to reflect different content areas on my site. Ive 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.To see how I use this script, check out http://www.weeklydavespeak.com/news/DMBFestival_SF_072004.php 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 |