Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 24, 2012, 06:42:39 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter
hier
und auf unserer
neuen Webseite
.
155442
Posts in
21702
Topics by
7733
Members
Latest Member:
DarrellDD
WebsiteBaker Community Forum
English
Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
(Moderator:
Argos
)
Picture of the Week
Pages: [
1
]
Go Down
Author
Topic: Picture of the Week (Read 1923 times)
Luckyluke
Offline
Posts: 555
Picture of the Week
«
on:
September 26, 2008, 04:37:39 PM »
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...
Grtz,
Luc
Logged
doc
Guest
Re: Picture of the Week
«
Reply #1 on:
September 26, 2008, 05:25:05 PM »
Hello,
without any checks if the image exists, you can use the following in the index.php of your template:
Code:
<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:
Code:
<img src="http://localhost/webserver/wb27/media/pic_week/pic-39.jpg" alt="" />
Regards Christian
«
Last Edit: September 26, 2008, 05:26:36 PM by doc
»
Logged
Luckyluke
Offline
Posts: 555
Re: Picture of the Week
«
Reply #2 on:
September 26, 2008, 05:38:28 PM »
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
Logged
doc
Guest
Re: Picture of the Week
«
Reply #3 on:
September 26, 2008, 07:43:36 PM »
Weeks should be in xx format (week 1 := 01).
Christian
Logged
Ruud
WebsiteBaker Org e.V.
Offline
Posts: 2294
Re: Picture of the Week
«
Reply #4 on:
September 27, 2008, 09:52:02 PM »
Quote from: Luckyluke on September 26, 2008, 04: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
Logged
Professional WebsiteBaker Solutions
Luckyluke
Offline
Posts: 555
Re: Picture of the Week
«
Reply #5 on:
September 27, 2008, 10:18:06 PM »
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
Logged
Ruud
WebsiteBaker Org e.V.
Offline
Posts: 2294
Re: Picture of the Week
«
Reply #6 on:
September 27, 2008, 10:28:22 PM »
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
Just create a wysiwyg page and add an image.
Ruud
Logged
Professional WebsiteBaker Solutions
Luckyluke
Offline
Posts: 555
Re: Picture of the Week
«
Reply #7 on:
September 27, 2008, 10:36:13 PM »
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
Just kidding...
Luc
// off topic
Ironically... they change the "foto der Woche" this week.
«
Last Edit: September 30, 2008, 10:36:30 AM by Luckyluke
»
Logged
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> WebsiteBaker Website Showcase
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
=====> Modules / Extensions
===> Suggestions
===> Software bugs
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
=====> Module / Extensions
===> Vorschläge
===> Softwarefehler
===> Erfahrungs und Testberichte
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...