vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   New Thread additions? (https://vborg.vbsupport.ru/showthread.php?t=54229)

colicab-d 06-12-2003 01:10 PM

New Thread additions?
 
Hi I got a question..

Im writing up a hack which I dont want to reveal at this early stage but I need some info on the best place to add the ,ysql insert querie to add the extra data when making a new thread.

I have it so that when a checkbox is ticked it should have the value "yes"

So i really need to know where i would add

if($add_to_gall = "yes"){
mysql ( Insert blah blah blah);
}

so that when the thread is submitted values from the attachment are inserted into a new table like above.

thnx any help is appreciated and if i get this done i can move onto the second stage of my hack ;) maybe throw up some screenies of it working ;)

Dean C 06-12-2003 03:48 PM

Look for this line of code in newthread.php and modify it.. If your having a checkbox then set the field a default value and use an if statement whether to insert a 0 or 1 into the field...

PHP Code:

      $DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."','".time()."','$forumid','1','0','".addslashes($postusername)."','$bbuserinfo[userid]','".addslashes($postusername)."','".time()."','$iconid','$visible','$attachcount')");
      
$threadid=$DB_site->insert_id(); 


colicab-d 06-12-2003 05:30 PM

k thnx mist mate.. i,ll try adding underneath that line as its using only one table so far..

maybe something like

$DB_site->query("INSERT into lalala (gallimagename , .........

and im using if($addtogall=="yes"){ around it ;) which is a bit of modified post poll code.

be back soon with some interesting screenies ;)

colicab-d 06-12-2003 05:45 PM

ok now i got a bit of a problem where is the code for inserting the attachment into the database?

as the only thing i can find in newthread is the code to show the attachment count

Dean C 06-12-2003 08:35 PM

I assumed you just added a field to the thread table?

- miSt

colicab-d 06-12-2003 10:54 PM

no i have it mirroring the table, and sending the data to the new table, due to it being easier to get the info that way..


All times are GMT. The time now is 08:57 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.00993 seconds
  • Memory Usage 1,721KB
  • 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_php_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