Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-18-2002, 05:00 AM
mADmAX` mADmAX` is offline
 
Join Date: Dec 2001
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Auto Link Threads

I am trying to do something similiar to here with the hacks / support threads. I have it all set where it will make the both of them but I am trying to get them to link.

Will try to explain. I do a form pretty much like newthread but it does it twice (so the support forums has been started) but want them to link.

If your on the support thread, it will give you the link to the file thread with the description etc.

If your on the file thread, it will give you the link to the support thread.

I have to keep them seperate as the file thread will have way more stuff in it than what I want in the main thread (support thread). I cant figure out how to do this as I have no idea what the postid will be. So what would I write for it to know this?

I will pay well if needed for this little code...
Reply With Quote
  #2  
Old 10-18-2002, 11:59 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well you have to add a field to thread- table called for example linkid
then when inserting the threads, you have to fill it with the other threadid.
then you've just add a link into your showthreadtemplate which calls showthread.php?threadid=$threadinfo[linkid]..

can't help more without knowing your exact code
Reply With Quote
  #3  
Old 10-18-2002, 03:45 PM
mADmAX` mADmAX` is offline
 
Join Date: Dec 2001
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks...

At the time of creating the thread, I will not know the threadid as its posting it at the same time.

I think this will work however if I give both threads the same linkid and at the same time being sure that its not a linkid that I have already used.

So, how would I go about having it auto-increment and know the linkid at the same time?
Reply With Quote
  #4  
Old 10-18-2002, 04:40 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by mADmAX`
So, how would I go about having it auto-increment and know the linkid at the same time?
MySQL will only allow you to have one field per table auto-increment, so if you were adding the linkid to the thread table then you can use that method
Reply With Quote
  #5  
Old 10-18-2002, 06:19 PM
mADmAX` mADmAX` is offline
 
Join Date: Dec 2001
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm, so how would I go about doing this? Create a new table and have it autoincrement and connect to threadid somehow?

I also wouldnt want it to increment unless its told to (like when I create both threads). That way, the only ones that have linkid's are the ones that have two threads.
Reply With Quote
  #6  
Old 10-18-2002, 11:47 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no just add the linkidtable as i told ya

then in your script you find for example this parts..:
PHP Code:
//insert thread 1
$DB_site->query("INSERT INTO thread ...."); 
//insert thread 2
$DB_site->query("INSERT INTO thread ...."); 
you have to add one query and change the things a bit:
PHP Code:
//insert thread 1
$DB_site->query("INSERT INTO thread ...."); 
$thread1id=$DB_site->insert_id();
//insert thread 2 (add linkid and $thread1id as value
$DB_site->query("INSERT INTO thread ...."); 
$thread2id=$DB_site->insert_id();
$DB_site->query("UPDATE thread SET linkid=$thread2id WHERE threadid=$thread1id"); 
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 10:18 PM.


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.04692 seconds
  • Memory Usage 2,214KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)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
  • (6)postbit
  • (6)postbit_onlinestatus
  • (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_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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete