473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 2112
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Steffen Brodowski | last post by:
Hello everyone, since one week, I'm programming with python. Its a realy interesting tool. I wrote a script for generating barcodes in jpg-format. Everything is ok, but my function...
2
by: JR | last post by:
Is there a script available to automatically reload images on visiting a page? I change images once a week and they have the same name so I'm not changing the page code. Some people have the...
10
by: mattmerc | last post by:
Hi all, I posted this about a week back with no response so I want to try again. I have a weird questions in regards to working with sql image data types. I know how to take the image type and...
0
by: wizardworkz | last post by:
Hello All! Having a bit of a problem combining php with javascript here. What I have is a store with images (There will be a smaller image of each item, and a larger image of each item, but I want...
6
by: Seth Illgard | last post by:
Hi, Im writting a custom CMS and everything looks great, except when I see the results in IE. What im trying to do is: *Have an image in a layer (or relative positioned, or just margined). The...
2
by: Tarik Monem | last post by:
OK! I've gone through a few tutorials and I cannot understand what I'm doing wrong casting_registration.php <table> <tr> <td> <form enctype="multipart/form-data" action="thankyou.php"...
3
by: xxtokenxx | last post by:
I am writing a birthday list for a site for my school. While developing it. Currently the code for the output of birthdays is: <html><head> <title>Birthday List</title><script...
1
by: rsteph | last post by:
I've got some product information pages, with images and text, all setup within a table. I'm trying to add a small image in the upper right hand corner of the content div (where all the important...
4
by: yatin | last post by:
hi, friend. i have a problem in image validation plz check it. i have to include a image validation in foam 1. but i sending a details through form2. But when i include a image validation in foam1,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

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.