Changeset 836 for temp


Ignore:
Timestamp:
2006/12/13 11:03:57 (19 years ago)
Author:
uehara
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollrating.php

    r834 r836  
    4949    case 'rating': 
    5050        $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(); 
    5663        } 
    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(); 
    6164        break; 
    6265    default: 
     
    8184$xoopsTpl->assign('poll_id', $poll_id); 
    8285$xoopsTpl->assign('start', $start); 
     86$xoopsTpl->assign('arrErr', $arrErr); 
    8387 
    8488include XOOPS_ROOT_PATH.'/include/comment_view.php'; 
    8589 
    8690include XOOPS_ROOT_PATH."/footer.php"; 
     91 
     92//--------------------------------------------------------------------------------------------------- 
     93 
     94function 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} 
    87106?> 
Note: See TracChangeset for help on using the changeset viewer.