WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Picture of the Week
  • Print
Pages: [1]   Go Down

Author Topic: Picture of the Week  (Read 11771 times)

Offline Luckyluke

  • Posts: 556
  • Gender: Male
  • Let's Rock
Picture of the Week
« on: September 26, 2008, 05: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...  :cry:

Grtz,
Luc
Logged

doc

  • Guest
Re: Picture of the Week
« Reply #1 on: September 26, 2008, 06:25:05 PM »
Hello,

without any checks if the image exists, you can use the following in the index.php of your template:
Code: [Select]
<img src="<?php echo WB_URL . MEDIA_DIRECTORY; ?>/pic_week/pic-<?php echo date(&#39;W&#39;, time()); ?>.jpg" alt="" />
This should result in an output like:
Code: [Select]
<img src="http://localhost/webserver/wb27/media/pic_week/pic-39.jpg" alt="" />
Regards Christian
« Last Edit: September 26, 2008, 06:26:36 PM by doc »
Logged

Offline Luckyluke

  • Posts: 556
  • Gender: Male
  • Let's Rock
Re: Picture of the Week
« Reply #2 on: September 26, 2008, 06: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, 08:43:36 PM »
Weeks should be in xx format (week 1 := 01).

Christian
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Picture of the Week
« Reply #4 on: September 27, 2008, 10:52:02 PM »
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
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

Offline Luckyluke

  • Posts: 556
  • Gender: Male
  • Let's Rock
Re: Picture of the Week
« Reply #5 on: September 27, 2008, 11: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

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Picture of the Week
« Reply #6 on: September 27, 2008, 11: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  8-)
Just create a wysiwyg page and add an image.  :-P

Ruud
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

Offline Luckyluke

  • Posts: 556
  • Gender: Male
  • Let's Rock
Re: Picture of the Week
« Reply #7 on: September 27, 2008, 11: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  :-D    Just kidding...

Luc

// off topic
Ironically... they change the "foto der Woche" this week.
« Last Edit: September 30, 2008, 11:36:30 AM by Luckyluke »
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Picture of the Week
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2