Recent Topics

1 Jul 29, 2004 00:05    

I'm currently working on a new skin and would like to be able to change the appearance of the date. I know how to change it's format (e.g. from 31/05/04 to 31 May 2004), but I can't figure out how to center it, give it a unique background etc.

I've tried creating a new class called .bDate and including that in the <h2> tag (ie <h2 class="bDate">), but that seems to have no effect.

Any ideas?

Thanks

2 Jul 29, 2004 05:25

You can change the visual appearance through the CSS, but to change the actual format have a look at conf/_locales.php

The format b2evo uses for that date is based on the locale defined in that file


$default_locale = 'en-US';



for me, which corresponds to this line of code


	'en-US' => array( 'name' => NT_('English (US)'),
										'charset' => 'iso-8859-1',
										'datefmt' => 'l, F d',
										'timefmt' => 'h:i:s a',
										'messages' => 'en_US',
										'enabled' => 1,

You can successfully edit the date format portion of the array with any PHP date format variables. See http://www.php.net/date for the different options.

HTH,
Matt

4 Jul 29, 2004 10:54

Thanks guys. But this did not address my question. Note my original post stated:

I know how to change it's format (e.g. from 31/05/04 to 31 May 2004)

What I want to do is create a style for the date. At the moment, it's aligned on the left. But I want to center it, and give it a different background. Kind of like a header for each post.

5 Jul 29, 2004 17:01

whoops! *slaps forehead*

OK, so now that I understand the question correctly let's try this.

The date/single post title/etc all gets displayed from the following line of code in your _main.php file which comes immediately after the bPosts div start.


<h2><?php
							single_cat_title();
							single_month_title();
							single_post_title();
							arcdir_title();
							last_comments_title();
							stats_title();
							profile_title();
						?></h2>

That is where the styling can be done. If it were me I would use another div or span to replace the <h2> tags so that the formatting will take. Then style that class accordingly.

6 Jul 29, 2004 23:57

Hi mattbta,

I have tried that, but for some reason it does not work. I created the following new style:

.Date {
	color: #FF9900;
	background: #000000;
	text-align: center;
	width: 100%;
	margin: 0;
	padding: 0;
}

and included it as so:

<h2 class="Date">
<?php
	single_cat_title();
	single_month_title();
	single_post_title();
	arcdir_title();
	last_comments_title();
	stats_title();
	profile_title();
?></h2>

For some reason, this does not work. Even if you just alter the <h2> tag by introducing the .Date elements to it, it doesn't work. The only thing that seems to work with the date is if you change the text-color of the <h2> tag. Note, it is easier to see the dodgy effects of messing with the <h2> tag if you view it in Explorer.

The other thing I noticed is that if you try to move the code for the date (e.g. to inside the bPost div [as opposed to bPosts div]), it stays in the same place i.e. above the bPost div in the bPosts div.

I think I'm chucking this one in the too hard basket.

7 Jul 30, 2004 00:06

Whoops again on my part. Instead of making a new class for it, just edit the css for


.bPosts h2  {
}

That's what controls the h2 element if you're using a skin. Sorry for the run around...I knew there had to be something simple. So take all the css for that class you made, and put it there in the .bPosts h2 declaration.

9 Jul 31, 2004 05:29

mattbta, thanks for the advice. It did work.

isaac, thanks for the links. I'm learning more and more all the time.


Form is loading...