Jump to content
MakeWebGames

Uridium

Members
  • Posts

    2,657
  • Joined

  • Last visited

  • Days Won

    74

Everything posted by Uridium

  1. This Plugin will allow your users to right click on a page and instantly get to where they want to be SCRIPT not written by me i just thought it would be useful open up header.php find [css]a:hover {color: blue;text-decoration: underline; }[/css] and underneath add [css].link{ cursor:default; text-decoration:none; color:black; font-size:8pt; font-family:verdana; padding:3px; } .normtext{ color:black; font-size:8pt; font-family:verdana; font-weight:bold; padding:3; } #conmenu { cursor:default; position:absolute; top:0px; left:0px; visibility:hidden; background-color:lightgrey; layer-background-color:lightgrey; border:outset 2px; font-size:8pt; font-family:verdana; font-weight:normal; color:#000000; width:200px; padding:1 2 0 2; z-index:2; } #conshadow{ position:absolute; top:0px; left:0px; visibility:hidden; background-color:black; layer-background-color:black; z-index:0; }[/css] In the same section just below the <body> tag add underneath.. [js]<script language="javascript"> /***************************************************** TITLE: CONTEXT MENU V1.2 AUTHOR: Brian Gosselin SITE: http://HTTP://SCRIPTASYLUM.COM EMAIL: [email protected] SUPPORT: WORKS IN NETSCAPE 4+ AND 6+. WORKS IN IE4+ KNOWN BUGS: BOX DOES NOT APPEAR CORRECTLY WHEN OVER FORM ELEMENTS IN NETSCAPE4.X. AS A RESULT, I HAVE CREATED PROVISIONS FOR THIS. SEE BELOW. ******************************************************/ var menuNormColor="black"; //NORMAL COLOR OF THE MENU ITEMS var menuHoverColor="#0084d8"; //COLOR OF THE MENU ITEMS ONMOUSEOVER var enableShadow=true; //SET TO "true" TO ENABLE SHADOW, "false" TO DISABLE IT. var enableShadowTransparency=true; //SET TO "true" TO ENABLE SHADOW SEMI-TRANSPARENCY (ie4+, ns6+ ONLY), "false" TO DISABLE IT. var disableNS4=true; // BECAUSE THE MENU DOESNT LOOK RIGHT WHEN THE PAGE CONTAINS FORMS IN NS4, SET THIS VALUE TO // "true" TO DISABLE THIS CONTEXT MENU AND USE THE DEFAULT ONE. THIS EFFECTS NS4.X ONLY. // THE ARRAY BELOW CONTAINS THE MENU ITEMS. FORMAT: // [ 'LINK TEXT TO APPEAR IN MENU' , 'LINK HREF' , 'TARGET WINDOW/FRAME' ]; // JUST ADD ARRAY ITEMS AS NEEDED KEEPING NUMBER SEQUENCE // TO ADD REGULAR (NON-LINK) HTML/TEXT, USE THE FOLLOWING FORMAT: // [ 'REGULAR TEXT/HTML HERE' ]; var menu=new Array(); menu[0]=['<center>- Quick Menu -</center>']; menu[1]=['Inventory' , 'inventory.php' , '_parent']; menu[2]=['Home' , 'index.php' , '_parent']; menu[3]=['Mail Box' , 'mailbox.php' , '_parent']; menu[4]=['Events' , 'events.php' , '_parent']; menu[5]=['Inventory' , 'inventory.php' , '_parent']; menu[6]=['Explore' , 'explore.php' , '_parent']; menu[7]=['Log Out' , 'logout.php' , '_parent']; menu[8]=['Your Settings' , 'preferences.php' , '_parent']; menu[9]=['Your Profile' , 'viewuser.php?u={$ir['userid']}' , '_parent']; menu[10]=['<center>- EXPLORE AREAS -</center>']; menu[11]=['Users Online' , 'usersonline.php' , '_parent']; menu[12]=['Shops' , 'shops.php' , '_parent']; menu[13]=['Item Market' , 'itemmarket.php' , '_parent']; menu[14]=['Your Bank' , 'bank.php' , '_parent']; menu[15]=['Deposit Cash $ {$ir['money']}' , 'bank.php?action=deposit' , '_parent']; menu[16]=['Withdraw Cash $ {$ir['bankmoney']}' , 'bank.php?action=withdraw' , '_parent']; menu[17]=['Gender = {$ir['gender']} [change]' , 'preferences.php?action=sexchange2' , '_parent']; menu[18]=['Right-click the mouse again to dismiss...']; //****************** NO NEED TO EDIT BEYOND HERE ******************** ns4 = (navigator.appName.indexOf("Netscape")>=0 && document.layers)? true : false; ie4 = (document.all && !document.getElementById)? true : false; ie5 = (document.all && document.getElementById)? true : false; ns6 = (document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? true: false; w3c = (document.getElementById)? true : false; var mx=0; var my=0; var conmenu; var conshadow; var windowloaded=false; var opened=false; var ch=0; var cw=0; function setc(ref,c){ if(ns4)ref.bgColor=c; else ref.style.backgroundColor=c; } var txt='<div id="conshadow"> </div>'; txt+='<div id="conmenu">'; for(i=0;i<menu.length;i++){ if(menu.length<3){ txt+='<ilayer><div class="normtext">'+menu[0]+'</div></ilayer>'; }else{ txt+=(ns4)?'<ilayer width="100%" bgcolor="'+menuNormColor+'"><layer width="100%" onmouseover="setc(this,\''+menuHoverColor+'\')" onmouseout="setc(this,\''+menuNormColor+'\')">':'<div class="link" style="background-color:'+menuNormColor+'" onmouseover="setc(this,\''+menuHoverColor+'\')" onmouseout="setc(this,\''+menuNormColor+'\')">'; txt+='[1]+'"]'+menu[0]+''; txt+=(ns4)?'</layer></ilayer>':'</div>'; }} txt+='</div>'; document.write(txt); function ns4trap(evt){ if(evt.which==2||evt.which==3){ showmenu(); return false; }} function showmenu(){ if(windowloaded){ if(opened){ if(ns4){ conmenu.visibility="hide"; conshadow.visibility="hide"; conmenu.moveTo(0,0); conshadow.moveTo(0,0); }else{ conmenu.style.visibility="hidden"; conshadow.style.visibility="hidden"; conmenu.style.left='0px'; conmenu.style.top='0px'; conshadow.style.left='0px'; conshadow.style.top='0px'; } opened=false; }else{ opened=true; var wh=(ie4||ie5)?document.body.clientHeight:window.innerHeight; var ww=(ie4||ie5)?document.body.clientWidth:window.innerWidth; var sx=(ie4||ie5)?document.body.scrollLeft:pageXOffset; var sy=(ie4||ie5)?document.body.scrollTop:pageYOffset; if(ie4||ie5){ if(mx+cw+13>=ww)mx=mx-cw-13; if(my+ch+13>=wh)my=my-ch-13; }else{ if(mx+cw-sx+13>=ww)mx=mx-cw-13; if(my+ch-sy+13>=wh)my=my-ch-13; } if(ns4){ conmenu.moveTo(mx,my); conmenu.visibility="show"; conshadow.moveTo(mx+8,my+8); if(enableShadow)conshadow.visibility="show"; }else{ conmenu.style.left=mx+((ie4||ie5)?sx:0)+'px'; conmenu.style.top=my+((ie4||ie5)?sy:0)+'px'; conshadow.style.left=mx+10+((ie4||ie5)?sx:0)+'px'; conshadow.style.top=my+10+((ie4||ie5)?sy:0)+'px'; setTimeout('conmenu.style.visibility="visible"; if(enableShadow)conshadow.style.visibility="visible"; ',50); }}}} if(ns4&&!disableNS4){ document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE); document.onmousedown=ns4trap; }else{ document.oncontextmenu=function(){ showmenu(); return false; }} document.onmousemove=function(evt){ mx=(ie4||ie5)?event.clientX:evt.pageX; my=(ie4||ie5)?event.clientY:evt.pageY; } window.onload=function(){ windowloaded=true; conmenu=(ns4)?document.layers['conmenu']:(ie4)?document.all['conmenu']:document.getElementById('conmenu'); conshadow=(ns4)?document.layers['conshadow']:(ie4)?document.all['conshadow']:document.getElementById('conshadow'); ch=(ns4)?conmenu.document.height:(ie4||ie5)?conmenu.clientHeight:conmenu.offsetHeight; cw=(ns4)?conmenu.document.width:(ie4||ie5)?conmenu.clientWidth:conmenu.offsetWidth; if(ns4){ conshadow.clip.height=conmenu.document.height; conshadow.clip.width=conmenu.document.width; conmenu.clip.bottom=conmenu.document.height; }else{ if(enableShadowTransparency){ if(ie4||ie5)conshadow.style.filter="alpha(opacity=50)"; if(ns6||!ie4||!ie5)conshadow.style.MozOpacity=.5; } conshadow.style.height=ch+((ie4||ie5)?4:0); conshadow.style.width=cw+((ie4||ie5)?4:0); } //ADD OTHER WINDOW ONLOAD EVENT HANDLER SCRIPTS/COMMANDS HERE } window.onresize=function(){ if(ns4)setTimeout('history.go(0)',200); //ADD OTHER WINDOW RESIZE HANDLER COMMANDS/SCRIPTS HERE } </script>[/js] Reupload your header.php work on all browsers
  2. Search the forums you will save yourself some cash
  3. Uridium

    align

    found this maybe useful for you http://www.jegsworks.com/Lessons/web/html/fp/align.htm
  4. Godaddy isnt the best for setting up any game or website. I remember when i was with them it was a hassle just to set up a Dbase as they dont use localhost.. Your best bet is get anotehr HOSt and steer clear of godaddy their support is an automated bot you'll never talk to a human
  5. Points taken i was lokoing for Swords but as there are so many images to apply chains seemed appropriate to continue the loop However I am working on reducing the amount of images taken to create the skin and make it so the images lenghens when the menu is lenghened. there are 39 images for that one page and most are really not needed..
  6. Just because an Error is reported on a LINE doesnt always mean its that line thats at fault o try looking at lines before that statement.
  7. Created a new skin for the miniNEAB just wanted some feedback on your view as its my first attempt at making a Skin. All comments are welcome if i get enough feedback i'll give this SKIN away for FREE
  8. I dont claim to be a geat Javascript coder i just added some extra parts and thought it would be useful.. However if this can be reduced in size and made smaller than the original Script thats good by me the font size on this doesnt have a limit and can be zoomed in and out at incredible sizes.
  9. This Plugin will allow your users to select from different font sizes they can reduce and Enlarge the font to suit their needs and the options are saved they can also change their Fontstyles and again this is saved... The Javascript wasnt written by me but ive added some functions so it works with MCC... Call this file easydynfont.js   /* Easydynfont Version 1.0 written by Chris Heilmann please refer to the homepage at [url]http://www.onlinetools.org/tools/easydynfont.php[/url] */ // Standard setting, separate fonts with "," and make sure to set standardfont // and size to avoid errors var fonts="Arial,Times New Roman,Verdana,Courier".split(","); // you can addmore fonts here as and when you wish illusions var standardfont="Arial" var standardsize="90%" var nosave=false; /* function drawform() adds the standard form to the document. */ function drawform(){ if (!document.layers){ document.write("<form action=\"/\" name=\"dynform\" class=\"dynform\">"); document.write("<select class=\"dynselect\" name=\"typeface\" onchange=\"setFont(this.options[this.selectedIndex].value)\">"); for (i=0;i<fonts.length;i++){ document.write(" <option value=\""+fonts[i]+"\">"+fonts[i]+"</option>"); } // EDITS AND ADDITIONS BELOW CREATED BY ILLUSIONS TO FORM IMAGES AND REDUCE AND MAKE LARGER // document.write("[img=save.gif]"); document.write("</select>"); document.write("[img=up.gif]"); document.write("[img=down.gif]"); document.write("<input type=\"button\" name=\"nosave\" value=\"SAVE\" />"); document.write("</form>"); } } /* function init() loads the cookiedata and changes the document accordingly, if there is no cookie, sets the standard settings and stores it */ function init(){ if (!document.layers){ size=getCookie("dynfontsize"); if (size!=null){ c=size.split(":"); document.getElementsByTagName("body").item(0).style.fontSize=c[0]; document.getElementsByTagName("body").item(0).style.fontFamily=c[1]; } if (size==null || c[0]=="" || c[1]==""){ document.getElementsByTagName("body").item(0).style.fontSize=standardsize; document.getElementsByTagName("body").item(0).style.fontFamily=standardfont; storeSize() } } // Special setting, if you want to use the "don't save" chekbox nosave=document.dynform.nosave.checked } /* function addSize(add) increases the size of the document font by "add", negative values make the font smaller. */ function addSize(add){ if (!document.layers){ doc = document.getElementsByTagName("body").item(0) size=parseInt(doc.style.fontSize)+add; doc.style.fontSize=size+"%"; if (nosave==false) storeSize() } } /* function SetSize(add) sets the font size of the document. */ function setSize(add){ if (!document.layers){ document.getElementsByTagName("body").item(0).style.fontSize=add+"%"; if (nosave==false) storeSize() } } /* function SetFont(add) sets the font face of the document. */ function setFont(add){ if (!document.layers){ doc = document.getElementsByTagName("body").item(0) doc.style.fontFamily=add; if (nosave==false) storeSize() } } /* function storeSize() saves the current settings of the document in a cookie */ function storeSize(){ var exp = new Date(); exp.setTime(exp.getTime() + 24*60*60*90*1000); size=document.getElementsByTagName("body").item(0).style.fontSize; font=document.getElementsByTagName("body").item(0).style.fontFamily; setCookie("dynfontsize",size+":"+font,exp); } /* function setCookie() sets the cookie */ function setCookie(name, value, expires, path, domain, secure) { var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "") document.cookie = curCookie } /* function getCookie() reads the cookie */ function getCookie(name) { var prefix = name + "=" var cookieStartIndex = document.cookie.indexOf(prefix) if (cookieStartIndex == -1) return null var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length) if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex)) }   open up header.php where the HTML part is find   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>   Underneath add   <script language="JavaScript" src="easydynfont.js"></script>   Now remove the function for fonts which is   table,tr,td { font-family:helvetica, arial, geneva, sans-serif;font-size: 12px; } img { border:none; } textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:12px;color: black; }   Now near the end of the HTML look for the body tag <body> and underneath add   <body bgcolor="black"> <body onload="init()"> <script language="JavaScript">drawform();</script>   And your done DEMO >>> http://www.mccode.doom-nights.com USERNAME= test AND PASSWORD= test Download the fontimages.rar fle and upload to the root of your game
  10. Nicely done Ishmell very nice. would be nice to create some Mods/plugins for you when its available...
  11. Tried several times to install this script and failed there is however an updated version which is called webdiplomacy which is exact same as above and by the same Author as above,, LINK http://webdiplomacy.net/webDiplomacy-latest.tgz Again tried to install this The registration page uses captch image but it doesnt work so you cant register. File size of this one however is 9mb Was easier to install but again even with the reg names on the MYSQL i got an error at login... Fatal error: Access to undeclared static property: Config::$salt in /xxxx/xxxx/xxxx/phpdiplomacy/webdiplomacy/lib/auth.php on line 168 Thier forums can be found at http://forum.webdiplomacy.net/index.php but doesnt offer much hope for a solution.....
  12. Plus Points... Nicely animated 2D interface, charcter's are nicely drawn, plenty of maps can be added Once youve worked out how to do them as there isnt much of a help file. But overall the charcter based 2D environment was unwittingly addictive to walk round and exlpore.. and could be made even larger with new addon Maps, The editing system although basic did prove a purpose that it can be used to make a great game if the owner had the time and temprament to do so.   Minus Points.. I found that even on the Beta version which can probably be improved the Javascript Crashed Quite a lot, The ability to click and manouver your charcter around the 2d frame seemed a task at some points and, also found that your character would just Freeze to the spot whenever you gave them a direction to walk to. The CPU usuage would be a concern when more people got involved in the game as i found that using 3 charcters caused a great deal of lagg. Overall As a game it has some unique spots that could entertain your members but i do feel on the whole because of lack of movement sometimes, This could be a headache.. My score for the Glorylands engine has to be 5/10...
  13. This mod will allow users to enter Reminders for themselves for a given date of the year when the event has been reached you will receieve a Notification message of your said event. SQLS   CREATE TABLE IF NOT EXISTS `myevents` ( `id` int(6) NOT NULL auto_increment, `userid` int(11) NOT NULL, `event` varchar(40) default NULL, `date` varchar(255) default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;   call this file myevents.php   <?PHP include"globals.php"; //include the globals file if ( isset($_GET['act'])) { //Check the mode $act = $_GET['act']; } else { $act = "view"; //Otherwise let the mode = view } if ( isset($_GET['format'])) { //Check the number formatting $format = $_GET['format']; setcookie('format', $format, time()+3600 ); //Set the cookie } else { //If number formatting isnt set if ( isset($_COOKIE['format'])) { //check for cookies $format = $_COOKIE['format']; } else { $format = $defaultformat; //If unset then set cookie setcookie('format', $format, time()+3600 ); } } $today = mktime(); //Get todays date/time $today2 = mktime(0,0,0); echo <<<tophtml <html> <head> </head> <body> <table width=100% cellspacing=1 cellpadding=3px> tophtml; // use the command tophtml so not to confuse header.php and make firefox gain 2 moves if ($act == "add"){ //What to do if we are adding the data to the db $name = $_POST['name']; //Put the inputs into the variables $eventday = $_POST['day']; $eventmonth = $_POST['month']; $year = $_POST['year']; $eventname = strip_tags($name); //Clean up the text $eventyear = strip_tags($year); $valid = checkdate($eventmonth, $eventday, $eventyear); //Check for valid date $eventstamp = mktime(0,0,0,$eventmonth,$eventday,$eventyear); //Create the tomestamp if ($eventname == "" OR $eventday == '0' OR $eventmonth='0' OR $eventyear == ""){ //Check all fields completed echo "<tr><td class=error>[b]Error: [/b]You must complete all fields.</td></tr>"; } elseif ( $valid == False ) { //Check for valid date echo "<tr><td class=error>[b]Error: [/b]The entered date is not a valid date.</td></tr>"; } elseif ( $eventyear>"2069" ) { //Check if the year is too far away echo "<tr><td class=error>[b]Error: [/b]Dates past 2069 are not allowed.</td></tr>"; } elseif ( $eventstamp < $today2 ) { //Check the event is not in the past echo "<tr><td class=error>[b]Error: [/b]Dates in the past are not allowed.</td></tr>"; } elseif ( strlen($eventname)>30 ) { //Check the name is not too long echo "<tr><td class=error>[b]Error: [/b]The maximum length of the event name is 30 characters.</td></tr>"; } elseif ( strlen($eventyear)<>4) { //Check for 4 digits in year echo "<tr><td class=error>[b]Error: [/b]The year must contain 4 digits.</td></tr>"; } elseif ( $eventname !== $eventname ) { //Check the event hasnt been sued before echo "<tr><td class=error>[b]<h1>Illegal Error: [/b]$eventname already in use.</h1></td></tr>"; } else { global $db,$r; $query = "INSERT INTO myevents (event,userid,date) VALUES ('$eventname', '$userid', '$eventstamp')"; mysql_query($query) or die(mysql_error()); if (mysql_error() == NULL) { echo "<tr><td class=success>[b]Success!: [/b]Your event has been added.</td></tr>"; } else { echo "<tr><td class=error>[b]Error: [/b]Your event could not be added.</td></tr>"; } } } $query = "SELECT * FROM `myevents` WHERE userid='$userid'"; //Select the dates, earlyest first $result = mysql_query($query) or die(mysql_error()); $c=0; while ( $i = mysql_fetch_array($result) ) { $secs = $i['date'] - $today; //Find the difference between the dates if (($c%2)==1){ $class = "row1"; } else { $class = "row2"; } if ($today2 == $i['date']) //Check to see if the event is today { echo "<tr><td class=$class>You have a reminder set for today with the message:- <font color='yellow'> [b]".$i['event']."</font>[/b]</td></tr>"; $c++; } elseif (($i['date']-86400)==$today2) { echo "<tr><td class=$class>Tomorrow is [b]".$i['event']."[/b]</td></tr>"; $c++; } elseif (($today2-86400)==$i['date']) { echo "<tr><td class=$class>Yesterday was [b]".$i['event']."[/b]</td></tr>"; $c++; } elseif (($today2-86400)>$i['date']) //If the event has passed delete it { $query = "DELETE FROM myevents WHERE id='$i' AND userid='$userid'"; mysql_query($query) or die(mysql_error()); } else { //If everything's ok go on to print the countdowns echo "<tr><td class=$class>[b]".$i['event']."[/b] is in [i]"; if ($format==0){ calcyears($secs); calcmonths($rem); calcweeks($rem); calcdays($rem); } elseif ($format==1){ calcmonths($secs); calcweeks($rem); calcdays($rem); } elseif ($format==2){ calcweeks($secs); calcdays($rem); } elseif ($format==3){ calcdays($secs); } else { calcyears($secs); calcmonths($rem); calcweeks($rem); calcdays($rem); } echo "[/i](".date("l jS F Y", $i['date']).")</td></tr>"; //Print the date of the event //eg. Friday 6th of October 2006 $c++; } } $thisyear = date("Y"); echo <<<formhtml <tr><td class=format> [url="./myevents.php?format=0"]Years[/url] | [url="./myevents.php?format=1"]Months[/url] | [url="./myevents.php?format=2"]Weeks[/url] | [url="./myevents.php?format=3"]Days[/url] </td></tr> </table> <center> <form action="myevents.php?act=add" method=POST> Event name: <input type=text name=name size=30> [i]eg. Bob's Birthday[/i] <select name=day size=1> <option value=0 selected>Day</option> <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> <option value=8>8</option> <option value=9>9</option> <option value=10>10</option> <option value=11>11</option> <option value=12>12</option> <option value=13>13</option> <option value=14>14</option> <option value=15>15</option> <option value=16>16</option> <option value=17>17</option> <option value=18>18</option> <option value=19>19</option> <option value=20>20</option> <option value=21>21</option> <option value=22>22</option> <option value=23>23</option> <option value=24>24</option> <option value=25>25</option> <option value=26>26</option> <option value=27>27</option> <option value=28>28</option> <option value=29>29</option> <option value=30>30</option> <option value=31>31</option> </select> / <select name=month size=1> <option value=0 selected>Month</option> <option value=1>January</option> <option value=2>Febuary</option> <option value=3>March</option> <option value=4>April</option> <option value=5>May</option> <option value=6>June</option> <option value=7>July</option> <option value=8>August</option> <option value=9>September</option> <option value=10>October</option> <option value=11>November</option> <option value=12>December</option> </select> / <input type=text name=year size=3 value={$thisyear}> <input type=submit value=Submit> </form></center> formhtml; mysql_close(); //-------------------------------------------------------------------------- // Functions for calculating the different units from the number of seconds //-------------------------------------------------------------------------- function calcyears($secs) { //Calculate the years GLOBAL $rem; //Declare the global variable $years = floor($secs/60/60/24/365); $rem = ($secs/60/60/24/365 - $years)*60*60*24*365; //Calculate the remaining time in seconds if ($years == 1){ echo "$years year "; //Output the number of units, remembering s if needed } elseif ($years <> 0){ echo "$years years "; } } function calcmonths($secs) { GLOBAL $rem; $months = floor($secs/60/60/24/30); $rem = ($secs/60/60/24/30 - $months)*60*60*24*30; if ($months == 1){ echo "$months month "; } elseif ($months <> 0){ echo "$months months "; } } function calcweeks($secs) { GLOBAL $rem; $weeks = floor($secs/60/60/24/7); $rem = ($secs/60/60/24/7 - $weeks)*60*60*24*7; if ($weeks == 1){ echo "$weeks week "; } elseif ($weeks <> 0){ echo "$weeks weeks "; } } function calcdays($secs) { GLOBAL $rem; $days = floor($secs/60/60/24); $rem = ($secs/60/60/24 - $days)*60*60*24; if ($days == 1){ echo "$days day "; } elseif ($days <> 0){ echo "$days days "; } } // End of script and thanks to all that are using it Illsuions ?>   add a link to myevents.php somewhere And thats it really :)
  14. Nicely Done my son ;) on me ed Cheers Matey :) Got myself an avatar made for me profile on here looks kinds cool if i do say so :)
  15. Re: [NOTAMOD]Free Crypting[NOTAMOD] TOO LONG TO POST RESULT but it becomes Base_64 crypted
  16. Re: [NOTAMOD]Free Crypting[NOTAMOD] this site will do exaclty the same http://www.rightscripts.com/phpencode/index.php
  17. Re: [MMCODE V2] Set Sell Price of houses after they are Purchased... for those who are seeing the message that their houses are being sold for $0 then alter this   $db->query("UPDATE users SET money=money+'{$np['hSELLPRICE']}',will=150,maxwill=150 WHERE userid=$userid",$c); print "You sold your {$np['hNAME']} for \$$j".money_formatter($r['hSELLPRICE'],'')." Minus Lawyer fees and went back to your shed.";   to this   $db->query("UPDATE users SET money=money+'{$np['hSELLPRICE']}',will=150,maxwill=150 WHERE userid=$userid",$c); print "You sold your {$np['hNAME']} for \$$j".money_formatter($np['hSELLPRICE'],'')." Minus Lawyer fees and went back to your shed.";
  18. Re: Lost my crons(v2) just goto a torrent site your bound to get a free one there ( NOT THAT I AGREE TO THEFT ) or google one :) Is bound to get a few Minus marks for my post now oops lol
  19. Re: New Houses Mod [Mccodes V2] I made a small booboo on the above script to remove from market so goto the function that removes from market and find this line..   mysql_query(sprintf("UPDATE `owned_houses` SET `uhouseRent` = '0', `uhouseRTime` = '0', `uhouseTenant` = '0' WHERE `uhouseId` = '2'", $_GET['id']));   and replace with   mysql_query(sprintf("UPDATE `owned_houses` SET `uhouseRent` = '0', `uhouseRTime` = '0', `uhouseTenant` = '0' WHERE `uhouseId` = '%u'", $_GET['id']));   Sorry about that
  20. Re: New Houses Mod [Mccodes V2] I was thinking about adding a per month price increase for house rentals as it would make this mod a lot more productive
  21. Uridium

    Help Please

    Re: Help Please I never like reading about learning things cos i could never take it all in. what i did find though was looking at a small script and deliberatley make an error in it to find what the outcome would be, Obviously an error message was displayed but i learnt that certain error messages reflected on certain mistakes i made so i knew instantly how to fix an error for the message displayed.. Do it in bite size chunks dont take on a big script get used to what statements do also having a decent text editor is a great idea like Notepad++ which is free and displays PHP in a colourful way so its easier to spot mistakes rather than using the rudamentry notepad that comes with windows..
  22. Re: New Houses Mod [Mccodes V2] * FOOT NOTE * when editing a rented property you will need to Remove it from the rented list first then edit it. I didnt want people thinking you could edit the Rentals whilst others were still able to rent :)
  23. Re: New Houses Mod [Mccodes V2] Just a small Update to Richards mod this upgrade will allow users to remove their house from being rented and will also allow them to edit the rental settings.. houses.php   <?php include_once('globals.php'); echo '<p class="heading">Your Houses</p>'; switch ($_GET['page']) { case 'move': move_house(); break; case 'move_out': move_out(); break; case 'estate': estate_agent(); break; case 'sell': sell_house(); break; case 'rentals': rental_market(); break; case 'rent': rent_house(); break; case 'removestart': remove_from_market_start(); break; case 'removal': remove_from_market_end(); break; case 'upgrade': upgrade_house(); break; default: houses_index(); break; } function houses_index() { global $ir; $houses = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseOwner` = '%u' || `uhouseTenant` = '%u') AND `uhouseId` != '%d'", $ir['userid'], $ir['userid'], $ir['house'])); echo '<table width="600"> <tr> <td width="50%" align="left">[url="houses.php?page=estate"]Estate agent[/url]</td> <td width="50%" align="center">[url="houses.php?page=rentals"]Rent a house[/url]</td> </tr> </table> '; if($ir['house']) { $fetch = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) WHERE (`uhouseId` = '%u')", $ir['house'])); $h = mysql_fetch_assoc($fetch); echo '[b]Current house:[/b] <table width="300" class="table"> <tr> <th width="50%">Current house</th> <th width="50%">Move out</th> </tr> <tr> <td>'.stripslashes($h['hNAME']).'</td> <td>[url="houses.php?page=move_out"]Move out[/url]</td> </tr> </table> '; } echo '<table width="600" class="table"> <tr> <th width="25%">House name</th> <th width="25%">Owner</th> <th width="25%">Mood value</th> <th width="25%">Manage</th> <th width="25%">Remove</th> </tr>'; if(!mysql_num_rows($houses)) { echo '<tr> <td colspan="5">You have no houses at this time, purchase one at the estate agent\'s.</td> </tr>'; } while($r = mysql_fetch_assoc($houses)) { echo '<tr> <td>'.stripslashes($r['hNAME']).'</td> <td>[url="viewuser.php?u='.$r['userid'].'"]'.stripslashes($r['username']).'[/url]</td> <td>'.number_format($r['uhouseMood']).' mood bar</td> <td>[url="houses.php?page=move&id='.$r['uhouseId'].'"]Move in[/url] [url="houses.php?page=sell&id='.$r['uhouseId'].'"]Sell house[/url] [url="houses.php?page=rent&id='.$r['uhouseId'].'"]Rent house[/url] [url="houses.php?page=upgrade&id='.$r['uhouseId'].'"]Add upgrades[/url]</td> <td>[url="houses.php?page=removal&id='.$r['uhouseId'].'"]Remove '.($r['hNAME']).'[/url]</td> </tr>'; } echo '</table>'; } function move_house() { global $ir; $fetch = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseId` = '%u')", abs((int) $_GET['id']))); if(!isset($_GET['id'])) { echo 'You did not select a house to move in to.'; } else if(!mysql_num_rows($fetch)) { echo 'You cannot move into a non-existant house.'; } else { $r = mysql_fetch_assoc($fetch); if($r['uhouseOwner'] != $ir['userid'] AND $r['uhouseTenant'] != $ir['userid']) { echo 'You are not permitted to move into this house.'; } else if($r['uhouseRTime'] AND $r['uhouseOwner'] == $ir['userid']) { echo 'You cannot move into a house while it is being rented to another member.'; } else { mysql_query(sprintf("UPDATE `users` SET `house` = '%d', `maxwill` = '%d' WHERE (`userid` = '%u')", abs((int) $_GET['id']), $r['uhouseMood'], $ir['userid'])); echo 'You have moved into the '.stripslashes($r['hNAME']).', You now have a maximum mood bar of '.number_format($r['uhouseMood']).'.'; } } } function move_out() { global $ir; $fetch = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseId` = '%u')", $ir['house'])); if(!mysql_num_rows($fetch)) { echo 'You cannot move out of a non-existant house.'; } else { $r = mysql_fetch_assoc($fetch); if($r['uhouseOwner'] != $ir['userid'] AND $r['uhouseTenant'] != $ir['userid']) { echo 'You are not permitted to move out of this house.'; } else { mysql_query(sprintf("UPDATE `users` SET `house` = '0', `maxwill` = '100' WHERE (`userid` = '%u')", $ir['userid'])); echo 'You have moved out of the '.stripslashes($r['hNAME']).', You now have a maximum mood bar of 100.'; } } } function sell_house() { global $ir; $fetch = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseOwner` = '%u') AND (`uhouseId` = '%u')", $ir['userid'], abs((int) $_GET['id']))); if(!isset($_GET['id'])) { echo 'You did not select a house to sell.'; } else if(!mysql_num_rows($fetch)) { echo 'You cannot attempt to sell a non-existant house.'; } else { $r = mysql_fetch_assoc($fetch); if($r['uhouseOwner'] != $ir['userid']) { echo 'You do not own this house, so don\'t attempt to sell it.'; } else if($r['uhouseTenant']) { echo 'You cannot sell a house while it is being rented to another member.'; } else { mysql_query(sprintf("UPDATE `users` SET `money` = `money` + '%d' WHERE (`userid` = '%u')", $r['houseCost'], $ir['userid'])); mysql_query(sprintf("DELETE FROM `owned_houses` WHERE (`uhouseId` = '%u')", abs((int) $_GET['id']))); echo 'You have sold the '.stripslashes($r['hNAME']).' for a total of $'.number_format($r['hPRICE']).'.'; } } } function estate_agent() { global $ir; if(isset($_GET['id'])) { $house = mysql_query(sprintf("SELECT * FROM `houses` WHERE (`hID` = '%u')", abs((int) $_GET['id']))); $r = mysql_fetch_assoc($house); if(!mysql_num_rows($house)) { echo 'You cannot attempt to purchase a non-existant house.'; } else if($ir['money'] < $r['hPRICE']) { echo 'You cannot afford to purchase this house right now, come back another time.'; } else { mysql_query(sprintf("UPDATE `users` SET `money` = `money` - '%d' WHERE (`userid` = '%u')", $r['hPRICE'], $ir['userid'])); mysql_query(sprintf("INSERT INTO `owned_houses` (`uhouseId`, `uhouseOwner`, `uhouseHouse`, `uhouseMood`) VALUES ('NULL','%u', '%d', '%d')", $ir['userid'], $r['hID'], $r['hWILL'])); echo 'You have purchased the '.stripslashes($r['hNAME']).' for a total of $'.number_format($r['houseCost']).'!'; } } else { $houses = mysql_query(sprintf("SELECT * FROM `houses` ORDER BY `hWILL` ASC")); echo '<table width="600" class="table"> <tr> <th>House name</th> <th>Mood value</th> <th>Cost</th> </tr>'; while($r = mysql_fetch_assoc($houses)) { echo '<tr> <td>[url="houses.php?page=estate&id='.$r['hID'].'"]'.stripslashes($r['hNAME']).'[/url]</td> <td>'.number_format($r['hWILL']).' mood bar</td> <td>$'.number_format($r['hPRICE']).'</td> </tr>'; } print '</table>'; } } function rental_market() { global $ir; if(isset($_GET['id'])) { $house = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseId` = '%u')", abs((int) $_GET['id']))); $r = mysql_fetch_assoc($house); if(!mysql_num_rows($house)) { echo 'You cannot rent a house that does not exist.'; } else if($r['uhouseOwner'] == $ir['userid']) { echo 'You own this house at this time, You cannot rent it aswell.'; } else { mysql_query(sprintf("UPDATE `owned_houses` SET `uhouseTenant` = '%d' WHERE (`uhouseId` = '%u')", $ir['userid'], abs((int) $_GET['id']))); echo 'You are now renting the '.stripslashes($r['hNAME']).' for a total of $'.number_format($r['uhouseRent']).' each night!'; } } else { $houses = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE `uhouseTenant` = '0' AND `uhouseRent` > '0' ORDER BY `uhouseRent` ASC")); echo '<table width="600" class="table"> <tr> <th>House name</th> <th>Owner</th> <th>Mood value</th> <th>Cost each night</th> <th>Rental time</th> <th>Manage</th> <th>Remove</th> </tr>'; while($r = mysql_fetch_assoc($houses)) { echo '<tr> <td>'.stripslashes($r['hNAME']).'</td> <td>[url="userprofile.php?id='.$r['userid'].'"]'.stripslashes($r['username']).'[/url]</td> <td>'.number_format($r['uhouseMood']).' mood bar</td> <td>$'.number_format($r['uhouseRent']).'</td> <td>'.number_format($r['uhouseRTime']).' nights</td> <td>[url="houses.php?page=rentals&id='.$r['uhouseId'].'"]Rent house[/url]</td> <td>[url="houses.php?page=removal&id='.$r['uhouseId'].'"]Remove '.($r['hNAME']).'[/url]</td> </tr>'; } print '</table>'; } } function rent_house() { global $ir; $fetch = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseOwner` = '%u') AND (`uhouseId` = '%u')", $ir['userid'], abs((int) $_GET['id']))); if(!isset($_GET['id'])) { echo 'You did not select a house to rent out to members.'; } else if(!mysql_num_rows($fetch)) { echo 'You cannot attempt to rent out a non-existant house.'; } else { $r = mysql_fetch_assoc($fetch); if($r['uhouseOwner'] != $ir['userid']) { echo 'You do not own this house, so don\'t attempt to rent it out to people.'; } else if($r['uhouseTenant']) { echo 'You cannot rent out a house while it is being rented to another member.'; } else { if(isset($_POST['time']) AND isset($_POST['cost'])) { mysql_query(sprintf("UPDATE `owned_houses` SET `uhouseRent` = '%d', `uhouseRTime` = '%d' WHERE (`uhouseId` = '%u')", abs((int) $_POST['cost']), abs((int) $_POST['time']), abs((int) $_GET['id']))); echo 'You have added the '.stripslashes($r['hNAME']).' the the rental market at a cost of $'.number_format($_POST['cost']).' per night.'; } else { echo '<form action="houses.php?page=rent&id='.$_GET['id'].'" method="post"> <table width="600"> <tr> <td>[b]Amount of nights:[/b]</td> <td><input type="text" name="time" value="30" /></td> </tr> <tr> <td>[b]Cost per nights:[/b]</td> <td><input type="text" name="cost" value="250" /></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="Submit rental" /></td> </tr> </table> </form>'; } } } } function remove_from_market_end() { global $db,$ir,$c,$h,$userid; $fetch = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseOwner` = '%u') AND (`uhouseId` = '%u')", $ir['userid'], abs((int) $_GET['id']))); if(!isset($_GET['id'])) { echo 'You did not select a house to remove from the market.'; } else if(!mysql_num_rows($fetch)) { echo 'You cannot attempt to rent out a non-existant house.'; } else { $r = mysql_fetch_assoc($fetch); if($r['uhouseOwner'] != $ir['userid']) { echo 'You do not own this house, so don\'t attempt to rent it out to people.'; } else if($r['uhouseTenant']) { echo 'You cannot remove a rented house whilst it\'s being lived in by another member.'; } //if(isset($_POST['time']) AND isset($_POST['cost'])) { mysql_query(sprintf("UPDATE `owned_houses` SET `uhouseRent` = '0', `uhouseRTime` = '0', `uhouseTenant` = '0' WHERE `uhouseId` = '2'", $_GET['id'])); echo '<h1> '.stripslashes($r['hNAME']).' Will no Longer Be classed as a Rented Property</h1> [url="houses.php>["]> RETURN << ][/url]'; } //else { } } } function upgrade_house() { global $ir; if(!isset($_POST['id'])) { if(isset($_GET['id'])) { echo '<form action="houses.php?page=upgrade&id='.$_GET['id'].'" method="post" name="upgrades"> <table class="table" width="600"> <tr> <th width="45%">Upgrade name</th> <th width="25%">Mood gain</th> <th width="25%">Cost</th> <th width="5%"></th> </tr>'; $fetch = mysql_query("SELECT * FROM `house_upgrades` ORDER BY `upgradeMood` ASC"); while ($r = mysql_fetch_assoc($fetch)) { echo '<tr> <td>'.stripslashes($r['upgradeName']).'</td> <td>'.number_format($r['upgradeMood']).' mood</td> <td>$'.number_format($r['upgradeCost']).'</td> <td><input type="radio" name="id" value="'.$r['upgradeId'].'" onClick="document.upgrades.submit();" /></td> </tr>'; } echo '</table>'; } else { echo 'You did not select a house to add upgrades to.'; } } else { $upgrade = mysql_query(sprintf("SELECT * FROM `house_upgrades` WHERE `upgradeId` = '%u'", abs((int) $_POST['id']))); if(!mysql_num_rows($upgrade)) { echo 'This upgrade does not exist at this time, if this problem continues report it to staff.'; } else if(!isset($_GET['id'])) { echo 'You did not select a house to add upgrades to.'; } else { $house = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `houses` ON (`hID` = `uhouseHouse`) LEFT JOIN `users` ON (`userid` = `uhouseOwner`) WHERE (`uhouseId` = '%u')", abs((int) $_GET['id']))); $h = mysql_fetch_assoc($house); $r = mysql_fetch_array($upgrade); if(!mysql_num_rows($house)) { echo 'You cannot add upgrades to a non-existant house.'; } else if($h['uhouseOwner'] != $ir['userid']) { echo 'You are not permitted to add upgrades to this house.'; } else if($ir['money'] < $r['upgradeCost']) { echo 'You do not have enough cash to purchase this upgrade right now.'; } else { $check = mysql_query(sprintf("SELECT * FROM `owned_upgrades` WHERE (`ownupHouse` = '%u') AND (`ownupUpgrade` = '%d')", abs((int) $_GET['id']), abs((int) $_POST['id']))); if(mysql_num_rows($check)) { echo 'This house has this upgrade at this time, it cannot be bought again.'; } else { mysql_query(sprintf("UPDATE `users` SET `money` = `money` - '%d' WHERE `userid` = '%u'", $r['upgradeCost'], $ir['userid'])); mysql_query(sprintf("UPDATE `owned_houses` SET `uhouseMood` = `uhouseMood` + '%d' WHERE `uhouseId` = '%u'", $r['upgradeMood'], abs((int) $_GET['id']))); mysql_query(sprintf("INSERT INTO `owned_upgrades` (`ownupId`, `ownupHouse`, `ownupUpgrade`) VALUES ('NULL','%u', '%d')", abs((int) $_GET['id']), abs((int) $_POST['id']))); echo 'You have purchased the '.stripslashes($r['upgradeName']).' for $'.number_format($r['upgradeCost']).'.'; } } } } } $h->endpage(); ?>
  24. Re: viewuser Put up a screenie of your current Viewuser so we have an idea what that layouts like
  25. This is quite useful for those that have the same url link on multiple files and want to change the name of the actual file name. example there are various files that can use the viewuser.php but if we changed the filename to say look_at_user.php then we would have to change every files so it matches the new link.. what this trick does is it lets you change the config.php file so every link for look_at_user.php is automatically updated on every file that calls for the file.. so for arguments sake we want to add a new staff.php name which we will call staff_new_name.php so open up config.php after the cron code add a , at the end and add $staff_file = 'staff_new_name' now open up mainmenu.php and under the <? add include "config.php"; and change the url for the staff link to if your using the echo statement echo "Staff Menu"; or this if your using the print statement print "Staff Menu "; change name of the file as well so it reflects to staff_new_name.php << this is just an example name obviously... repeat the procedure for all the new file names you want to create.
×
×
  • Create New...