Picture of the Week

Luckyluke

#8
Yeah, you're right. That's why I will take some pictures and put it already in a map.
You know, this place is really a small town. When a chicken and a cow dies they must close the local zoo. The baker, mayor and fireman are all the same people  :-D    Just kidding...

Luc

// off topic
Ironically... they change the "foto der Woche" this week.

Ruud

If you look at the picture of the week, you see it is allmost 3 weeks old.

Looks to me, it is something they are doing manually whenever someone sends a nice picture.

That would be easy to build  8-)
Just create a wysiwyg page and add an image.  :-P

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

Luckyluke

I've got this idea from the town where I go to ski every year.
On there site they got a "Foto der Woche".
It's no WB site. if you want to see it, click here. It's a little town on the west of Austria.

I just think something. We've got a module to display a rondom picture. Maybe the php-coders can change this module with a "picture of the day", "picture of ther week", "picture of the month" and a "random picture". Just an idea...

Grtz,
Luc

Ruud

Quote from: Luckyluke on September 26, 2008, 05:37:39 PM
I have a folder under MEDIA, for example, "pic_week". In that folder are 52 photos with the names  pic-01.jpg, pic-02.jpg and so on until pic-52.jpg.

If this is true, you don't need to test.

Week 125 will not happen.

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

doc

Weeks should be in xx format (week 1 := 01).

Christian

Luckyluke

Hey,

Thanks a lot. I will test it the following days.
What about week 1 to 10? is it pic-1.jpg or pic-01.jpg?

And there is no need for testing if the picture exist.

Grtz,
Luc

doc

#2
Hello,

without any checks if the image exists, you can use the following in the index.php of your template:
<img src="<?php echo WB_URL MEDIA_DIRECTORY?>/pic_week/pic-<?php echo date('W'time()); ?>.jpg" alt="" />

This should result in an output like:
<img src="http://localhost/webserver/wb27/media/pic_week/pic-39.jpg" alt="" />

Regards Christian

Luckyluke

Hi,

Here something for the PHP coders...

I have a folder under MEDIA, for example, "pic_week". In that folder are 52 photos with the names  pic-01.jpg, pic-02.jpg and so on until pic-52.jpg.
Well, I'm looking for a snippet that shows every week a new photo. So at week 5, it shows pic-05.jpg; at week 40 it shows pic-40.jpg.
I think this is a snipped that can be done in one line... but, I'm no coder... snif snif...  :cry:

Grtz,
Luc