Ignore:
Timestamp:
2006/12/11 21:53:47 (20 years ago)
Author:
uehara
Message:
 
Location:
temp/test-xoops.ec-cube.net/html/modules/xoopspoll
Files:
4 edited

Legend:

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

    r405 r709  
    4040        $this->db =& Database::getInstance(); 
    4141        $this->initVar("poll_id", XOBJ_DTYPE_INT, null, false); 
     42        $this->initVar("option_id", XOBJ_DTYPE_INT, null, false); 
    4243        $this->initVar("question", XOBJ_DTYPE_TXTBOX, null, true, 255); 
    4344        $this->initVar("description", XOBJ_DTYPE_TXTBOX, null, false, 255); 
  • temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspolloption.php

    r699 r709  
    120120 
    121121    // public static 
     122    function &getOptionByOptionId($option_id) 
     123    { 
     124        $db =& Database::getInstance(); 
     125        $ret = array(); 
     126        $sql = "SELECT * FROM ".$db->prefix("xoopspoll_option")." WHERE option_id=".intval($option_id).""; 
     127        $result = $db->query($sql); 
     128        while ( $myrow = $db->fetchArray($result) ) { 
     129            $ret[] = new XoopsPollOption($myrow); 
     130        } 
     131        //echo $sql; 
     132        return $ret; 
     133    } 
     134         
     135    // public static 
    122136    function &getAllOption() 
    123137    { 
  • temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspollrenderer.php

    r695 r709  
    153153    function assignOptions(&$tpl) 
    154154    { 
    155         $options_arr =& XoopsPollOption::getAllOption(); 
     155        $arrOption =& XoopsPollOption::getOptionByOptionId($this->poll->getVar("option_id")); 
     156        $i = 0; 
     157        $tpl->assign('arrOption', $arrOption); 
     158    } 
     159     
     160    function assignPoll(&$tpl) 
     161    { 
     162        $options_arr =& XoopsPollOption::getAllByPollId($this->poll->getVar("poll_id")); 
    156163        $i = 0; 
    157164        $tpl->assign('option_list', $options_arr); 
    158     }    
     165    } 
    159166} 
    160167?> 
  • temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollregist.php

    r707 r709  
    3333include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspollrenderer.php"; 
    3434 
    35 $poll_id = $_GET['poll_id']; 
     35$option_id = $_GET['option_id']; 
    3636 
    37 $poll_id = (!empty($poll_id)) ? intval($poll_id) : 0; 
    38 if (empty($poll_id)) { 
     37$option_id = (!empty($option_id)) ? intval($option_id) : 0; 
     38if (empty($option_id)) { 
    3939    redirect_header("index.php",0); 
    4040    exit(); 
     
    4242$xoopsOption['template_main'] = 'xoopspoll_regist.html'; 
    4343include XOOPS_ROOT_PATH."/header.php"; 
    44 /* 
    45 $poll = new XoopsPoll($poll_id); 
     44 
     45$poll = new XoopsPoll($option_id); 
    4646$renderer = new XoopsPollRenderer($poll); 
    47 $renderer->assignResults($xoopsTpl); 
    48 */ 
     47$renderer->assignOptions($xoopsTpl); 
     48 
    4949include XOOPS_ROOT_PATH.'/include/comment_view.php'; 
    5050 
Note: See TracChangeset for help on using the changeset viewer.