-BRAIDZ-
Members-
Posts
403 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by -BRAIDZ-
-
[ATTACH]2098[/ATTACH] ^this one is the inventory table^ [ATTACH]2099[/ATTACH] ^and this one is items^ [MENTION=67703]adamhull[/MENTION] is this good enough?
-
Have you had a look yet? It works when you install the headers and everything. But on playpoker.php there's a shout box, I wouldn't mind integrating that into my index.php.. I did try [MENTION=65371]sniko[/MENTION] live chat, but just didn't want to work properly for me..
-
<?php $housequery=1; include_once "globals.php"; $awp=round($ir['attacking_won']/($ir['attacking_total'] > 0 ? $ir['attacks_total'] : 1)*100,2); $alp=round($ir['attacking_lost']/($ir['attacking_total'] > 0 ? $ir['attacks_total'] : 1)*100,2); $atp=round($ir['attacking_total']/($ir['total_total'] > 0 ? $ir['total_total'] : 1)*100,2); $dwp=round($ir['defending_won']/($ir['defending_total'] > 0 ? $ir['defends_total'] : 1)*100,2); $dlp=round($ir['defending_lost']/($ir['defending_total'] > 0 ? $ir['defends_total'] : 1)*100,2); $dtp=round($ir['defending_total']/($ir['total_total'] > 0 ? $ir['total_total'] : 1)*100,2); $twp=round($ir['total_won']/($ir['total_total'] > 0 ? $ir['total_total'] : 1)*100,2); $tlp=round($ir['total_lost']/($ir['total_total'] > 0 ? $ir['total_total'] : 1)*100,2); $bbb=$ir['attacks_won']+$ir['defends_won']; $TotalEXP = abs(@intval($ir['exp']/$ir['exp_needed']*100)); $BankMoney = ($ir['bankmoney'] == '-1') ? 'No Account!' : number_format($ir['bankmoney']); if ( !$ir['married'] ) { $marital="<font color='red'>No</font>"; } else { $k=$db->query("SELECT username FROM users WHERE userid={$ir['married']}", $c); $marital="<a href='viewuser.php?u={$ir['married']}' style='color:green;'>".mysql_result($k,0,0)."</a> "; $marital.="[<a href='marriage.php'>Manage</a>]"; $mair=$db->query("SELECT u.*, h.* FROM users u LEFT JOIN houses h ON h.hWILL=u.maxwill WHERE userid={$ir['married']}",$c); $ms=mysql_fetch_array($mair); } print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> Home </h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'><br> <br><br>"; echo '<table width="55%" border="0" cellspacing="1" cellpadding="3" style="text-align:center;" class="table"> <tr> <th colspan="2">Updates</th><!--add your updates here are examples--> </tr> <tr><td width="150px">6 - June - 2015</td><td style="color:#009900">Home page revamped!</td></tr> <tr><td width="150px">6 - June - 2015</td><td style="color:#009900">Lottery added to the game!</td></tr> <tr><td colspan="2">Report bugs to administration</td></tr> </table> '; echo '<table width="55%" border="0" cellspacing="1" cellpadding="3" style="text-align:center;" class="table"> <tr> <th colspan="3">General Info</th> </tr> <tr> <td width="50%"><b>Name:</b> '.stripslashes($ir['username']).'</td> <td width="50%"><b>Level:</b> '.number_format($ir['level']).'</td> </tr> <tr style="text-align:center;"> <td><b>EXP:</b> '.number_format($TotalEXP).'%</td> <td><b>Life:</b> '.number_format($ir['hp']).'/'.number_format($ir['maxhp']).'</td> </tr> <tr> <td><b>Money:</b> $'.number_format($ir['money']).'</td> <td><b>Crystals:</b> '.number_format($ir['crystals']).'</td> </tr> <tr> <td><b>Crimes Passed:</b> '.number_format($ir['crimesdone']).'</td> <td><b>Total Busts:</b> '.number_format($ir['bustdone']).'</td> </tr> <tr> <td><b>Days Old:</b> '.number_format($ir['daysold']).'</td> <td><b>Married:</b> '.stripslashes($marital).'</td> </tr> <tr> <td><b>Bank Account:</b> $'.$BankMoney.'</td> <td><b>Property:</b> '.stripslashes($ir['hNAME']).'</td> </tr> </table> '; $ts = $ir['strength'] + $ir['agility'] + $ir['guard'] + $ir['labour'] + $ir['IQ']; $ir['strank'] = get_rank($ir['strength'], 'strength'); $ir['agirank'] = get_rank($ir['agility'], 'agility'); $ir['guarank'] = get_rank($ir['guard'], 'guard'); $ir['labrank'] = get_rank($ir['labour'], 'labour'); $ir['IQrank'] = get_rank($ir['IQ'], 'IQ'); $tsrank = get_rank($ts, 'strength+agility+guard+labour+IQ'); $ir['strength'] = number_format($ir['strength']); $ir['agility'] = number_format($ir['agility']); $ir['guard'] = number_format($ir['guard']); $ir['labour'] = number_format($ir['labour']); $ir['IQ'] = number_format($ir['IQ']); $ts = number_format($ts); echo" <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'>Stats Info</th> </tr> <tr> <th width='33%'>Stat</th> <th width='33%'>Amount</th> <th width='34%'>Rank</th> </tr> <tr> <td>Strength</td> <td>{$ir['strength']} </td> <td><li>Rank:{$ir['strank']}</li></td> </tr> <tr> <td>Agility</td> <td>{$ir['agility']}</td> <td>Rank:{$ir['agirank']}</td> </tr> <tr> <td>Guard</td> <td>{$ir['guard']}</td> <td>Rank:{$ir['guarank']}</td> </tr> <tr> <td>Labour</td> <td>{$ir['labour']}</td> <td>Rank:{$ir['labrank']}</td> </tr> <tr> <td>IQ</td> <td>{$ir['IQ']}</td> <td>Rank:{$ir['IQrank']}</td> <tr> <td>Total Stats:</td> <td>{$ts}</td> <td>Rank:$tsrank</td> </tr> </table><hr width=85%> "; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'>Finacial Info</th> </tr> <tr> <td>City Bank</td> <td>\${$ir['bankmoney']} </td> </tr> <tr> <td>Investment</td> <td>\${$ir['userBANKAMMT']} </td> </tr> </table><hr width=85%> "; echo" <table cellspacing='1' border='0' cellpadding='0' class='table' width='85%'> <th colspan='5'><b><center>Attack Info</b></td></tr> <tr> <th>Attacking:</th> <td>Won: <b><font color='green'>{$ir['attacking_won']}</b></font> ($awp%)</td> <td>Lost: <b><font color='red'>{$ir['attacking_lost']}</font></b> ($alp%)</td> <td>Total: <b><font color='green'>{$ir['attacktotal']}</font></b> ($atp%)</td> </tr> <tr> <th>Defending:</th> <td>Won: <b><font color='green'>{$ir['defendwon']}</font></b> ($dwp%)</td> <td>Lost: <b><font color='red'>{$ir['defendlost']}</b></font> ($dlp%)</td> <td>Total: <b><font color='green'>{$ir['defendtotal']}</font></b> ($dtp%)</td> </tr> <tr> <th>Both:</th> <td>Won: <b><font color='green'>$bbb</font></b>($twp%)</td> <td>Lost: <b><font color='red'>{$ir['totallost']}</font></b> ($tlp%)</td> <td>Grand Total: <b><font color='green'>{$ir['total_total']}</font></b> / Draw's: <b><font color='green'>{$ir['draws']}</font></b></td> </tr> </table> "; $_POST['pn_update'] = (isset($_POST['pn_update'])) ? strip_tags(stripslashes($_POST['pn_update'])) : ''; if (!empty($_POST['pn_update'])) { if (strlen($_POST['pn_update']) > 5000) { echo '<hr /><span style="font-weight:bold;">You may only enter 5000 or less characters here.</span>'; } else { $pn_update_db = $db->escape($_POST['pn_update']); $db->query( "UPDATE `users` SET `user_notepad` = '{$pn_update_db}' WHERE `userid` = {$userid}"); $ir['user_notepad'] = $_POST['pn_update']; echo '<span style="font-weight:bold;">Personal Notepad Updated!</span>'; } } echo "<hr width=85% />Your Personal Notepad:<hr width=85% /> <form action='index.php' method='post'> <textarea rows='10' cols='50' name='pn_update'>" . htmlentities($ir['user_notepad'], ENT_QUOTES, 'ISO-8859-1') . "</textarea> <br><input type='submit' value='Update Notes!' /></form></br>"; $h->endpage(); ?>
-
What do you mean by the variable?
-
But the itmid does exist
-
And how do I do that? Also can you see what's going on with my last function? I only keep getting You don't have enough beer code: <?php require_once("globals.php"); if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } if($ir['brew_time']) { die("You can't brew for another {$ir['brew_time']} minutes, when your current batch finishes."); } if($ir['brew'] == 10) { echo 'You have already brewed 10 times today, come back tomorrow'; $h->endpage(); die; } $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']){ case 'beer': brew_beer(); break; case 'drinkbeer': drink_beer(); break; case 'brewbeer': brew_beer_sub(); break; case 'whiskey': brew_whiskey(); break; default: brewery(); break; } function brewery() { global $db,$ir,$c,$userid,$h; print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <table class='tablee'><tr><td><center><img src='/images/brewery.jpg' /></td></tr></table> <h3>Your Brewery</h3>"; echo " You are sitting in your shed. </br>What would you like to brew?</br>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'>Brewery Options</th> </tr> <tr> <td>Beer</td> <td> <a href='brewery.php?action=beer'>Brew</a> </td> </tr> <tr> <td>Whiskey</td> <td> <a href='brewery.php?action=whiskey'>Brew</a> </td> </tr> </tr> <tr> <td>Cider</td> <td> <a href='brewery.php?action=cider'>Brew</a> </td> </tr> </tr> <tr> <td>Vodka</td> <td> <a href='brewery.php?action=vodka'>Brew</a> </td> </tr> </table> "; print "<h3><font color='red'>This module is a is not complete and still in early production stage.</br> Not all functions will work properly.</font></h3>"; } function brew_beer() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Beer</h3>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'> Beer Information</th> </tr> <tr> <td>Time to brew Beer?</td> <td>25 Minutes</td> </tr> <tr> <td>Brave needed to brew Beer?</td> <td>5 Brave</td> </tr> <td>What does beer do?</td> <td>Gives you an energy boost of 25 Energy</td> </tr> </table> <form method='post' action='brewery.php?action=brewbeer'> <input type='submit' name='brewbeer' value='Brew Beer' /> </form> "; } function brew_whiskey() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Whiskey</h3>"; } function brew_beer_sub() { if ($_POST['brewbeer']){ global $db,$ir,$c,$userid,$h,$beer; $beer = rand(1, 6); echo "While brewing away, you managed to brew {$beer} Bottles of Beer!"; item_add($userid, 277, $beer); $db->query("UPDATE users SET brew=brew + 1 WHERE userid=$userid"); $db->query("UPDATE users SET brave=brave - 5 WHERE userid=$userid"); $db->query("UPDATE users SET brew_time=brew_time + 25 WHERE userid=$userid"); } } function drink_beer() { if($itmid['277'] < 1){ echo "You don't have enough beer"; die; }else{ if($_GET['ID'] == 277){ echo "You used 1 beer and gained 20 energy"; item_remove($userid, 277, 1); } } } ?>
-
Id rather the button option to brew. Looks neater, and yes I have really thought about that, well I have, but have no clue how I'd do it..
-
I did, and now I have this <?php require_once("globals.php"); if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } if($ir['brew_time']) { die("You can't brew for another {$ir['brew_time']} minutes, when your current batch finishes."); } if($ir['brew'] == 10) { echo 'You have already brewed 10 times today, come back tomorrow'; $h->endpage(); die; } $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']){ case 'beer': brew_beer(); break; case 'drinkbeer': drink_beer(); break; case 'brewbeer': brew_beer_sub(); break; case 'whiskey': brew_whiskey(); break; default: brewery(); break; } function brewery() { global $db,$ir,$c,$userid,$h; print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <table class='tablee'><tr><td><center><img src='/images/brewery.jpg' /></td></tr></table> <h3>Your Brewery</h3>"; echo " You are sitting in your shed. </br>What would you like to brew?</br>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'>Brewery Options</th> </tr> <tr> <td>Beer</td> <td> <a href='brewery.php?action=beer'>Brew</a> </td> </tr> <tr> <td>Whiskey</td> <td> <a href='brewery.php?action=whiskey'>Brew</a> </td> </tr> </tr> <tr> <td>Cider</td> <td> <a href='brewery.php?action=cider'>Brew</a> </td> </tr> </tr> <tr> <td>Vodka</td> <td> <a href='brewery.php?action=vodka'>Brew</a> </td> </tr> </table> "; print "<h3><font color='red'>This module is a is not complete and still in early production stage.</br> Not all functions will work properly.</font></h3>"; } function brew_beer() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Beer</h3>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'> Beer Information</th> </tr> <tr> <td>Time to brew Beer?</td> <td>25 Minutes</td> </tr> <tr> <td>Brave needed to brew Beer?</td> <td>5 Brave</td> </tr> <td>What does beer do?</td> <td>Gives you an energy boost of 25 Energy</td> </tr> </table> <form method='post' action='brewery.php?action=brewbeer'> <input type='submit' name='brewbeer' value='Brew Beer' /> </form> "; } function brew_whiskey() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Whiskey</h3>"; } function brew_beer_sub() { if ($_POST['brewbeer']){ global $db,$ir,$c,$userid,$h,$beer; $beer = rand(1, 6); echo "While brewing away, you managed to brew {$beer} Bottles of Beer!"; item_add($userid, 277, $beer); $db->query("UPDATE users SET brew=brew + 1 WHERE userid=$userid"); $db->query("UPDATE users SET brave=brave - 5 WHERE userid=$userid"); $db->query("UPDATE users SET brew_time=brew_time + 25 WHERE userid=$userid"); } } function drink_beer() { print "still working on this function"; } ?> The way you explained was way too complicated. Now to work out how to make it so you require the item Bottle of Beer to access brewery.php?action=drinkbeer So then it credits the user the energy it provides, and also deletes one if that item from the users inventory, if you get what I mean?
-
This is what I have now <?php require_once("globals.php"); if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } if($ir['brew_time']) { die("You can't brew for another {$ir['brew_time']} minutes, when your current batch finishes."); } if(['brew'] == 10) { echo 'You have already brewed 10 times today, come back tomorrow'; $h->endpage(); die; } $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']){ case 'beer': brew_beer(); break; case 'brewbeer': brew_beer_sub(); break; case 'whiskey': brew_whiskey(); break; default: brewery(); break; } function brewery() { global $db,$ir,$c,$userid,$h; print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <table class='tablee'><tr><td><center><img src='/images/brewery.jpg' /></td></tr></table> <h3>Your Brewery</h3>"; echo " You are sitting in your shed. </br>What would you like to brew?</br>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'>Brewery Options</th> </tr> <tr> <td>Beer</td> <td> <a href='brewery.php?action=beer'>Brew</a> </td> </tr> <tr> <td>Whiskey</td> <td> <a href='brewery.php?action=whiskey'>Brew</a> </td> </tr> </tr> <tr> <td>Cider</td> <td> <a href='brewery.php?action=cider'>Brew</a> </td> </tr> </tr> <tr> <td>Vodka</td> <td> <a href='brewery.php?action=vodka'>Brew</a> </td> </tr> </table> "; print "This module is a working progress. Should be up and running in a few weeks."; } function brew_beer() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Beer</h3>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'> Beer Information</th> </tr> <tr> <td>Time to brew Beer?</td> <td>25 Minutes</td> </tr> <tr> <td>Brave needed to brew Beer?</td> <td>5 Brave</td> </tr> <td>What does beer do?</td> <td>Gives you an energy boost</td> </tr> </table> <form method='post' action='brewery.php?action=brewbeer'> <input type='submit' name='brewbeer' value='Brew Beer' /> </form> "; } function brew_whiskey() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Whiskey</h3>"; } function brew_beer_sub() { if ($_POST['brewbeer']){ global $db,$ir,$c,$userid,$h,$beer; $beer = rand(1, 6); echo "While brewing away, you managed to brew {$beer} Bottles of Beer!"; item_add($userid, 277, $beer); $db->query("UPDATE users SET brew=brew + 1 WHERE userid=$userid"); $db->query("UPDATE users SET brave=brave - 5 WHERE userid=$userid"); $db->query("UPDATE users SET brew_time=brew_time + 25 WHERE userid=$userid"); } } ?> I will be making a new case and function, so you can go into "Inventory" and it will say "Drink" next to "Bottle of Beer" but I will also set it up so you can't drink it while you have time left brewing.. What does everyone think?
-
Did I get this correct? <?php require_once("globals.php"); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']){ case 'beer': brew_beer(); break; case 'brewbeer': brew_beer_sub(); break; case 'whiskey': brew_whiskey(); break; default: brewery(); break; } function brewery() { global $db,$ir,$c,$userid,$h; print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <table class='tablee'><tr><td><center><img src='/images/brewery.jpg' /></td></tr></table> <h3>Your Brewery</h3>"; echo " You are sitting in your shed. </br>What would you like to brew?</br>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'>Brewery Options</th> </tr> <tr> <td>Beer</td> <td> <a href='brewery.php?action=beer'>Brew</a> </td> </tr> <tr> <td>Whiskey</td> <td> <a href='brewery.php?action=whiskey'>Brew</a> </td> </tr> </tr> <tr> <td>Cider</td> <td> <a href='brewery.php?action=cider'>Brew</a> </td> </tr> </tr> <tr> <td>Vodka</td> <td> <a href='brewery.php?action=vodka'>Brew</a> </td> </tr> </table> "; print "This module is a working progress. Should be up and running in a few weeks."; } function brew_beer() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Beer</h3>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'> Beer Information</th> </tr> <tr> <td>Time to brew Beer?</td> <td>25 Minutes</td> </tr> <tr> <td>Brave needed to brew Beer?</td> <td>5 Brave</td> </tr> <td>What does beer do?</td> <td>Gives you an energy boost</td> </tr> </table> <form method='post' action='brewery.php?action=brewbeer'> <input type='submit' name='brewbeer' value='Brew Beer' /> </form> "; } function brew_whiskey() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Whiskey</h3>"; } function brew_beer_sub() { $strDbQuery = "SELECT COUNT(id) AS `times_brewed` FROM `users_brew` WHERE `userid`=". $_SESSION['userid']; $resTimesBrewed = $db->query($strDbQuery); $arrResults = $db->fetch_row($resTimesBrewed); if($arrResults['times_brewed'] > 10) { echo 'You have already brewed 10 times today, come back tomorrow'; $h->endpage(); die; } print "You brewed (number of bottles) Bottles of Beer"; $db->query("UPDATE `users_brew` SET `times_brewed`=`times_brewed`+1 WHERE 'userid' = {$userid}"); item_add($_SESSION['userid'], 277, mt_rand(1,6)); } ?>
-
Thanks, do I need to do anymore sql strings? Or is this all I need to pit in it?
-
Where do I put this? $strDbQuery = "SELECT COUNT(id) AS `times_brewed` FROM `users_brew` WHERE `userid`=". $_SESSION['userid']; $resTimesBrewed = $db->query($strDbQuery); $arrResults = $db->fetch_row($resTimesBrewed); if($arrResults['times_brewed'] > 10) { echo 'You have already brewed 10 times today, come back tomorrow'; $h->endpage(); die; }
-
Okay thanks, this is complicated haha. Where do I put this? And what do I write for the give item? The item number is 277.. Sorry to be a pain in the back side haha
-
What about this? Can you help me with adding queries please? Give me an example, and tell me where to put it? I only want one sql and that is 'brew' and it will be in the 'users' table. Also, I want it so when you brew you get an item, and set the rand between 1 and 6 or something.. And also, if you have brewed 10 times in one day, how do I get it so it says "You have already brewed 10 times today, come back tomorrow" I do not want to change any part of my code as this is the only way I can read code at the moment aha! <?php require_once("globals.php"); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']){ case 'beer': brew_beer(); break; case 'brewbeer': brew_beer_sub(); break; case 'whiskey': brew_whiskey(); break; default: brewery(); break; } function brewery() { global $db,$ir,$c,$userid,$h; print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <table class='tablee'><tr><td><center><img src='/images/brewery.jpg' /></td></tr></table> <h3>Your Brewery</h3>"; echo " You are sitting in your shed. </br>What would you like to brew?</br>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'>Brewery Options</th> </tr> <tr> <td>Beer</td> <td> <a href='brewery.php?action=beer'>Brew</a> </td> </tr> <tr> <td>Whiskey</td> <td> <a href='brewery.php?action=whiskey'>Brew</a> </td> </tr> </tr> <tr> <td>Cider</td> <td> <a href='brewery.php?action=cider'>Brew</a> </td> </tr> </tr> <tr> <td>Vodka</td> <td> <a href='brewery.php?action=vodka'>Brew</a> </td> </tr> </table> "; print "This module is a working progress. Should be up and running in a few weeks."; } function brew_beer() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Beer</h3>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'> Beer Information</th> </tr> <tr> <td>Time to brew Beer?</td> <td>25 Minutes</td> </tr> <tr> <td>Brave needed to brew Beer?</td> <td>5 Brave</td> </tr> <td>What does beer do?</td> <td>Gives you an energy boost</td> </tr> </table> <form method='post' action='brewery.php?action=brewbeer'> <input type='submit' name='brewbeer' value='Brew Beer' /> </form> "; } function brew_whiskey() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Whiskey</h3>"; } function brew_beer_sub() { print "You brewed (number of bottles) Bottles of Beer"; $db->query("UPDATE users SET brew=brew-1 WHERE $userid=userid"); } ?>
-
Will do this soon, but I'm not getting any errors as of yet
-
Okay, yeah I'm going to try figure out how I can get the shout box on my home page, check it out when you get the chance
-
-
No worries mate, thanks :)
-
I installed the headers and everything, and works a charm now.. I like the shout box idea, that's pretty cool
-
Okay so in playpoker.php I realised the button to "Begin Playing" has no action, so how are you meant to start playing when there is no action for it to execute?
-
Because my laptop kind of had a "malfunction" so until I can fix that or get a new one, I'll be using my phone haha
-
I will mate thanks
-
Thank you, but I got it working now mate :) [MENTION=67703]adamhull[/MENTION] helped me
-
Could someone help me set the queries in the last function? I only want 'brew' in the 'users' table.. Also, a die message when you have gone over 10 brews a day.. And it will be an item added to the user (set at rand) <?php require_once("globals.php"); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']){ case 'beer': brew_beer(); break; case 'brewbeer': brew_beer_sub(); break; case 'whiskey': brew_whiskey(); break; default: brewery(); break; } function brewery() { global $db,$ir,$c,$userid,$h; print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <table class='tablee'><tr><td><center><img src='/images/brewery.jpg' /></td></tr></table> <h3>Your Brewery</h3>"; echo " You are sitting in your shed. </br>What would you like to brew?</br>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'>Brewery Options</th> </tr> <tr> <td>Beer</td> <td> <a href='brewery.php?action=beer'>Brew</a> </td> </tr> <tr> <td>Whiskey</td> <td> <a href='brewery.php?action=whiskey'>Brew</a> </td> </tr> </tr> <tr> <td>Cider</td> <td> <a href='brewery.php?action=cider'>Brew</a> </td> </tr> </tr> <tr> <td>Vodka</td> <td> <a href='brewery.php?action=vodka'>Brew</a> </td> </tr> </table> "; print "This module is a working progress. Should be up and running in a few weeks."; } function brew_beer() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Beer</h3>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'> Beer Information</th> </tr> <tr> <td>Time to brew Beer?</td> <td>25 Minutes</td> </tr> <tr> <td>Brave needed to brew Beer?</td> <td>5 Brave</td> </tr> <td>What does beer do?</td> <td>Gives you an energy boost</td> </tr> </table> <form method='post' action='brewery.php?action=brewbeer'> <input type='submit' name='brewbeer' value='Brew Beer' /> </form> "; } function brew_whiskey() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Whiskey</h3>"; } function brew_beer_sub() { print "You brewed (number of bottles) Bottles of Beer"; } ?>
-
Thanks, what I have now <?php require_once("globals.php"); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']){ case 'beer': brew_beer(); break; case 'whiskey': brew_whiskey(); break; default: brewery(); break; } function brewery() { global $db,$ir,$c,$userid,$h; print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <table class='tablee'><tr><td><center><img src='/images/brewery.jpg' /></td></tr></table> <h3>Your Brewery</h3>"; echo " You are sitting in your shed. </br>What would you like to brew?</br>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'>Brewery Options</th> </tr> <tr> <td>Beer</td> <td> <a href='brewery.php?action=beer'>Brew</a> </td> </tr> <tr> <td>Whiskey</td> <td> <a href='brewery.php?action=whiskey'>Brew</a> </td> </tr> </tr> <tr> <td>Cider</td> <td> <a href='brewery.php?action=cider'>Brew</a> </td> </tr> </tr> <tr> <td>Vodka</td> <td> <a href='brewery.php?action=vodka'>Brew</a> </td> </tr> </table> "; print "This module is a working progress. Should be up and running in a few weeks."; } function brew_beer() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Beer</h3>"; echo " <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'> Beer Information</th> </tr> <tr> <td>Time to brew Beer?</td> <td>25 Minutes</td> </tr> <tr> <td>Brave Needed to brew Beer?</td> <td>5 Brave</td> </tr> <td>What does beer do?</td> <td>Gives you an energy boost</td> </tr> </table> <input type='submit' name='brewbeer' value='Brew Beer' /> "; } function brew_whiskey() { print "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Brewery</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> <h3>Whiskey</h3>"; } ?>