-
Posts
443 -
Joined
-
Last visited
-
Days Won
20
Content Type
Profiles
Forums
Events
Everything posted by AdamHull
-
need to post the code for them and then we will be able to help
-
-
Think I will make this more dynamic and make a staff panel to add things if anybody is interested.
-
I asked him to add me one skype as it is only still in beta stages with updates coming (hence why i have not put it on here yet), He has it installed on his site and as far as i am aware he likes it, it does work has been on another site for quiet a while now, yes there might off been a issue when adding to his site (due to a little update I did before giving it to him) but it is a fully working script
-
is yours html 5 ? and javascript?
-
its me! i have the mod has been a while since i have even looked at it! if you add me on skype using: [email protected] i will send you the screen shots and things, this being as i have never actually realised it to the forum just to one game
-
so it is setting your brew_beer to 0 as you are taking away brew_beer by $ir['brew_beer'] (these two values are the same, so it will equal to 0) $db->query("UPDATE users SET brewed_beer=brewed_beer - {$_POST['ammount']} WHERE userid=$userid"); Your other is is echo "You have collected ". number_format($ir["amount"]) ." Bottles of Beer, you have ". number_format($ir["brewed_beer"]) ." left"; this is wrong as $ir["amount"] does not exist this should be echo "You have collected ". number_format($_POST['amount']) ." Bottles of Beer, you have ". number_format($ir['brewed_beer']) ." left"; also why are you doing this(i don't think you should be but i could be wrong!) $ir['brewed_beer']= abs((int) $ir['brewed_beer']); instead you should be securing your $_POST you can do this by doing the following $_POST['amount'] = (isset($_POST['amount']) && is_numeric($_POST['amount'])) ? abs(intval($_POST['amount'])) : '';
-
Image mailed you back with what you need to add to your function - - - Updated - - - Image mailed you back with what you need to add to your function
-
This should help if any "Newbies" dont understand Now lets stop arguing with each other, we are here to help/learn not argue over silly things
-
sorry i got it wrong you where missing a opening one after you switch clause and on after your function before the ?>
-
you where also missing two closing curly braces check this updated one for you <?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; 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 Home 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><hr width=85%></br> "; print "This module is a working progress. Should be up and running in a few weeks."; } function brew_beer() { print "<h3>Beer Brewing</h3>"; } ?>
-
if you look on line 5 you have a extra curly brace that needs removing and then should work
-
https://market.android.com/details?id=com.welant.webmaster.DEMO&feature=search_result check out this editor
-
I use ftp manager on my iOS devices and never have had a problem with, there is a free version and a paid version - - - Updated - - - I use ftp manager on my iOS devices and never have had a problem with, there is a free version and a paid version
-
I really do think you Gould scrap Ravans, every mod you have had problems with
-
yeh was just a straight conversion the php and html needs to be separated and the how often in the control panel needs removing
-
So here is a quick conversion off the file Add this to cron_day $res = $db->query("SELECT * FROM `lottery_players` ORDER BY RAND() LIMIT 1"); $checkwinner = $db->num_rows($res); $row = $db->fetch_row($res); if($checkwinner == 0) { echo "There is no winners yet!"; } else { $check = $db->query("SELECT * FROM `lottery`"); $worked =$db->fetch_row($check); event_add($row['user'], "Congrats you have won the lottery your prize is $".number_format($worked['lotofund'])); $db->query("UPDATE `users` SET `money` = `money` + ".$worked['lotofund']." WHERE `userid` = ".$row['user'].""); $db->query("UPDATE `lottery` SET `lotofund` = '0',`tickets` = '0'"); $db->query("UPDATE `users` SET `tickets` = '0' WHERE `tickets` > '0'"); $db->query("INSERT INTO `lotowinners` VALUES({$row['user']},{$worked['lotofund']})"); $db->query("TRUNCATE TABLE `lottery_players`"); } This is the main lottery file lottery.php <?php require("globals.php"); $res = $db->query("SELECT * FROM `lottery`"); $row = $db->fetch_row($res); $checkp = $db->query("SELECT * FROM `lottery_players` WHERE `user` = {$ir['userid']}"); $num = $db->num_rows($checkp); $checkt = $db->fetch_row($checkp); $config = $db->query("SELECT * FROM `lottery_config`"); $worked = $db->fetch_row($config); if($worked['pagedisable'] == 'Yes') { echo 'Admin has disabled the Lottery Page.'; $h->endpage();; } $_POST['amount'] = isset($_POST['amount']) && ctype_digit($_POST['amount']) ? abs(intval($_POST['amount'])) : null; if($_POST['buy']) { if(empty($_POST['amount'])) { echo "You didn't enter a valid amount"; $h->endpage();; } $cost = $worked['ticketprice'] * $_POST['amount']; $usercash = $ir['money'] - $cost; $tickets = $ir['tickets'] + $_POST['amount']; $loto = $row['lotofund'] + $cost; $ltick = $row['tickets'] + $_POST['amount']; $deficit = $worked['maxtickets'] - $ir['tickets']; $havetick = $checkt['tickets'] + $_POST['amount']; if($tickets > $worked['maxtickets']) { echo "The max tickets is ".number_format($worked['maxtickets'])." This means you can only buy ".number_format($worked['maxtickets'] - $ir['tickets'])." more ticket";($deficit == 1 ? '' : 's'); $h->endpage(); } if($_POST['amount'] > $worked['maxtickets']) { echo 'You can only purchase '.number_format($worked['maxtickets']); $h->endpage();; } if($ir['money'] < $worked['ticketprice']) { echo 'You cant afford '.number_format($_POST['amount']).' tickets. It costs $'.number_format($worked['ticketprice'] * $_POST['amount']); $h->endpage();; } if($ir['tickets'] > $worked['maxtickets']) { echo 'You have already purchased max tickets which is '.number_format($worked['maxtickets']); $h->endpage();; } if($ir['money'] >= $worked['ticketprice'] && $_POST['amount'] <= $worked['maxtickets']) { if($num) { echo "You have purchase {$_POST['amount']} lottery tickets for ${number_format($cost)}"; $db->query("UPDATE `users` SET `money` = {$usercash}, `tickets` = {$tickets} WHERE `userid` = ".$userid.""); $db->query("UPDATE `lottery` SET `lotofund` = {$loto}, `tickets` = {$ltick}"); $db->query("UPDATE `lottery_players` SET `tickets` = {$havetick} WHERE `user` = {$ir['userid']}"); } else { echo "You have purchase {$_POST['amount']} lottery tickets for ${number_format($cost)}"; $db->query("UPDATE `users` SET `money` = {$usercash}, `tickets` = {$tickets} WHERE `userid` ={$ir['userid']}"); $db->query("UPDATE `lottery` SET `lotofund` = {$loto}, `tickets` = {$ltick}"); $db->query("INSERT INTO `lottery_players` VALUES('{$ir['userid']}',{$_POST['amount']})"); } } } ?> <table class="table"> <tr><td class="contenthead">Lottery</td></tr> <tr><td class="contentcontent"> <div class="infobox"> <span>Welcome to the lottery</span> <span>Each ticket costs $<?php echo number_format($worked['ticketprice']); ?></span> <span>Maximum of <?php echo number_format($worked['maxtickets']); ?> tickets per person</span> </div> <div class="otherbox"> <span>Lottery Fund: $<?php echo number_format($row['lotofund']); ?></span> <span>Tickets Purchased: <?php echo number_format($row['tickets']); ?></span> </div> </td></tr> <tr><td class="contentcontent"> <div class="buysection"> <form method="post"> [buy Tickets] <input class="lotoinput" type="text" name="amount" value="1" maxlength="2" /> <input type="submit" name="buy" value="Buy Ticket" /> </form> </div> </td></tr> <tr><td class="contenthead">Previous Winners</td></tr> <tr><td class="contentcontent"> <?php $win = $db->query("SELECT * FROM `lotowinners`"); $check = $db->num_rows($win); while($row = $db->fetch_row($win)) { if($check == 0) { echo "<div class='infobox'><span>There has been no previous Winners</span></div>"; } else { echo " <table class='infobox'> <tr> <td>".$row['username']." - $".number_format($row['amountwon'])."</td> </tr>"; } echo "</table>"; } ?> </td></tr> </table> Lottery cofig file lottery_config.php <?php require("globals.php"); if($ir['user_level'] != 2) { exit("You do not have permission to view this page!"); } echo '<h2>Lottery Control Panel</h2>'; echo '<form method="post">'; echo '<h3>Lottery Days</h3>'; echo 'Select how often (days) you want the lottery draw to take place. NOTE: You will need to update the cron job.'; echo "<b>The current setting is: {$set['lottery_days']} days.</b>"; echo '<select name="days"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option></select>'; echo '<h3>Lottery Numbers</h3>'; echo 'Select the amount of numbers you want users to be able to choose from.'; echo "<b>The current setting is: {$set['lottery_numbers']} numbers.</b>"; echo "<input type='text' name='numbers' size='2' maxlength='2' value='{$set['lottery_numbers']}' />"; echo '<h3>Ticket Cost</h3>'; echo 'Select the cost per lottery ticket.'; echo "<b>The current setting is: \${$set['lottery_ticketcost']}.</b>"; echo "$<input type='text' name='cost' value='{$set['lottery_ticketcost']}' />"; echo '<input type="submit" name="update" value="Update" />'; echo '</form>'; if(isset($_POST['update'])) { $days = abs(intval($_POST['days'])); $numbers = abs(intval($_POST['numbers'])); $cost = abs(intval($_POST['cost'])); if ($days > 7) { echo 'The days must be 7 or less!'; } else { if ($numbers < 6 || $numbers > 99) { echo 'The numbers must be greater than 5 and less than 100!'; } else { $db->query("UPDATE settings SET conf_value=$days WHERE conf_name='lottery_days'"); $db->query("UPDATE settings SET conf_value=$numbers WHERE conf_name='lottery_numbers'"); $db->query("UPDATE settings SET conf_value=$cost WHERE conf_name='lottery_ticketcost'"); echo 'Successfully updated!'; }} } $h->endpage(); ?> May be errors in place but it works! lol - - - Updated - - - SQL FILE http://pastebin.com/BrFVEifr Due to forum screwing sql up its in the pastebin link above
-
There is already lotto mods for mccodes which just need converting to the new style the link for the forum post is http://makewebgames.io/showthread.php/44832-Lottery-System?highlight=lottery
-
I have look over the business mod for Ravan and it does look like the mod Richard made, but when looking over the whole Ravan script it is more of a mess then MCcodes, not to forget they have encrypted some off the files! when I looked I think it was core.php and install.php, Not to mention the lack of security it has, the files I have scanned over does not secure POST very well or at all
-
@-BRAIDZ- most of us use Mccodes and we all know it does not have a business mod
-
No you do not need to change UPDATE to INSERT, as UPDATE is for if a value is already in the database, by default it is going to be 0 so it already exsits in the database. So all you need to change is the $userid to $i so your code should look like this: $db->query("UPDATE `users` SET `mail_new` = `mail_new` +1 WHERE `userid` = $i");
-
Message me your full register file and I will add it and test it on my localhost and send you it back
-
<?php require(__DIR__.'/sglobals.php'); echo " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> New Business</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'>"; if($ir['user_level'] > 2) die("Unauthroized Access!"); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']) { case "createbusiness": create_business_form(); break; case "createbusinesssub": create_business_sub(); break; default: print "Error this script requires an action."; break; } function create_business_form() { global $h; print " <form action='test.php?action=createbusinesssub' method='POST'> <h3>Create a Business</h3> Name: <input type='text' name='className' /> Minimum users for business: <input type='text' name='classMembers'/> Business Description: <textarea rows=4 cols=40 name='classDesc' /></textarea> Cost to start business: <input type='text' name='classCost'/> <input type='submit' value='Create' /> </form>"; $h->endpage(); } function create_business_sub() { global $db,$ir,$h; if($ir['user_level'] > 2) die("Unauthorized Access!"); $cn = isset($_POST['className']) && ctype_alpha($_POST['className']) ? $db->escape(strip_tags(stripslashes($_POST['className']))) : ''; $cd = isset($_POST['classDesc']) && ctype_alpha($_POST['classDesc']) ? $db->escape(strip_tags(stripslashes($_POST['classDesc']))) : ''; $cm = isset($_POST['classMembers']) && ctype_digit($_POST['classMembers']) ? abs(intval($_POST['classMembers'])) : 0; $cc = isset($_POST['classCost']) && ctype_digit($_POST['classCost']) ? abs(intval($_POST['classCost'])) : 0; if(empty($cn) || empty($cd) || empty($cm) || empty($cc)) { echo "You have missed a required field."; $h->endpage(); exit; } $db->query("INSERT INTO `businesses_classes` VALUES('', '{$cn}', '{$cm}', '{$cd}', '{$cc}')"); print "The business was successfully created. <a href='staff_business.php?action=createbusiness'>Ba ck!</a>"; stafflog_add("Created the <span class='highlight'>business</span>: {$_POST['className']}"); } $h->endpage(); ?> This code is fully working and tested
-
I'll pm your now!