View Full Version : php [image]
rhosk
09-21-2004, 11:45 AM
http://s92220213.onlinehome.us/php/index2.php
Just wondering if this works for all. I have an image/quote array in this and to see if it works, just refresh your browser and the items will change. I just think this is pretty neat. I have no idea where I'm going with this, but thought I'd share to get your ideas/feedback. Understand that this is an image (or IR wouldn't have let me post it I presume) and not a "print screen" type output.
Some entire websites are actually going to this. The [engines] can actually build images from scratch (haven't got that far yet - I'm using an actual basic image array). Once it renders, the image is destroyed. If you're using a different browser, I'd also like to know if it sees it according to the if statements. Again, just playing around :D
Intrigued
09-21-2004, 11:49 AM
Works here!
Mind sharing the core code?
Sincerely,
rhosk
09-21-2004, 12:00 PM
Good.
Yeah, let me smooth it up a bit, I've got variables all over the place and I'll tie some strings together to make it easier to edit. Give me a day or so.
longedge
09-21-2004, 02:14 PM
I've found in the past that this type of 'feedback' very easily freaks people out Ron.
Time, date, weather, news tickers etc etc are all fine. People love little extras that do something unusual.
But as soon as you start saying, "I know who you are - I'm collecting information about you" even though you aren't, there's a lot of visitors you won't see for a cloud of dust and they won't be back again.
Just my twopennorth ( = 2 cents worth :) )
rhosk
09-21-2004, 03:15 PM
Hmm touche, but it's probably true for about 90% of the websites on the Internet today. Have you checked your cookies lately? :)
This is merely a demo of what this particular feature can perform. I don't advocate [people] telling me they know who I am. Heck, IR probably knows more about me than I do ("Welcome, rhosk...You last visited, blah blah"). And well, I figured if I posted it here in the "Developers Den" section that it wouldn't be taken like that. And conversely, if someone is perusing this section of the forum, they probably know a little about scripting/code in general, don't you think? I don't think that my Grandmother would be in here looking around - but then again, ya' never know :D
I'm just trying to figure out what I can do with this stuff. Watermarking images would be one. You can apply shadows to the text, use different fonts, gradients, transparencies, etc. It could be as simple as - read a folder full of images, grab the array, and watermark every one of them "on the fly" (without writing on the original image whatsoever). The image viewer inside that beta test site does something similar. Uses php and GD and creates those thumbnails that you see "on the fly". Let me rephrase that - creates the thumbs, then saves them. It even has .gif support now (was phased out for a while because of the copyright issue). I just think that this is powerful stuff. Maybe the guys who maintain IR's websites wouldn't think so (they're probably php'd to death), but I think it's pretty neat.
Any more ideas out there?
longedge
09-21-2004, 03:34 PM
I know exactly what it's like when you find some new functionality you want to explore it - I'm the world's worst for that and know exactly where you're coming from.
Intrigued
09-21-2004, 04:15 PM
I have been looking through the..what 2,700+ PHP funtions?
The drawing functions are interesting to name a few. After I finish this HTML book I am going to head back to the PHP 5 book, between projects of course.
That's the cool thing with computers... so much... so little time... so dang interesting!
Sincerely,
rhosk
09-21-2004, 04:19 PM
Exactly; to both of you!!
Hows come you two guys are the only one's interested in this stuff?
Intrigued
09-21-2004, 04:30 PM
I suppose others are still pouring in lots of time into AMS. Myself, I know I spent just about every day for 10 months reading and testing script in AMS to the point where I feel confident (but still plenty to learn) enough to take on other computer scripting languages and what not.
Everyone travels at their own speed. Others here that probable view these forums, that are experts through and through with say PHP or AMS, may never post, being that they are the quiet type. Which is a real shame! I would love to pick up more ways to code in yet unknown ways or with interaction with say PHP, HTML!
Corey
09-21-2004, 06:34 PM
PHP drawing is server instensive, not generally practical for commercial sites whereas Flash is all client side and has much more capability. You very, very rarely see any busy web site on the internet which uses PHP drawing, if ever. Two cents.
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
Intrigued
09-21-2004, 06:35 PM
Ah! Good heads up note!
Thanks!
Corey
09-21-2004, 06:51 PM
Don't get me wrong, VBulletin for example uses it to create thumbnails for attached images. But the key here is to use it sparingly, i.e. a typical user session should not make more than one image call to the PHP library. You can use PHP drawing OK and everything without killing your site but your server just has to push harder to get up the hills.
I'm all about client side these days. Javascript, Flash, and AMS. let the users computer do the work. For example I used to randomize the banners here with PHP but it's all javascript now, etc. Saves the server a few thousand small tasks per day and puts that load onto the viewer's CPU...
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
rhosk
09-21-2004, 07:28 PM
Har, don't get me wrong either. I'm not about to create an entire website with this, just ain't gonna happen in my lifetime, LOL. I'm not a PHP'r by any means, I just love manipulating it and playing with it - and viewing the results which are amazing (to me). I'm definitely a Flasher as well. I mentioned earlier that I have a couple of other scripts that *create the thumbnails (same tech), but then, *saves them (instead of rendering all the time in the browser). There's "if statements" incorporated to see if they first exist, if so - do nothing. As I said in another post, the flash galleries are almost all using all three technologies. It's pretty neat when you can merge them all together and get them to play nice :)
PS, I've played a lot with JavaScript too, but more and more browsers/users handle it differently these days - and I got complaint after complaint that "they couldn't see/use the widget", so I don't use it as often anymore (not sure if 'includes' are the same or not). Depending on the user's security settings, you may not be advertising anything at all (or do you have backup static images?).
Late entry -- Are you sure you're not using php for the ads?
Corey
09-21-2004, 07:35 PM
PHP to admin them but Javascript to serve them. Typically you don't spend hardly anytime doing admin work so... Yeah I love it when a good plan comes together myself, i.e. when you can integrate multiple technolohies seamlessly. I still get a rush from that. In terms of Javascript it's all a quotient of your end audience. It's going to be a long time before the large 90% majority of non IT web surfers start blocking Javascript as a matter of habit. The other ten percent know exactly what they're missing and how to let through what they want. I don't want to serve ads to anyone who isn't going to buy anything from them... :)
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
rhosk
09-21-2004, 07:42 PM
PHP to admin them but Javascript to serve them.
Ahh, cool!
...I don't want to serve ads to anyone who isn't going to buy anything from them... :)
And a good point, got ya'!
If you're using a different browser, I'd also like to know if it sees it according to the if statements. Again, just playing around :D
Hey Rhosk,
I'm using Mozilla 1.8a2, and it tells me that my browser is type
"Netscape (Mozilla)"
Under FireFox 1.0pr it says the same thing, is there any other information that you would like to know?
Personally I think it's pretty cool.
Corey
09-22-2004, 11:32 PM
BTW to be fair my opinion on the server load is rather old, I haven't refreshed my knowledge of GD for a couple years. It's possible that version 5.0 has brought some performance fixes vis-a-vis dynamic image handling. One cool thing about using GD is if you hook up Image Magick (I think it's free on Google) because it gives you a whole lot of new functionality. I'm no expert on it but I've played with it and it's cool... If you haven't seen it yet, check it out:
http://www.imagemagick.org/
:yes :yes :yes
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
Intrigued
09-22-2004, 11:48 PM
Now that's dang nifty Corey!
GPL too! Woot!
Intrigued
09-22-2004, 11:55 PM
Ack!
I opened a .jpg in that program Corey. Then I 'sheared' it 45 degrees. Then I ctrl-z (to go back a step) and the program crashed hard.
Hope that is not a fortelling of what is to come. Because this looks like a useful application!
Corey
09-23-2004, 01:05 AM
It is *definitely* tricky getting up to speed, on the upside though there's a few good forums out there where you can get answers from people using it. I decided to set it aside until such time as I need it for something. But using AutoPlay Media Studio with irfanview has so far met all my imaging needs big time... :yes
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
rhosk
09-23-2004, 08:10 AM
Hey Rhosk,
I'm using Mozilla 1.8a2, and it tells me that my browser is type
"Netscape (Mozilla)"
Under FireFox 1.0pr it says the same thing, is there any other information that you would like to know?
Personally I think it's pretty cool.
Hmm, From what I understand about browsers, especially the new ones out there (personally not privy), most tend to hide their identity in various ways. I appreciate the test feedback Mark!
OK, this may freak you out, still playing. Remember, this is an image, not a script in this thread. Got some transparecy going on here. I am loving this stuff!! Again, refresh, it will update....
http://s92220213.onlinehome.us/php/index3.php
Intrigued
09-23-2004, 07:16 PM
I uploaded the file and setup 5 .gif images (image1.gif, image2.gif, etc.) and uploaded them to the same directory;however, I only get a blank screen. I have not edited the PHP file either.
Where did I go awry do you think?
By the way, this is an excellent example (not to involved) on PHP! So many functions to learn in PHP, if one wants too (I like that flexibility!). It reminds me of AMS 5's load of functions and how flexible that program is!
rhosk
09-24-2004, 03:59 AM
Couple of things to check:
Make sure your gif images are pure white for the transparency (255, 255, 255 - 16 million colors -- I tried 2 color / 8 bit and that didn't work) and believe it or not, watch the case (can't be Image1.gif --- has to be image1.gif and so on for a Unix server). The font must be installed correctly, because you would've received major errors from that :yes
And you're right, I find the syntax and functions very similar to AMS (actually helps me a bit). The problem I have is it's very unforgiving and the output errors usually don't point to the exact spot in the script. ((ie, you could have an error on line 360, which is caused by a syntax goof at line 15)) Fun to play with though :)
Corey
09-24-2004, 04:11 AM
PHP is based upon C. Not sure about Lua but it would make sense it if is too. Anyhow the same basic components seem to make up all programming, i.e. functions, arrays, variables, etc. and from what I have seen the implementation from language to language is usually very similar. The strong exception being Microsoft technologies, i.e. ASP.
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
rhosk
09-24-2004, 10:30 AM
More stuff...For you pro photographers or graphic designers, here's a good solution using basically the same technique. In short, instead of taking all your images and adding a watermark by hand in an editor, this takes the original image and adds the watermark "on the fly". The original images are protected and never downloaded and the current watermarked image again is destroyed on exit. IOW, drop all your originals in a protected directory, set your array or folder build and the script does the rest. Copies the original, adds the watermark and renders. And as always, hit refresh, and the image will change. Custom fonts, shadows and even image on image.....Still playing.....:)
http://s92220213.onlinehome.us/php/watermark.php
rhosk
09-26-2004, 01:50 PM
I uploaded the file and setup 5 .gif images (image1.gif, image2.gif, etc.) and uploaded them to the same directory;however, I only get a blank screen. I have not edited the PHP file either.
Where did I go awry do you think?
By the way, this is an excellent example (not to involved) on PHP! So many functions to learn in PHP, if one wants too (I like that flexibility!). It reminds me of AMS 5's load of functions and how flexible that program is!
Did you ever get it to work?
Corey
09-26-2004, 02:45 PM
I remember taking that photo, ahhhh those were simpler times... Nice watermark BTW...
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
csd214
09-26-2004, 04:26 PM
Hows come you two guys are the only one's interested in this stuff?
Not lack of interest; more lack of time! And a LOT of new techniques to learn. Yes, I'm going to look at PHP (some day), especially if I know I need it. It confuses me when Corey says:
"I'm all about client side these days. Javascript, Flash, and AMS. let the users computer do the work." (It's not difficult to "confuse" me.)
On my homepage I have a Javascript menu system. The intention was to help my visitors to navigate on my site, but WinXP SP2 kills it! Dangerous, dangerous!! Is it like this: Microsoft (IE) sees a wasp. Oh, it could stick me! CLOSE THE DOOR! – Don't they have confidence with their own firewall? (Which is turned off by Symantec whether or not the Symantec firewall is running.)
Due to this MS fear I thought I really had to learn a server side script like PHP "to morrow" (I have downloaded XAMPP; this forum gives me too many ideas! But to day I'm on the "Hello World level") But what is Corey telling me?
Corey
09-26-2004, 05:01 PM
Hee, I'm not telling anyone anything, just talking out of my hat. :) I know every little about MS technologies, so my opinions of that stuff are of no use. In terms of PHP it's a great thing but it's important to make sure you are compatible with your clients, etc. In other words if you are working with a lot of people who use ASP you are probably better off with ASP even though PHP is perhaps a superior technology vis-a-vis performance...
In my case I'm just lucky, I picked a few different things to focus on early in my carreer such as PHP, Photoshop, Flash, Dreamweaver, etc. which all turned out to be very popular technologies. Total fluke, I picked what I liked personally back when all those things were at version 1.0/2.0/3.0, not what I thought would "win out". I have some friends who went the JSP route and it really left them out of the loop. I also know some people who focused on ASP who, as a result, are limited to working only within the institutional sector, i.e. you are not going to get small/midsized clients to invest in software for their site.. It all comes down to goals. :)
I remember having a debate about PHP with a certain IT billionaire back in about 1998/1999 or so. I told him, "PHP is da bomb baby!" and he said, "Forget PHP, Java is where it's at. Java is the future." And here we are 5-6 years later and Java is pretty much stagnant, especially amongst SMEs. Whereas PHP has grown by leaps and bounds. And that guy is one of the smartest people I know, so it just goes to show you how complicated the debate is...
DHTML was the same thing. Some guys decided DHTML was the solution to everything back in the day, and they built a bunch of apps for a bunch of clients, and the apps never did work quite right for *everyone* and the clients kept paying the DHTML guys to get things 100% operational, and the DHTML guys never really did manage to figrue out all the browser issues, and essentially the whole thing died an ugly death with both parties leaving quite sour on the other side. I haven't heard of a DHTML app in years, used to be a few, even a few commercial ones which got widely known. I bought one once, I think it was an .mshta file, "DHTML Menu Creator" I think it was called, very popular. Sold thousands of copies at $50 each but it was always a buggy, crashy app at best. Anyhow I digress, just making the point that it's always best to look at things from the end destination backward as opposed to from the starting point forward... :)
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
csd214
09-27-2004, 12:32 AM
I'm not telling anyone anything, just talking out of my hat. I know every little about MS technologies, so my opinions of that stuff are of no use.
Don't be modest, Corey! I love your talking out of your hat. Your opinion; based on knowledge and experience; is what I'm looking for. The other day you had some comments regarding XML: "It's just a container. What is your goal?" I like your approach. "It's always best to look at things from the end destination backward as opposed to from the starting point forward."
With respect to my JavaScript menu system, I should rather ask my menu builder provider. (In my opinion it's a great system!). The "problem" is: The I.R. Forums are my Computer CNN channel.
Corey
09-27-2004, 01:00 AM
Hee. Yes this forum has a way of grabbing me too. :) :yes
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
Intrigued
09-27-2004, 09:32 AM
The I.R. Forums are my Computer CNN channel
I like that! Ha! Ha!
Forget the hurricanes this year on CNN!
Intrigued
09-27-2004, 05:20 PM
rhosk, your forum message box is filled! I can not reply until you delete at least one.
Sincerely,
ps. Corey/Ted, anyway of letting us have more storage for the text files (they take up so little and there are relatively few that are 'active posters')?
Thanks nontheless though for any consideration taken on this request!
rhosk
09-27-2004, 05:22 PM
Complete :)
rhosk
10-01-2004, 09:56 AM
OK, a tiny update. Besides the font/color/angle aspects of this image, if you look at the source, it appears to be a JPG file (as opposed to the php files above). I managed to tell the server to parse JPG files (in this folder) as php. It's a php file in disguise :D
This would be advantageous if you wanted to post an array of images at a forum/website that didn't allow linking to php files for whatever reason. Again, refreshing changes the image.
http://s92220213.onlinehome.us/phpstuff/watermark.jpg
csd214
10-01-2004, 10:39 AM
rhosk, Your Index2.php (your first post) tells me:
"Your Browser Type is Other"
I have XP SP2 with IE Version 6.0.2900.2180.xmsp_sp2_rtm.04803-2158. Should that be "Other"?
May be you can tell me why MS Office Update doesn't reckognize my browser (and tells me that I have a MAC)?
rhosk
10-01-2004, 11:02 AM
Wow, have no idea. First I've heard of that one. I have the same versions as you (with the exception of the Office stuff). So, I guess your inclination is correct - an Office update is messing with that. That script above only checks about 6 known type browsers and like I mentioned earlier, a lot of browsers today hide their identity for whatever reason. It's no biggie, I just used that as a sample/demo.
Maybe your Office Update installs recent plugins (for Word, PowerPoint, etc...) and changes the identity internally to reflect that? Just a guess.
Ted Sullivan
10-01-2004, 11:50 AM
FYI, I have increase the maximum private message storage to 60 (it was 50 before). As a factoid though, there are only 10 people with more than 20 private messages on this system out of close to 6000 members!
Intrigued
10-01-2004, 12:33 PM
Thank you Ted... I apologize for being a pack-rat. D'oh!
csd214
10-01-2004, 12:50 PM
rhosk, thankyou; you gave me the SOLUTION:
"a lot of browsers today hide their identity .."
It's Norton Internnet Security Pro, in general browser info is blocked.
I had opened for microsoft.com and indigorose.com, but not for office.microsoft.com and your server.
Now your demo displays MSIE and MS Office Update doesn't tell me that I have a MAC.
Demo or not demo; I was thinking of a connection with Office Update.
Once again, THX. (I don't have to phone MS.)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.