Jump to content
MakeWebGames

peterisgb

Members
  • Posts

    739
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by peterisgb

  1. well i am completely new to .htaccess files and i hardly know anything about it.
  2. Hello, i'm playing around with the .htaccess file. I've got this   RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L]   Which does this to links: http://www.example.com/usersonline.php to http://www.example.com/usersonline Is there a way in the .htaccess file to make all pages display like the above link without editing every link on the site?
  3. oh it takes 5 minutes to double one seed, it costs 5 minutes per seed, so if you do 12 seeds it'll take an hour to complete. so it does take time. I do have intentions on making this bigger and better, just though i would chuck it on here to see if any other people had some good ideas to make it better.
  4. hmm, well as i said it was a quick throw together.
  5. Ok this is quick Grow Weed mod. I didn't spend alot of time on this but i might have intentions to update this as it goes along. run these sql's ALTER TABLE `users` ADD `weed` int(11) NOT NULL DEFAULT '0', ADD `weedtime` int(11) NOT NULL DEFAULT '0', ADD `treatedweed` int(11) NOT NULL DEFAULT '0'; grow.php <?php include "globals.php"; if($ir['weedtime'] > 0) { echo "<h2>You have <font color='red'>{$ir['weedtime']}</font> Minutes until your weed is done.<br /><br /><a href='grow.php'>Reload</a>"; $h->endpage(); exit; } echo "<h2>Grow House</h2><br />"; switch($_GET['action']) { default: grow_index(); break; case "grow": grow_weed(); break; case "grow1": grow_weed1(); break; case "sell": grow_sell(); break; case "sell1": grow_sell1(); break; case "sellt": grow_sellt(); break; case "sellt1": grow_sellt1(); break; case "treat": grow_treat(); break; case "treat1": grow_treat1(); break; } function grow_index() { global $db,$ir,$c,$userid; echo " Welcome to your Grow Room.<br /><br /> <table class='table1' width='75%'><tr> <td align='center'>You have <b><font color='red'>{$ir['weed']}</font></b> weed</td></tr><tr> <td align='center'>You have <b><font color='red'>{$ir['treatedweed']}</font></b> treated weed</td> </tr><tr></tr><tr> <td><a href='grow.php?action=grow'>Grow</a></td> <td><a href='grow.php?action=sell'>Sell</a></td> </tr> <tr> <td><a href='grow.php?action=treat'>Treat Weed</a></td> <td><a href='grow.php?action=sellt'>Sell Treated Weed</a></td> </tr> </table> "; } function grow_weed() { global $db,$ir,$userid; echo "It will cost you $10,000 per seed grown.<br /> It will take you 5 Minutes for every 1 seed grown.<br /> How many seeds do you want to grow? <form action='grow.php?action=grow1' method='post'>Qty: <input type='text' name='qty' value='{$ir['weed']}' class='loginbox' /><input type='submit' value='Grow' class='loginbox' /></form> <br /><a href='grow.php'>Go Back</a>"; } function grow_weed1() { global $db,$ir,$userid; $_POST['qty']= abs((int) $_POST['qty']); $cost=($_POST['qty']*10000); $time=($_POST['qty']*5); $quty=($_POST['qty']); if($ir['money'] < $cost) { echo "Your trying to grow more weed than you can afford.<br /><br /><a href='grow.php'>Go Back</a>"; exit; if($_POST['qty'] <= 0) { echo "Your trying to grow no weed!<br /><a href='grow.php'>Go back</a>"; } exit; } else { $db->query("UPDATE users SET money=money-$cost, weed=weed+$quty, weedtime=weedtime+$time WHERE userid=$userid"); echo "You started to grow {$_POST['qty']} ounces costing you $cost.<br /> Your weed will be ready in $time Minutes. <br /><br /><a href='grow.php'>Go back</a>"; } } function grow_sell() { global $db,$ir,$userid; echo "You currently have <b><font color='red'>{$ir['weed']}</font></b> ounce of Weed.<br /> One ounce will get you $7,500 <form action='grow.php?action=sell1' method='post'>Qty: <input type='text' name='qty' value='{$ir['weed']}' class='loginbox' /><input type='submit' value='Sell' class='loginbox' /></form> <br /><a href='grow.php'>Go Back</a>"; } function grow_sell1() { global $db,$ir,$userid; $_POST['qty']= abs((int) $_POST['qty']); if($_POST['qty'] <= 0) { echo "You dont have that much weed<br /><a href='grow.php'>Go back</a>"; } else { $price=($_POST['qty']*7500); $db->query("UPDATE users SET money=money+$price, weed=weed-{$_POST['qty']} WHERE userid=$userid"); echo "You sold {$_POST['qty']} ounces of weed for $price.<br /><br /><a href='grow.php'>Go back</a>"; } } function grow_treat() { global $db,$ir,$userid; echo "You currently have <b><font color='red'>{$ir['weed']}</font></b> ounce of Weed.<br /> It will cost you $1,000 to treat your weed.<br /> It will take 1 minute for each ounce of weed to complete.<br /> Treating your weed will allow you to see you weed at double its price.<br /> <form action='grow.php?action=treat1' method='post'>Qty: <input type='text' name='qty' value='{$ir['weed']}' class='loginbox' /><input type='submit' value='Treat' class='loginbox' /></form> <br /><a href='grow.php'>Go Back</a>"; } function grow_treat1() { global $db,$ir,$userid; $_POST['qty']= abs((int) $_POST['qty']); if($_POST['qty'] <= 0) { echo "You dont have that much weed to treat<br /><a href='grow.php'>Go back</a>"; } else { $price=($_POST['qty']*1000); $time=($_POST['qty']*1); $db->query("UPDATE users SET money=money-$price, weed=weed-{$_POST['qty']}, treatedweed=treatedweed+{$_POST['qty']}, weedtime=weedtime+$time WHERE userid=$userid"); echo "You treated {$_POST['qty']} ounces of weed for $price.<br /><br /><a href='grow.php'>Go back</a>"; } } function grow_sellt() { global $db,$ir,$userid; echo "You currently have <b><font color='red'>{$ir['treatedweed']}</font></b> ounce of treated Weed.<br /> One ounce will get you $20,000 <form action='grow.php?action=sellt1' method='post'>Qty: <input type='text' name='qty' value='{$ir['weed']}' class='loginbox' /><input type='submit' value='Sell' class='loginbox' /></form> <br /><a href='grow.php'>Go Back</a>"; } function grow_sellt1() { global $db,$ir,$userid; $_POST['qty']= abs((int) $_POST['qty']); if($_POST['qty'] <= 0) { echo "You dont have that much weed<br /><a href='grow.php'>Go back</a>"; } else { $price=($_POST['qty']*20000); $db->query("UPDATE users SET money=money+$price, treatedweed=treatedweed-{$_POST['qty']} WHERE userid=$userid"); echo "You sold {$_POST['qty']} ounces of weed for $price.<br /><br /><a href='grow.php'>Go back</a>"; } } $h->endpage(); ?> and then in explore add <a href='grow.php'>Grow Weed</a> The Cron: $db->query("UPDATE `users` SET weedtime=weedtime-1 WHERE `weedtime` > 0"); And your done, if you have any ideas on where i could expand etc please post here.
  6. I like this, would a CSS code added in overide the default chatbox style.
  7. oh right, well i aint that good yet, i did it this way as i noticed i dont always get the log in staff log. plus this way i can keep an eye on the staff without them really knowing. i shall improve on this once i learnt abit more./
  8. This is only small but i made it on my site and i though other game owners might want it to. First Create page called follow.php <?php $page = basename($_SERVER['PHP_SELF']. "?" . $_SERVER['QUERY_STRING']); if($ir['userid'] > 2) { event_add(1, "{$ir['username']} has loaded the page $page"); } ?> and then on all staff pages under include "sglobals.php"; Add include "follow.php";
  9. yeah, just putting in how to get it added into mccodes.
  10. Nope not quite sure on that yet,
  11. for me works with firefox and opera
  12. yup feedback goes nicely, there shouldn't be anything wrong with it i hope.
  13. Don't post much here as i don't get many ideas so i though i would post this here at least.. Enjoy. This code gives you a coloured animation stat bars. create a .css page. .progress-bar { background-color: #1a1a1a; height: 10px; padding: 1px; width: 100px; margin: 0px 0; border-radius: 1px; box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444; } .progress-bar span { display: inline-block; height: 100%; border-radius: 3px; float: left; box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset; transition: width .4s ease-in-out; } .blue span { background-color: #1fbbdf; } .orange span { background-color: #fecf23; background-image: linear-gradient(top, #fecf23, #fd9215); } .green span { background-color: #a5df41; background-image: linear-gradient(top, #a5df41, #4ca916); } .stripes span { background-size: 30px 30px; background-image: linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); animation: animate-stripes 3s linear infinite; } @keyframes animate-stripes { 0% {background-position: 0 0;} 100% {background-position: 60px 0;} } .shine span { position: relative; } .shine span::after { content: ''; opacity: 0; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #fff; border-radius: 3px; animation: animate-shine 2s ease-out infinite; } @keyframes animate-shine { 0% {opacity: 0; width: 0;} 50% {opacity: .5;} 100% {opacity: 0; width: 95%;} } .glow span { box-shadow: 0 5px 5px rgba(255, 255, 255, .7) inset, 0 -5px 5px rgba(255, 255, 255, .7) inset; animation: animate-glow 1s ease-out infinite; } @keyframes animate-glow { 0% { box-shadow: 0 5px 5px rgba(255, 255, 255, .7) inset, 0 -5px 5px rgba(255, 255, 255, .7) inset;} 50% { box-shadow: 0 5px 5px rgba(255, 255, 255, .3) inset, 0 -5px 5px rgba(255, 255, 255, .3) inset;} 100% { box-shadow: 0 5px 5px rgba(255, 255, 255, .7) inset, 0 -5px 5px rgba(255, 255, 255, .7) inset;} } and then in header add <link rel='stylesheet' type='text/css' href='FILE_NAME.css' /> under title. (change FILE_NAME.css to the .css file you've created.) You can replace the stats bar with the code below, Of course change the names accordingly. <b>Energy:</b> {$ir['energy']}/{$ir['maxenergy']} {$enperc}%<br /> <div class="progress-bar orange stripes"> <span style="width: $enperc%"></span> </div> That shouldn't be to hard i hope. Contact me if you do need help. Tips. You can change the colour of the bars via CSS, orange, green and blue are included and remove the "stripes" to remove the animation. Enjoy
  14. MTG rewrote the class for me a while back as it was better than the basic mccodes codes lol.
  15. oh right ok, well i cant use that either as it throws up another error to do with the class_db_mysqli.php which MTG wrote. will have get his help there.
  16. I keep this this error on loads of pages. Please help and thanks in advance :) Error Code is Fatal error: Call to undefined method database::fetch_array() in /home/electri9/public_html/viewuser.php on line 251 lines 244 - 263   print"<table width=100% cellspacing=1 class='table'><tr style='background:gray'><th colspan=2>Users Comments <A href=comments.php?ID={$r['userid']}>[Add Comment]</a></th>"; if($ir['userid'] == $r['userid'] || $ir['user_level'] > 1) { print"<th width=10%>Delete</th>"; } print"</tr>"; $blah=$db->query("SELECT * FROM comments WHERE cmtTO={$r['userid']} ORDER BY cmtTIME DESC limit 5", $c) or die(mysql_error()); while($cmnt = $db->fetch_array($blah)); { $they=$db->query("SELECT * FROM users WHERE userid={$cmnt['cmtFROM']}",$c); $them=$db->fetch_array($they); $sent=date('F j, Y, g:i:s a',$cmnt['cmtTIME']); print"<td width=25%><b>{$them['username']} [{$them['userid']}]</br></br></b>$sent</td><Td>{$cmnt['cmtTEXT']}</td>"; if($ir['userid'] == $r['userid'] || $ir['user_level'] > 1) { print"<td width=10%><a href=comments.php?action=delete&ID={$cmnt['cmtID']}>Delete</a></td>"; } print"</tr>"; } print"</table>";
  17. any chance of a screeny script?
  18. Stick up the code.
  19. have a go at a map travel system, Info map with cords where you can move around, while moving you could do foresting (streets) and travel to locations replacing the old travel system.
  20. Hi its been a while since there has been any new mods, so i was wondering if anyone on here would like to team up with me on a titanpad and see if we can make something new. Mail me on here or e-mail at [email protected]. Thanks
  21. Thanks MTG, got it right the second time, thanks... works a charm,
  22. anyone? could really use some help. thanks.
  23. not quite, this picks a random winner, there is no random winner. not only that, i am looking for a cron file. would someone have a go for me please.
  24. I'm trying to make a cron file where the prizes are auto credited and an announcement is made. I've done abit of this so far and all the functions. but its not quite right and i need a little help to finish it of so it will work, This is what i have so far. <?php include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $userInfo = $db->query('SELECT `userid`, `sides` FROM `users` ORDER BY sides DESC LIMIT 3'); if($db->num_rows($userInfo) > 0) { $ir = $db->fetch_row($userInfo); $AddAnnouce = sprintf("INSERT INTO mod_announcements (`annouce_NAME`, `annouce_TEXT`, `annouce_TIME`, `annouce_URGENCY`, `annouce_TOPIC`, `annouce_POSTED`)VALUES ('Hackers VS Police', 'Hackers Vs Police Event has Finished.<br /> The Winners are:<br /> 1st Place - {username} Winning 10 Magic Boxes<br /> 2nd Place - {username} Winning 5 Magic Boxes<br /> 3rd Place - {username} Winning 1 Magic Boxes<br /> <br />Congrats and well done.<br />', unix_timestamp(), 'No Urgency', 'Fun', 'System Message')"); $db->query($AddAnnouce); $db->query("UPDATE users SET new_announcements=new_announcements+1"); $db->query("INSERT INTO inventory VALUES('',72,{winner},10)", $c); $db->query("INSERT INTO inventory VALUES('',72,{second},5)", $c); $db->query("INSERT INTO inventory VALUES('',72,{third},1)", $c); $db->query("UPDATE users SET sides=0 WHERE sides > 0"); ?>   As you can see there are a few bits missing and things are wrong, but i've done what i can to the best of my knowledge. Any help would be great, thanks
  25. i also have the facebook connect, however it wont work for what Jimbo has in mind.
×
×
  • Create New...