Changeset 727 for temp


Ignore:
Timestamp:
2006/12/11 22:40:09 (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/class/xoopspolloption.php

    r722 r727  
    120120 
    121121    // public static 
     122    function &getAllCommentByOptionId($option_id) 
     123    { 
     124        $db =& Database::getInstance(); 
     125        $ret = array(); 
     126        $sql = "SELECT u.uid, u.uname, l.rating_id, l.comment FROM ".$db->prefix("xoopspoll_log")." l, ". $db->prefix("users") ." u WHERE l.user_id = u.uid AND l.option_id=".intval($option_id)." ORDER BY time DESC"; 
     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     
     136    // public static 
    122137    function &getOptionByOptionId($option_id) 
    123138    { 
  • temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspollrenderer.php

    r725 r727  
    161161        $tpl->assign('option_list', $options_arr); 
    162162    } 
     163 
     164    function assignComment(&$tpl, $option_id) 
     165    { 
     166        $arrComment =& XoopsPollOption::getAllCommentByOptionId($option_id); 
     167        $tpl->assign('arrComment', $arrComment); 
     168    } 
     169 
    163170} 
    164171?> 
  • temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollregist.php

    r726 r727  
    4545$renderer = new XoopsPollRenderer(); 
    4646$renderer->assignOptions($xoopsTpl, $option_id); 
     47$renderer->assignComment($xoopsTpl, $option_id); 
    4748 
    4849$xoopsTpl->assign('arrStatus', $arrStatus); 
Note: See TracChangeset for help on using the changeset viewer.