Index: temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollrating.php
===================================================================
--- temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollrating.php	(revision 765)
+++ temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollrating.php	(revision 771)
@@ -33,4 +33,5 @@
 include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspollrenderer.php";
 
+$poll_id = $_GET['poll_id'];
 $option_id = $_GET['option_id'];
 if(empty($option_id)) $option_id = $_POST['option_id'];
@@ -39,7 +40,27 @@
 $option_id = (!empty($option_id)) ? intval($option_id) : 0;
 if (empty($option_id)) {
-	redirect_header("pollresults.php?poll_id=".POLL_ID,0);
+	redirect_header("pollresults.php?poll_id=".$poll_id,0);
 	exit();
 }
+
+switch($_POST['mode']) {
+	case 'rating':
+		$poll_id = $_POST['poll_id'];
+		$poll = new XoopsPoll($poll_id);
+		if ( $xoopsUser ) {
+			$uid = $xoopsUser->getVar("uid");
+		} else {
+			$uid = 0;
+		}
+		$poll->vote($option_id, xoops_getenv('REMOTE_ADDR'), $uid, $_POST['rating_id'], $_POST['comment']);
+		$poll->updateCount();
+		redirect_header(XOOPS_URL."/modules/xoopspoll/pollresults.php?poll_id=".$poll_id, 1, $msg);
+		exit();
+		break;
+	default:
+		break;
+}
+
+
 $xoopsOption['template_main'] = 'xoopspoll_rating.html';
 include XOOPS_ROOT_PATH."/header.php";
@@ -47,4 +68,5 @@
 $dummy = "";
 $renderer = new XoopsPollRenderer($dummy);
+
 $renderer->assignOption($xoopsTpl, $option_id);
 $renderer->assignComment($xoopsTpl, $option_id);
@@ -53,4 +75,5 @@
 $xoopsTpl->assign('arrCat', $arrCategory);
 $xoopsTpl->assign('arrRating', $arrRating);
+$xoopsTpl->assign('poll_id', $poll_id);
 
 include XOOPS_ROOT_PATH.'/include/comment_view.php';
Index: temp/test-xoops.ec-cube.net/html/modules/xoopspoll/xoops_version.php
===================================================================
--- temp/test-xoops.ec-cube.net/html/modules/xoopspoll/xoops_version.php	(revision 757)
+++ temp/test-xoops.ec-cube.net/html/modules/xoopspoll/xoops_version.php	(revision 771)
@@ -60,4 +60,6 @@
 $modversion['templates'][4]['file'] = 'xoopspoll_rating.html';
 $modversion['templates'][4]['description'] = '';
+$modversion['templates'][5]['file'] = 'xoopspoll_new.html';
+$modversion['templates'][5]['description'] = '';
 
 //Blocks
Index: temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollresults.php
===================================================================
--- temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollresults.php	(revision 765)
+++ temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollresults.php	(revision 771)
@@ -37,5 +37,5 @@
 $poll_id = (!empty($poll_id)) ? intval($poll_id) : 0;
 if (empty($poll_id)) {
-	redirect_header("pollresults.php?poll_id=".POLL_ID,0);
+	redirect_header("pollresults.php?poll_id=".$poll_id,0);
 	exit();
 }
@@ -50,4 +50,5 @@
 $xoopsTpl->assign('arrStatus', $arrStatus);
 $xoopsTpl->assign('arrCat', $arrCategory);
+$xoopsTpl->assign('poll_id', $poll_id);
 
 include XOOPS_ROOT_PATH.'/include/comment_view.php';
