0

Since two days I'm trying to add some condition in which I compare the date-expiration of my promotion added with the date of today. If it's expired then I want to display on the text of promotion: "promo expired.."

So something like this:

$today = date( "Y-m-d" );
        <div class="main-news-content"  <?php if( [xfvalue_expiration] <  $today ){ die  "this promo is expired" ;}?>> 
            {short-story limit="300"}<div style="clear: both;"></div>
    <div class="main-news-line"></div>
    <div class="infocoupon">
    <b>Ajouter : </b> {date} | [xfgiven_expiration] <b>Date D'expiration :</b> <span class="blink">[xfvalue_expiration]</span> [/xfgiven_expiration]  {rating}
        </div>
        </div>

But no result ! How can I get the date of today ? Does datalife accept the PHP condition on her script? Ps: I added my code to page shortstory.

2 Answers2

0

You cannot input php codes into tpl files.

you must set tag in Engine/Modules/show.short.php near this line:

$news_date = $row['date'];
0

Open file index.php (newest versions engine/modules/main.php)

Find:

echo $tpl->result['main'];

Replace to:

eval (' ?' . '>' . $tpl->result['main'] . '<' . '?php ');

and

in to main.tpl you can place php

Kumar Saurabh
  • 2,297
  • 5
  • 29
  • 43
Rytis
  • 1
  • 2