Here's the code that FetchAll needs:
Code: Select all
<?php
//
// This path points to the directory where phpBB is installed. Do
// not enter an URL here. The path must end with a trailing
// slash.
//
$phpbb_root_path = './forum/';
define ('IN_PHPBB', true);
if (!file_exists($phpbb_root_path . 'extension.inc'))
{
die ('<tt><b>phpBB Fetch All:</b>
$phpbb_root_path is wrong and does not point to your forum.</tt>');
}
//
// phpBB related files
//
include_once ($phpbb_root_path . 'extension.inc');
include_once ($phpbb_root_path . 'common.' . $phpEx);
include_once ($phpbb_root_path . 'includes/bbcode.' . $phpEx);
//
// Fetch All related files
//
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/common.' . $phpEx);
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/polls.' . $phpEx);
//
// start session management
//
##$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// fetch a poll
$poll = phpbb_fetch_poll(2);
//
// disconnect from the database
//
phpbb_disconnect();?>Code: Select all
<?php if ($poll) { ?>
<table width="150" cellpadding="1" cellspacing="1" border="0" style="border: 2px solid #36558C">
<tr>
<td height="32" bgcolor="#FFFF66">
<div align="center"><strong>What's Goin' On?</strong></div></td>
</tr>
<tr>
<td width="100%" align="left" bgcolor="#FFFFFF"> <font color="#000033">
<?php if (!$poll) { ?>
<strong><font size="-1" face="Arial">No poll at the moment.</font></strong>
<?php } else { ?>
<strong><font size="-1" face="Arial"><?php echo $poll['vote_text']; ?></font></strong>
</font> <form method="post" action="<?php echo append_sid($phpbb_root_path . 'posting.php?t=' . $poll['topic_id']); ?>">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber7">
<tr>
<td width="100%"> <table>
<font color="#000033" face="Arial">
<?php for ($i = 0; $i < count($poll['options']); $i++) { ?>
</font>
<tr>
<td> <font color="#000033">
<input type="radio" name="vote_id" value="<?php echo $poll['options'][$i]['vote_option_id']; ?>">
</font></td>
<td> <font color="#000033"><font size="-1" face="Arial"><?php echo $poll['options'][$i]['vote_option_text']; ?></font>
</font></td>
</tr>
<?php } ?>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td width="100%" height="30"> <p align="center"> <font color="#000033">
<input type="submit" class="mainoption" name="submit" value="Vote">
</font></td>
</tr>
</table>
<input type="hidden" name="topic_id" value="<?php echo $poll['topic_id']; ?>">
<input type="hidden" name="mode" value="vote">
<?php } ?></font>
<font color="#000033"></font></font></form></td>
</tr>
</table>
<?php } ?>