Jump to content
MakeWebGames

boionfire81

Members
  • Posts

    532
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by boionfire81

  1. Thought I'd post this now that it is finished Mailbox widget $mm = $db->query( "SELECT `m`.*, `userid`, `username` FROM `mail` AS `m` LEFT JOIN `users` AS `u` ON `m`.`mail_from` = `u`.`userid` WHERE `m`.`mail_to` = $userid ORDER BY `mail_time` DESC LIMIT 3"); while ($r = $db->fetch_row($mm)) { if ($r['userid']) { echo "<b>From:</b> <a href='viewuser.php?u={$r['userid']}'><font color=black>{$r['username']}</font></a><br>"; } else { echo "<br><b>From: <font color=red>SYSTEM</font></b>"; } $sent = date('n/d/y g:i', $r['mail_time']); echo "$sent"; // cut messae down to 20 characters $qm = substr($r['mail_text'], 0, 100); echo "<br>{$qm}<br /><br />"; } echo "<a href='mailbox.php'>View Mailbox...</a></td></tr></table><br>";   Events widget $ed = $db->query( "SELECT `evTIME`, `evREAD`, `evTEXT`, `evID` FROM `events` WHERE `evUSER` = $userid ORDER BY `evTIME` DESC LIMIT 3"); echo"<table class='menu'><tr><th>Events</th></tr>"; while ($t = $db->fetch_row($ed)) { echo "<tr><td>" . date('n/d/y g:i', $t['evTIME']); if (!$t['evREAD']) { echo ' <font color="#CE0101">New!</font>'; } echo "</td></tr><tr><td>{$t['evTEXT']}</td></tr>"; } echo "<tr><td><a href='events.php'>View Events...</a></td></tr></table>";
  2. is there anyway to start the pot off @ say 50? I'm using this as a crystals thing so need to get it started. Needs a jump off.
  3. yeah, I did include that
  4. thought that would work too...but I'll double check I just bought the pet attack mod, and literally bugs everywhere! A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Use of undefined constant spd - assumed 'spd' (8) Line executed: /home/public_html/pet.php:181 A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Use of undefined constant pwr - assumed 'pwr' (8) Line executed: /home/public_html/pet.php:185 A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined variable: freespd (8) Line executed: /home/public_html/pet.php:130 A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined variable: freepwr (8) Line executed: /home/public_html/pet.php:131 A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined variable: freestr (8) Line executed: /home/public_html/pet.php:132 A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined variable: freesma (8) Line executed: /home/public_html/pet.php:133 A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined variable: freelife (8) Line executed: /home/public_html/pet.php:134     $enperc=(int) ($Pet['pet_energy']/$Pet['pet_maxen']*100); $PetLvl = 100*$Pet['pet_level']; $experc=(int) ($Pet['pet_exp']/$PetLvl*100); $EN = floor($Pet['pet_energy'] / 5) * 5; if($Pet['pet_lifestat'] < 11) { $Price =number_format(5000*$Pet['pet_lifestat']); $llink="[<a href='pet.php?action=buystat&s=life'>$$Price</a>]"; } if($Pet['pet_lifestat'] == 11) { $Price =number_format(5000*$Pet['pet_lifestat']); $llink=""; } if($Pet['pet_agistat'] < 11) { $Price =number_format(5000*$Pet['pet_agistat']); $slink="[<a href='pet.php?action=buystat&s=spd'>$$Price</a>]"; } if($Pet['pet_agistat'] == 11) { $Price =number_format(5000*$Pet['pet_agistat']); $slink=""; } if($Pet['pet_strstat'] < 11) { $Price =number_format(5000*$Pet['pet_strstat']); $plink="[<a href='pet.php?action=buystat&s=pwr'>$$Price</a>]"; } if($Pet['pet_strstat'] == 11) { $Price =number_format(5000*$Pet['pet_strstat']); $plink=""; } if($Pet['pet_guardstat'] < 11) { $Price =number_format(5000*$Pet['pet_guardstat']); $stlink="[<a href='pet.php?action=buystat&s=str'>$$Price</a>]"; } if($Pet['pet_guardstat'] == 11) { $Price =number_format(5000*$Pet['pet_guardstat']); $stlink=""; } if($Pet['pet_iqstat'] < 11) { $Price =number_format(5000*$Pet['pet_iqstat']); $ilink="[<a href='pet.php?action=buystat&s=sma'>$$Price</a>]"; } if($Pet['pet_iqstat'] == 11) { $Price =number_format(5000*$Pet['pet_iqstat']); $ilink=""; } if($Pet['pet_enstat'] < 11) { $Price =number_format(5000*$Pet['pet_enstat']); $elink="[<a href='pet.php?action=buystat&s=en'>$$Price</a>]"; } if($Pet['pet_enstat'] == 11) { $Price =number_format(5000*$Pet['pet_enstat']); $elink=""; } if($Pet['pet_freestat']) { $freespd = "[<a href='pet.php?action=freestat&s=spd' title='Click for 4 free agility stats'>Free</a>]"; $freepwr = "[<a href='pet.php?action=freestat&s=pwr' title='Click for 4 free strength stats'>Free</a>]"; $freestr = "[<a href='pet.php?action=freestat&s=str' title='Click for 4 free guard stats'>Free</a>]"; $freesma = "[<a href='pet.php?action=freestat&s=sma' title='Click for 4 free iq stats'>Free</a>]"; $freelife = "[<a href='pet.php?action=freestat&s=life' title='Click for 1 free day added to your lifespan.'>Free</a>]"; } $Pet['pet_name'] = stripslashes(htmlentities($Pet['pet_name'])); echo "<center><table class='table' width='75%'><tr><th>Pet</th><th>Info</th></tr> <tr><td width='40%' valign='top'><img src='{$Pet['Pet_Pic']}'><br /><b>{$Pet['pet_name']} lvl {$Pet['pet_level']}</b><br /> <b>Agility:</b> {$Pet['pet_agility']} $freespd $slink <br /> <b>Strength:</b> {$Pet['pet_strength']} $freepwr $plink<br /> <b>Guard:</b> {$Pet['pet_guard']} $freestr $stlink<br /> <b>IQ:</b> {$Pet['pet_iq']} $freesma $ilink<br /> <b>Lifespan:</b> {$Pet['pet_lifespan']} $freelife $llink<br /></td></td> <td width='60%' valign='top'><div id='details'><b>Energy:</b> $elink {$Pet['pet_energy']}/{$Pet['pet_maxen']}</a></span><div id='stat_bar' title='{$Pet['pet_energy']}/{$Pet['pet_maxen']}'><div style='width:$enperc%'></div></div> <b>Exp: </b>".number_format($Pet['pet_exp'])."/".number_format($PetLvl)."</a></span><div id='stat_bar'><div style='width:$experc%'></div></div></div> <table><tr> <td width='50%'><a href='pet.php?action=train&stat=spd'>Train Agility</a></td><td width='50%'>[<a href='pet.php?action=train&stat=spdall'>Use $EN</a>]</td></tr> <tr><td><a href='pet.php?action=train&stat=pwr'>Train Strength</a></td><td>[<a href='pet.php?action=train&stat=pwrall'>Use $EN</a>]<br /></td></tr> <tr><td><a href='pet.php?action=train&stat=str'>Train Guard</a></td><td>[<a href='pet.php?action=train&stat=strall'>Use $EN</a>]<br /></td></tr> <tr><td><a href='pet.php?action=train&stat=sma'>Train IQ</a></td><td>[<a href='pet.php?action=train&stat=smaall'>Use $EN</a>]<br /></td></tr></table> <br /><b>Your Pet has ".number_format($Pet['pet_freestat'])." free upgrades!</b><br /> <a href='pet.php?action=rename'>Rename pet</a><br /> <a href='pet.php?action=abandon'>Abandon pet</a><br /> </td></tr></td></tr></table><br> <table class='table' width='100%'> <tr><td width='65%' valign='top'> <table class='table' width='100%'><tr><th colspan='2'>Last 20 Pet Events</th></tr>"; $c=$db->query("SELECT * FROM petevents WHERE pevPET={$Pet['pet_id']} ORDER BY pevID DESC LIMIT 20"); if($db->num_rows($c)==0) { echo "<tr><td colspan='2'>There Are no pet events.</td></tr>"; } while($cash=$db->fetch_row($c)) { $sup = date('n/j/y, g:i:s a', $cash['pevTIME']); echo "<tr><td width='25%'>$sup</td><td>".stripslashes($cash['pevTEXT'])."</td></tr>"; } echo "</table></td> <td valign='top'> <table class='table' width='100%'> <tr><th colspan='2'>List of attackable pets</th></tr>"; $c=$db->query("SELECT * FROM pets ORDER BY pet_level DESC LIMIT 20"); if($db->num_rows($c)==0) { echo "<td colspan='2'>There Are no pets.</td>"; } while($atk=$db->fetch_row($c)) { echo "<tr><td><a href='pet.php?action=view&ID={$atk['pet_id']}'>".stripslashes($atk['pet_name'])."</a> (lvl {$atk['pet_level']})</td> <td><a href='pet.php?action=fight&id={$atk['pet_id']}'>Attack</a></td></tr>"; } echo "</table></td></tr></table>"; } function pet_freestat() { global $ir,$db,$c,$userid,$h; $_REQUEST['s'] = isset($_REQUEST['s']) && ctype_alpha($_REQUEST['s']) ? $_REQUEST['s'] : null; $q=$db->query("SELECT * FROM pets WHERE pet_userid=$userid"); $Pet=$db->fetch_row($q); if(!$Pet['pet_freestat']) { echo "You don't have any more free stats. If you wish to get more you have to level your pet up."; pet_index(); $h->endpage(); exit; } if($_REQUEST['s'] == spd) { $db->query("UPDATE pets SET pet_agility=pet_agility+4,pet_freestat=pet_freestat-1 WHERE pet_userid=$userid",$c); pet_index(); } if($_REQUEST['s'] == pwr) { $db->query("UPDATE pets SET pet_strength=pet_strength+4,pet_freestat=pet_freestat-1 WHERE pet_userid=$userid",$c); pet_index(); } if($_REQUEST['s'] == str) { $db->query("UPDATE pets SET pet_guard=pet_guard+4,pet_freestat=pet_freestat-1 WHERE pet_userid=$userid",$c); pet_index(); } if($_REQUEST['s'] == sma) { $db->query("UPDATE pets SET pet_iq=pet_iq+4,pet_freestat=pet_freestat-1 WHERE pet_userid=$userid",$c); pet_index(); } if($_REQUEST['s'] == life) { $db->query("UPDATE pets SET pet_lifespan=pet_lifespan+1,pet_freestat=pet_freestat-1 WHERE pet_userid=$userid",$c);  
  5. ok, how do you validate $_REQUEST
  6. I don't think that will work cause there are 2 total queries making the 1 view log. 1 in for attacking and 1 for defending. Full queries (just queries)   $attacks=$db->query("SELECT * FROM `attacklogs` WHERE `attacker` = {$r['userid']} OR `attacked` = {$r['userid']} AND `attacker` = {$ir['userid']} OR `attacked` = {$ir['userid']} ORDER BY time ASC LIMIT 5"); if($db->num_rows($attacks)) $a = $db->fetch_row($attacks); $att=$db->query("SELECT `username` FROM `users` WHERE `userid` = {$a['attacker']}"); $attacker=$db->fetch_row($att); $z=$db->query("SELECT `username` FROM `users` WHERE `userid` = {$a['attacked']}"); $defender=$db->fetch_row($z); while ($a = $db->fetch_row($attacks)) $d=date('n/j/y<br> g:i a',$a['time']); print "   I had to run the attack log query to check both sides of the fight. THEN the username query to pretty it up lol.
  7. it printed up as - 167
  8. Changed the $d to $z   $z=$db->query("SELECT `username` FROM `users` WHERE `userid` = {$a['attacked']}"); $defender=$db->fetch_row($z);   And yeah the debug is on. That has helped me A LOT as I'm digging deep into the code. But this doesn't have an error it just simply only displays 1 result, not the last 5 results.
  9. Anyone care to add their 2 cents on this.   <?php require "globals.php"; $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? $_GET['action'] : null; switch ($_GET['action']) { case 'pray': prayer(); break; default: index(); break; } function index() { global $db,$h,$ir,$userid; print "<h3>You are currently at the church</h3><br><br> <form action='?action=pray' method='post'> Do you have a request of our Lord?<br> <select id='state' name='pray'> <option value='will'></option> <option value='hp'>Health Issues</option> <option value='energy'>I'd like to be more energetic</option> <option value='money'>I'd like help with a financial burden</option> <option value='friend'>I'd like to pray for my friend</option> </select><br><br> Please select your friend you would like to pray for<br>"; $q = $db->query( "SELECT `cl_ADDED` FROM `contactlist` WHERE `cl_ADDER` = {$userid}"); if ($db->num_rows($q) == 0) { echo "You have no contacts!"; } else { echo "<select id='foo' name='user1' type='dropdown'><option value=''><select a contact...></option>"; while ($r = $db->fetch_row($q)) { $esc_part = addslashes($r['username']); echo "<option value='{$esc_part}'>{$r['username']}</option>"; } echo "</select>"; } $db->free_result($q); echo" <input type='submit' value='Pray'>"; $h->endpage(); } function prayer() { global $db, $ir, $userid, $h; $_POST['pray'] = isset($_POST['pray']) && ctype_alpha($_POST['pray']) ? $_POST['pray'] : null; $_POST['user1'] = isset($_POST['user1']) && ctype_digit($_POST['user1']) ? $_POST['user1'] : null; $friend = $_POST['user1']; if($_POST['user1'] != $userid) { if($_POST['pray'] === 'hp') { $gain = ($ir['karma'] * 5); $total = ($ir['hp'] + $gain); echo "You prayed for a healing and you were blessed with + " . $total . "% of your health"; $db->query("UPDATE `users` SET `hp` = LEAST($total, maxhp) WHERE `userid` = $userid"); } elseif($_POST['pray'] === 'energy') { $grand = rand(1,3); $brand = rand(5,10); $ggain = $ir['maxenergy'] / $rand; $bgain = $ir['maxenergy'] / $brand; if($ir['karma'] > 39) { echo "You prayed for energy and you were blessed with $ggain energy"; $db->query("UPDATE `users` SET `energy` = LEAST(`energy` + $ggain, `maxhenergy`) WHERE `userid` = $userid"); } elseif($ir['karma'] < 40) { echo "You prayed for energy and you were blessed with $bgain energy"; $db->query("UPDATE `users` SET `energy` = LEAST(`energy` + $bgain, `maxhenergy`) WHERE `userid` = $userid"); } } elseif($_POST['pray'] === 'money') { $money = rand (10,50); echo "You prayed for money and you were blessed with " . money_formatter($money) . ""; $db->query("UPDATE `users` SET `money` = `money` + $money WHERE `userid` = $userid"); } } elseif(!empty($_POST['user1'])) { $a = $db->query("SELECT `karma` FROM `users` WHERE `userid` = $friend"); $b = $db->fetch_row($a); if($_POST['pray'] === 'hp') { $hpgain = $b['karma'] * 5; echo "You prayed for a healing and you were blessed with + " . $total . "% of your health"; $db->query("UPDATE `users` SET `hp` = LEAST(`hp` + $hpgain, `maxhp`) WHERE `userid` = $friend"); } elseif($_POST['pray'] === 'energy') { $grand = rand(1,3); $brand = rand(5,10); $ggain = $ir['maxenergy'] / $rand; $bgain = $ir['maxenergy'] / $brand; if($b['karma'] > 39) { echo "You prayed for energy and you were blessed with $ggain energy"; $db->query("UPDATE `users` SET `energy` = LEAST(`energy` + $ggain, `maxhenergy`) WHERE `userid` = $friend"); } if($b['karma'] < 40) { echo "You prayed for energy and you were blessed with $bgain energy"; $db->query("UPDATE `users` SET `energy` = LEAST(`energy` + $bgain, `maxhenergy`) WHERE `userid` = $friend"); } } elseif($_POST['pray'] === 'money') { $money = rand (10,50); echo "You prayed for money and you were blessed with " . money_formatter($money) . ""; $db->query("UPDATE `users` SET `money` = `money` + $money WHERE `userid` = $friend"); } $h->endpage(); } }   And in header.php   <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js'></script> <script> $(document).ready(function (){ $('state').change(function() { if ($(this).val() != 'notinoz') { $('#foo').show(); }else{ $('#foo').hide(); } }); }); </script>   First the java isn't hiding the contact list. Second, hp is going negative?????? Doesn't make sense because hp ++++++ ANYTHING equals a GAIN >.<
  10. Posted this on freelancer.com if anyone is interested https://www.freelancer.com/projects/php/Install-mods-for-mccodes/#/
  11. Did that   $attacks=$db->query("SELECT * FROM `attacklogs` WHERE `attacker` = {$r['userid']} OR `attacked` = {$r['userid']} AND `attacker` = {$ir['userid']} OR `attacked` = {$ir['userid']} ORDER BY time ASC LIMIT 5"); if($db->num_rows($attacks)) { print "<b>Attack Logs</b> <center><table width='60%' cellspacing='1' class='table' border='1' bordercolor='#636363'></center> <tr> <th>Time</th> <th>Attacker</th> <th>Defender</th> <th>Result</th> </tr>"; $a = $db->fetch_row($attacks); $att=$db->query("SELECT `username` FROM `users` WHERE `userid` = {$a['attacker']}"); $attacker=$db->fetch_row($att); $d=$db->query("SELECT `username` FROM `users` WHERE `userid` = {$a['attacked']}"); $defender=$db->fetch_row($d); while ($a = $db->fetch_row($attacks)) $d=date('n/j/y<br> g:i a',$a['time']); print "<tr> <td><center>$d</td> <td><a href='viewuser.php?u={$a['attacker']}'>{$attacker['username']}</a></td> <td><a href='viewuser.php?u={$a['attacked']}'>{$defender['username']}</a></td> <td>{$attacker['username']} {$a['result']}</td> </tr>"; print "</table>"; }   didn't work
  12. OK, here's one issue that is definitely from being php 7.0 bbcode engine. A non-critical error has occurred. Page execution will continue. Below are the details: PHP Deprecation Notice: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead (8192) Line executed: /home/public_html/bbcode_engine.php:181 What is preg_replace_callback?!?!?!?!
  13. cool. Thanks! What do I do about it only displaying the first attack?
  14. Ok great! thanks. So this is what I have   $attacks=$db->query("SELECT * FROM `attacklogs` WHERE `attacker` = {$r['userid']} OR `attacked` = {$r['userid']} AND `attacker` = {$ir['userid']} OR `attacked` = {$ir['userid']} LIMIT 5"); $a = $db->fetch_row($attacks); $att=$db->query("SELECT `username` FROM `users` WHERE `userid` = {$a['attacker']}"); $attacker=$db->fetch_row($att); $d=$db->query("SELECT `username` FROM `users` WHERE `userid` = {$a['attacked']}"); $defender=$db->fetch_row($d); print "<b>Attack Logs</b> <center><table width=50% cellspacing=1 class='table' border='1' bordercolor='#636363'></center> <tr> <th>Time</th> <th>Attacker</th> <th>Defender</th> <th>Result</th> </tr>"; $d=date('F j, Y, g:i:s a',$a['time']); print "<tr> <td><center>$d</td> <td><a href='viewuser.php?u={$a['attacker']}'>{$attacker['username']}</a></td> <td><a href='viewuser.php?u={$a['attacked']}'>{$defender['username']}</a></td> <td>{$attacker['username']} {$a['result']}</td> </tr>"; print "</table>   Only 2 issues. 1 it only displays 1 result, which I believe is the first attack, as todays attack didn't appear. And 2 if there are no attack logs, it gives an error say unable to execute mysql query.
  15. I'm trying to run an attack log and print it on the members profile so donators can see the attack logs between them and the player who's profile they are viewing. This is my query right now   $attacks=$db->query("SELECT * FROM `attacklogs` WHERE `attacker` = {$r['userid']} OR `attacked` = {$r['userid']} AND `attacker` = {$ir['userid']} OR `attacked` = {$ir['userid']}"); $a = $db->fetch_row($attacks); $att=$db->query("SELECT `username` FROM `users` WHERE `userid` = {$a['attacker']}"); $attacker=$db->fetch_row($att); $d=$db->query("SELECT `username` FROM `users` WHERE `userid` = {$a['attacked']}"); $defender=$db->fetch_row($d);   This is what I get when I try to display the usernames ($defender/$attacker) Array to string conversion fail.
  16. Any way to have sub-course? like you must have complete course 101 before trying course 102?
  17. I'm trying to validate user signatures
  18. [uSER=70485]G7470[/uSER] exactly. simply ctype_alpha doesn't work, nor does alnum.
  19. ok new question. When you have say a description input, what is the best $_POST to use?
  20. btw, I'm basically retiring to simple stuff, for awhile atleast. If you guys have a freelancer account let me know and I'll invite you on my posted projects.
  21. I only installed 1 by [uSER=65371]sniko[/uSER] http://mccodes.com/viewmod.php?id=44
  22. no, if uncommented, white page with the gethosterror. commented it says invalid id
  23. yes, but it shows invalid id.
  24. ok, but in the meantime, I'm stuck here with 2 choices. Have a gethostaddrs error or remove/comment out that part and have an invalid userid. Invalid userid basically leaves me without being able to use the majority of the site.
  25. I made this change   // $r['lastiph'] = @gethostbyaddr($r['lastip']); // $r['lastiph'] = checkblank($r['lastiph']); // $r['lastip_loginh'] = @gethostbyaddr($r['lastip_login']); // $r['lastip_loginh'] = checkblank($r['lastip_loginh']); // $r['lastip_signuph'] = @gethostbyaddr($r['lastip_signup']); // $r['lastip_signuph'] = checkblank($r['lastip_signuph']);   and just deleted the td calls code. But now my profile says Sorry, we could not find a user with that ID, check your source.  
×
×
  • Create New...