Php joomla 1.5.26系统消息和投票不在同一页上
我有joomla版本1.15.26。我使用了一些组件 在我的index.php中,我有如下代码:Php joomla 1.5.26系统消息和投票不在同一页上,php,joomla,joomla1.5,Php,Joomla,Joomla1.5,我有joomla版本1.15.26。我使用了一些组件 在我的index.php中,我有如下代码: <jdoc:include type="message" /> <jdoc:include type="component" /> 如果需要任何其他信息,请告诉我。 提前谢谢 function vote() { $mainframe = JFactory::getApplication(); $poll_id = JRequest:
<jdoc:include type="message" />
<jdoc:include type="component" />
如果需要任何其他信息,请告诉我。
提前谢谢
function vote() {
$mainframe = JFactory::getApplication();
$poll_id = JRequest::getInt('id', 0);
$option_id = JRequest::getInt('voteid', 0);
$poll =& JTable::getInstance('Poll', 'Table');
$item_id = JRequest::getInt('itemid');
if (!$poll->load($poll_id) || $poll->published != 1) {
JError::raiseWarning(404, JText::_('ALERTNOTAUTH'));
return;
}
$cookieName = JUtility::getHash($mainframe->getName().'poll'.$poll_id);
$voted = JRequest::getVar($cookieName, '0', 'COOKIE', 'INT');
if ($voted || !$option_id) {
if ($voted) {
$msg = JText::_('COM_ACEPOLLS_ALREADY_VOTED');
$tom = "error";
}
if (!$option_id){
$msg = JText::_('COM_ACEPOLLS_NO_SELECTED');
$tom = "error";
}
}
else {
require_once(JPATH_COMPONENT.DS.'models'.DS.'poll.php');
$model = new AcepollsModelPoll();
if ($model->vote($poll_id, $option_id)) {
//Set cookie showing that user has voted
setcookie($cookieName, '1', time() + 60*$poll->lag);
}
$msg = JText::_('COM_ACEPOLLS_THANK_YOU');
$tom = "";
if (JFactory::getUser()->id != 0) {
JPluginHelper::importPlugin('acepolls');
$dispatcher =& JDispatcher::getInstance();
$dispatcher->trigger('onAfterVote', array($poll, $option_id));
}
}
// set Itemid id for links
$menu = &JSite::getMenu();
$items = $menu->getItems('link', 'index.php?option=com_acepolls');
$itemid = isset($items[0]) ? '&Itemid='.$items[0]->id : '';
if(!$itemid)
$itemid = '&Itemid='.$item_id;
$this->setRedirect(JRoute::_('index.php?option=com_acepolls&view=poll&id='. $poll_id.':'.$poll->alias.$itemid, false), $msg, $tom);
}