[Phpslash-commit] CVS: phpslash-ft/public_html poll.php3,1.13,1.14
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2002-06-25 22:51:23
|
Update of /cvsroot/phpslash/phpslash-ft/public_html In directory usw-pr-cvs1:/tmp/cvs-serv10563/phpslash-ft/public_html Modified Files: poll.php3 Log Message: correct commit for poll.php3 Index: poll.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/poll.php3,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** poll.php3 17 Jun 2002 16:54:51 -0000 1.13 --- poll.php3 25 Jun 2002 22:51:20 -0000 1.14 *************** *** 3,73 **** /* $Id$ */ ! $pagetitle = "Poll Administration"; // The name to be displayed in the header ! $xsiteobject = "Administration"; // Defines The META TAG Page Type require("config.php3"); page_open(array("sess"=>"slashSess","auth"=>"slashAuth","perm"=>"slashPerm")); ! /***************************** ! START OF PAGE ! *****************************/ ! $auth->login_if(!$perm->have_perm('pollList')); ! /* DEBUG STUFF */ ! // debug("HTTP_POST_VARS" , $HTTP_POST_VARS); ! // debug("HTTP_GET_VARS" , $HTTP_GET_VARS); ! /* END DEBUG STUFF */ $poll = new Poll; ! $content = ''; ! switch ($submit) { ! case "edit": ! if ($perm->have_perm("pollEdit")) { ! $content .= $poll->editPoll($question_id); } break; ! case "new": ! if ($perm->have_perm("pollNew")) { ! $content .= $poll->newPoll(); ! } break; ! case "save": ! if ($perm->have_perm("pollPut")) { ! if ($poll->savePoll($HTTP_POST_VARS)) { ! $content .= "<center>"; ! $content .= getFancybox(210, $_PSL['site_name'] ."Poll", $poll->getPollBooth($HTTP_POST_VARS['question_id']), "r"); ! $content .= "</center>"; ! } else { ! $content .= getError($poll->message); ! } ! } break; ! case "delete": ! $content .= getTitlebar ("100%", "Deleting poll"); ! if($poll->deletePoll($question_id)) { ! $content .= getMessage($poll->message); } else { ! $content .= getError($poll->message); ! } ! case "makecurrent": ! if(!$poll->makeCurrent($question_id)) { ! $content .= getError($poll->message); } - default: - if ($perm->have_perm("pollList")) { - $content .= $poll->listPolls($min); - } - } - - if($content == '') { - $content = getTitlebar("100%","Error! Invalid Privileges"); - $content .= "Sorry. You do not have the necessary privilege to view this page."; } $block = new Block_i; - $ary['section'] = "Admin"; $breadcrumb = breadcrumb($ary); --- 3,88 ---- /* $Id$ */ ! $pagetitle = "Polls"; // The name to be displayed in the header ! $xsiteobject = "Poll Booth"; //Defines The META TAG Page Type require("config.php3"); page_open(array("sess"=>"slashSess","auth"=>"slashAuth","perm"=>"slashPerm")); ! /* parse cmd line variables into array */ ! while ( list($key, $val) = each($HTTP_GET_VARS )) { ! $ary[$key] = $val; ! } ! if ((!$section) AND (!$section_id)){ ! $section = $_PSL['site_homesection']; ! if(!$section) { ! $section = "Home"; ! } ! $ary['section'] = $section; ! } else { ! $pagetitle .= " - $section"; ! } ! // TODO: Make this work with $HTTP_*_VARS ! /* the comment stuff is using "story_id" so we have to funky ! fix it here. */ ! if (!$ary['question_id'] && $ary['story_id']) { ! $question_id = $ary['story_id']; ! } else { ! $question_id = $ary['question_id']; ! } + $as = arg_separator("1"); # Default: = & $poll = new Poll; ! // debug("HTTP_POST_VARS", $HTTP_POST_VARS); ! // debug("HTTP_GET_VARS", $HTTP_GET_VARS); ! ! /* setting up the possible comment variables... */ ! $cmtary['mode'] = $ary['mode']; ! $cmtary['order'] = $ary['order']; ! $cmtary['question_id'] = $question_id; ! ! switch ($ary['submit']) { ! case "vote": ! if($poll->vote($question_id, $answer_id, $REMOTE_ADDR)) { ! $content .= pslgetText('VOTE: ') . $poll->message . "<BR>\n"; ! } else { ! $content .= getError($poll->getMessage()); } + /* NOTE: there's no "break" here, cause after you vote, we + roll down and "viewresults" */ + + case "viewresults": + + /* we register the "return link" in case they post a comment */ + $return_link = $HTTP_SERVER_VARS["REQUEST_URI"]; + $sess->register("return_link"); + + $content .= $poll->resultPage($cmtary); break; ! ! case "viewbooth": ! $content .= getTitlebar ("100%", pslgetText("View Pollbooth")); ! $content .= "<center>\n"; ! $content .= getFancybox (210, sprintf(pslgetText("%s Poll"), $_PSL['site_name']), $poll->getPollBooth($question_id), "nc"); ! $content .= "</center>\n"; break; ! ! case "list": ! $content .= $poll->listPolls ($ary['min']); break; ! ! default: ! if ($question_id) { ! $content .= $poll->resultPage($cmtary); } else { ! // Umm min isn't defined anywhere for a default ! $content .= $poll->listPolls ($ary['min']); } } $block = new Block_i; $breadcrumb = breadcrumb($ary); *************** *** 122,125 **** --- 137,141 ---- slashfoot(); page_close(); + ?> |