Jump to content

Dynamic content on web pages


NYPaddleCacher

Recommended Posts

I guess this is a question about the geocaching.com web site. Moderators feel free to move the topic but I suspect that a definitive answer is more likely going to come from this forum.

 

Someone in one of the other topics asked about how they might put something on their cache listing which dynamically displayed the number of days/hours that the cache remained unfound. Suggestions about the use of embed, iframe, or java applet tags wouldn't work as the site, understandably, would not allow these tags.

Someone else suggest a dynamically generated image so I looked around a bit and found a small piece of PHP code that gave and example of how to create an image with a string displayed. I made a couple of modifications such that it would display the current time just to demonstrate to the OP of that thread just to demonstrate that it could be done. Basically, in the description of the cache page an img tag is used, but instead of the src attribute specifying a url for a jpg, gif, or png file it points to a php script running on one of the web servers I have access to at work. That script dynamically produces a png image.

 

Is doing something like this acceptable on a cache page? I thought it might be a fun little addition to an event cache page as a countdown until the event happens. I haven't posted to code for I put together anywhere but did try it on one of my active caches. I just didn't want to do anything more with it without some confirmation from the lackeys that a dynamically generated image in a cache description would be allowed.

Link to comment

Something like a counter would probably be okay. But if it's a significant part of the cache page content, that may be a different story. When a cache is reviewed, the content of the cache page is reviewed as well. So something that could significantly change it on the fly, might not be allowed.

Link to comment

Something like a counter would probably be okay. But if it's a significant part of the cache page content, that may be a different story. When a cache is reviewed, the content of the cache page is reviewed as well. So something that could significantly change it on the fly, might not be allowed.

 

How would that be different from someone that has a cache published then changes the entire description frequently? Why should it matter how much of the content changes or how frequently as long as the content itself is "acceptable". I suspect that reviewers don't review the content of a listing whenever a CO has used the "edit listing" form.

Link to comment

I guess this is a question about the geocaching.com web site. Moderators feel free to move the topic but I suspect that a definitive answer is more likely going to come from this forum.

 

Someone in one of the other topics asked about how they might put something on their cache listing which dynamically displayed the number of days/hours that the cache remained unfound. Suggestions about the use of embed, iframe, or java applet tags wouldn't work as the site, understandably, would not allow these tags.

Someone else suggest a dynamically generated image so I looked around a bit and found a small piece of PHP code that gave and example of how to create an image with a string displayed. I made a couple of modifications such that it would display the current time just to demonstrate to the OP of that thread just to demonstrate that it could be done. Basically, in the description of the cache page an img tag is used, but instead of the src attribute specifying a url for a jpg, gif, or png file it points to a php script running on one of the web servers I have access to at work. That script dynamically produces a png image.

 

Is doing something like this acceptable on a cache page? I thought it might be a fun little addition to an event cache page as a countdown until the event happens. I haven't posted to code for I put together anywhere but did try it on one of my active caches. I just didn't want to do anything more with it without some confirmation from the lackeys that a dynamically generated image in a cache description would be allowed.

Why not just have the script that makes the image, make the images name static and use img src as usual.

long as the script runs on your own server it should be ok.

Link to comment

I guess this is a question about the geocaching.com web site. Moderators feel free to move the topic but I suspect that a definitive answer is more likely going to come from this forum.

 

Someone in one of the other topics asked about how they might put something on their cache listing which dynamically displayed the number of days/hours that the cache remained unfound. Suggestions about the use of embed, iframe, or java applet tags wouldn't work as the site, understandably, would not allow these tags.

Someone else suggest a dynamically generated image so I looked around a bit and found a small piece of PHP code that gave and example of how to create an image with a string displayed. I made a couple of modifications such that it would display the current time just to demonstrate to the OP of that thread just to demonstrate that it could be done. Basically, in the description of the cache page an img tag is used, but instead of the src attribute specifying a url for a jpg, gif, or png file it points to a php script running on one of the web servers I have access to at work. That script dynamically produces a png image.

 

Is doing something like this acceptable on a cache page? I thought it might be a fun little addition to an event cache page as a countdown until the event happens. I haven't posted to code for I put together anywhere but did try it on one of my active caches. I just didn't want to do anything more with it without some confirmation from the lackeys that a dynamically generated image in a cache description would be allowed.

Why not just have the script that makes the image, make the images name static and use img src as usual.

long as the script runs on your own server it should be ok.

 

Unless I misunderstand your suggestion, that's what I'm doing. The src attritube just points to a php script running on my server. The script doesn't save the image that it creates as a file. It just returns an image/png content type. Put this on any web page and see:

 

<img src="http://turner.mannlib.cornell.edu/dynimg/CurrentTime.php" />

Link to comment

I guess this is a question about the geocaching.com web site. Moderators feel free to move the topic but I suspect that a definitive answer is more likely going to come from this forum.

 

Someone in one of the other topics asked about how they might put something on their cache listing which dynamically displayed the number of days/hours that the cache remained unfound. Suggestions about the use of embed, iframe, or java applet tags wouldn't work as the site, understandably, would not allow these tags.

Someone else suggest a dynamically generated image so I looked around a bit and found a small piece of PHP code that gave and example of how to create an image with a string displayed. I made a couple of modifications such that it would display the current time just to demonstrate to the OP of that thread just to demonstrate that it could be done. Basically, in the description of the cache page an img tag is used, but instead of the src attribute specifying a url for a jpg, gif, or png file it points to a php script running on one of the web servers I have access to at work. That script dynamically produces a png image.

 

Is doing something like this acceptable on a cache page? I thought it might be a fun little addition to an event cache page as a countdown until the event happens. I haven't posted to code for I put together anywhere but did try it on one of my active caches. I just didn't want to do anything more with it without some confirmation from the lackeys that a dynamically generated image in a cache description would be allowed.

Why not just have the script that makes the image, make the images name static and use img src as usual.

long as the script runs on your own server it should be ok.

 

Unless I misunderstand your suggestion, that's what I'm doing. The src attritube just points to a php script running on my server. The script doesn't save the image that it creates as a file. It just returns an image/png content type. Put this on any web page and see:

 

<img src="http://turner.mannlib.cornell.edu/dynimg/CurrentTime.php" />

 

I think what the fox was saying is that your script which runs on your own server creates an actual image file. You then link to it using something like:

 

<img src="http://turner.mannlib.cornell.edu/dynimg/CurrentTime.png" />

 

The difference, as you know, is that you now have a saved image on your server, which just gets overwritten each time the script runs. To the end user, the effect is the same. However, to you and your server, the load is a lot heavier as the image would have to be regenerated every minute (or second, depending upon the application) on the off chance that someone is viewing the page.

 

Personally, I prefer serving images on-the-fly just as you've done - server load is reduced, and end effect is identical to both the user and Groundspeak...

Link to comment

 

I think what the fox was saying is that your script which runs on your own server creates an actual image file. You then link to it using something like:

 

<img src="http://turner.mannlib.cornell.edu/dynimg/CurrentTime.png" />

 

The difference, as you know, is that you now have a saved image on your server, which just gets overwritten each time the script runs. To the end user, the effect is the same. However, to you and your server, the load is a lot heavier as the image would have to be regenerated every minute (or second, depending upon the application) on the off chance that someone is viewing the page.

 

Personally, I prefer serving images on-the-fly just as you've done - server load is reduced, and end effect is identical to both the user and Groundspeak...

 

For dynamically generated content I've always prefered to produce the content when the request is made rather than schedule a script or program using cron (or equivalent). If the script was providing something other than returning the current time (for example, the number of days since the cache was last found) I'd add a caching mechansm so it wouldn't have to reproduce the same image every time a request was made. I've done that for services I created where I knew the data would only change once a day (and when it would change).

Link to comment

I've seen dynamic content used for counters, and also for puzzles. Within the limit of what's allowed by Groundspeak (e.g. no scripts), and as long as it conforms to the guidelines (no ads, family friendly, etc.), I don't see a problem with that. But then again, I've been surprised so many times in the forums here...

Edited by Chrysalides
Link to comment

I've seen dynamic content used for counters, and also for puzzles. Within the limit of what's allowed by Groundspeak (e.g. no scripts), and as long as it conforms to the guidelines (no ads, family friendly, etc.), I don't see a problem with that. But then again, I've been surprised so many times in the forums here...

 

By "no scripts" I assume that you mean using a client side scripting language (i.e. javascript). I'm not sure why it would matter if a scripting anguage (i.e. php) or a compiled language was used on the server side. I could just as easily replace the php script I used with a java servlet

Link to comment
Guest
This topic is now closed to further replies.
×
×
  • Create New...