// Close polls that have exceeded their allowed runtime
$result=db_query("SELECT p.nid FROM poll p LEFT JOIN node n ON p.nid=n.nid WHERE (n.created + p.runtime) < '".time()."' AND p.active = '1' AND p.runtime != '0'");
while($poll=db_fetch_object($result)){
db_query("UPDATE poll SET active='0' WHERE nid='$poll->nid'");
db_query("UPDATE poll SET active='0' WHERE nid = '%d'",$poll->nid);
}
}
functionpoll_delete($node){
db_query("DELETE FROM poll WHERE nid='$node->nid'");
db_query("DELETE FROM poll_choices WHERE nid='$node->nid'");
db_query("DELETE FROM poll WHERE nid='%d'",$node->nid);
db_query("DELETE FROM poll_choices WHERE nid = '%d'",$node->nid);
}
functionpoll_form(&$node,&$help,&$error){
...
...
@@ -102,7 +102,7 @@ function poll_form(&$node, &$help, &$error) {
$output.=form_select(t("Number of choices"),"choices",$node->choices,$opts,t("This item sets the number of multiple choice options in the poll, but it doesn't have to equal the actual amount of options; you can leave the extra boxes empty."));
...
...
@@ -136,15 +136,11 @@ function poll_insert($node) {
// Close polls that have exceeded their allowed runtime
$result=db_query("SELECT p.nid FROM poll p LEFT JOIN node n ON p.nid=n.nid WHERE (n.created + p.runtime) < '".time()."' AND p.active = '1' AND p.runtime != '0'");
while($poll=db_fetch_object($result)){
db_query("UPDATE poll SET active='0' WHERE nid='$poll->nid'");
db_query("UPDATE poll SET active='0' WHERE nid = '%d'",$poll->nid);
}
}
functionpoll_delete($node){
db_query("DELETE FROM poll WHERE nid='$node->nid'");
db_query("DELETE FROM poll_choices WHERE nid='$node->nid'");
db_query("DELETE FROM poll WHERE nid='%d'",$node->nid);
db_query("DELETE FROM poll_choices WHERE nid = '%d'",$node->nid);
}
functionpoll_form(&$node,&$help,&$error){
...
...
@@ -102,7 +102,7 @@ function poll_form(&$node, &$help, &$error) {
$output.=form_select(t("Number of choices"),"choices",$node->choices,$opts,t("This item sets the number of multiple choice options in the poll, but it doesn't have to equal the actual amount of options; you can leave the extra boxes empty."));
...
...
@@ -136,15 +136,11 @@ function poll_insert($node) {