69-FLy-gUy
07-06-2002, 11:51 AM
ok.. I used to have a trivia kind of hack.. and when the change to vb 2.2.6 happened. i couldnt get it to work....
in my postbit i have ea variable $trivia
now the cool thing is that i can put a question in a field
and someone replies and it shows the answer after they reply
(this isn't lockdown... i changed lockdown so it works for trivia)
now with the change of coding.. i can't get it to work anymore...
i have most of the code down... but i can't get it to show up in the thread... i will post part of the code here. i know i am missing something that makes the postbit show the $trivia i just don't know what..
here is the code...
// Morgans modified trivia hack
$trivia='';
if (($thread['forumid']==2) AND ($counter==1)) {
$triviadata=$DB_site->query_first("SELECT answer from triviadata WHERE threadid=$threadid");
if (($triviadata['answer'] != '') {
$myreplies=$DB_site->query_first("SELECT COUNT(*) AS replies FROM post WHERE threadid='$threadid' AND userid='$bbuserinfo[userid]'");
$myreplies=$myreplies[replies];
if ($myreplies > 0) {
eval("\$trivia = \"".gettemplate("showthread_triviaanswer")."\";");
} else {
$triviadata='<blockquote><font face="Verdana, Arial"><b>If You Don't Know The Answer to the Question, Reply:)</font></b></blockquote>';
}
}
}
now from there. i don't know how to tell it to grab $trivia in the postbit....
i tried this code (that is what it used to be before)
eval("\$postbits .= \"".gettemplate("postbit")."\";");
Can someone please help? thanks!
in my postbit i have ea variable $trivia
now the cool thing is that i can put a question in a field
and someone replies and it shows the answer after they reply
(this isn't lockdown... i changed lockdown so it works for trivia)
now with the change of coding.. i can't get it to work anymore...
i have most of the code down... but i can't get it to show up in the thread... i will post part of the code here. i know i am missing something that makes the postbit show the $trivia i just don't know what..
here is the code...
// Morgans modified trivia hack
$trivia='';
if (($thread['forumid']==2) AND ($counter==1)) {
$triviadata=$DB_site->query_first("SELECT answer from triviadata WHERE threadid=$threadid");
if (($triviadata['answer'] != '') {
$myreplies=$DB_site->query_first("SELECT COUNT(*) AS replies FROM post WHERE threadid='$threadid' AND userid='$bbuserinfo[userid]'");
$myreplies=$myreplies[replies];
if ($myreplies > 0) {
eval("\$trivia = \"".gettemplate("showthread_triviaanswer")."\";");
} else {
$triviadata='<blockquote><font face="Verdana, Arial"><b>If You Don't Know The Answer to the Question, Reply:)</font></b></blockquote>';
}
}
}
now from there. i don't know how to tell it to grab $trivia in the postbit....
i tried this code (that is what it used to be before)
eval("\$postbits .= \"".gettemplate("postbit")."\";");
Can someone please help? thanks!