471,075 Members | 910 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,075 software developers and data experts.

image of the week type script?

1
hi there
i need a site where the client can upload an image every week, with a
caption, (so pref use the php upload image function to provide a web based
interface)
and that then automatically publishes and becomes the image of the week, and
all previous weeks images become smaller thumbnails below.... anybody have
an idea of how to do this? or is there a predesigned script i could use?
thanks

Jul 17 '05 #1
15 1997
1 wrote:
hi there
i need a site where the client can upload an image every week, with a
caption, (so pref use the php upload image function to provide a web based
interface)
and that then automatically publishes and becomes the image of the week, and
all previous weeks images become smaller thumbnails below.... anybody have
an idea of how to do this? or is there a predesigned script i could use?
thanks


Is there a reason why something simple like this wouldn't work?
<?php
echo
'<table>
<tr>
<td>
<img src="url_of_image" ><br>' ;
include( 'url_of_caption' ) ;
echo
' </td>
</tr>
</table>' ;

Margaret
--
(To mail me, please change .not.invalid to .net, first.
Apologies for the inconvenience.)
Jul 17 '05 #2
Sorry, I see now that I didn't read your posting all the way through,
so while my suggestion will handle the current image, it does nothing
about relegating previous images.

Is there any upper bound on the number of stale images to be
relegated?

I wrote:
1 wrote:
hi there
i need a site where the client can upload an image every week, with a
caption, (so pref use the php upload image function to provide a web based
interface)
and that then automatically publishes and becomes the image of the week, and
all previous weeks images become smaller thumbnails below.... anybody have
an idea of how to do this? or is there a predesigned script i could use?
thanks


Is there a reason why something simple like this wouldn't work?
<?php
echo
'<table>
<tr>
<td>
<img src="url_of_image" ><br>' ;
include( 'url_of_caption' ) ;
echo
' </td>
</tr>
</table>' ;

Margaret


--
(To mail me, please change .not.invalid to .net, first.
Apologies for the inconvenience.)
Jul 17 '05 #3
1 wrote:
hi there
i need a site where the client can upload an image every week, with a
caption, (so pref use the php upload image function to provide a web based
interface)
and that then automatically publishes and becomes the image of the week, and
all previous weeks images become smaller thumbnails below.... anybody have
an idea of how to do this? or is there a predesigned script i could use?
thanks


This should be fairly easy...

Create your form that will upload the image and store the caption in a
file (single line append).

When saving the file, generate both the thumbnail and large versions of
the image (use GD or ImageMagick to resize accordingly). Save the image
as a JPEG with a file name as a timestamp (http://www.php.net/time).
(Then you'll have image names like "1091546757.jpg"

Append the caption to a single line of the file.

Now for the front end of things...

Grab all the file names from the directory (http://www.php.net/readdir)
into an array and sort them according to filename. (Watch for the "."
and ".." entries, you won't want those.)

Read in the captions (http://www.php.net/file), which will already be
sorted by date.

Flip both arrays, output element 0 of each for the pic of the week.

The rest in the array would be previous images...

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Jul 17 '05 #4
Justin Koivisto wrote:
Append the caption to a single line of the file.


Sorry, forgot the reference... http://www.php.net/fopen &
http://www.php.net/fwrite

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Jul 17 '05 #5
1
the archive will be ongoing - i.e. no upper limit...

"Margaret MacDonald" <sc**********@att.not.invalid> wrote in message
news:9o********************************@4ax.com...
Sorry, I see now that I didn't read your posting all the way through,
so while my suggestion will handle the current image, it does nothing
about relegating previous images.

Is there any upper bound on the number of stale images to be
relegated?

I wrote:
1 wrote:
hi there
i need a site where the client can upload an image every week, with a
caption, (so pref use the php upload image function to provide a web basedinterface)
and that then automatically publishes and becomes the image of the week, andall previous weeks images become smaller thumbnails below.... anybody havean idea of how to do this? or is there a predesigned script i could use?
thanks


Is there a reason why something simple like this wouldn't work?
<?php
echo
'<table>
<tr>
<td>
<img src="url_of_image" ><br>' ;
include( 'url_of_caption' ) ;
echo
' </td>
</tr>
</table>' ;

Margaret


--
(To mail me, please change .not.invalid to .net, first.
Apologies for the inconvenience.)

Jul 17 '05 #6
1
cheers justin
btw you dont have a source for any code that is similar do you?
my php skills are basic to say the least,

"Justin Koivisto" <sp**@koivi.com> wrote in message
news:cd*************@news7.onvoy.net...
Justin Koivisto wrote:
Append the caption to a single line of the file.


Sorry, forgot the reference... http://www.php.net/fopen &
http://www.php.net/fwrite

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 17 '05 #7
I noticed that Message-ID: <lb*************@news7.onvoy.net> from Justin
Koivisto contained the following:
Create your form that will upload the image and store the caption in a
file (single line append).


I'd store all the stuff about the image in a database table( image URL
thumb URL, Image caption, thumb caption, alt text, date created etc.
This is more flexible as it allows you to add extra information
(photographer, location, model name, agency...) at a later date, if need
be. The data can also be used for other things.

Fetch the data with an ordered query and the first record will be pic of
the week. It stays till you upload a new one.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #8
1 wrote:
the archive will be ongoing - i.e. no upper limit...


So you are happy that in three years' time, the page will have over 150
images on it?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Now Playing ~ ./manic_street_preachers/you_stole_the_sun_from_my_heart.ogg

Jul 17 '05 #9
1 wrote:

"Justin Koivisto" <sp**@koivi.com> wrote in message
news:cd*************@news7.onvoy.net...
Justin Koivisto wrote:

Append the caption to a single line of the file.


Sorry, forgot the reference... http://www.php.net/fopen &
http://www.php.net/fwrite

cheers justin
btw you dont have a source for any code that is similar do you?
my php skills are basic to say the least,


Sure, for the image part of it anyway:
http://www.koivi.com/php-gd-image-watermark/

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Jul 17 '05 #10
Geoff Berrow wrote:
I noticed that Message-ID: <lb*************@news7.onvoy.net> from Justin
Koivisto contained the following:

Create your form that will upload the image and store the caption in a
file (single line append).

I'd store all the stuff about the image in a database table( image URL
thumb URL, Image caption, thumb caption, alt text, date created etc.
This is more flexible as it allows you to add extra information
(photographer, location, model name, agency...) at a later date, if need
be. The data can also be used for other things.

Fetch the data with an ordered query and the first record will be pic of
the week. It stays till you upload a new one.


I would as well, but the OP had said something about mysql being
overkill in an earlier thread today... ;)

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Jul 17 '05 #11
1
"Toby Inkster" <us**********@tobyinkster.co.uk> wrote in message
news:pa****************************@tobyinkster.co .uk...
1 wrote:
the archive will be ongoing - i.e. no upper limit...


So you are happy that in three years' time, the page will have over 150
images on it?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Now Playing ~ ./manic_street_preachers/you_stole_the_sun_from_my_heart.ogg


we'll worry about that in 3 years time!

Jul 17 '05 #12
I noticed that Message-ID: <Uw**************@news7.onvoy.net> from
Justin Koivisto contained the following:
Fetch the data with an ordered query and the first record will be pic of
the week. It stays till you upload a new one.


I would as well, but the OP had said something about mysql being
overkill in an earlier thread today... ;)


But once you are used to it, it's so easy, especially with phpMyadmin to
set up tables.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #13
1 wrote:
"Toby Inkster" <us**********@tobyinkster.co.uk> wrote in message
news:pa****************************@tobyinkster.co .uk...
1 wrote:
> the archive will be ongoing - i.e. no upper limit...


So you are happy that in three years' time, the page will have over
150 images on it?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Now Playing ~
./manic_street_preachers/you_stole_the_sun_from_my_heart.ogg


we'll worry about that in 3 years time!


Something I never do.

When I make stuff, I am always thinking ahead, what if the site gets
*really* busy.

Efficient stuff that works well on busy sites, works a treat on quiet
sites too!

--
Charles Sweeney
http://CharlesSweeney.com
Jul 17 '05 #14
On Tue, 03 Aug 2004 20:37:47 +0100, 1 wrote:
we'll worry about that in 3 years time!


Isn't that the thinking that got us into the Y2K mess?

La'ie Techie

Jul 17 '05 #15
"La?ie Techie" <laie@win_remove_get_nospam_solutions.com> wrote in message
news:pan.2004.08.11.07.16.11.867680@win_remove_get _nospam_solutions.com...
On Tue, 03 Aug 2004 20:37:47 +0100, 1 wrote:
we'll worry about that in 3 years time!


Isn't that the thinking that got us into the Y2K mess?


Who said it was a mess? Paid for a new car didn't it?
Jul 17 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Steffen Brodowski | last post: by
2 posts views Thread by JR | last post: by
10 posts views Thread by mattmerc | last post: by
6 posts views Thread by Seth Illgard | last post: by
4 posts views Thread by yatin | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.