Log in

View Full Version : New Thread additions?


colicab-d
06-12-2003, 01:10 PM
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...


$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,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..