Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Apr 2005
    Posts
    150
    Plugin Contributions
    0

    Default Show todays date

    I want to have a daily special headed with todays date.

    Now the specials box has this line;

    define('TABLE_HEADING_SPECIALS_INDEX', 'Daily Special For %s');

    It displays as "Daily Special For January"

    I want it to be "Daily special for (todays date)"

    What do I need to change "%s" to to show todays date?

    thanks.

  2. #2
    Join Date
    Aug 2005
    Posts
    26,010
    Plugin Contributions
    9

    Default Re: Show todays date

    You leave this as is but edit this file & line /includes/modules/specials_index.php Find this Line:
    Code:
    $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')) . '</h2>';
    Assuming you want month/day/year change to:
    Code:
    $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime(
    '%m/%d/%Y')) . '</h2>';
    This should get you the month day and year...you can leave out what you do not want and/or add others like the hour /min/sec
    Zen-Venom Get Bitten
    Get Your Business Found

  3. #3
    Join Date
    Aug 2005
    Posts
    26,010
    Plugin Contributions
    9

    Default Re: Show todays date

    NEWS FLASH!!! Alternatively:
    Code:
    define('TABLE_HEADING_SPECIALS_INDEX', 'Daily Special For' . date('D M d Y));
    Zen-Venom Get Bitten
    Get Your Business Found

  4. #4
    Join Date
    Aug 2005
    Posts
    26,010
    Plugin Contributions
    9

    Default Re: Show todays date

    CORRECTION:
    Code:
    define('TABLE_HEADING_SPECIALS_INDEX', 'Daily Special For' . date('D M d Y'));
    Credit to "Ajeh"
    Zen-Venom Get Bitten
    Get Your Business Found

  5. #5
    Join Date
    Apr 2005
    Posts
    150
    Plugin Contributions
    0

    Default Re: Show todays date

    Quote Originally Posted by kobra View Post
    You leave this as is but edit this file & line /includes/modules/specials_index.php Find this Line:
    Code:
    $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')) . '</h2>';
    Assuming you want month/day/year change to:
    Code:
    $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime(
    '%m/%d/%Y')) . '</h2>';
    This should get you the month day and year...you can leave out what you do not want and/or add others like the hour /min/sec

    Thanks, that got the date displayed.
    It displays the date as 01/10/07.
    How can I change it to Jan/10/2007 or better yet January 10, 2007?
    I tried changeing %m to %M but that did not work.

  6. #6
    Join Date
    Apr 2005
    Posts
    150
    Plugin Contributions
    0

    Default Re: Show todays date

    OK, the second line worked the best, but both worked.
    In case someone else has the same question I used this line in english.php

    define('TABLE_HEADING_SPECIALS_INDEX', 'Daily Special for ' . date('F d, Y'));

    It displays the date as January 10, 2007.

    Thanks Kobra and Ajeh!

 

 

Similar Threads

  1. Help making Template
    By Shiftypow in forum Basic Configuration
    Replies: 8
    Last Post: 4 Jun 2007, 07:20 AM
  2. Posting today's date
    By RummageGuy in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 Sep 2006, 04:51 PM
  3. Product - show date available
    By icemanchai in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 23 Aug 2006, 10:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •