-
Posts
2,667 -
Joined
-
Last visited
-
Days Won
75
Content Type
Profiles
Forums
Events
Everything posted by Uridium
-
Re: [mccode v2] Add images when you attack Just to show what you can Achieve from adding the pics and a bit of sparkle..
-
Re: [mccode v2] Add images when you attack Just a small update for those using the attpics mod seeing as NPC's cant upload thier own image and it was driving me mental to find a cure.. Decepti0n kindly posted the fix for it Upload a default.jpg to your attpics folder this will be used by the NPCS goto your PHPMYADMIN and run this SQL update users set attpics = 'default.jpg' where user_level = 0 And if your just nistalling this it would be wise also to give members a pic so upload a pic call it nomemb.jpg or what ever.. and run this SQL update users set attpics = 'default.jpg' where user_level = 1 You can do the same for Staff if they dont have an image to share.
-
Re: MYSQL to give pics to User_level 0 how ??? Cheeers Deception your a life saver this has been driving me mental :)
-
in a nutshell I want all my NPC's to have an image But i dont want to Manually Alter them 1 by 1 what would be the Correct SQL so that i can get all user-level 0's so that they have an image.. would it be something like UPDATE user_level=0 FROM users WHERE attpics='default.jpg' at the moment the deafult.jpg isnt in the table so how would i make it so all the NPC's end up with that image as deafult ?? Sorry for posting in here i did post in the correct Area but tehre are more people here to read this. Thanks to Decepti0n :)
-
i want to set all my NPCS so they all have the same IMAGE picture i have the images in the USERS table but how do i make it so the NPCS get the same image without having to do it manually via the phpmyadmin. i was thinking something like UPDATE user_level=0 FROM users WHERE attpics='default.jpg' but that doesnt seem to work at the moment all the NPCS images for the attpics table is empty.
-
Re: [mccode v2] Add images when you attack if you would prefer to use the display_pic rather than the attpics then use the script below for the attack.php you will need the display pic uploader already installed for this to work however,,, print "<table width='50%' align='center'><tr><td align=right> {$odata['username']} Health: </td><td><img src=greenbar.png width={$vars['hpperc']} height=10><img src=redbar.png width={$vars['hpopp']} height=10> [img=displaypic/{$odata[]<tr><td align=right> {$ir['username']} Health: </tr></td><td><img src=greenbar.png width={$vars2['hpperc']} height=10><img src=redbar.png width={$vars2['hpopp']} height=10> [img={$ir[]</td></tr></table>"; }
-
This mod will allow you to upload an image for the sole use that it will be displayed when someone clicks on Attack. You will see your Image + that of your Opponents very small has no real purpose but it brings fun to the game. call this file attackimageuploader.php <?php /*----------------------------------------------------- -- Isomerizer -- Copyright held 2007-2008 © Isomerizer.com -- uploadpic.php -----------------------------------------------------*/ require("globals.php"); if(empty($_FILES['imagefile'])) { echo ' Upload an Attack Image: <form name="imageuploader" method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data"> [i]Path of Image:[/i] <input type="file" name="imagefile" /> <input type="submit" name="Submit" value="Upload Image" /> </form> (Max 10000 file bytes , Must be file extention gif, jpg, jpeg, png, bmp....) (Images are resized to 150 x 150) '; } else { //Edit below for max fb size of the pic $maxsize = 1000000; /*Basic security procedures*/ if(!$_SERVER['REQUEST_METHOD'] == "POST" || !isset($_SERVER['HTTP_USER_AGENT'])){ echo 'Hack Attempt!'; $h->endpage(); exit; } $headerinject = array("Content-Type:", "MIME-Version:", "Content-Transfer-Encoding:", "bcc:", "cc:"); foreach($_POST as $k => $v){ foreach($headerinject as $v2){ if(strpos($v, $v2) !== false){ logBadRequest(); header("HTTP/1.0 403 Forbidden"); exit; } } } /*What extensions can be used?*/ $valid = array('image/gif', 'image/png', 'image/pjpeg','image/jpeg', 'image/jpg'); /*If the extension isnt allowed...*/ if(!in_array($_FILES['imagefile']['type'], $valid)) { $type = strrchr($_FILES['imagefile']['name'], '.'); echo 'This file type '.$type.' is not allowed. [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } /*Check image size*/ if ($_FILES['imagefile']['size'] > $maxsize) { echo 'Image to large [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } $check = ''.$_FILES['imagefile']['tmp_name'].''; /*Check for .exe files*/ if (is_executable($check) || !is_file($check)) { echo 'The file '.$_FILES['imagefile']['name'].' seems to be harmful to the server [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; @unlink($check); $h->endpage(); exit; } /*Now to create the correct image using php*/ if ($_FILES['imagefile']['type']=="image/jpeg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'attpics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/png") { $create = @ImageCreateFromPNG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagepng($create, 'attpics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/jpg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'attpics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/gif") { $create = @ImageCreateFromGIF(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagegif($create, 'attpics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/pjpeg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'attpics/'.$_FILES['imagefile']['name'].''); } /*Destroy the php image*/ @unlink(''.$_FILES['imagefile']['tmp_name'].''); @ImageDestroy($create); /*If php could not create the image*/ if (!$create) { echo 'The image you are trying to upload seems to be corrupt please try again! [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } $path = 'attpics/'; $pic = $_FILES['imagefile']['name']; $picture = $path.$pic; $oldpic = $ir['attpics']; /*Check to see if its already uploaded*/ if ($picture == $oldpic) { echo ' Image already uploaded![url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } /*Delete previous image to save space*/ $delete = @unlink($oldpic); if ($delete) { echo 'Previous image deleted from system... '; } if (!$delete) { echo 'No Previous image to be deleted... '; } $dataa = $_FILES['imagefile']['size']; $datab = $_FILES['imagefile']['type']; $datad = $_FILES['imagefile']['name']; /*Information for user*/ echo 'Old Image Location: '.$oldpic.' New Image Location: '.$picture.' Image Uploaded <u>Info:</u> Image Name: '.$datad.' Image Size: '.$dataa.' bytes Type: '.$datab.' [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; /*Check DB*/ $check = mysql_query( sprintf("SELECT COUNT(*) as cnt FROM `users` WHERE `attpics` = '%s'", mysql_real_escape_string($picture))); $checks = mysql_fetch_array($check); if ($checks['cnt'] > 0) { echo 'Please use another image name [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } /*Update DB*/ mysql_query( sprintf("UPDATE `users` SET `attpics` = '%s' WHERE `userid` = %u", mysql_real_escape_string($picture), $userid)); } $h->endpage(); exit; ?> Now open up Preferences.php and add this line somewhere on the print preferences [url='attackimageuploader.php']Upload Attack Picture[/url] Now open up attack.php Scroll down to the bottom where the print"</table>"; and after it over write with this one print "<table width='50%' align='center'><tr><td align=right> {$odata['username']} Health: </td><td><img src=greenbar.png width={$vars['hpperc']} height=10><img src=redbar.png width={$vars['hpopp']} height=10> [img=attpics/{$odata[]<tr><td align=right> {$ir['username']} Health: </tr></td><td><img src=greenbar.png width={$vars2['hpperc']} height=10><img src=redbar.png width={$vars2['hpopp']} height=10> [img={$ir[]</td></tr></table>"; } Create a Folder on your FTP called attpics then add this to your MSQL ALTER TABLE users ADD `attpics` VARCHAR(255) NOT NULL I'll post a screenie its not brilliant but i hate tables but the pics show up at least..
-
I was reading a POST regards it ebing able to show how many members there are Currently online. And since i havent found a post that allows users to see howm many Males and females are in the game and also that are online.. Ive made this small mod. <?php include "globals.php"; /*count total Male members */ $sql= $db->query ("Select count(*) AS num from users where gender='Male'"); $var = $db->fetch_row($sql); print" Males Regsitered ({$var['num']}) "; /*count total Female members */ $sql= $db->query ("Select count(*) AS num from users where gender='Female'"); $var = $db->fetch_row($sql); print" Females Registerd on the game ({$var['num']}) "; /* bit of space needed here */ $sql= $db->query ("Select count(gender) AS female from users where laston >= UNIX_TIMESTAMP() - 900 ORDER BY gender='Female'"); $var = $db->fetch_row($sql); print" [url='usersonline.php']Females online now ({$var['female']})[/url] "; $sql2= $db->query ("Select count(gender) AS male from users where laston >= UNIX_TIMESTAMP() - 900 ORDER BY gender='Male'"); $var2 = $db->fetch_row($sql2); print" [url='usersonline.php']Males online now ({$var2['male']})[/url] "; ?> Remove the include globals.php and the <? also ?> if your planning on adding it to another file as its not needed unlless you just want to use the script as it is... CALL ME DUMB ;) After I did this smoeone pointed out that MCC already has it built in but never mind. :) its here now lol
-
Re: [mccode v2] House Images Just an update. You can basically add Items or house images to any part of the gamenand for those that are having problems heres a small Tutorial.. Each script on a page has a Different string so to speak so for example if you wanted images in the attack.php script you can still use the items or house pics code to do this.. All you have to remember is adding a new SQL to the dbase of your phpmyadmin so that pic shows up.. so we are going to use the attack script for this Demo.. create a new sql ALTER TABLE users ADD `attpics` VARCHAR(255) NOT NULL Now create a new folder on your FTP call it attpics call this file attackimageuploader.php <?php /*----------------------------------------------------- -- Isomerizer -- Copyright held 2007-2008 ? Isomerizer.com -- uploadpic.php -----------------------------------------------------*/ require("sglobals.php"); if(empty($_FILES['imagefile'])) { echo ' Upload Attack Image Image: <form name="imageuploader" method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data"> [i]Path of Image:[/i] <input type="file" name="imagefile" /> <input type="submit" name="Submit" value="Upload Image" /> </form> (Max 10000 file bytes , Must be file extention gif, jpg, jpeg, png, bmp....) (Images are resized to 150 x 150) '; } else { //Edit below for max fb size of the pic $maxsize = 1000000; /*Basic security procedures*/ if(!$_SERVER['REQUEST_METHOD'] == "POST" || !isset($_SERVER['HTTP_USER_AGENT'])){ echo 'Hack Attempt!'; $h->endpage(); exit; } $headerinject = array("Content-Type:", "MIME-Version:", "Content-Transfer-Encoding:", "bcc:", "cc:"); foreach($_POST as $k => $v){ foreach($headerinject as $v2){ if(strpos($v, $v2) !== false){ logBadRequest(); header("HTTP/1.0 403 Forbidden"); exit; } } } /*What extensions can be used?*/ $valid = array('image/gif', 'image/png', 'image/pjpeg','image/jpeg', 'image/jpg'); /*If the extension isnt allowed...*/ if(!in_array($_FILES['imagefile']['type'], $valid)) { $type = strrchr($_FILES['imagefile']['name'], '.'); echo 'This file type '.$type.' is not allowed. [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } /*Check image size*/ if ($_FILES['imagefile']['size'] > $maxsize) { echo 'Image to large [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } $check = ''.$_FILES['imagefile']['tmp_name'].''; /*Check for .exe files*/ if (is_executable($check) || !is_file($check)) { echo 'The file '.$_FILES['imagefile']['name'].' seems to be harmful to the server [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; @unlink($check); $h->endpage(); exit; } /*Now to create the correct image using php*/ if ($_FILES['imagefile']['type']=="image/jpeg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'attpics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/png") { $create = @ImageCreateFromPNG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagepng($create, 'attpics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/jpg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'attpics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/gif") { $create = @ImageCreateFromGIF(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagegif($create, 'attpics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/pjpeg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'attpics/'.$_FILES['imagefile']['name'].''); } /*Destroy the php image*/ @unlink(''.$_FILES['imagefile']['tmp_name'].''); @ImageDestroy($create); /*If php could not create the image*/ if (!$create) { echo 'The image you are trying to upload seems to be corrupt please try again! [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } $path = 'attpics/'; $pic = $_FILES['imagefile']['name']; $picture = $path.$pic; $oldpic = $ir['attpics']; /*Check to see if its already uploaded*/ if ($picture == $oldpic) { echo ' Image already uploaded![url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } /*Delete previous image to save space*/ $delete = @unlink($oldpic); if ($delete) { echo 'Previous image deleted from system... '; } if (!$delete) { echo 'No Previous image to be deleted... '; } $dataa = $_FILES['imagefile']['size']; $datab = $_FILES['imagefile']['type']; $datad = $_FILES['imagefile']['name']; /*Information for user*/ echo 'Old Image Location: '.$oldpic.' New Image Location: '.$picture.' Image Uploaded <u>Info:</u> Image Name: '.$datad.' Image Size: '.$dataa.' bytes Type: '.$datab.' [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; /*Check DB*/ $check = mysql_query( sprintf("SELECT COUNT(*) FROM `houses` WHERE `attpics` = '%s'", mysql_real_escape_string($picture))); //$checks = mysql_fetch_array($check); if ($checks['cnt'] > 0) { echo 'Please use another image name [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } /*Update DB*/ mysql_query( sprintf("UPDATE `users` SET `attpics` = '%s' WHERE `attpics` = %u", mysql_real_escape_string($picture), $userid)); } $h->endpage(); exit; ?> Now open up your attack.php Right at the bottom of that script find this line print "<table width='50%' align='center'><tr><td align=right>Your Health: </td><td><img src=greenbar.png width={$vars['hpperc']} height=10><img src=redbar.png width={$vars['hpopp']} height=10></td><tr><td align=right>{$odata['username']} Health: </td><td><img src=greenbar.png width={$vars2['hpperc']} height=10><img src=redbar.png width={$vars2['hpopp']} height=10></td></tr></table>"; } Notice how it says $vars but yet on the items and the houses it was either $ir or $p So aslong as you stick with the $ on the line you want to add your pics to you should have viewable pictures all the time.. so the above would be [img={$vars[] for your pic and [img={$vars2[] for your opponents image.. Keep the same basics through out the pages your adding pics to and you should be fine.
-
Re: [mccode v2] House Images Same error as above, but great addition! Try installing it using my Original Post see if that helps
-
Re: [MOD] House Images have you tried the staff_houses.php from my orig post ? on Zeros script overwrite with this one on line 127 $query = sprintf("UPDATE `users` SET money=money+'%.0f', maxwill = %u WHERE userid IN(".implode(', ', %u).")", $old['hPRICE'], 100, $ids); I cant even see the code to select so im going to have to quote it... change line 127 for this one all ZEROS mistake was adding "%.0f" have changed it to '%.0f'
-
Re: Car Mod Im on your site will chat with you on there
-
Re: Car Mod If its a paid mod we cant really touch it. But if its a freebie mod we may be able to help. I regd on your site and got this message when going to the tune.php page Tuning Shop -------------------------------------------------------------------------------- > Back To Garage -------------------------------------------------------------------------------- Invalid Usage Now Invalid usage could mean that that its calling for an ID example tune.php?id=1 and 1 being the CAR in question. So i would add some CARS to the list and try again
-
Re: [MOD] House Images Just noticed that on the staff_houses ive called some routines {$ir['hsepic']} where as on the other scripts ive called it {$ir['hsepics']} for some silly reason, so if your using this make sure the rest of the script for that routine is the same either with the s or without it Bare in mind if you change it to not having the (s) at the end you will also need to alter the SQL ALTER TABLE houses ADD `hsepics` VARCHAR(255) NOT NULL or ALTER TABLE houses ADD `hsepic` VARCHAR(255) NOT NULL
-
I found a tourney script which was discontinued in 2002 yep its old and it only runs off php4 but i've given it a rebirth i sent an email to the script writer who Hasnt replied back to me for a few weeks. The only reason im trying to give it a new lease of life is because its cram packed full of decent features that i feel would be good for. Tournaments against other MORPG sites. and your own site the system allows you to create Tournaments not only for you own webiste but you can introduce other websites to join in the fun. Bit like a Global Battle Ladder. However im having a few issues converting the php4 to work on php5 mainly the dbase isnt updating when i try to add tournaments. Ive redone the installer and fixed a lot of bugs. and im getting hash errors. So if anyone could help me out id be appreciative Ive managed to get rid of a great deal of errors from the script by redoing the php files and converting them into TPL. However the downside to this is that it needs its own Cache folder so it will now need to be installed seperatly from your MCC preferably on s sub-domain. Ive also added to the installer so it CHMODS the needed files. to save you from doing it.. Still having issues with Cookies as its not storing them... and its annoying the hell outta me having to login to each page.
-
Re: Delete My post Please!!!!!!!! well to be honest nobody on here is an expert coder infact nobody on the net is an expert coders simply.. theres no such thing what you dont know today about php you'll know tomorrow so its a game of swings and roundabouts. So quit whining woman and get the post put back up or i will have to bitch slap ya lol
-
Re: [MOD] House Images Cheers ZERO worst thing about adding scripts on here is trying to remember what you did whilst making it work. I think im doing too many tasks at once lol I appreciate your help though Thank You :)
-
Add images to your index page and estate.php so people can view before they buy. Overwrite staff_houses.php with this one <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains shop stuffs switch($_GET['action']) { case "addhouse": addhouse(); break; case "edithouse": edithouse(); break; case "delhouse": delhouse(); break; default: print "Error: This script requires an action."; break; } function addhouse() { global $db, $ir, $c, $h, $userid; $price=abs((int) $_POST['price']); $will=abs((int) $_POST['will']); $name=$_POST['name']; if($price and $will and $name) { $q=$db->query("SELECT * FROM houses WHERE hWILL={$will}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $db->query("INSERT INTO houses VALUES(NULL, '$name', '$price', '$will', '$hsepic')"); print "House {$name} added to the game."; print "House Image {$hsepic} was added to database."; stafflog_add("Created House $name"); } else { print "<h3>Add House</h3><hr /> <form action='staff_houses.php?action=addhouse' method='post'> Name: <input type='text' name='name' /> Price: <input type='text' name='price' /> Max Will: <input type='text' name='will' /> [b]Item Pics[/b] <input type='text' name='hsepic' value='{$ir['hsepic']}' /><hr /> <input type='submit' value='Add House' /></form>"; } } function edithouse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $price=abs((int) $_POST['price']); $will=abs((int) $_POST['will']); $q=$db->query("SELECT * FROM houses WHERE hWILL={$will} AND hID!={$_POST['id']}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $name=$_POST['name']; $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['id']}"); $old=$db->fetch_row($q); if($old['hWILL'] == 100 && $old['hWILL'] != $will) { die("Sorry, this house's will bar cannot be edited."); } $db->query("UPDATE houses SET hWILL=$will, hPRICE=$price, hNAME='$name' WHERE hID={$_POST['id']}"); $db->query("UPDATE users SET maxwill=$will WHERE maxwill={$old['hWILL']}"); $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "House $name was edited successfully."; stafflog_add("Edited house $name"); break; case "1": $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); print "<h3>Editing a House</h3><hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['house']}' /> Name: <input type='text' name='name' value='{$old['hNAME']}' /> Price: <input type='text' name='price' value='{$old['hPRICE']}' /> Max Will: <input type='text' name='will' value='{$old['hWILL']}' /> [b]Item Pics[/b] <input type='text' name='hsepic' value='{$ir['hsepic']}' /><hr /> <input type='submit' value='Edit House' /></form>"; break; default: print "<h3>Editing a House</h3><hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='1' /> House: ".house_dropdown($c, "house")." <input type='submit' value='Edit House' /></form>"; break; } } function delhouse() { global $db,$ir,$c,$h,$userid; if($_POST['house']) { $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); if($old['hWILL']==100) { die("This house cannot be deleted."); } $q2=$db->query("SELECT * FROM users WHERE maxwill={$old['hWILL']}"); $ids=array(); while($r=$db->fetch_row($q2)) { $ids[]=$r['userid']; } if(count($ids)) { $db->query("UPDATE users SET money=money+{$old['hPRICE']}, maxwill=100 WHERE userid IN(".implode(', ', $ids).")"); } $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); $db->query("DELETE FROM houses WHERE hID={$old['hID']}"); print "House {$old['hNAME']} deleted."; stafflog_add("Deleted house {$old['hNAME']}"); } else { print "<h3>Delete House</h3><hr /> Deleting a house is permanent - be sure. Any users that are currently on the house you delete will be returned to the first house, and their money will be refunded.<form action='staff_houses.php?action=delhouse' method='post'> House: ".house_dropdown($c, "house")." <input type='submit' value='Delete House' /></form>"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?> now call this one uploadhsepix.php <?php /*----------------------------------------------------- -- Isomerizer -- Copyright held 2007-2008 ? Isomerizer.com -- uploadpic.php -----------------------------------------------------*/ require("sglobals.php"); if(empty($_FILES['imagefile'])) { echo ' Upload an House Image: <form name="imageuploader" method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data"> [i]Path of Image:[/i] <input type="file" name="imagefile" /> <input type="submit" name="Submit" value="Upload Image" /> </form> (Max 10000 file bytes , Must be file extention gif, jpg, jpeg, png, bmp....) (Images are resized to 150 x 150) '; } else { //Edit below for max fb size of the pic $maxsize = 1000000; /*Basic security procedures*/ if(!$_SERVER['REQUEST_METHOD'] == "POST" || !isset($_SERVER['HTTP_USER_AGENT'])){ echo 'Hack Attempt!'; $h->endpage(); exit; } $headerinject = array("Content-Type:", "MIME-Version:", "Content-Transfer-Encoding:", "bcc:", "cc:"); foreach($_POST as $k => $v){ foreach($headerinject as $v2){ if(strpos($v, $v2) !== false){ logBadRequest(); header("HTTP/1.0 403 Forbidden"); exit; } } } /*What extensions can be used?*/ $valid = array('image/gif', 'image/png', 'image/pjpeg','image/jpeg', 'image/jpg'); /*If the extension isnt allowed...*/ if(!in_array($_FILES['imagefile']['type'], $valid)) { $type = strrchr($_FILES['imagefile']['name'], '.'); echo 'This file type '.$type.' is not allowed. [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } /*Check image size*/ if ($_FILES['imagefile']['size'] > $maxsize) { echo 'Image to large [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } $check = ''.$_FILES['imagefile']['tmp_name'].''; /*Check for .exe files*/ if (is_executable($check) || !is_file($check)) { echo 'The file '.$_FILES['imagefile']['name'].' seems to be harmful to the server [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; @unlink($check); $h->endpage(); exit; } /*Now to create the correct image using php*/ if ($_FILES['imagefile']['type']=="image/jpeg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'hsepics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/png") { $create = @ImageCreateFromPNG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagepng($create, 'hsepics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/jpg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'hsepics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/gif") { $create = @ImageCreateFromGIF(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagegif($create, 'hsepics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/pjpeg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'hsepics/'.$_FILES['imagefile']['name'].''); } /*Destroy the php image*/ @unlink(''.$_FILES['imagefile']['tmp_name'].''); @ImageDestroy($create); /*If php could not create the image*/ if (!$create) { echo 'The image you are trying to upload seems to be corrupt please try again! [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } $path = 'hsepics/'; $pic = $_FILES['imagefile']['name']; $picture = $path.$pic; $oldpic = $ir['hsepics']; /*Check to see if its already uploaded*/ if ($picture == $oldpic) { echo ' Image already uploaded![url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } /*Delete previous image to save space*/ $delete = @unlink($oldpic); if ($delete) { echo 'Previous image deleted from system... '; } if (!$delete) { echo 'No Previous image to be deleted... '; } $dataa = $_FILES['imagefile']['size']; $datab = $_FILES['imagefile']['type']; $datad = $_FILES['imagefile']['name']; /*Information for user*/ echo 'Old Image Location: '.$oldpic.' New Image Location: '.$picture.' Image Uploaded <u>Info:</u> Image Name: '.$datad.' Image Size: '.$dataa.' bytes Type: '.$datab.' [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; /*Check DB*/ $check = mysql_query( sprintf("SELECT COUNT(*) FROM `houses` WHERE `hsepics` = '%s'", mysql_real_escape_string($picture))); $checks = mysql_fetch_array($check); if ($checks['cnt'] > 0) { echo 'Please use another image name [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } /*Update DB*/ mysql_query( sprintf("UPDATE `houses` SET `hsepics` = '%s' WHERE `hsepics` = %u", mysql_real_escape_string($picture), $userid)); } $h->endpage(); exit; ?> Now open smenu.php Under the HOUSES catagory add > [url='uploadhsepix.php']Upload House Pic[/url] ow open index.php and add this line where you want your pic to be displayed.. [b]Property:</center>[/b] {$ir['hNAME']} <center>[img=hsepics/{$ir[]</center>"; Now overwrite estate.php with this one which also allows you to sell your house <?php include "globals.php"; $mpq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $mp=$db->fetch_row($mpq); $_GET['property']=abs((int) $_GET['property']); if($_GET['property']) { $npq=$db->query("SELECT * FROM houses WHERE hID={$_GET['property']}"); $np=$db->fetch_row($npq); if($np['hWILL'] < $mp['hWILL']) { print "You cannot go backwards in houses!"; } else if ($np['hPRICE'] > $ir['money']) { print "You do not have enough money to buy the {$np['hNAME']}."; } else { $db->query("UPDATE users SET money=money-{$np['hPRICE']},will=0,maxwill={$np['hWILL']} WHERE userid=$userid"); print "Congrats, you bought the {$np['hNAME']} for \${$np['hPRICE']}!"; } } else if (isset($_GET['sellhouse'])) { $npq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $np=$db->fetch_row($npq); if($ir['maxwill'] == 100) { print "You already live in the lowest property!"; } else { $db->query("UPDATE users SET money=money+{$np['hPRICE']},will=0,maxwill=100 WHERE userid=$userid"); print "You sold your {$np['hNAME']} and went back to your shed."; } } else { print "<center>Your current property: <font color=blue>[b]{$mp['hNAME']}[/b]</font> The houses you can buy are listed below. Click a house to buy it. "; print "[url='estate.php?sellhouse']Sell Your House[/url] "; if($ir['willmax'] > 100) { } $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC"); while($r=$db->fetch_row($hq)) { print " <table cellspacing=2 class='table'><tr style='background:gray;'><th>House</th><th>House Price</th><th>House Will</th><th>Image</th><th>Buy?</th></tr>"; $hq=mysql_query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC",$c); while($r=$db->fetch_row($hq)) { print "<tr><td>{$r['hNAME']}</a></td><td>\$$t".money_formatter($r['hPRICE'],'')."</td> <td>{$r['hWILL']}</td> <td>[img=hsepics/{$r[]</td> <td><a href='estate.php?property={$r['hID']}'>Buy</tr>"; } print "</table>"; } } $h->endpage(); if($ir['married']) { die("You cannot manage your estate agent while your being married!"); } ?> Now create a folder on your ftp called hsepics and add a new table to your database under houses.. ALTER TABLE houses ADD `hsepics` VARCHAR(255) NOT NULL And thats it
-
Re: Delete My post Please!!!!!!!! MrGI why do you want your post deleting ? if we were to delete all the posts on here that have been RE-Modded from another mod there wouldnt be many posts on this Forum for Freebies. Your idea is original and could be helpful to others.. Put it back up matey. All my Mods are re-mods of others and they havent been taken down..
-
Re: Build Car {v2} and {v1} MRGI find these in your script else { if($_GET['spend'] == '1') Starting from the top you need to renumber them from 1 - 9 so your final piece would be else { if($_GET['spend'] == '9')
-
[mccode v2] BRAND NEW EXPLORE Tested
Uridium replied to Modern-Empires's topic in Free Modifications
Re: BRAND NEW EXPLORE [v2] Tested A friend kindly loaned me some webspace so i could show you how my original version worked.. some links are just ALT text and others will open up graphics for a more indepth description of the area.. hover over items 1 30 and any parking to reveal graphics.. DEMO http://www.slave-traders.net/exploring.html -
for the Purposes of this mod i'll be using Zero-Effects Register.php page this is only a very small mod Zero already has the ability to stop users reging with small names i just added so they dont exceed massive reg name.. open up zero=effects register.php find these lines... } if(strlen($_POST['username']) < 4) { die("Sorry, the username is too short. >[url='register.php']Back[/url]"); and just under them add these } if(strlen($_POST['username']) > 12) { die("Sorry, the username exceeds 12 characters. >[url='register.php']Back[/url]"); you can obviously alter the 12 to anything i suppose 16 character would suffice.. You can also do the same for users that want to rename themselves after registering open up preferences.php find function do_name_change() { global $db,$ir,$c,$userid,$h; and underneath add if(strlen($_POST['newname']) < 4) { die("Sorry, the username is too short. >[url='preferences.php?action=namechange']Back[/url]"); } if(strlen($_POST['newname']) > 12) { die("Sorry, the username exceeds 12 characters. >[url='preferences.php?action=namechange']Back[/url]"); }
-
To those that may not know my host decided to shut down my website and has now gone into hiding also closing down his own hosting company.. The reason for my apology is because most of the scripts i have done on here had images attached for screenshot purposes and also images that were needed for some of my mods. I am doing my utmost to get back what ive lost which some of it is still in the depths of my hard drive so im having to scour 2000gig to find images that are missing and zip files so i can re-upload them to a new host. Please bear with me whilst i do this i promise to return all my posts to how they were before my host went mental on me. Thanks for reading Illusions.. PS sorry iof this is in the wrong place but i wanted it here so people could find it quicker..
-
[mccode v2] BRAND NEW EXPLORE Tested
Uridium replied to Modern-Empires's topic in Free Modifications
Re: BRAND NEW EXPLORE [v2] Tested Nice to see someone actually followed this image explore map up. After i did the one for my site it became clear is was more of a burden than a help. Although colourful and graphical and seemed like a good idea at the time. It soon became clear that it was quicker to alter text rather than co-ordinating grid refs all the time So i kinda dropped the Project. But still say its good to see it being put to some use for others :) -
[mccode v2] Updated From Snikos' Pollution Mod :D
Uridium replied to Zytraw's topic in Free Modifications
Re: V2 Updated From Snikos' Pollution Mod :D im 5 just starting big school beat that ;)