BigJohnson
02-22-2003, 07:10 PM
Help I have this command in the newreply.php and what it does is find the number of of new threads made in certain forums and average it out a month since the persons registration date.
$threads = $DB_site->query_first("SELECT COUNT(*) as counter FROM thread WHERE postuserid=$bbuserinfo[userid] AND forumid IN(23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 55, 63, 65, 66, 67) AND dateline>".(time()-2592000));
That line goes in this bunch of code.
$threads = $DB_site->query_first("SELECT COUNT(*) as counter FROM thread WHERE postuserid=$bbuserinfo[userid] AND forumid IN(23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 55, 63, 65, 66, 67) AND dateline>".(time()-2592000));
if(in_array($threadinfo[forumid],array(23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 55, 63, 65, 66, 67)) and $threads[counter]<2) {
eval("standarderror(\"".gettemplate("error_notenoughthreads")."\");");
exit;
}
but instead of searching for the number of threads that way I made a field in the USER table called THREADCOUNTER. the THREADCOUNT field has a number in the field and goes up 1 everytime i new thread is made in certain forums.
What I would like to do is. Use the number in the THREADCOUNTER field instead of this code
$threads = $DB_site->query_first("SELECT COUNT(*) as counter FROM thread WHERE postuserid=$bbuserinfo[userid] AND forumid IN(23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 55, 63, 65, 66, 67) AND dateline>".(time()-2592000));
because with the new code the counter does not decrease when a thread is deleted.
What I don't know how to do is change the code so it works. I hope someone can understand me and help me out by tell me the code I should use. Thank you.
$threads = $DB_site->query_first("SELECT COUNT(*) as counter FROM thread WHERE postuserid=$bbuserinfo[userid] AND forumid IN(23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 55, 63, 65, 66, 67) AND dateline>".(time()-2592000));
That line goes in this bunch of code.
$threads = $DB_site->query_first("SELECT COUNT(*) as counter FROM thread WHERE postuserid=$bbuserinfo[userid] AND forumid IN(23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 55, 63, 65, 66, 67) AND dateline>".(time()-2592000));
if(in_array($threadinfo[forumid],array(23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 55, 63, 65, 66, 67)) and $threads[counter]<2) {
eval("standarderror(\"".gettemplate("error_notenoughthreads")."\");");
exit;
}
but instead of searching for the number of threads that way I made a field in the USER table called THREADCOUNTER. the THREADCOUNT field has a number in the field and goes up 1 everytime i new thread is made in certain forums.
What I would like to do is. Use the number in the THREADCOUNTER field instead of this code
$threads = $DB_site->query_first("SELECT COUNT(*) as counter FROM thread WHERE postuserid=$bbuserinfo[userid] AND forumid IN(23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 55, 63, 65, 66, 67) AND dateline>".(time()-2592000));
because with the new code the counter does not decrease when a thread is deleted.
What I don't know how to do is change the code so it works. I hope someone can understand me and help me out by tell me the code I should use. Thank you.