Jump to content

Xtremer360

Members
  • Posts

    1,444
  • Joined

  • Last visited

Everything posted by Xtremer360

  1. i'll try and come up with something
  2. The lock_date in the db is 2011-09-05 15:11:08.
  3. For some reason when I echo $diff and $time_remaining it ALWAYS echos with values of 3 and 7 and not sure why. $lock_date = $row['lock_date']; $current_time = time(); // Find out if user is locked out of their account if (($lock_date != "0000-00-00 00:00:00") && strtotime($lock_date) < $current_time) { $lock_date = strtotime($lock_date); $diff = $current_time - $lock_date; $diff = floor($diff/6000); // Take minutes and perform tasks if ($diff <= 10) { // Calculate time remaining $time_remaining = 10 - $diff; // Account locked error $errors = true; $message = "Account is locked! Must wait " .$time_remaining." minutes to log in again!"; $output = array('errorsExist' => $errors, 'message' => $message); } else { // Clear the lock $query = "UPDATE users_logins_attempts SET lockDate = NULL, ip_address = NULL, failed_logins = 0 WHERE users_id = '".$users_id."'"; $result = mysqli_query($dbc,$query); // Account locked error $errors = true; $message = "Account is unlocked. You may now try to log in again!"; $output = array('errorsExist' => $errors, 'message' => $message); } }
  4. Amazing work. What do you mean format? If you mean what I'm using on client side scripting on my front end it's jquery.
  5. That works great thank you however I want to add something to it. I want it to basically before it runs through check to make sure that in that table called handlers that there isn't someone already with that characer as there default_character_id and if there is a match then it kicks it back to my form with an alert since I am also using jquery on my front end.
  6. I know via firebug that the correct parameters were passed to my process page and the parameter being passed that in caused issues on the process page is $characterIDList. What's causing the issue is that its not inserting the value into the insert query. The rest of the insert query works fine. process page $characterIDs = explode(',', $_POST['characterIDList']); foreach($characterIDs as $itm){ $id = (int)$itm; } $defaultcharid = (int)$characterIDs[0]; $query = "INSERT INTO `handlers` (username, password, firstname, lastname, email, status_id, isadmin, default_character_id, creator_id, datecreated) VALUES ('$username','$password','$firstname','$lastname','$email','$status','$admin', '$defaultcharid', 1, NOW())";
  7. I take that back. The only way the info displays is if the person has a manager and if it doesn't then it says all the variables are undefined. function getWrestling($style, $id) { $id=mysql_real_escape_string($id); if ($style=='singles') { $sql = "SELECT bio.charactername AS manager, ebw.finisher AS finisher, ebw.setup AS setup, ebw.music AS music FROM efed_bio_wrestling AS ebw JOIN efed_bio AS bio ON ( ebw.manager_id = bio.id) WHERE ebw.bio_id = '$id'"; $re = mysql_query($sql); $row = mysql_fetch_assoc($re); extract($row); ?> <h2>Wrestling</h2> <table class="biotable" cellspacing="10px"> <tr class="biotablerowb"> <td class="biotableheadingb">Manager/Valet:</td> <td class="biotabledatab"><?php if (strlen ($manager) < 1) { print "N/A"; } else { print "$manager";}?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Finisher:</td> <td class="biotabledatab"><?php if (strlen ($finisher) < 1) { print "N/A"; } else { print "$finisher";}?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Setup:</td> <td class="biotabledatab"><?php if (strlen ($setup) < 1) { print "N/A"; } else { print "$setup";}?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Entrance Music:</td> <td class="biotabledatab"><?php if (strlen ($music) < 1) { print "N/A"; } else { print "$music";}?></td> </tr> </table> <?php } ?>
  8. Finally solved it on my own. I thank everyone who contributed to the thread.
  9. Okay so I got something to work. I have it to display the value of the manager_id field. However my coding says that if its value is less than 1 then print N/A but it's not then it needs to take it back to efed_bio and match it up with the id value and then grab that charactername. <td class="biotableheadingb">Manager/Valet:</td> <td class="biotabledatab"><?php if (strlen ($manager) < 1) { print "N/A"; } else { print "$manager";}?></td>
  10. These are just the parts that don't work. I already have it getting the rest of the information so it has the bio_id of the character and what it's supposed to do when it's inside of the efed_bio_wrestling table is get the manager_id and then take it to the efed_bio table and match that to the same integer and when it finds a match record then get that person's charactername and if there is a 0 for the value inside of manager_id then it says "N/A" efed_bio id charactername efed_bio_wrestling bio_id manager_id
  11. Again I spent the better part of the day researching and trying different things and can't seem to come up with a solution. Anyone available to try it from a second brain instead of mine.
  12. Anyone have any other suggestions that I could plug in and try because I've about tried everything I can come up with. It just keeps saying its undefined.
  13. That didn't work it made all the variables in that area undefined. Not saying you don't understand what I'm trying to attempt here but that way you can get a better understanding. Okay so say i have wrestler 1 that inside the efed_bio_wrestling table has a value of 2 in the manager_id field. I want it to take that value to the efed_bio table and look in the id field with that integer. Then when it finds a match then grab the value inside the charactername field.
  14. Does anyone know that can read a few previous posts?
  15. LOL I was about to say you should have been the end of the function besides you had reposted old code.
  16. Its working great, however, I'm trying to also get the manager of someone if one exist by taking the id of the competitor's biography that you are looking at and putting that in the efed_bio_wrestling table that is being used inside the getWrestling function part. The table all that info is taken from is efed_bio_wrestling which has a field called manager_id. If there is a value there I want it to take it to the efed_bio table and match that value to the id inside that table and when it finds a match then grab the field from efed_bio table called charactername and then take that charactername back to the Wrestling area of the bio and insert it for Manager/Valet since right now it says that the variable manager is undefined. Here's the query from the first try at the bio I once had that worked before trying to redo it all to make it more efficient: $sql = "SELECT ebw.manager_id AS managerid, ebw.finisher AS finisher, ebw.setup AS setup, ebw.music AS music, ebw.nicknames AS nicknames, bio.id AS id, bio.posername AS posername, bio.charactername AS charname, bio.style_id AS style, bio.status_id AS status FROM `efed_bio` AS bio LEFT JOIN `efed_bio_wrestling` AS ebw ON bio.id = ebw.bio_id WHERE bio.username = '$username'"; One more thing, I have that function for that biomenu that was made however I took it out as a div and gave it the same tagging as with a few other uses like it called with a class of minilinks and for some reason its adding a line break after each one and not sure why? http://kansasoutlawwrestling.com/bio?username=satoshi function getBioMenu($username) { ?> <p><span class="minilinks"> <a href="/bio?username=<? echo $username; ?>" class="mwtabslink">Biography</a> <a href="/bio?page=gallery&username=<? echo $username; ?>" class="mwtabslink">Gallery</a> <a href="/bio?page=news&username=<? echo $username; ?>" class="mwtabslink">News</a> <a href="/bio?page=segments&username=<? echo $username; ?>" class="mwtabslink">Segments</a> <a href="/bio?page=matches&username=<? echo $username; ?>" class="mwtabslink">Matches</a> <a href="/bio?page=chronology&username=<? echo $username; ?>" class="mwtabslink">Chronology</a> </span> </p> <? } function getBio($style, $id) { $id = mysql_real_escape_string($id); ?> <h2>Personal</h2> <?php if ($style=='singles') { $sql = "SELECT a.*,b.manager_id, b.nicknames, b.finisher, b.setup, b.music FROM efed_bio_singles AS a JOIN efed_bio_wrestling AS b ON (a.bio_id = b.bio_id) WHERE a.bio_id = '$id' LIMIT 1"; $re = mysql_query($sql); $row = mysql_fetch_assoc($re); extract($row); ?> <table class="biotable" cellspacing="5px"> <tr class="biotablerowa"> <td class="biotableheadingb">Nicknames:</td> <td class="biotabledatab"><?php echo (empty($nicknames)) ? "N/A" : $nicknames; ?></td> </tr> <tr class="biotablerowa"> <td class="biotableheadingb">Height:</td> <td class="biotabledatab"><?php echo $height; ?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Weight:</td> <td class="biotabledatab"><?php echo $weight; ?></td> </tr> <tr class="biotablerowa"> <td class="biotableheadingb">Hometown:</td> <td class="biotabledatab"><?php echo $hometown; ?></td> </tr> </table> <?php } ?> <? if ($style=='tagteam') { ?> <? } ?> <? if ($style=='manager') { ?> <? } ?> <? if ($style=='referee') { ?> <? } ?> <? if ($style=='staff') { ?> <? } ?> <? if ($style=='stable') { ?> <? } ?> <h2>History</h2> <? echo getHistory($style, $id); ?> <h2>Quotes</h2> <? echo getQuotes($id); ?> <h2>Wrestling</h2> <? echo getWrestling($style, $id); ?> </div> <? } function getGallery($id) { $id=mysql_real_escape_string($id); ?> <table class="biotable" cellspacing="0px"> <tr class="biotablerowa"> <td class="biotableheadingb">Headshot Image</td> <td class="biotabledatab"><?php if(file_exists('images/headshots/' . $posername . '.jpg')){ echo '<img src="/backstage/images/headshots/' . $posername . '.jpg" alt="" />'; } else { echo 'No Image Uploaded'; } ?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Roleplay Image</td> <td class="biotabledatab"><?php if(file_exists('images/lp/' . $posername . '.jpg')){ echo '<img src="/backstage/images/lp/' . $posername . '.jpg" alt="" />'; } else { echo 'No Image Uploaded'; } ?></td> </tr> <tr class="biotablerowa"> <td class="biotableheadingb">Titantron Image</td> <td class="biotabledatab"><?php if(file_exists('images/titantron/' . $posername . '.jpg')){ echo '<img src="/backstage/images/titantron/' . $posername . '.jpg" alt="" />'; } else { echo 'No Image Uploaded'; } ?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Champion Image</td> <td class="biotabledatab"><?php if(file_exists('images/champions/' . $posername . '.jpg')){ echo '<img src="/backstage/images/champions/' . $posername . '.jpg" alt="" />'; } else { echo 'No Image Uploaded'; } ?></td> </tr> </table> <?php } function getHistory($style, $id) { $id=mysql_real_escape_string($id); if ($style=='singles') { $sql = "SELECT * FROM `efed_bio_history` WHERE bio_id = '$id'"; $re = mysql_query($sql); $row = mysql_fetch_assoc($re); extract($row); ?> <table class="biotable" cellspacing="10px"> <tr class="biotablerowb"> <td class="biotableheadingb">KOW Titles:</td> <td class="biotabledatab"><?php if (strlen ($kowtitles) < 1) { print "N/A"; } else { print "$kowtitles";}?></td> </tr> <tr class="biotablerowa"> <td class="biotableheadingb">KOW Awards:</td> <td class="biotabledatab"><?php if (strlen ($kowawards) < 1) { print "N/A"; } else { print "$kowawards";}?></td> </tr> </table> <?php } ?> <? if ($style=='tagteam') { ?> <? } ?> <? if ($style=='manager') { ?> <? } ?> <? if ($style=='referee') { ?> <? } ?> <? if ($style=='staff') { ?> <? } ?> <? if ($style=='stable') { ?> <? } } function getQuotes($id) { $id=mysql_real_escape_string($id); ?> <ul id="quotes"> <?php if(count($quotes) > 0){ for($i = 0; $i < count($quotes); $i++){ echo "<li>".$quotes[$i]."</li>"; } } else{ echo '<li>This wrestler has no quotes.</li>'; } ?> </ul> <?php } function getWrestling($style, $id) { $id=mysql_real_escape_string($id); if ($style=='singles') { $sql = "SELECT * FROM `efed_bio_wrestling` WHERE bio_id = '$id'"; $re = mysql_query($sql); $row = mysql_fetch_assoc($re); extract($row); ?> <table class="biotable" cellspacing="10px"> <tr class="biotablerowb"> <td class="biotableheadingb">Manager/Valet:</td> <td class="biotabledatab"><?php if (strlen ($manager) < 1) { print "N/A"; } else { print "$manager";}?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Finisher:</td> <td class="biotabledatab"><?php if (strlen ($finisher) < 1) { print "N/A"; } else { print "$finisher";}?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Setup:</td> <td class="biotabledatab"><?php if (strlen ($setup) < 1) { print "N/A"; } else { print "$setup";}?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Entrance Music:</td> <td class="biotabledatab"><?php if (strlen ($music) < 1) { print "N/A"; } else { print "$music";}?></td> </tr> </table> <?php if ($style=='tagteam') { ?> <? } ?> <? if ($style=='manager') { ?> <? } ?> <? if ($style=='referee') { ?> <? } ?> <? if ($style=='staff') { ?> <? } ?> <? if ($style=='stable') { ?> <? } } } ?>
  17. Yes. The id from efed_bio is the same int as all the other tables with bio_id.
  18. well this is where it gets confusing for most people. After it finds out if its a singles competitor then it goes into the efed_bio_singles table and matches the id of the competitor which was passed and connects it to the bio_id inside of efed_bio_singles. There will be use for the efed_bio_wrestling table as well. efed_bio_singles Table - bio_id, hometown, height, weight efed_bio_wrestling Table- bio_id, manager_id, nicknames, finisher, setup, music
  19. efed_list_styles Table- id, name efed_bio Table- id, charactername, username, posername, style_id
  20. Well I changed the .php issue in the links and changed the getBio function to have $row and it went to heck after that. So basically it all stems off that initial query which I need to include styles.name and have an Inner/Left Join I still don't understand the difference so that bio.styles.id = styles.id. Also need to add to the query that some of the data comes from the efed_list_styles table.
  21. http://kansasoutlawwrestling.com/bio?username=cruz
  22. So I can't have: <?php $page = (isset($_GET['page'])) ? strip_tags($_GET['page']) : NULL; if(isset($_GET['username']) && $_GET['username'] != '') { $username = $_GET['username']; $query = "SELECT bio.username AS username, bio.posername AS posername, bio.charactername AS charactername, bio.id AS id, bio.style_id AS style FROM `efed_bio` AS bio WHERE bio.username = '$username'"; $result = mysql_query($query); if(mysql_num_rows($result) > 0) { $row = mysql_fetch_assoc($result); $row = array_map('cleanquerydata',$row); extract($row); } } ?> <div id="bio"> <h1><?php echo $charactername; ?>'s Biography</h1> <?php echo getBioMenu($username); ?> <?php if(file_exists('images/fullshots/' . $posername . '.png')){ echo '<img class="fullshot" src="images/fullshots/' . $posername . '.png" />'; } else{ echo '<img class="fullshot" src="images/fullshots/default.png" />'; } ?> <? //Or if the GET page variable is gallery, display the gallery page if ($page == 'gallery') { echo getGallery($style,$id); } //If the GET page variable is news, display the news page elseif ($page == 'news') { echo getNews($$id); } //If the GET page variable is segments, display the segments page elseif ($page == 'segments') { echo getBioSegments($id,S); } //If the GET page variable is matches, display the matches page elseif ($page == 'matches') { echo getBioSegments($id,M); } elseif ($page == 'chronology') { echo getChronology($id); } //Otherwise display the bio else { echo getBio($style,$id); } ?> And here's the functions: function getBioMenu($username) { ?> <div class="mwtabsdiv"> <a href="/bio.php?username=<? echo $username; ?>" class="mwtabslink">Biography</a> <a href="/bio.php?page=gallery&username=<? echo $username; ?>" class="mwtabslink">Gallery</a> <a href="/bio.php?page=news&username=<? echo $username; ?>" class="mwtabslink">News</a> <a href="/bio.php?page=segments&username=<? echo $username; ?>" class="mwtabslink">Segments</a> <a href="/bio.php?page=matches&username=<? echo $username; ?>" class="mwtabslink">Matches</a> <a href="/bio.php?page=chronology&username=<? echo $username; ?>" class="mwtabslink">Chronology</a> </div> <? } function getBio($username) { $username=mysql_real_escape_string($username); ?> <h2>Personal</h2> <? if ($style=='singles') { ?> <table class="biotable" cellspacing="10px"> <tr class="biotablerowa"> <td class="biotableheadingb">Nicknames:</td> <td class="biotabledatab"><?php if (strlen ($nicknames) < 1) { print "N/A"; } else { print "$nicknames";}?></td> </tr> <tr class="biotablerowa"> <td class="biotableheadingb">Height:</td> <td class="biotabledatab"><?php echo $height; ?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Weight:</td> <td class="biotabledatab"><?php echo $weight; ?></td> </tr> <tr class="biotablerowa"> <td class="biotableheadingb">Hometown:</td> <td class="biotabledatab"><?php echo $hometown; ?></td> </tr> </table> <? } ?> <? if ($style=='tagteam') { ?> <? } ?> <? if ($style=='manager') { ?> <? } ?> <? if ($style=='referee') { ?> <? } ?> <? if ($style=='staff') { ?> <? } ?> <? if ($style=='stable') { ?> <? } ?> <h2>History</h2> <? echo getHistory($id); ?> <h2>Quotes</h2> <? echo getQuotes($id); ?> <h2>Wrestling</h2> <? echo getWrestling($id); ?> </div> <? } function getGallery($id) { $id=mysql_real_escape_string($id); ?> <table class="biotable" cellspacing="0px"> <tr class="biotablerowa"> <td class="biotableheadingb">Headshot Image</td> <td class="biotabledatab"><?php if(file_exists('images/headshots/' . $posername . '.jpg')){ echo '<img src="/backstage/images/headshots/' . $posername . '.jpg" alt="" />'; } else { echo 'No Image Uploaded'; } ?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Roleplay Image</td> <td class="biotabledatab"><?php if(file_exists('images/lp/' . $posername . '.jpg')){ echo '<img src="/backstage/images/lp/' . $posername . '.jpg" alt="" />'; } else { echo 'No Image Uploaded'; } ?></td> </tr> <tr class="biotablerowa"> <td class="biotableheadingb">Titantron Image</td> <td class="biotabledatab"><?php if(file_exists('images/titantron/' . $posername . '.jpg')){ echo '<img src="/backstage/images/titantron/' . $posername . '.jpg" alt="" />'; } else { echo 'No Image Uploaded'; } ?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Champion Image</td> <td class="biotabledatab"><?php if(file_exists('images/champions/' . $posername . '.jpg')){ echo '<img src="/backstage/images/champions/' . $posername . '.jpg" alt="" />'; } else { echo 'No Image Uploaded'; } ?></td> </tr> </table> <?php } function getHistory($id) { $id=mysql_real_escape_string($id); ?> <table class="biotable" cellspacing="10px"> <tr class="biotablerowb"> <td class="biotableheadingb">KOW Titles:</td> <td class="biotabledatab"><?php if (strlen ($kowtitles) < 1) { print "N/A"; } else { print "$kowtitles";}?></td> </tr> <tr class="biotablerowa"> <td class="biotableheadingb">KOW Awards:</td> <td class="biotabledatab"><?php if (strlen ($kowawards) < 1) { print "N/A"; } else { print "$kowawards";}?></td> </tr> </table> <?php } function getQuotes($id) { $id=mysql_real_escape_string($id); ?> <ul id="quotes"> <?php if(count($quotes) > 0){ for($i = 0; $i < count($quotes); $i++){ echo "<li>".$quotes[$i]."</li>"; } } else{ echo '<li>This wrestler has no quotes.</li>'; } ?> </ul> <?php } function getWrestling($id) { $id=mysql_real_escape_string($id); ?> <table class="biotable" cellspacing="10px"> <tr class="biotablerowb"> <td class="biotableheadingb">Manager/Valet:</td> <td class="biotabledatab"><?php if (strlen ($manager) < 1) { print "N/A"; } else { print "$manager";}?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Finisher:</td> <td class="biotabledatab"><?php if (strlen ($finisher) < 1) { print "N/A"; } else { print "$finisher";}?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Setup:</td> <td class="biotabledatab"><?php if (strlen ($setup) < 1) { print "N/A"; } else { print "$setup";}?></td> </tr> <tr class="biotablerowb"> <td class="biotableheadingb">Entrance Music:</td> <td class="biotabledatab"><?php if (strlen ($music) < 1) { print "N/A"; } else { print "$music";}?></td> </tr> </table> <?php } Problem is after it gets the username in the getBio function I need to take that username and match it up in the db table and see what style it is.
  23. I still don't know why I have those page notice errors though
  24. Yeah I was about to type that. I don't have any idea why it's failing. I passed it as a variable from the roster list and I have it grabbing the username but its not going anywhere after that for some reason.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.