The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How does one create their own dynamic graphic?
denmarks
post Oct 7 2013, 11:47 AM
Post #1


Advanced Member
****

Group: Members
Posts: 207
Joined: 17-January 08
Member No.: 4,734



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.

This post has been edited by denmarks: Oct 7 2013, 11:55 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jimlongo
post Oct 7 2013, 12:22 PM
Post #2


This is My Life
*******

Group: Members
Posts: 1,128
Joined: 24-August 06
From: t-dot
Member No.: 16



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.

This post has been edited by jimlongo: Oct 7 2013, 12:27 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
denmarks
post Oct 7 2013, 01:07 PM
Post #3


Advanced Member
****

Group: Members
Posts: 207
Joined: 17-January 08
Member No.: 4,734



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jimlongo
post Oct 7 2013, 01:23 PM
Post #4


This is My Life
*******

Group: Members
Posts: 1,128
Joined: 24-August 06
From: t-dot
Member No.: 16



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?

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 7 2013, 01:24 PM
Post #5


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Oct 7 2013, 01:27 PM
Post #6


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
denmarks
post Oct 7 2013, 02:31 PM
Post #7


Advanced Member
****

Group: Members
Posts: 207
Joined: 17-January 08
Member No.: 4,734



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jimlongo
post Oct 7 2013, 02:43 PM
Post #8


This is My Life
*******

Group: Members
Posts: 1,128
Joined: 24-August 06
From: t-dot
Member No.: 16



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Oct 7 2013, 11:22 PM
Post #9


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th April 2024 - 11:45 PM