Help - Search - Members - Calendar
Full Version: How does one create their own dynamic graphic?
HTMLHelp Forums > Web Authoring > Graphics, Flash and Multimedia
denmarks
I am referring to the type of graphic used in countdown clocks. Parameters are passed to a URL and a graphic is returned that is created using the parameters. Where would I even start looking for information on creating such a script?

I do not want a site that does it for me. There are hundreds of those sites. I want to know how they do it.
jimlongo
The best solution I've found is this jQuery plugin "Countdown".

It's basically 10 small images ( zero to nine )
Javascript that rolls the numbers over every second.
It's pretty easy to customize and use if you know a little css.

You need to download the script and the underConstruction packages (to get the images).

If by "want to do it yourself" you mean code it yourself, well, if you know enough javascript/jQuery to do that you probably don't need me to give you the psuedo code, but you could look at his script to get an idea of how it's done.
denmarks
Let me clarify. I want to call the URL from ANY website and a graphic is returned to display at that website. The contents of the graphic is dynamic and changes based on the parameters. It is trivial for my own website since I can easily run a Javascript or Jquery to do it. How does one run a script independent of a website? Look at countdown clocks that are included in signatures on many forums. They basically insert a graphic but the call includes parameters which alter the graphic.
jimlongo
I'd suspect that's flash.
I can put the clock on a webpage, but most forums won't let you display html in a sig will they?

Christian J
QUOTE(denmarks @ Oct 7 2013, 08:07 PM) *

Let me clarify. I want to call the URL from ANY website and a graphic is returned to display at that website.

Not sure I understand. Do you want to see a countdown on other peoples' sites that you visit? Then you might use a bookmarklet script. You'll only see the countdown yourself, of course.

QUOTE
How does one run a script independent of a website? Look at countdown clocks that are included in signatures on many forums. They basically insert a graphic but the call includes parameters which alter the graphic.

In that case the graphic is created on the fly by the server hosting it. I've never seen countdowns in signatures (maybe because I disable animated GIFs --can you link to an example?), but I have seen graphics displaying e.g. your IP, which is sent when you request the graphic.
Brian Chandler
QUOTE(denmarks @ Oct 8 2013, 03:07 AM) *

Let me clarify. I want to call the URL from ANY website and a graphic is returned to display at that website. The contents of the graphic is dynamic and changes based on the parameters. It is trivial for my own website since I can easily run a Javascript or Jquery to do it. How does one run a script independent of a website? Look at countdown clocks that are included in signatures on many forums. They basically insert a graphic but the call includes parameters which alter the graphic.


At least some of your question doesn't really make sense: "How does one run a script independent of a website?" for example. But perhaps you simply want to know how a URL can provide a variable image, depending on parameters passed?

The answer is very simple: the URL accesses a program which generates the appropriate image, and sends it. You can do this quite easily in PHP using the GD library, or you can use the Google chart api if you don't want to do everything from the bottom level.

Does this answer your question?
denmarks
QUOTE(Brian Chandler @ Oct 7 2013, 11:27 AM) *


The answer is very simple: the URL accesses a program which generates the appropriate image, and sends it. You can do this quite easily in PHP using the GD library, or you can use the Google chart api if you don't want to do everything from the bottom level.

Does this answer your question?


This is exactly what I meant. I assume there is no easy way without learning PHP. I did a quick look at Google Chart it is seems to be something you insert into your own website. I guess there is no easy way.

What I wanted to do was create an image that I would place in my signature on another forum that would be my own design of a countdown until a cruise. I did not want to use the boilerplate counters that are available.
jimlongo
Like I said many forums allow flash in signatures, that's the only way any smart forum would allow such a thing.
If they allowed html (other than links) php and javascript in signatures all hell would break loose.
Brian Chandler
QUOTE(denmarks @ Oct 8 2013, 04:31 AM) *

QUOTE(Brian Chandler @ Oct 7 2013, 11:27 AM) *


The answer is very simple: the URL accesses a program which generates the appropriate image, and sends it. You can do this quite easily in PHP using the GD library, or you can use the Google chart api if you don't want to do everything from the bottom level.

Does this answer your question?


This is exactly what I meant. I assume there is no easy way without learning PHP. I did a quick look at Google Chart it is seems to be something you insert into your own website. I guess there is no easy way.

What I wanted to do was create an image that I would place in my signature on another forum that would be my own design of a countdown until a cruise. I did not want to use the boilerplate counters that are available.


This still seems a bit confused, and it seems to me some of the other comments are also confused. (How would it help to use Flash? Do forums let you embed[?] Flash, but not write an <img> tag or the URL of an image?)

If you can write the URL of an image, then it can be an image you generate dynamically. Generally if the image is in PNG format (for example), the URL will need to be something.png, but this can happily be a php script. (You have to cope with even more confusion: typical OS behaviour is to tell you that a php script is of "type" PNG, if its name happens to be something.png, but this just means "This filename ends in .png and it is thought helpful to misbelieve this means it is a PNG image.")

The script could for example just generate the appropriate Google chart url, and pass this file through. The script does also need to send appropriate MIME headers.

HTH
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.