-
Posts
2,491 -
Joined
-
Last visited
-
Days Won
196
Content Type
Profiles
Forums
Events
Everything posted by Dayo
-
This code is not 100% mine it is just mccodes lite secured/improved ... The core scripts are for learners to learn from and for advanced coders to build upon without having to go thro and secure the files the name will me MCLR mc codes lite revamped as it's still mainly mccodes
-
yea i was thinking about the forums, i was thinking about just intergrating usebb in to it as default with the option to enable/disable it but that would be at a later date as for beta testers i will be adding the scripts to my server for users to try and hack/exploit/find bugs as for jail and hospitali will add that and make it using timestamps insted of crons ... asi hate crons oh yea i forgot to mention i will be removing the crons so that they run by the users (user specific crons not global crons)
-
Yea :D
-
There will be the option for fbml or iframe
-
Can people post below known bugs (not hacks pm them to me) I am recoding the lite version so it is a ready to use secure game with the option to intergrate into facebook (paid version (only 25-50 usd)) I have secured te scripts agains SQL injections and hacks such as the auto admin by changing each and every feild name so $ir['userid'] would be $ir[PREFIX.'userid'] (prefix defined on instilation) ... Yes I know there ate better ways to do this but I done it like this so if there was ever a vunrability in the scripts and added mods they would have to guess the prefix also all errors are hidden so they cantt force an SQL error showing the prefix Like I said this will be free with the option to upgrade for $55 and get it intergrated with facebook for this all you do is run an installer and it will do the rest for you (please note it will run of 1 script so you can have a web version and an facebook version) ATM this is 75% complete for the normal web version and 20% for the facebook version
-
Welcome back, I think I remember you, what a nick name the noob almost as bad as my old nick name back in yr9 ... It was like dayo but started with a diffrent letter :rolleyes: So imature :P enough ranting for now
-
If you do user spesific timestamps eg a 10 min cron that updates users online do it so it only affects that user not everyone
-
same thats why i like to make functions, gives me an excuse when it dont work ... blame the servers :P
-
Timestamps - Tutorial Talking on IRC today someone was saying how they use crons insted of using timestamps, in my mind timestamps are much better then a cron (when used propely) here are a few tips on how to use timestamps, i have made a few functions to help using timestamps more easier. Functions // Timestamp Tutorial // Made By Dayo // Functions by: Dayo class ts{ // This function comes in handy when you come to use timestamps. function secs($day=0, $hours=0, $min=0, $sec=0) { $total = ($day*24*60*60)+($hours*60*60)+($min*60)+$sec; return $total; } function tstotime($var) { // There are 60 seconds in a minute and 3600 seconds in a hour as well as 86400 seconds in a day $return=array(); $return['d']=floor($var/86400); $var=$var-($return['d']*86400); $return['h']=floor($var/3600); $var=$var-($return['h']*3600); $return['m']=floor($var/60); $var=$var-($return['m']*60); $return['s']=$var; return $return; } // This function will check your timestamps and will return TRUE or FALSE if it is TRUE prosess your info if not show an error. function check($check) { if (time() >= $check){ return TRUE; } else { return FALSE; } } // this will tell you when your timestamp was last run $type must either be D, H, M, S (for days, hours, mins, seconds). function lastrun($check, $type) { $diff=time()-$check; if ($type=='D') { return floor($diff/86400); } else if ($type=='H') {return floor($diff/3600);} else if ($type=='M') {return floor($diff/60);} else if ($type=='S') {return $diff;} } } $ts=new ts; How to use $ts->secs($days, $hours, $mins, $secs); This just converts the specified ammount of days/hours/mins/seconds to secconds BUT you have to specify each one so if you wanted 1 hour you cant do $ts->secs('1') you have to do $ts->secs('', '1', '', '') $ts->tstotime($var); Cant beleive i didnt add this, all this does is divides a timestamp up into days, hours, minutes and seconds. You use it like $ts->tstotime(90061) and that would return an array with the values 'd'=>1, 'h'=>1, 'm'=>1, 's'=>1 $ts->check($check); This checks if your date specified is before the current date if it is it will return true if not it will be false $ts->lastrun($check, $type); This function will return how many days, hours, mins or seconds since the specified date was last run. $type must be either D, H, M or S. also since this rounds the value down there will be a remainder of seconds/mins/hours you may want to find that out, ill edit the function later to return the remainder too Examples First of all we will be using time() when echo'ed it will produce someting like 1267039058 (i think i read somewhere this is the amount of seconds since 01/01/1970: 00:00:00). Now your probley wondering, how am i spose to use this well there is a number of ways you can use it, lets say you have a user you want to put in jail for 5 mins you can use the folowing code $jtime=time()+(5*60); mysql_query("UPDATE `users` SET `jail`={$jtime} WHERE id={$id}"); //code to check if user is in jail if($ts->check($user['jail'])) { // not in jail } else { // in jail } //code to check if user is in jail inverted else function by using a `!` if(!$ts->check($user['jail'])) { // in jail } else { // not in jail }
-
Problems Problems....I Have Tried I Swear..Please Help
Dayo replied to protek123's topic in General Discussion
try this <?php session_start(); 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; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } print <<<EOF <!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> <title>{$set['game_name']}</title> <script language="JavaScript"> <!-- function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function DeleteCookie (name,path,domain) { if (GetCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } // --> </script> <script language="JavaScript"> var usr; var pw; var sv; function getme() { usr = document.login.username; pw = document.login.password; sv = document.login.save; if (GetCookie('player') != null) { usr.value = GetCookie('username') pw.value = GetCookie('password') if (GetCookie('save') == 'true') { sv[0].checked = true; } } } function saveme() { if (usr.value.length != 0 && pw.value.length != 0) { if (sv[0].checked) { expdate = new Date(); expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000)); SetCookie('username', usr.value, expdate); SetCookie('password', pw.value, expdate); SetCookie('save', 'true', expdate); } if (sv[1].checked) { DeleteCookie('username'); DeleteCookie('password'); DeleteCookie('save'); } } else { alert('You must enter a username/password.'); return false; } } </script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .over { background-image: url(images/nav2.gif); } body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xxx-small; color: #FFFFFF; font-family:calibri, helvetica, arial, geneva, sans-serif; font-size: xxx-small;;color: black; } 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; } a:link { font-weight: bold; color: 5A9F00; text-decoration: none; } a:hover { font-weight: bold; color: #FFFFFF; } a:visited { color: 5A9F00; } .table { background-color:#000000; } .table3 { background-color:#000000; } .table td { background-color:#DEDEDE; height:22px; } .table3 td { background-color:#CCCCCC; } td .alt { background-color:#EEEEEE; height:22px; } td .h { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } .table th { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } --> </style> <style type="text/css"> <!-- input { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; border: 1px; background-color: #4A4A4A; } --> </style> </head> <body bgcolor="#262626" onLoad="MM_preloadImages('images/showshoutboxover.gif')"> <table width="95" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>[img=images/topleftheader.jpg]</td> <td>[img=images/topdigitanimated.gif] [img=images/topbaranimated.gif]</td> <td>[img=images/toprightheader.jpg]</td> </tr> </table></td> </tr> <tr> <td>[img=images/header_blank.jpg]</td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>[img=images/tleftm.gif]</td> <td valign="top">[img=images/bottombaranimated.gif] [url="#"][img=images/showshoutbox_blank.gif][/url] </td> <td>[img=images/tlrightm.gif]</td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="172" valign="top"> [/b]</font></div></td> </tr> </table> </td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/mcbg.gif"> <tr> <td>[img=images/maincontent_blank.gif]</td> </tr> <tr> <td><table width="95%" height="100%" border="0" align="top" cellpadding="0" cellspacing="1"> <tr> <td width="10%" ><div align="center"><font size="1"> EOF; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$IP)) { die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this.</font>[/b]</body></html>"); } $year=date('Y'); print "<h3>> {$set['game_name']} Log-In</h3> <table width=50%> <tr> <td width=50%> <fieldset> <legend>About {$set['game_name']}</legend> {$set['game_description']} </fieldset> </td> <td> <fieldset> <legend>Login</legend>"; print "<form action=authenticate.php method=post name=login onsubmit=\"return saveme();\">Username: <input type=text name=username> Password: <input type=password name=password> Remember me? <input type=\"radio\" value=\"ON\" name=\"save\">Yes <input type=\"radio\" name=\"save\" value=\"OFF\" checked>No <input type=submit value=Submit></form></fieldset></td></tr></table> <h3>[url='register.php']REGISTER NOW![/url]</h3> [i]<center>Powered by codes made by Dabomstew (© {$year}). Game Copyright ©{$year} {$set['game_owner']}.</center>[/i]</table>"; print <<<OUT [/b]</font></div></td> </tr> </table> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/mcbg.gif"> <tr> <td>[img=images/copyright_do_not_remove.gif]</td> </tr> <tr> <td><table width="95%" height="100%" border="0" align="top" cellpadding="0" cellspacing="1"> <tr> <td width="10%" ><div align="center"><font size="1"> <tr> <td><table width="95%" height="100%" border="0" align="top" cellpadding="0" cellspacing="1"> <tr> <td width="10%" ><div align="center"><font size="1"> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="dgradl"></td> <td class="dgrad"></td> <td class="dgradr"></td> </tr> </table> </td> </tr> </table> </body> </html> OUT; ?> -
v1.0.2 Relesed Bug Fix - users now cant submit nothing Chat lines are deleted every 24 hours to reduce server space (editable see README file) Instalation instructions added, for the few who dont know how to :rolleyes: Enjoy :D
-
source is avalable for download at http://www.cddesigns.org/downloads.php - Enjoy :D
-
yea i see that to plus header_01 is 1px out also it looks like this <div class="sitewrap"></div> is ment to be around the rest of your content that will center all your images and make it look much better
-
v1.0.1 relesed boolean error fixed, delet posts added, 4 bb coides removed (code, size, img and quote) if you want any of these just uncomment them in receive.php Enjoy :D
-
[align=center]FREE AJAX CHAT[/align]Hi i found this old chat script on my computer, i found the simple ajax chat on the web at 1st it used an external file called chat.txt to add/read content ive edited it to run off mysql this is only a simple chat script that alows you to post and chat, i will be intergrating diffrent options as i update the mod. Things like chat ban, remove/edit post etc... Please note i did not make the chat nor the bbcode function they were scripts i have on my computer made by someone else ... they were free to distribute i will find links to original source if i can find them all i did was convert the chat to work with mccodes and a mysql backend insted of reading from a txt filehere is the download link ... http://www.cddesigns.org/mods.php?dl=ajchat Enjoy :D
-
agreed also unforgivenwar used v2 - was rather basic when i 1st played just with a few mods thrown on it
-
you could always use an irc client like wsirc i made a intergrated version for mccodes
-
1) For a template can I google images and use them or is that illegal? if the image is copyrighted and you poassit off as your own yes it it you may be able to ask premision to use it 2) Is it illegal to buy a custom template and resell it later? if you ask the seller they may let you sell it on they might say you have to refer to them when selling
-
how did this thread get from badges to harry potter? ....
-
can external links be opened in a new page it is realy anoying having to right click and press open in a new tab
-
agreed karma was/would be a better way to do this that way if you anoy a little kid he cant destroy your reputation by blacklisting you with karma he could only give you a -1
-
try this then $_SESSION['uGang']=''; if (!isset($_SESSION['uGang'])) { $fivgz=$db->query("SELECT gangNAME, gangID FROM gangs ORDER BY gangRESPECT DESC LIMIT 3"); while($r=$db->fetch_row($fivgz)) { $_SESSION['uGang'] =$_SESSION['uGang']."[size="1"]<a href='gangs.php?action=view&ID={$r['gangID']}'>{$r['gangNAME']}<a> [/size]";} } else {echo $_SESSION['uGANG'];}
-
the inventory was never made, not by me anyway. as for the css genorator ill have alook throgh my old site back-up for it and upload tonight/tomorow
-
with the new release of the wsirc i will be making the options into a staff page so you dont have to edit the source code, ill also update a few things that comealong with the wsirc client
-
No problem mate, glad to see my old mods r still getin used I may release a new version soon so it will be easier for admins to add catagorys and links