
LordDan
Members-
Posts
66 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by LordDan
-
I have no problems paying an upgrade fee for an updated copy of the engine. I'll email you shortly.
-
I just came here because I tried to download a fresh copy of NEaB only to see the site was down/under construction. How saddening. Most important question is, as I have proof of purchase; will I be required to purchase all over again? Can existing customers at least still download the latest version up until the point you have taken over? It would be such a shame to lose this product. Naturally, I take interest in your progress, but with an original $200 price tag way back when I'm sure you can understand my frustration. Regards, Dan
-
Interesting thoughts. I recently upgraded my development machine and whilst backing up my projects I stumbled across my very first, from scratch PHP project. It was looking through that old code from 2005/06 that got me to thinking of Procedural again. Admittedly, this was back when it was possible to waste a day away developing and enjoying every second of it. Being able to just make **** work whether it conformed to some sort of convention, or having your code perceived as poor quality because it isn't "pro-something" or "anti-some-other-crap". I miss these times.
-
I wish to hear peoples reasoning for staying with procedural for all this time. When I first joined this forum, I was still using procedural too, but I've 'progressed' if you will, into OO, MVC and I truly enjoy working with it. I seem to shudder looking back at procedural code, particularly when I see large chunks of HTML mixed in with PHP, or lack of comments, lack of consistency and convention. It truly annoys me and I've struggled to go back to procedural, even for tiny projects where it makes more sense. So, a genuine question, why are you all seemingly sticking with it? Surely this goes deeper than the common excuse of "Performance" right? As snobby as I may sound here, I ask with good intent, I'm currently building up a Game Framework using OO and MVC, strictly sticking to conventions and so on etc etc. So far I have good progress, every feature is a self contained module, allowing features to be disabled, removed and installed easily with the bonus of creating hybrid genres by mixing modules. This works great, and creating a Module called Signup will override the default Signup controller, should you wish to extends it's functionality without editing the core application. Much of the code is reused from objects I have already created and I have a lot of work done already in such a small amount of time. However, if you're still so passionate about procedural, I'm likely wasting my time marketing it here in the future when it is ready. So, I'd really enjoy your thoughts and reasoning for staying with procedural for so long. Regards Dan
-
It seems no one is yet to mention how much quicker Windows 8 is over 7? Personally, I am not the biggest fan of Windows 8, there are things I like (It's simplicity and ease of use (in some areas)) however, Windows 8, without all the fancy glass rubbish and shadowy glamour uses far less Memory, CPU and is less intensive on the GPU. This, is why I went to Windows 8. I am gamer, I do not care for my hardware running fancy junk on my desktop when I want every ounce of juice going into my FPS. In terms of development, I still use the same tools (PHPDesigner 8 IDE, XAMPP, Firefox etc) and nothing has really changed there. All in all, I think it really depends on what you want to do with your computer, whether you play a lot of games, or care too much about how fancy your desktop looks. (Side note: I do not have a touchscreen monitor, which is of course what Windows 8 is all about, because of this, there are a few "menus" that can be a little awkward to use with a mouse)
-
Hey guys, Do any of you know a method to escape an array using MySQLi? For normal MySQL I'm using array_map public function escapeArray( $array ) { return array_map( "mysql_real_escape_string", $array ); } However, I'm having trouble doing the same thing for MySQLi as I'm using the OO method, not procedural. public function escapeArray( $array ) { return array_map( "$this->_mysqli->real_escape_string", $array ); }
-
Unless i've made a mistake then you should be able to change the width paramter and the width attribute to the same +4 [img=draw_bar.php?per=95&bar=gold&width=150]
-
Goddamn art theives.... Well, good to know who to avoid, thanks for the info.
-
Last time i did this i used an include rather than going to the page itself. if( isset( $_POST['use_item'] ) ){ if( !empty( $item['itm_addon'] ) ){ include( './modules/item_functions/'.$item['item_addon'].'.php' ); } else { // Stuff to run normal item functions.. } }
-
Well if you're okay with spending, the only two I know of are IonCube and Zend Guard. I'm not sure if the latest versions have been reversed yet, but I know they have been in the past. I think one of those two are your best bet. Also, I'm not sure about Zend Guard, but with IonCube, you need to IonCube Module on your server to read the files, I know this because about four years ago i purchased a Game Script only to find I couldn't use it or modify it because it was IonCubed and the bastard who sold it never stated that anywhere on his website. Make sure you do state it, but keep in mind this tells everyone what your using to Encode the files. Your best bet is to just get a beer and discuss it with Google for an hour. Look around, do some research and see what has and hasn't been reversed yet. That's as much advice i can give.
-
Why has nobody mentioned this is just a waste of time? You pay money for Encryption Software, which can then just be Decrypted by someone who knows what they're doing. Both Zend Guard and IonCube have been Decrypted many times before. There is no true way of completely securing your software against Piracy, Software or Web App. As far as I am aware the only thing you can really do is register yourself as the official software owner (Not sure how it is done outside the UK) but even this doesn't help much. It'll probably cost you more to sue for Intellecual Property than your software costs anyway. If you don't want to be pirated, don't sell.
-
ID using Auto Increment, for me, have always started at 1 in phpMyAdmin.. Which is what i was reffering to. I've never seen 0 or negative ID rows myself.
-
Sorry my fault, I should learn to read what i type -_- Anyway, i think i can see one advantage with the mention of Database ID's.. The majority of the time, abs(), for me above returned 0 so long as the string didn't start with a valid INT such as the "3g33" example.. This could be used to avoid an extra query, as there is no such thing as ID 0? if( abs( $_GET['id'] ) == 0 ){ exit( 'No such query ID'); } else { $query = "SELECT id FROM users WHERE id=".abs($_GET['id'])." AND `username`=".mysql_real_escape_string($_SESSION['user'])." LIMIT 1"; } Am i on the right track here?
-
Hmm, i overlooked that, i wanted a way to allow negatives because i usually just use (int). I'm still not seeing the advantage of abs() though, any examples of when it's better than just (int)?
-
I've never used abs() for security, that's just a bit dumb isn't it? Correct me if i am wrong but abs() will not always give you a result you're after. A simple preg_replace with (int) will give you an INT without trailing 0's, abs() on the other hand can be really retarded with cleaning up INT's depending on what your after. function filter_int( $val, $negatives = false ){ $regex = ($negatives) ? "/[^0-9-\s]/" : "/[^0-9\s]/" ; return (int)preg_replace( $regex, "", $val ); } echo filter_int( '00h-h3Ll0' ); // 30 echo abs( '00h-h3Ll0' ); // 0 echo filter_int( '3g33' ); // 333 echo abs( '3g33' ); // 3 echo filter_int( '-11abc', true ); // -11 echo abs( '-11abc' ); // 11 echo filter_int( 'a-s200abc', true ); // -200 echo abs( 'a-s200abc' ); // 0 So, what exactly is the advantage of using abs() over what i am doing? :huh:
-
Just an additional note: I often use the following snippet to find out how many files i am including to aid me reduce the amount of includes where possible. echo 'Included: '.count(get_included_files()); get_included_files() returns an array so you can use foreach to display the included file names as well if needed. It's not exactly what you're asking for/about, but hopefully it'll be of some use to you. :thumbup:
-
I'm not too sure on resource usage, the bar generates pretty quick so i doubt something so small would have a noticeable impact. Obviously a larger image with some texts would take more time. I'm still only just starting to get my hands dirty with GD though, so I'm not really in any position to comment on it. No disrespect. Wasn't sure if you meant somebody else did it, as in wrote it, or not. :pinch:
-
Oh, cool looking bar!
-
That depends, are you accusing me of stealing it, or stating someone else made a version not long ago. If the latter, likely, i didn't search the forums before hand. What's yours like? :pinch:
-
Just finished another function I'd like to share. Well, it's not a function() really, but who cares? Anyway, I want to start developing games again soon so I am spending time developing some personal Frameworks ready for when I do. As it's "Game" development, a common element is Stat Bars such as HP, MP and XP. With that in mind I set to and made a "function" to generate these bars on the fly. Now I am sharing it here; Images Two minutes in Gimp and ended up with these, should you choose to use them is your choice ;) draw_bar.php This is the file that generates the bar image, several parameters can be sent into this which I'll mention shortly. <?php // Check for custom width.. (Remember to change your images width="" // and height="" if using custom widths!) $width = ( isset( $_GET['width'] ) ) ? (int)$_GET['width'] : 100; $height = ( isset( $_GET['height'] ) ) ? (int)$_GET['height'] : 10; // Get our Percentage.. $perc = (int)$_GET['per']; // If width is greater than default 100, we need to multiply // our Percentage so the percentage bar is the correct size. // Multiply by 1 for each 100.. IE: 300 = *3 $perc = ( substr( $width, 0, 1) > 1 ) ? $perc * substr( $width, 0, 1) : $perc; // Find which color bar we want switch( strtolower( $_GET['bar'] ) ){ case 'red': $image = 'bar_red.png'; break; case 'blue': $image = 'bar_blue.png'; break; case 'pink': $image = 'bar_pink.png'; break; case 'green': $image = 'bar_green.png'; break; case 'gold': $image = 'bar_gold.png'; break; default: $image = 'bar_green.png'; } $per = imagecreate( $width, $height ); $background = imagecolorallocate( $per, 255, 255, 255 ); $foreground = imagecolorallocate( $per, 255, 255, 255 ); $border = imagecolorallocate( $per, 100, 100, 100 ); $grad = imagecreatefrompng( 'images/'.$image ); $per2 = imagecopy( $per, $grad, 1, 1, 0, 0, ( $perc ), $height ); imagerectangle( $per, 0, 0, $width-1, $height-1, $border ); header( "Content-type: image/png" ); imagepng( $per, NULL, 5 ); imagedestroy( $per ); ?> Parameters The great thing about this Bar Generator is that is allows custom widths. Most I have seen online didn't support this and only had a single fixed width, don't know why, all it took is a 1 extra ternary operator :huh: Parameter: ?width=xxx Using a switch, it's also possible to setup several different bar graphics for generating different bars. Again, something most bar generators didn't bother with :huh: Paramter: ?bar=xxx And finally, the requirement, percentage value for the bar. Parameter: ?per=xxx Example Usage This is the example usage code i've used during testing and to generate the bars seen in the screenshot below. [img=draw_bar.php?per=100] [img=draw_bar.php?per=75&bar=red] [img=draw_bar.php?per=54&bar=blue] [img=draw_bar.php?per=68&bar=pink] [img=draw_bar.php?per=95&bar=gold&width=200] Enjoy! :thumbup:
-
Use at will ^^ Thanks.
-
Hey! Been away from PHP for a few weeks and cannot bare it any longer so I had to type something! Anyway, I decided to write a quick Search Phrase Highlighter. PHP: function highlight_words( $string, $words, $color = '#FFFF99' ){ $words = ( is_array( $words ) ) ? $words = implode( '|', $words ) : $words; return preg_replace( '@\b('. $words .')\b@si', '<span style="background-color:'. $color .'">$1</span>', $string ); } Usage: echo highlight_words( 'This is my string ya\'know!', 'my' ) .' '; echo highlight_words( 'This is my string ya\'know!', array('my', 'this'), '#99FFCC' ); Result: Hope you find use of it ^^
-
You're Welcome. ^^
-
I do not know what source you're using so forgive me if what i am posting is incorrect. If you want to show how many users are on the Hitlist, would a num_rows query not be more suitable? $result = db_execute_return( "SELECT id FROM hitlist WHERE status='active'" ); $count = mysql_num_rows( $result ); $css = ( $count > 0 ) ? 'txt_2' : 'txt_1'; // Sets the class for the span $count = ( $count < 1 ) ? 0 : $count; // Make sure our count is 0 rather than empty. echo '<span class="'. $css .'">[url="hitlist.php"]Hitlist('. $count .')[/url]</span>'; Resulting in: Also, there is no need to add around Hitlist, just add it into the CSS class. .txt_2 a { font-weight: bold; } Hope this helps you out a little, but as stated i am not sure what source you're using, nor would i be familiar with it even if i did. :huh: Good luck! :thumbup: EDIT: Fixed a small mistake..
-
Surely one heredoc would be quicker than several Echos. It would make sense. However, i have not looked it up.