
AlabamaHit
Members-
Posts
1,308 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by AlabamaHit
-
Ok, this is not complete yet, but posting it so you know I haven't forgot...So far it appears it works on everything EXCEPT for the top of the page. I have not added that yet. When I get that in. I will Make another topic. Maybe the mods here will sticky it. Cause I know it will be useful to a lot of people. <?php /****** ***Mccode page converter ***Created by AlabamaHit ***Enjoy, and give credit where due. ******/ echo '<h2>Code Convertor</h2>'; if(isset($_POST['v1'])) { $old = array('fetch_row','$db->'); $new = array('fetch_assoc','mysql_'); $newtext = str_replace($old, $new, $_POST['code']); echo ' <h2>Code Converted to v1</h2> <form action="convertor.php" method="post" name="form"> <textarea rows="150" cols="150" name="code">'.$newtext.'</textarea> <input type="submit" name="v2" value="Go Back" /> </form>'; focus(); } else if(isset($_POST['v2'])) { $old = array('fetch_array','mysql_','global $ir'); $new = array('fetch_row','$db->','global $db,$ir'); $newtext = str_replace($old, $new, $_POST['code']); echo ' <h2>Code Converted to v2</h2> Just remeber there still might be some errors. This don\'t work 100% of the time. <form action="convertor.php" method="post" name="form"> <textarea rows="150" cols="150" name="code">'.$newtext.'</textarea> <input type="submit" name="v1" value="Go Back" /> </form>'; focus(); } else { echo ' Place code in text box and click on how to convert it. <form action="convertor.php" method="post" name="form"> <textarea rows="150" cols="150" name="code"></textarea> <input type="submit" name="v1" value="Convert to v1" /> <input type="submit" name="v2" value="Convert to v2" /> </form>'; focus(); } // //No reason really for this. //But I'm using it anyway. function focus() { echo '<script type="text/javascript" language="JavaScript">'; echo "document.forms['form'].elements['code'].focus();"; echo '</script>'; } ?> Remeber this is not done yet.
-
Javascript - Focus on input field on page load
AlabamaHit replied to AlabamaHit's topic in Other Programming
Yup exactly. Just makes it quicker and easier, because it loads you in the field your typing in already. (Also, remeber, I just found the code online. I didn't write it up. Just made a function out of it.) -
Give me til tonight. I will make everyone a working convertor. I just have to run down the road for a couple hours. Then I'll finish a when I get back. So don't everyone go making one, lol, I"m 85% done already, just have to handle some stuff, then I'll finish it. It will be done tonight. Maybe staff will sticky my post with it??
-
Javascript - Focus on input field on page load
AlabamaHit replied to AlabamaHit's topic in Other Programming
Yeah your probarly right, lol. -
Javascript - Focus on input field on page load
AlabamaHit replied to AlabamaHit's topic in Other Programming
No problem, glad you like it. I was hoping that people would find it useful. :) -
Javascript - Focus on input field on page load
AlabamaHit replied to AlabamaHit's topic in Other Programming
Yeah on the engine I'm working on, I'm making the page focus on the first input on any page that has an input.. So, if using mccodes, I would agree completely, pages like login, register, bank, home page(index) focus on notepad, etc... In mccodes I would put it in the global function page, But if using on login, you will have to put it on the page. So really wouldn't need the functnion. Just adding the javascript itself to pages like that. -
First off, I in 'no' way take credit for writing this script. I just found it on 'google'. (Sorry, I can't remeber where.). What I did was took the javascript and made a super simple function out of it, to save typing so you can use it on all your pages you want. Sorry, I don't have an example of this, I don't have hosting for my engine (yet). So I have nothing online to show this. I made this for my engine. But it's just a function so it will work on anything.. Here is the function (Don't talk bad about it. It's VERY simple, not complex. I Know that there are lots of ways of doing this.). function focus'$form,$input) { echo '<script type="text/javascript" language="JavaScript">'; echo "document.forms['".$form."'].elements['".$input."'].focus();"; echo '</script>'; } Now it used in action. (Just an example so please don't pick at it. or try to talk bad about it. echo ' <form action="PAGENAME" method="post" name="form_name_here"> <input type="text" name="input_name" value="Nothing" /> <input type="submit" value="Do It" /> </form>'; //Now we use the function. focus('form_name_here','input_name'); //Yes it MUST be AFTER the FROM! <-- Very important or it will not work. //First name is forms name. <-- In example it is (form_name_here) //Second is the Inputs name that you want it to put the cursor on when loaded. <-- In example it is (input_name) //Now, when they load the page it will put the cursor in that input everytime :) Hope you enjoy, yeah I know this is really nothing special. But I'm sure there are lots of people like me that are lazy :P. I use stuff like this all the time to save typing. I'm sure everyone is going to say how they would have done it, lol.. But that is ok :thumbsup:
-
So...what? Your laughing at your speeds compared to mine LOL :P
-
:D :P
-
If you don't like scrolling press the "End" button it will take you to the bottom of the page..............
-
Javascript or Ajax really isn't a good way, an user can turn that off.. Just an idea maybe someone can help with this..Using sessions if(isset($_POST['stuff'])) { if(isset($_SESSION['stop_refresh'])) { unset($_SESSION['stop_refresh']); echo 'Ok'; } else { echo 'no'; } } else { $_SESSION['stop_refresh'] = mt_rand(1,5000); echo 'Your page stuff <form action="PAGE" method="post"> <input type="text" name="stuff" value="Whatever" /> <input type="submit" value="Send" /> </form>'; } I would think something along these lines would be best..
-
People come on, please stop complaining about a "Free" script. It is "Free" not like you paid for it.. If you know a better way then make it and use/release it.... I will never understand someone downing someone over something free. (when it is something that someone wanted/requested).
-
Yeah, I restarted, it is working. Nice mod. I just thought I would test it cause all the people saying not working. I edited my last post also, cause it is working. The first restart of lmap didn't make it work...(odd) Restarted computer and it "Is" working. Very creative.
-
Um..If that was there I certainly did not see it. I do see you added it. After I posted... Unless you just add the font.
-
I have seen more than 1 say this don't work. So I tried it on my test code.. In FF. On LAMP. Nothing works. Just thought you might want to know.
-
Looks like you might need to reinstall XAMP. That might fix your error with Apache not working.
-
I'm glad to here that. It will take competition out :). Although I won't be running a game for quite awhile. I still have a lot to code in my script.. I don't care what anyone says...any engine/gaming script from scratch..is HARD!!! :thumbsup:
-
None taken. :) It was strictly an example. Not ment to be used in the form I did it in, just pointing in right direction :thumbsup: Did you know you can put the $h->endpage() in the exit also. To help save lines. exit($h->endpage()); :D
-
You could do something like adding a timestamp or using what you have in the matenince table. Example When you go offline. add unix_timestamp to field say 'time_off' Then you don't need the users. Just somethign like this. select it from table with example $j if(time() > $j['time_off']) { die(''); } That would be of course if the Current time is greater than the Time_off WHich is the Time stamp put in. Then when you cutt if back on. You just set clear the time_off field.
-
First Happy Late Birthday :). I'm turning 27 on the 23rd of this month. :( lol, he is not modding anymore. But I surely hope he stops in from time to time to say hi. :)
-
Not saying they pay, not saying they don't. But I will say the site sign up is http://www.cpalead.com/get-started.php not what he gave. His is a referal link. He is just trying to make money off a link. Though he/she will not. These site 'never' pay.
-
Probary a typo, i do that all the time. Try this $users = $db->query ( "SELECT u.`userid`, u.`username`, u.`level`, u.`hp`, u.`gang`, u.`location`, g.`gangname`, g.`gangPREF`, c.`cityname` FROM `users` u LEFT JOIN `gangs` g ON `gangID` = u.`gang` LEFT JOIN `cities` c ON c.`cityID` = u.`location` WHERE c.`cityID` = ".$ir['location']." AND u.`user_level` != 0 ");
-
$weapon = $wep['itmname'] == 0 ? 'Fists' : ''.$wep['itmname'].''; echo $weapon;
-
$users = $db->query ( "SELECT u.`userid`, u.`username`, u.`level`, u.`hp`, u.`gang`, u.`location`, g.`gangname`, g.`gangPREF`, c.`cityname` FROM `users` u LEFT JOIN `gangs` g ON `gangID` = u.`gang` LEFT JOIN `cities` c ON c.`cityID` = u.`location` WHERE c.`cityID` = ".$ir['location']." AND `u.user_level` != 0 ");
-
That didn't help either. Sorry never posted back, I just stopped working on my codes for awhile. Now I'm starting back. Still have same issue. It is very odd. If I put it online, it don't do this. It is only on LAMP lol.