
bluegman991
Members-
Posts
394 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Events
Everything posted by bluegman991
-
Last time I checked JavaScript is executed as soon as it is loaded. The only way to have javascript execute After the DOM is loaded is by binding it to an onload event or placing it at the end of the DOM. Consider the following: http://pastebin.com/aYM00JHh Edit: Had to link to paste bin because of the poor bbcode parsing. Put this code into an html page and view it in your browser. "0" will be alerted because the JavaScript was loaded and executed before the DOM was loaded. The same thing would happen if you were to put the JavaScript into a separate file. HTML script tags by default are loaded synchronously so if the code is at the top of the page it will have no choice but to load first and execute. So if you don't want the code to run until after the DOM is loaded you will have to bind it to an onload event or place the code at the end of the DOM.
-
If you want stylish and cross browser compatible scrollbars? Then use javascript, html, and css. (A bit more coding: 100's of lines depending whether or not a library is used) If you want a cross browser compatible scrollbar whos style is defined by the browser/os then use just css. (can be done with a minimum of two lines of code)
-
The template is descent but there are a few things wrong. @The name of your game and short description (Fearless City: The city of lost heaven) I can't exactly tell the mood of your game. But either way the color scheme doesn't mesh. Your font used with a red foreground suggest that it is a city of chaos. But your main background color (white) along with your game title and description suggest that your game is a heavenly game with angels and etc... @The icons at the bottom The stand out too far from the template and color scheme and are over sized. @The navigation menu title Text effects and background color stand out too far from the template and color scheme.
-
Didn't say I wanted json. Yea it definitely makes more sense the way they did it. But i'm basically saying I wanted something that would require less typing. It could have been $blah=['a'='value a', 'b'='value b']; or $blah=['a'>'value a', 'b'>'value b']; for all I care. As long as it was shorter.
-
I'm happy they added dereferencing. No more wasting time/memory storing it in a variable first. Traits will be great for developing scripts that have have consistent methods. Allowing for an easily remembered api. Binary is a nice addition. Can make low level code management and/or certain tasks a bit more understandable (for some people). The shortened literal array syntax is nice but could be shorter. If you don't know the shortened syntax is: $blah=['a' => 'value a','b' => 'value b']; This only made making an array 5 less characters to type. I wish they had went with this shortened syntax instead: $blah=['a':'value a','b':'value b']; Upload progress for files. Yayy. No more need for flash to have a good looking upload system.
-
Lol php6 doesn't exist yet. These functions were completely remove in php 5.4 Which was released 3 days ago.
-
PHP's default precision is 14. Therefore the maximum number it can handle w/o loosing precision is 99,999,999,999,999.0(99 trillion) (without decimal places that is). The more decimal places you the lower your whole number precision gets. With that being said if the number in your db is higher than the number above or has more number places than the number above, then you will need to use a different method of showing, reading, and manipulating the numbers. If the number is not larger than the above number then the problem is being caused by an action being performed on the number. The problem is not with number_format's max precision is the same as php's so that will not be the problem unless the number as more places than the number above. The maximum signed value for an integer is 21bill and something. Therefore when you typecast to an integer you will get an (silent) error if the number is above 21 and some billion. So all you have to do is this. Change something like this: $strength=(int) a+(b*c); To... $strength=a+(b*c);
-
Lol. Your using $_POST when you should be using $_GET
-
Boots in any file which shows your stats. Go through it and find any occurrence of "(int)" and take it out.
-
Lol. Had fun making him dance.
-
Yep, I seen that after I tried typing in all the letters of the alphabet. Still Can't figure it out though. Is there like a hidden clue in the question or something? All I can see is: The question is for coding geeks The answer is the full name of something The answer is a descendant of something The answer starts with a "B" Then at the end it says 3rd letter. Could that mean "C". (the third letter of the alphabet) If so where does it fit in. Then from the hint page, It says, "needs 4 letters". Would that be indicating, the answer is 4 letters long. Or the answer needs 4 more letters. Until I found out what this something is I am completely stuck. Without knowing what that something is, the best word I could come up with is "BETA". Because (coding geeks) sometimes put there code up for beta testing. Couldn't link it to the full name part (since beta is the only term it is referred to as) It is the descendant of alpha testing It starts with a "B"
-
O.K. Now I'm on 3. Am I looking for the 3rd letter of something? Or Am I looking for the fullname of something? Also what is that something I'm looking for? All I know so far is. The answer is for coding geeks. And I'm looking for a letter or name.
-
What's the format? http://temp.nowhere-else.org/webquest/firstAnswer/nextAnswer Or http://temp.nowhere-else.org/webquest/nextAnswer Then http://temp.nowhere-else.org/webquest/answerAfterThat
-
Confused after question 2. Confused on how to enter the answer first off. Do I go to http://temp.nowhere-else.org/webquest/42/nextAnswer or do I go to http://temp.nowhere-else.org/webquest/nextAnswer Also for question 2. When you say when. Are you looking for a year? A date? A century?
-
Hi to All! A Text Based Mafia game - Trigger Happy Mafia!
bluegman991 replied to KashBFD's topic in Game Projects
[noparse]<?php session_start(); include_once "includes/db_connect.php"; include_once "includes/functions.php"; $username = $_SESSION['username']; $query = mysql_query("SELECT * FROM users WHERE username='$username'"); $fetch = mysql_fetch_object($query); $query_bf = mysql_query("SELECT * FROM bf WHERE location='$fetch->location'"); $fetch_bf = mysql_fetch_object($query_bf); $new_time = time() + 150; $up = mysql_fetch_object(mysql_query("SELECT * FROM bf")); $a = mysql_query("SELECT * FROM bf WHERE location='$fetch->location'"); while ($b = mysql_fetch_object($a)) { $user = mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$b->owner'")); $minus = $user->money - 1000; if ($user->money <= $minus) { mysql_query("UPDATE bf SET owner='0', producing='0' WHERE id='$b->id'"); $crap = 1; } if ($fetch_bf->producing == "Yes" && $up->next_restock < time() && $crap != "1") { mysql_query("UPDATE bf SET stock=stock+2000"); mysql_query("UPDATE bf SET next_restock='$new_time' WHERE id='1'"); mysql_query("UPDATE users SET money='$minus' WHERE username='$b->owner'"); } } ?>[/noparse] Code was killing my eyes. Had to run it through a beautifier. Now that I can read it. It looks like this is what is updating everything. So, it seems to me, that all you need to do is have the page called, by a cron handler. I haven't used or setup a cron using cpanel in years so i forgot which order you have to input things. So get me a print screen of your cron page, and I can help you with that. Or i'm sure someone else will help you if they know. If you have already set it up and it's not working, then... For the cron url try using "curl path/to/file" instead of just "path/to/file". Also make sure you have the numbers in the right places for the cron setup form, because you could have it set for something like 5 hours or 5 days instead of 5 minutes. -
It would be a lot of math to make a 3rd dimension, but its definitely possible. Although there probably, most likely would be a lot of lag unless you are using html5 canvas (which 3d games have been made with). So what are you using? The HTML Dom? If so did you do the math yourself or did you pick up the 3d math off of another website [*]The HTML5 Canvas? [*]Could you have possibly meant Java and not Javascript [*]Could you have possibly meant to say flash which uses actionscript not javascript?
-
Do you mean like GTA 2- style or GTA 3+ style? GTA 2 is in 2d displayed from top pov. While gta 3 and above is in 3d displayed in 3rd person pov. Or are do you mean it's text based with javascript effects.
-
Lol, sorry about that. Edited my post.
-
That would work to. I didn't suggest a join because I have no idea what the max joins are for her host. It's probably safe to assume that max join is not less than 2.
-
What you can do is make 5 different queries selecting the needed fields. Then fetch the array of each of them then merge the arrays. $id=abs((int) $_GET['u']); $q1="SELECT * FROM `users` WHERE `userid`=$id"; $q2=select next table blah blah; ... $q5=select last table blah bla; //run queries $q1=$db->query($q1) ... to $q5 //fetch each row and pump into array $q1rows[]=$db->fetch_row($q1) $userdata=array_merge($q1rows,$q2rows,$q3rows,$q4rows,$q5rows);
-
Could your host have possibly lowered the max join size?
-
Updated the post to quote the latest version of mysql.
-
I did delete something from the table didn't you see the part where it said "and deleted some rows". Besides I tried it both ways (with and without deleting rows) and it still reset auto increment to 0. Try it out for yourself. Here's proof that it resets it to 0. Quoted from http://dev.mysql.com/doc/refman/5.0/en/truncate-table.html ^^The above quote is to show since which version mysql has been resetting auto increment to 0. Here is the same thing quoted from the latest version http://dev.mysql.com/doc/refman/5.6/en/truncate-table.html
-
Assuming you mean you want to find the exact time between 2 dates. This is what i made up. [noparse]function timeDiff($ts1,$ts2) { $ts1=(int) $ts1; $ts2=(int) $ts2; $time=max($ts1,$ts2)-min($ts1,$ts2); $years=floor($time/60/60/24/364.25); $time=(float) ($time-($years*364.25*24*60*60)); $days=floor($time/60/60/24); $time=(float) ($time-($days*24*60*60)); $hours=floor($time/60/60); $time=(float) ($time-($hours*60*60)); $minutes=floor($time/60); $time=(float) ($time-($minutes*60)); $seconds=(float) $time; $return=$years>0 ? $years.'y' : ''; $return.=$days>0 ? (empty($return) ? '' : ' ').$days.'d' : ''; $return.=$hours>0 ? (empty($return) ? '' : ' ').$hours.'h' : ''; $return.=$minutes>0 ? (empty($return) ? '' : ' ').$minutes.'m' : ''; $return.=$seconds>0 ? (empty($return) ? '' : ' ').$seconds.'s' : ''; $return=empty($return) ? 'NOW!' : $return; return $return; }[/noparse]
-
@spudinski I just created a table and deleted some rows from it then truncated it and surely enough it reset auto increment to 0 @op If you do not want to reset everyones id. Then each time a user registers you should scan through the users table and check for gaps and a sign new users, id #'s that are in the gap. If you do not mind resetting everyones id. Then back up the table, then copy / paste the sql into the query textarea of phpmyadmin (or whatever mysql manager you may be using). Before running query. Remove any create table query's, remove query were auto increment is set, and remove part of query where id is set.