vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Comment System...question (https://vborg.vbsupport.ru/showthread.php?t=73049)

MLBCenter 12-18-2004 01:55 PM

Comment System...question
 
Okay, for a new site I'm going to have articles and at the bottom of each article I want a user comment system. Now, I can use a content managment system from ASP.net or I can buy a whole management system from http://www.pmachine.com, but I was wondering if it was possible to allow the users to only post comments on articles if they were registered at our forums (which are vbulletin of course). If not, I would like someone to try to work on a mod because if I have a user comments system where people still register then they can register under different names from their forum names and everything could get confusing. Either that or I don't use a comments system...

cinq 12-18-2004 02:01 PM

Just off the top.

You will need to create a table for the comments, probably with 3 fields :
- cid ( comment_id ) set to auto_increment.
- cuser ( comment_by_which_user_id )
- aid ( article_id_in_which_comment_was_made_in )
- ctext ( comment_text )

With this created, before inserting rows ( ie. comments ), just check
Code:

if($bbuserinfo['userid'])
to only allow registered members on the boards to be able to post a comment.

And when they do post a comment, use the value of
Code:

$bbuserinfo['userid']
and insert it into the cuser field, and the text the person makes into ctext field.

There would probably be a hidden tag in the form to be submitted when making a comment with the article id.

That's how I would do it :)

MLBCenter 12-18-2004 05:17 PM

So I don't need an actual content management system to work with comments? Or are you saying using the comments table from a content management system and tweak it?

MLBCenter 12-18-2004 08:36 PM

Also, it looks like I'll be using the content management system ExpressionEngine for my site. They offer user comments, so do you think I would be able to integrate this with vBulletin? You know, tweak EE so you have to be registered for my vBulletin forums to post comments? That's all I want.

cinq 12-19-2004 02:27 AM

I am sure it can be done, but I am not familiar with those CMSs you mentioned.

MeTaL_oRgY 12-22-2004 04:24 AM

well, I don't know if it'll be of much help.. but try what I do:

First of all, install the comment script you like the most, it doesn't matter which one you choose.

After you've got it up and running, you'll have to set permissions to the key file.. the key file is the one that'll allow people to post a comment. It can be either the html (or php) that you call to print the comment form on your page or the php file that processes the information entered at the form. This depends on the script you're using (which I recommend that it DO NOT require registration, since you'll need to hack it a little more...).

Now that you have located the file, you'll now need to include the global file to that page.
Code:

<?php  include ('../foro/global.php'); ?>
add this at the very top of the page. Now comes the tricky part. Add this code below the include command:
Code:

//change xx with the Guest Group ID.
if($bbuserinfo['usergroupid']==xx){
echo "Please log-in or register!";
} else {
//the rest of the code goes here

and don't forget to close the script adding one last } to the end of your page.. so the final php would look like this:
Code:

<?php  include ('../foro/global.php');
//change xx with the Guest Group ID.
if($bbuserinfo['usergroupid']==xx){
echo "Please log-in or register!";
} else {
//the rest of the code goes here
//code
//code
//code
//lol
}
?>

YOu'll hve to experiment with it a bit.. but it works fine for me ;)...

NOTE Remember that if you have HTML between the
Code:

} else {
and the final }, you'll have to add backslash (\) befor every quote (") you have ;).

EDIT
Damn. I forgot one thing... before including global.php you must modify it a bit... every url the file has is like this:
Code:

admin/functions.php
You must change it so it looks like this:
Code:

/home/user/public_html/forum/admin/functions.php
there aren't much of this.. so it's not such a big deal :P


All times are GMT. The time now is 10:24 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.01154 seconds
  • Memory Usage 1,729KB
  • 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
  • (8)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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