Changeset 709 for temp/test-xoops.ec-cube.net
- Timestamp:
- 2006/12/11 21:53:47 (20 years ago)
- Location:
- temp/test-xoops.ec-cube.net/html/modules/xoopspoll
- Files:
-
- 4 edited
-
class/xoopspoll.php (modified) (1 diff)
-
class/xoopspolloption.php (modified) (1 diff)
-
class/xoopspollrenderer.php (modified) (1 diff)
-
pollregist.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspoll.php
r405 r709 40 40 $this->db =& Database::getInstance(); 41 41 $this->initVar("poll_id", XOBJ_DTYPE_INT, null, false); 42 $this->initVar("option_id", XOBJ_DTYPE_INT, null, false); 42 43 $this->initVar("question", XOBJ_DTYPE_TXTBOX, null, true, 255); 43 44 $this->initVar("description", XOBJ_DTYPE_TXTBOX, null, false, 255); -
temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspolloption.php
r699 r709 120 120 121 121 // 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 122 136 function &getAllOption() 123 137 { -
temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspollrenderer.php
r695 r709 153 153 function assignOptions(&$tpl) 154 154 { 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")); 156 163 $i = 0; 157 164 $tpl->assign('option_list', $options_arr); 158 } 165 } 159 166 } 160 167 ?> -
temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollregist.php
r707 r709 33 33 include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspollrenderer.php"; 34 34 35 $ poll_id = $_GET['poll_id'];35 $option_id = $_GET['option_id']; 36 36 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; 38 if (empty($option_id)) { 39 39 redirect_header("index.php",0); 40 40 exit(); … … 42 42 $xoopsOption['template_main'] = 'xoopspoll_regist.html'; 43 43 include XOOPS_ROOT_PATH."/header.php"; 44 /* 45 $poll = new XoopsPoll($ poll_id);44 45 $poll = new XoopsPoll($option_id); 46 46 $renderer = new XoopsPollRenderer($poll); 47 $renderer->assign Results($xoopsTpl);48 */ 47 $renderer->assignOptions($xoopsTpl); 48 49 49 include XOOPS_ROOT_PATH.'/include/comment_view.php'; 50 50
Note: See TracChangeset
for help on using the changeset viewer.
