1 (edited by towelie 2007-05-07 17:50)

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.

Re: This mod in development - cool!

I guess Ill bump this, I have some stuff to add.

Okay, so here are a couple new links u can use to see what I am working on (more aesthetically pleasing for the moment)
iBattle
This link is where you set up a challenge with another player. What I am trying to do is that when the opponent value is selected, the title will input that value of the player beside your name ($pun_user) versus ($opponent). Unfortunately I am having a lot of trouble determining how to write the oponent variable. Check my code above for an example. PLEASE HELP

iLadder
Here is where the results are printed out. They use the same code as that drop down menu for opponents in the first example. Except they also include rows iwins ilosses and ipoints.

Any replies are welcome..

3 (edited by rollonequick 2007-05-09 06:02)

Re: This mod in development - cool!

YOU ARE AMAZING!!! PLEASE SHARE THIS!!

Re: This mod in development - cool!

Hey, thanks lol. I did share it, it's up there. What do you want to know?

Re: This mod in development - cool!

well.. after looking at it its not exactly what I wanted... :-(

I want my users to create game ladders with how ever many people they want... then only the topic poster could update the ladder.. or each person could update only on their name and their oppnants name so they advance if its equal...  And I want this incorperated with posting a new topic


I am going to suggest this...