06-16-2000, 03:24 PM
Ok, it's the really simple, crappy version - sue me! :)
Not tested too much (only twice), but seemed to work relatively well.
postings.php, find:
$DB_site->query("UPDATE thread SET forumid=$forumid WHERE threadid=$threadid");
ABOVE it add:
if ($savecopy) {
$threadinfo=$DB_site->query_first("SELECT title,lastpost,forumid,open,replycount,postusernam e,lastposter,dateline,views,iconid,notes,visible,s ubjectindex,threadindex,userindex FROM thread WHERE threadid=$threadid");
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,lastposter,dateline,views,iconid,notes ,visible,subjectindex,threadindex,userindex) VALUES (NULL,'".addslashes("$threadinfo[title]")."','".addslashes("$threadinfo[lastpost]")."','".addslashes("$threadinfo[forumid]")."',0,'".addslashes("$threadinfo[replycount]")."','".addslashes("$threadinfo[postusername]")."','".addslashes("$threadinfo[lastposter]")."','".addslashes("$threadinfo[dateline]")."','".addslashes("$threadinfo[views]")."','".addslashes("$threadinfo[iconid]")."','".addslashes("$threadinfo[notes]")."','".addslashes("$threadinfo[visible]")."','".addslashes("$threadinfo[subjectindex]")."','".addslashes("$threadinfo[threadindex]")."','".addslashes("$threadinfo[userindex]")."')");
$newid=$DB_site->insert_id();
$posts=$DB_site->query("SELECT postid,threadid,username,userid,title,dateline,pag etext,allowsmilie,email,signature,ipaddress,iconid ,visible FROM post WHERE threadid=$threadid");
while ($post=$DB_site->fetch_array($posts)) {
$DB_site->query("INSERT INTO post (postid,threadid,username,userid,title,dateline,pa getext,allowsmilie,email,signature,ipaddress,iconi d,visible) VALUES (NULL,'$newid','".addslashes("$post[username]")."','".addslashes("$post[userid]")."','".addslashes("$post[title]")."','".addslashes("$post[dateline]")."','".addslashes("$post[pagetext]")."','".addslashes("$post[allowsmilie]")."','".addslashes("$post[email]")."','".addslashes("$post[signature]")."','".addslashes("$post[ipaddress]")."','".addslashes("$post[iconid]")."','".addslashes("$post[visible]")."')");
}
}
find:
$DB_site->query("UPDATE forum SET replycount=$numberposts,threadcount=threadcount-1,lastpost=$lastpost,lastposter='".addslashes($lastposter)."' WHERE forumid=$curforumid");
REPLACE with:
if (!$savecopy) {
$DB_site->query("UPDATE forum SET replycount=$numberposts,threadcount=threadcount-1,lastpost=$lastpost,lastposter='".addslashes($lastposter)."' WHERE forumid=$curforumid");
}
find:
eval("echo standardredirect(\$bbtitle,\"".gettemplate("redirect_movethread")."\",\"showthread.php?threadid=$threadid\");");
REPLACE with:
if ($savecopy) {
eval("echo standardredirect(\$bbtitle,\"".gettemplate("redirect_movethread")."\",\"showthread.php?threadid=$newid\");");
} else {
eval("echo standardredirect(\$bbtitle,\"".gettemplate("redirect_movethread")."\",\"showthread.php?threadid=$threadid\");");
}
-----
Close that.
Now, in your move template, add this somewhere:
<TD><INPUT TYPE="checkbox" NAME="savecopy" value="yes"> <normalfont>Do you want to save a copy of this message (but closed) in its original forum?</normalfont></td>
----
That's it, you should be done.
Maybe not efficient, but it works :)
BTW, sorry there's no note on the page - I don't feel like adding a whole column to the database for that :D
[Edited by Ed Sullivan on 06-17-2000 at 11:01 PM]
Not tested too much (only twice), but seemed to work relatively well.
postings.php, find:
$DB_site->query("UPDATE thread SET forumid=$forumid WHERE threadid=$threadid");
ABOVE it add:
if ($savecopy) {
$threadinfo=$DB_site->query_first("SELECT title,lastpost,forumid,open,replycount,postusernam e,lastposter,dateline,views,iconid,notes,visible,s ubjectindex,threadindex,userindex FROM thread WHERE threadid=$threadid");
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,lastposter,dateline,views,iconid,notes ,visible,subjectindex,threadindex,userindex) VALUES (NULL,'".addslashes("$threadinfo[title]")."','".addslashes("$threadinfo[lastpost]")."','".addslashes("$threadinfo[forumid]")."',0,'".addslashes("$threadinfo[replycount]")."','".addslashes("$threadinfo[postusername]")."','".addslashes("$threadinfo[lastposter]")."','".addslashes("$threadinfo[dateline]")."','".addslashes("$threadinfo[views]")."','".addslashes("$threadinfo[iconid]")."','".addslashes("$threadinfo[notes]")."','".addslashes("$threadinfo[visible]")."','".addslashes("$threadinfo[subjectindex]")."','".addslashes("$threadinfo[threadindex]")."','".addslashes("$threadinfo[userindex]")."')");
$newid=$DB_site->insert_id();
$posts=$DB_site->query("SELECT postid,threadid,username,userid,title,dateline,pag etext,allowsmilie,email,signature,ipaddress,iconid ,visible FROM post WHERE threadid=$threadid");
while ($post=$DB_site->fetch_array($posts)) {
$DB_site->query("INSERT INTO post (postid,threadid,username,userid,title,dateline,pa getext,allowsmilie,email,signature,ipaddress,iconi d,visible) VALUES (NULL,'$newid','".addslashes("$post[username]")."','".addslashes("$post[userid]")."','".addslashes("$post[title]")."','".addslashes("$post[dateline]")."','".addslashes("$post[pagetext]")."','".addslashes("$post[allowsmilie]")."','".addslashes("$post[email]")."','".addslashes("$post[signature]")."','".addslashes("$post[ipaddress]")."','".addslashes("$post[iconid]")."','".addslashes("$post[visible]")."')");
}
}
find:
$DB_site->query("UPDATE forum SET replycount=$numberposts,threadcount=threadcount-1,lastpost=$lastpost,lastposter='".addslashes($lastposter)."' WHERE forumid=$curforumid");
REPLACE with:
if (!$savecopy) {
$DB_site->query("UPDATE forum SET replycount=$numberposts,threadcount=threadcount-1,lastpost=$lastpost,lastposter='".addslashes($lastposter)."' WHERE forumid=$curforumid");
}
find:
eval("echo standardredirect(\$bbtitle,\"".gettemplate("redirect_movethread")."\",\"showthread.php?threadid=$threadid\");");
REPLACE with:
if ($savecopy) {
eval("echo standardredirect(\$bbtitle,\"".gettemplate("redirect_movethread")."\",\"showthread.php?threadid=$newid\");");
} else {
eval("echo standardredirect(\$bbtitle,\"".gettemplate("redirect_movethread")."\",\"showthread.php?threadid=$threadid\");");
}
-----
Close that.
Now, in your move template, add this somewhere:
<TD><INPUT TYPE="checkbox" NAME="savecopy" value="yes"> <normalfont>Do you want to save a copy of this message (but closed) in its original forum?</normalfont></td>
----
That's it, you should be done.
Maybe not efficient, but it works :)
BTW, sorry there's no note on the page - I don't feel like adding a whole column to the database for that :D
[Edited by Ed Sullivan on 06-17-2000 at 11:01 PM]