Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by dubucm (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-26-2001 Last Update: Never Installs: 0
 
No support by the author.

Hi everyone,
First I apologize for my "frenchie" english .

Vbulletin is a great forum software.... but many of us are webmaster from website with articles, tutorials, contribution and more .

We are all using PHP/MySQL to have "automated" website.

As far as i am concern, my website deals with Flash. And i needed to have comments/questions forums for all of my tutorials and contributions.

My website is "automatic" and a user can add a script/tutorial so i was obliged to found a way to automatically create this comments forum. ( and with VBulletin on my website i did not want to create a comments table .... )


So here is a script with some usefull function to do that.

It creates a thread and insert a message in it. ( you should create a forum not visible from the users and use it's forum id ).

You can easilly understand how it works i think. .
Do not h?sitate for questions... i'll help you.

( Just wanna thanx TubeDog for his helps ).

I'll improve the script adding those features :

- Functions to retreive number of comments/questions for an article.

- E Mail sending to the articles author for each new responses.

- and more ... jsut ask away .

here it is :
PLEASE TAKE CARE OF CHANGING i conid by iconid ( the same for ipad dress by ipaddress etc.. ( see the post from tubedogg bellow ) due to a "bug" i cannot fix it manullay in my post sorry.

PHP Code:
<?
function InsertThread($THREADTITLE)
{
global $mysql_link_forum,$mysql_link_corpo,$db_forum,$db_corpo;
mysql_db_query($db_forum,"INSERT INTO thread(threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes("$THREADTITLE")."','".time()."','38','1','0','martin','2','martin','".time()."','1','1','0')",$mysql_link_forum) or die ("REQUETE PB1.");
// give the thread id
$threadidresult = mysql_db_query($db_forum, "SELECT threadid FROM thread WHERE title='".addslashes("$THREADTITLE")."'" , $mysql_link_forum) or die ("REQUETE PB.");
$threadid = mysql_result($threadidresult,0,0) or die ("REQUETE PB.");
return $threadid;
}
function InsertPost($THREADID,$MESSAGE) 
{
global $mysql_link_forum,$mysql_link_corpo,$db_forum,$db_corpo;
mysql_db_query($db_forum,"INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$THREADID','','martin','2','".time()."','','".addslashes("$MESSAGE")."','1','1','127.0.0.1','1','1')",$mysql_link_forum) or die ("REQUETE PB2.");
}
function UpdateTutTable($THREADID,$TUTID)
{
global $mysql_link_forum,$mysql_link_corpo,$db_forum,$db_corpo;

mysql_db_query($db_corpo,"update TUTORIALTABLE set threadid='$THREADID' where artid='$TUTID'",$mysql_link_corpo) or die ("REQUETE PB3.");
}
function AddTutForum($TUTID)
{
global $mysql_link_forum,$mysql_link_corpo,$db_forum,$db_corpo;
$result_tut = mysql_db_query($db_corpo,"SELECT title,description FROM TUTORIALTABLE WHERE artid='$TUTID'",$mysql_link_corpo) or die ("REQUETE PB4.");
list($THREADTITLE,$MESSAGE) = mysql_fetch_row($result_tut);
$MESSAGE.="<br>Use this thread to post all your comments / questions on this article.";
$THREADID=InsertThread($THREADTITLE);
InsertPost($THREADID,$MESSAGE);
UpdateTutTable($THREADID,$TUTID);
echo "DONE";
// jsut to see if everythin as well worked. :)
}
// MAIN PROGRAM
$dbhost='';
$dbname_forum='';
$dbname_corpo='';
$dbpass_forum='';
$dbpass_corpo='';
$dbuser_forum='';
$dbuser_corpo='';
$db_forum = '';
$db_corpo = '';
$mysql_link_forum = mysql_connect($dbhost,$dbuser_forum,$dbpass_forum) or DIE ("Impossible de trouver la serveur de donn?e1");
$mysql_link_corpo = mysql_connect($dbhost,$dbuser_corpo,$dbpass_corpo) or DIE ("Impossible de trouver la serveur de donn?e2");
AddTutForum($TUTID);
?>
it's really a little contribution but it's my first one... and i know vbulletin since only 1 week ...

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-26-2001, 09:40 PM
Guest
 
Posts: n/a
Default

This is my fault, cause I gave you the code (but I think it's really vB's fault, because I double-checked the code!!), but in the insert thread function, you need to change
Code:
dateline,i conid,visible
to
Code:
dateline,iconid,visible
and in the insert post function, change
Code:
showsignature,ipad dress,iconid
to
Code:
showsignature,ipaddress,iconid
Looks good!
Reply With Quote
  #3  
Old 03-26-2001, 09:46 PM
Guest
 
Posts: n/a
Default

Yes it's already done in the script I gave.. I had some mysql error ... but it was so strange to have i conid... so a little "phpmyadmin trip" and it was corrected.

Tommorrow i'll add some functions .

But do you know how i can have an e mail automaticcaly send to the author of the article when a message is posted in the thread ?
Reply With Quote
  #4  
Old 03-26-2001, 09:49 PM
Guest
 
Posts: n/a
Default

Wow ... i think in fact it s when we cut/paste the script he automatically add a space between i and conid ... but i don t know why ... .

I'll try to fix it manually by editing my post .
Reply With Quote
  #5  
Old 06-03-2001, 05:17 PM
andy_C
Guest
 
Posts: n/a
Default

Any updates on this project? Looks very very good
Reply With Quote
  #6  
Old 06-10-2001, 02:27 PM
andy_C
Guest
 
Posts: n/a
Default

bump
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 09:31 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.05612 seconds
  • Memory Usage 2,246KB
  • Queries Executed 21 (?)
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
  • (4)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)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
  • 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