- Timestamp:
- 2006/12/13 11:03:57 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollrating.php
r834 r836 49 49 case 'rating': 50 50 $poll_id = $_POST['poll_id']; 51 $poll = new XoopsPoll($poll_id); 52 if ( $xoopsUser ) { 53 $uid = $xoopsUser->getVar("uid"); 54 } else { 55 $uid = 0; 51 $arrErr = lfErrCheck($_POST); 52 if(count($arrErr) <= 0) { 53 $poll = new XoopsPoll($poll_id); 54 if ( $xoopsUser ) { 55 $uid = $xoopsUser->getVar("uid"); 56 } else { 57 $uid = 0; 58 } 59 $poll->vote($option_id, xoops_getenv('REMOTE_ADDR'), $uid, $_POST['rating_id'], $_POST['comment']); 60 $poll->updateCount(); 61 redirect_header(XOOPS_URL."/modules/xoopspoll/pollresults.php?poll_id=".$poll_id, 1, $msg); 62 exit(); 56 63 } 57 $poll->vote($option_id, xoops_getenv('REMOTE_ADDR'), $uid, $_POST['rating_id'], $_POST['comment']);58 $poll->updateCount();59 redirect_header(XOOPS_URL."/modules/xoopspoll/pollresults.php?poll_id=".$poll_id, 1, $msg);60 exit();61 64 break; 62 65 default: … … 81 84 $xoopsTpl->assign('poll_id', $poll_id); 82 85 $xoopsTpl->assign('start', $start); 86 $xoopsTpl->assign('arrErr', $arrErr); 83 87 84 88 include XOOPS_ROOT_PATH.'/include/comment_view.php'; 85 89 86 90 include XOOPS_ROOT_PATH."/footer.php"; 91 92 //--------------------------------------------------------------------------------------------------- 93 94 function lfErrCheck($arrForm) { 95 96 $body_len = 500; 97 98 $arrErr = array(); 99 100 if(mb_strlen($arrForm['body']) > $title_len) { 101 $arrErr['title'] = " ¢¨ ÆâÍÆ¤Ï$body_lenʸ»ú°ÊÆâ¤ÇÆþÎϤ·¤Æ²¼¤µ¤¤¡£"; 102 } 103 104 return $arrErr; 105 } 87 106 ?>
Note: See TracChangeset
for help on using the changeset viewer.
