Support Forums

Old 04-21-2006, 04:05 AM   #1
Member
 
Join Date: Mar 2006
Location: Sweden
Posts: 62
Rep Power: 15
quickbiz will become famous soon enough
Default Year

Hi

I dont want the year to show in the toplisting "20 Apr 2006 " How do i remove that?

Regards

//Bosse
quickbiz is offline  
Old 04-21-2006, 04:21 AM   #2
The Master
 
Maffo's Avatar
 
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 45
Maffo is just really niceMaffo is just really nice
Default

Go to Templates/Default/showlistings (if default is your default template folder).

Open showlistings.tpl

Locate this piece of code

PHP Code:
{if $sDisDateAdded == "Y"}
         <
td{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.dateadded|date_format:$dateformat}</td>
         {/if} 
It is the $dateformat that you can change.

For example {$entry.dateadded|date_format:"%d %b"}

will produce 21 Apr

This is from the smarty website so have a play around with it and find out how it works.

PHP Code:
index.php:

$smarty = new Smarty;
$smarty->assign('yesterday'strtotime('-1 day'));
$smarty->display('index.tpl');

index.tpl:


{
$smarty.now|date_format}
{
$smarty.now|date_format:"%A, %B %e, %Y"}
{
$smarty.now|date_format:"%H:%M:%S"}
{
$yesterday|date_format}
{
$yesterday|date_format:"%A, %B %e, %Y"}
{
$yesterday|date_format:"%H:%M:%S"}

OUTPUT:

Feb 62001
Tuesday
February 62001
14
:33:00
Feb 5
2001
Monday
February 52001
14
:33:00

Example 5
-9. date_format conversion specifiers

%abbreviated weekday name according to the current locale 

%full weekday name according to the current locale 

%abbreviated month name according to the current locale 

%full month name according to the current locale 

%preferred date and time representation for the current locale 

%century number (the year divided by 100 and truncated to an integerrange 00 to 99

%
day of the month as a decimal number (range 00 to 31

%
same as %m/%d/%

%day of the month as a decimal numbera single digit is preceded by a
space 
(range 1 to 31

%
Week-based year within century [00,99]

%
Week-based yearincluding the century [0000,9999]

%
same as %

%hour as a decimal number using a 24-hour clock (range 00 to 23

%
hour as a decimal number using a 12-hour clock (range 01 to 12

%
day of the year as a decimal number (range 001 to 366

%
Hour (24-hour clocksingle digits are preceded by a blank. (range 0 to 23)

%
hour as a decimal number using a 12-hour clocksingle digits preceeded by
a space 
(range 1 to 12)

%
month as a decimal number (range 01 to 12

%
minute as a decimal number 

%newline character 

%either `am' or `pm' according to the given time value, or the corresponding strings for the current locale 

%r - time in a.m. and p.m. notation 

%R - time in 24 hour notation 

%S - second as a decimal number 

%t - tab character 

%T - current time, equal to %H:%M:%S 

%u - weekday as a decimal number [1,7], with 1 representing Monday 

%U - week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week 

%V - The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1
is the first week that has at least 4 days in the current year, and with Monday as the first day of the week. 

%w - day of the week as a decimal, Sunday being 0 

%W - week number of the current year as a decimal number, starting with the first Monday as the first day of the first week 

%x - preferred date representation for the current locale without the time 

%X - preferred time representation for the current locale without the date 

%y - year as a decimal number without a century (range 00 to 99) 

%Y - year as a decimal number including the century 

%Z - time zone or name or abbreviation 

%% - a literal `%' 
character 
__________________
**Bulk Upload System** has been upgraded. Works on all v4 versions with new functionality. Free upgrade for existing customers.
Maffo is offline  
Old 04-21-2006, 07:20 AM   #3
Member
 
Join Date: Mar 2006
Location: Sweden
Posts: 62
Rep Power: 15
quickbiz will become famous soon enough
Default

Quote:
Originally Posted by Maffo
Go to Templates/Default/showlistings (if default is your default template folder).

Open showlistings.tpl

Locate this piece of code

PHP Code:
{if $sDisDateAdded == "Y"}
         <
td{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.dateadded|date_format:$dateformat}</td>
         {/if} 
It is the $dateformat that you can change.

For example {$entry.dateadded|date_format:"%d %b"}

will produce 21 Apr

This is from the smarty website so have a play around with it and find out how it works.

PHP Code:
index.php:

$smarty = new Smarty;
$smarty->assign('yesterday'strtotime('-1 day'));
$smarty->display('index.tpl');

index.tpl:


{
$smarty.now|date_format}
{
$smarty.now|date_format:"%A, %B %e, %Y"}
{
$smarty.now|date_format:"%H:%M:%S"}
{
$yesterday|date_format}
{
$yesterday|date_format:"%A, %B %e, %Y"}
{
$yesterday|date_format:"%H:%M:%S"}

OUTPUT:

Feb 62001
Tuesday
February 62001
14
:33:00
Feb 5
2001
Monday
February 52001
14
:33:00

Example 5
-9. date_format conversion specifiers

%abbreviated weekday name according to the current locale 

%full weekday name according to the current locale 

%abbreviated month name according to the current locale 

%full month name according to the current locale 

%preferred date and time representation for the current locale 

%century number (the year divided by 100 and truncated to an integerrange 00 to 99

%
day of the month as a decimal number (range 00 to 31

%
same as %m/%d/%

%day of the month as a decimal numbera single digit is preceded by a
space 
(range 1 to 31

%
Week-based year within century [00,99]

%
Week-based yearincluding the century [0000,9999]

%
same as %

%hour as a decimal number using a 24-hour clock (range 00 to 23

%
hour as a decimal number using a 12-hour clock (range 01 to 12

%
day of the year as a decimal number (range 001 to 366

%
Hour (24-hour clocksingle digits are preceded by a blank. (range 0 to 23)

%
hour as a decimal number using a 12-hour clocksingle digits preceeded by
a space 
(range 1 to 12)

%
month as a decimal number (range 01 to 12

%
minute as a decimal number 

%newline character 

%either `am' or `pm' according to the given time value, or the corresponding strings for the current locale 

%r - time in a.m. and p.m. notation 

%R - time in 24 hour notation 

%S - second as a decimal number 

%t - tab character 

%T - current time, equal to %H:%M:%S 

%u - weekday as a decimal number [1,7], with 1 representing Monday 

%U - week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week 

%V - The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1
is the first week that has at least 4 days in the current year, and with Monday as the first day of the week. 

%w - day of the week as a decimal, Sunday being 0 

%W - week number of the current year as a decimal number, starting with the first Monday as the first day of the first week 

%x - preferred date representation for the current locale without the time 

%X - preferred time representation for the current locale without the date 

%y - year as a decimal number without a century (range 00 to 99) 

%Y - year as a decimal number including the century 

%Z - time zone or name or abbreviation 

%% - a literal `%' 
character 
Thanks Maffo



Regards

//Bosse
quickbiz is offline  
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Year Eve Plans SkGold Off Topic 5 12-31-2006 09:19 AM
Birthdate Field Jake v3.1 Questions & Support 4 11-06-2006 11:07 AM
Extra Field numbers showing numerically GSP v3.0 Questions & Support 1 05-01-2006 05:36 PM
30 day bold/highlighted on 1 year ad? Lagniappe v3.0 Questions & Support 3 04-18-2006 10:46 AM


All times are GMT -4. The time now is 06:03 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0