e107help.org Q&A
0 like 0 dislike

I try to create a menu that displays a different image by date.

I started with this code, but I get an error. Where is the problem?

+ ----------------------------------------------------------------------------+
|     e107 website system

$text = "
<div style='text-align: center'>
<div class='spacer'>
switch(date('Y-m-d')) {
  // specific date image
  case '2017-12-25':
    print '<img src="/path/to/christmas.jpg" alt="" />';
case '2018-01-01':
    print '<img src="/path/to/newy.jpg" alt="" />';
  // fallback image
    print '<img src="/path/to/default.jpg" alt="" />';
$ns -> tablerender(EVCOUNT_L1,  $text, 'eventcount');

e107 version v. 0.7
in Plugins by (2 points)
This is for v7 ??? Anyway : code errors due to the use of single ' and/or " (apostrophs) You start a 'piece/block"by $text= " >> so everything below this (till close) NO double " (apostrph.) rest unsure think best to make it a simple page (on root ala test php) and ttry calling in i frame inside menu ??

2 Answers

0 like 0 dislike
You are messing php text/string variables with php functions. Really php fundamental knowledge, nothing related with e107.
by (1.6k points) 8 36 48
0 like 0 dislike
And it was already some v1.4x plugins that do just that....
by (297 points) 11 31 34
Welcome to e107 Q&A, where you can ask questions and receive answers from other members of the e107 community.
805 questions
1,208 answers
580 users