image of the week type script?

This is a discussion on image of the week type script? within the PHP Language forums, part of the PHP Programming Forums category; hi there i need a site where the client can upload an image every week, with a caption, (so pref ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-03-2004
1
 
Posts: n/a
Default image of the week type script?

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



Reply With Quote
  #2 (permalink)  
Old 08-03-2004
Justin Koivisto
 
Posts: n/a
Default Re: image of the week type script?

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 - spam@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Reply With Quote
  #3 (permalink)  
Old 08-03-2004
Justin Koivisto
 
Posts: n/a
Default Re: image of the week type script?

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 - spam@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Reply With Quote
  #4 (permalink)  
Old 08-03-2004
1
 
Posts: n/a
Default Re: image of the week type script?

the archive will be ongoing - i.e. no upper limit...

"Margaret MacDonald" <scratch65536@att.not.invalid> wrote in message
news:9obvg05sc1ietus4ba9fdtrfj34qfj9e8a@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

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.)



Reply With Quote
  #5 (permalink)  
Old 08-03-2004
1
 
Posts: n/a
Default Re: image of the week type script?

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" <spam@koivi.com> wrote in message
news:cdOPc.25$j1.974@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 - spam@koivi.com
> PHP POSTERS: Please use comp.lang.php for PHP related questions,
> alt.php* groups are not recommended.



Reply With Quote
  #6 (permalink)  
Old 08-03-2004
Geoff Berrow
 
Posts: n/a
Default Re: image of the week type script?

I noticed that Message-ID: <lbOPc.24$j1.974@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/
Reply With Quote
  #7 (permalink)  
Old 08-03-2004
Toby Inkster
 
Posts: n/a
Default Re: image of the week type script?

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

Reply With Quote
  #8 (permalink)  
Old 08-03-2004
Justin Koivisto
 
Posts: n/a
Default Re: image of the week type script?

1 wrote:
>
> "Justin Koivisto" <spam@koivi.com> wrote in message
> news:cdOPc.25$j1.974@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 - spam@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Reply With Quote
  #9 (permalink)  
Old 08-03-2004
Justin Koivisto
 
Posts: n/a
Default Re: image of the week type script?

Geoff Berrow wrote:

> I noticed that Message-ID: <lbOPc.24$j1.974@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 - spam@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Reply With Quote
  #10 (permalink)  
Old 08-03-2004
1
 
Posts: n/a
Default Re: image of the week type script?

"Toby Inkster" <usenet200408@tobyinkster.co.uk> wrote in message
news:pan.2004.08.03.17.30.49.424676@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!



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:32 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0