setQuery( $query ); $polls = $database->loadObjectList(); if($database->getErrorNum()) { echo "MB ".$database->stderr(true); return; } // try to find poll component's Itemid $query = "SELECT id" . "\n FROM #__menu" . "\n WHERE type = 'components'" . "\n AND published = 1" . "\n AND link = 'index.php?option=com_poll'" ; $database->setQuery( $query ); $_Itemid = $database->loadResult(); if ($_Itemid) { $_Itemid = '&Itemid='. $_Itemid; } $z = 1; foreach ($polls as $poll) { if ($poll->id && $poll->title) { $query = "SELECT id, text" . "\n FROM #__poll_data" . "\n WHERE pollid = " . (int) $poll->id . "\n AND text != ''" . "\n ORDER BY id"; $database->setQuery($query); if(!($options = $database->loadObjectList())) { echo "MD ".$database->stderr(true); return; } poll_vote_form_html( $poll, $options, $_Itemid, $params, $z ); $z++; } } } /** * @param object Poll object * @param array * @param int The current menu item * @param string CSS suffix */ function poll_vote_form_html( &$poll, &$options, $_Itemid, &$params, $z ) { $tabclass_arr = array( 'sectiontableentry2', 'sectiontableentry1' ); $tabcnt = 0; $moduleclass_sfx = $params->get('moduleclass_sfx'); $cookiename = "voted$poll->id"; $voted = mosGetParam( $_COOKIE, $cookiename, 'z' ); // used for spoof hardening $validate = josSpoofValue('poll'); ?>
">
title; ?>
  id$_Itemid"); ?>';" />