Powered by MediaWiki
Personal tools

Tag item issue date

From B2evolution

Jump to: navigation, search

To give an example, here is a question from the forum:

Is there any way that I could add something so it shows as: Day 331 of Week 48 Wednesday November, 28 2007

This is the answer:

Find your skin, crack open index.main.php, Find and replace something similar to this:

$Item->issue_date( array(
      'before'      => ' ',
      'after'       => ' ',
      'date_format' => '\D\a\y z \o\f \W\e\e\k W\, l F\, d o',
  ) );

To understand this code: the \ escapes the character after it. I used it too often. Characters that are not escaped represent php's Data / Time arguments. See http://www.php.net/date.

Some skins have the date in an image / icon. To do that you can use multiple $Item->issue_date calls like so:

<ul class="datetime"> 
      <li class="month"> 
		<?php
			$Item->issue_date( array(
				'before'	=> '',
				'after'		=> '',
				'date_format'	=> 'm',
	    		        )
			);
		?> 
	</li> 
	<li class="day">
		<?php 
			$Item->issue_date( array(
				'before'	=> '',
				'after'		=> '',
				'date_format'	=> 'd',
				)
			);
		?>
	</li> 
</ul>

This is an example style:

ul.datetime {
	background: url(images/calendar-blue.png);
	background-repeat: no-repeat;
	width: 66px;
	height: 67px;
	text-align: center;
	float: left;
	color: white;
	font-size: 10px;
	font-weight: bold;
	margin: 0px;
	margin-top: 3px;
	margin-right: 10px;
	padding-top: 1px;
	margin-bottom: 0px;
}
 
li.month {
	list-style: none;
	padding-top: 0px;
	margin-top: 0px;
}
 
li.day {
	font-size: 35px;
	font-weight: bold;
	color: rgb(65, 65, 65);
	padding-top: 8px;
	padding-bottom: 0px;
	margin-bottom: 0px;
	letter-spacing: -1px;
	list-style: none;
}