From: Benjamin C. <bc...@us...> - 2002-02-28 17:38:12
|
Update of /cvsroot/phpbt/phpbt In directory usw-pr-cvs1:/tmp/cvs-serv6515 Modified Files: bug.php Log Message: Bug voting works (display doesn't yet) Index: bug.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/bug.php,v retrieving revision 1.77 retrieving revision 1.78 diff -u -r1.77 -r1.78 --- bug.php 14 Feb 2002 03:56:22 -0000 1.77 +++ bug.php 28 Feb 2002 17:31:45 -0000 1.78 @@ -62,7 +62,12 @@ do_changedfields($u, $buginfo, $changedfields); } } - header("Location: bug.php?op=show&bugid=$bug_id&pos={$_pv['pos']}"); + if (isset($_pv['pos'])) { + $posinfo = "&pos={$_pv['pos']}"; + } else { + $posinfo = ''; + } + header("Location: bug.php?op=show&bugid=$bug_id$posinfo"); } @@ -671,6 +676,7 @@ isset($_gv['pos']) ? $_gv['pos'] : 0); $t->set_var(array( 'statuserr' => isset($error['status']) ? $error['status'].'<br><br>' : '', + 'vote_error' => isset($error['vote']) ? "<div class=\"error\">{$error['vote']}</div>" : '', 'bugid' => $bugid, 'TITLE' => "{$TITLE['editbug']} #$bugid", 'title' => stripslashes($row['title']), @@ -700,8 +706,12 @@ 'prevlink' => $prevlink, 'nextlink' => $nextlink, 'prevnextsep' => $prevlink && $nextlink ? ' | ' : '', - 'pos' => isset($_gv['pos']) ? $_gv['pos'] : 0 - )); + 'pos' => isset($_gv['pos']) ? $_gv['pos'] : 0, + 'already_voted' => $q->grab_field("select count(*) from ".TBL_BUG_VOTE. + " where bug_id = $bugid and user_id = $u"), + 'num_votes' => $q->grab_field("select count(*) from ".TBL_BUG_VOTE. + " where bug_id = $bugid") + )); switch($row['status_name']) { case 'Unconfirmed' : case 'New' : @@ -847,6 +857,7 @@ case 'update' : update_bug($_pv['bugid']); break; case 'do' : do_form($_pv['bugid']); break; case 'print' : show_bug_printable($_gv['bugid']); break; + case 'vote' : vote_bug($_gv['bugid']); break; } } else header("Location: query.php"); |