Ignore:
Timestamp:
2006/12/12 23:44:38 (20 years ago)
Author:
uehara
Message:
 
Location:
temp/test-xoops.ec-cube.net/html/modules/xoopspoll
Files:
3 edited

Legend:

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

    r765 r771  
    3333include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspollrenderer.php"; 
    3434 
     35$poll_id = $_GET['poll_id']; 
    3536$option_id = $_GET['option_id']; 
    3637if(empty($option_id)) $option_id = $_POST['option_id']; 
     
    3940$option_id = (!empty($option_id)) ? intval($option_id) : 0; 
    4041if (empty($option_id)) { 
    41     redirect_header("pollresults.php?poll_id=".POLL_ID,0); 
     42    redirect_header("pollresults.php?poll_id=".$poll_id,0); 
    4243    exit(); 
    4344} 
     45 
     46switch($_POST['mode']) { 
     47    case 'rating': 
     48        $poll_id = $_POST['poll_id']; 
     49        $poll = new XoopsPoll($poll_id); 
     50        if ( $xoopsUser ) { 
     51            $uid = $xoopsUser->getVar("uid"); 
     52        } else { 
     53            $uid = 0; 
     54        } 
     55        $poll->vote($option_id, xoops_getenv('REMOTE_ADDR'), $uid, $_POST['rating_id'], $_POST['comment']); 
     56        $poll->updateCount(); 
     57        redirect_header(XOOPS_URL."/modules/xoopspoll/pollresults.php?poll_id=".$poll_id, 1, $msg); 
     58        exit(); 
     59        break; 
     60    default: 
     61        break; 
     62} 
     63 
     64 
    4465$xoopsOption['template_main'] = 'xoopspoll_rating.html'; 
    4566include XOOPS_ROOT_PATH."/header.php"; 
     
    4768$dummy = ""; 
    4869$renderer = new XoopsPollRenderer($dummy); 
     70 
    4971$renderer->assignOption($xoopsTpl, $option_id); 
    5072$renderer->assignComment($xoopsTpl, $option_id); 
     
    5375$xoopsTpl->assign('arrCat', $arrCategory); 
    5476$xoopsTpl->assign('arrRating', $arrRating); 
     77$xoopsTpl->assign('poll_id', $poll_id); 
    5578 
    5679include XOOPS_ROOT_PATH.'/include/comment_view.php'; 
  • temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollresults.php

    r765 r771  
    3737$poll_id = (!empty($poll_id)) ? intval($poll_id) : 0; 
    3838if (empty($poll_id)) { 
    39     redirect_header("pollresults.php?poll_id=".POLL_ID,0); 
     39    redirect_header("pollresults.php?poll_id=".$poll_id,0); 
    4040    exit(); 
    4141} 
     
    5050$xoopsTpl->assign('arrStatus', $arrStatus); 
    5151$xoopsTpl->assign('arrCat', $arrCategory); 
     52$xoopsTpl->assign('poll_id', $poll_id); 
    5253 
    5354include XOOPS_ROOT_PATH.'/include/comment_view.php'; 
  • temp/test-xoops.ec-cube.net/html/modules/xoopspoll/xoops_version.php

    r757 r771  
    6060$modversion['templates'][4]['file'] = 'xoopspoll_rating.html'; 
    6161$modversion['templates'][4]['description'] = ''; 
     62$modversion['templates'][5]['file'] = 'xoopspoll_new.html'; 
     63$modversion['templates'][5]['description'] = ''; 
    6264 
    6365//Blocks 
Note: See TracChangeset for help on using the changeset viewer.