Topic: This mod in development - cool!
Okay so I am creating a ladder system based on poll votes from the Easy poll 2.0 mod.
//See Next Post For More Info and new links!
(second page is a query that looks for wins losses and points based on username (which are new rows that I inserted into the user table))
/* Also note that I am not styling it until it is fully functional with the site */
Here is some of the source from the first page:
<?php
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
?>
<div class="blockform">
<h2><span>Improv Ladder: Battle</span></h2>
<div class="box">
<form id="post" method="post" action="post.php?action=post&fid=15" onsubmit="return process_form(this)">
<div class="inform">
<fieldset>
<legend>Good luck, have fun!</legend>
<div class="infldset">
<input type="hidden" name="ptype" value="1" />
<label><strong>...</strong><br /><input type="text" name="req_question" value="Who won the battle?" readonly="" size="80" maxlength="70" tabindex="1" /><br /><br /></label>
<label><strong>You:</strong><br />
<select name="poll_option[1]">
<option value="<?php echo $pun_user['username']; ?>" selected="selected"><?php echo $pun_user['username']; ?></option>
</select>
<br /></label>
<label><strong>Opponent:</strong><br />
<?php
// Perform the query
$query = 'SELECT username FROM punbb2_users' . ' ORDER by username ASC' ;
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Print results in html
echo "<select name='poll_option[2]'>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<option>$col_value</option>\n";
}
echo "\t</tr>\n";
}
echo "</select>\n";
// define opponent, the variable is used later on as you can see (for the title of the poll)
/* $opponent = */
?>
<br /></label>
</div></fieldset></div> <div class="inform">
<fieldset>
<legend>Include video links</legend>
<div class="infldset txtarea">
<input type="hidden" name="form_sent" value="1" />
<input type="hidden" name="form_user" value="<?php echo $pun_user['username']; ?>" />
<label><strong>Subject</strong><br /><input class="longinput" type="text" name="req_subject" value="<?php echo $pun_user['username']; ?> versus <?php echo $opponent; ?>" size="80" maxlength="70" tabindex="100" /><br /></label>
<label><strong>Video links + info</strong><br />
<textarea name="req_message" rows="20" cols="95" tabindex="101"></textarea><br /></label>
If you look through the code you can see that one of the problems is using the second selected user option in the page title. I have tried numerous things to get it to work. Any ideas would be great. If you need more info or have comments PLEASE SHARE.