Recent Topics

1 Aug 22, 2009 20:09    

My b2evolution Version: Not Entered

How can I get the blog post date to show up always instead of just when it's changed? I'm assuming I need to fix this bit...but no matter what I try I get fatal errors...obviously I haven't guessed right yet ;o)

$MainList->date_if_changed( array(
'before' => '',
'after' => ' | ',
'date_format' => 'M d',
) );

2 Aug 22, 2009 20:22

That bit is designed to ONLY show the date if it changed. Kinda says it in the name eh? Like, where it says MainList->date_if_changed ;)

You can take that bit out if you want, then, DEPENDING ON YOUR SKIN, edit the appropriate file to make the item post date look kinda like the date_if_changed look. That would probably involve moving the correct bit to above your post title, then setting the 'before' and 'after' parameters in the function call. I'M GUESSING it'll look something like this when you're done:

	$Item->issue_time( array( 
			'before' => '<h2 class="whatever">',
			'after' => '</h2>',
			'time_format' => 'F jS, Y',
		) );

You might want to do a "view source" to see exactly what you want for 'before' and 'after' before you make a change and upload. Oh and of course keep backups of files affected to recover from anything really bad happening.

3 Aug 22, 2009 20:47

Thanks...let me show you what I have

Page is at http://creativetutorsinternational.com/blog/blog1.php

What I want to do is put a bkg image behind the date | title

BUT...without a date showing up always the title will be over to the left and it'll look screwy

Hope I explained myself OK...

THANKS

4 Aug 22, 2009 21:38

swaitela wrote:

Hope I explained myself OK...

EdB wrote:

I'M GUESSING it'll look something like this when you're done:

	$Item->issue_time( array( 
			'before' => '<h2 class="whatever">',
			'after' => '</h2>',
			'time_format' => 'F jS, Y',
		) );

¥

5 Aug 22, 2009 22:10

But, can we use something like an if -> then statement?

I looked up ideas and came up with this but...it gives errors too so I don't have the code right but it seems like it should work unless I've totally just lost it. I'm thinking that by having the choice of two classes I can use two different backgrounds and add a left margin to the second state.

<?php
$MainList->date_if_changed( array(
'before' => '<class="datebkg">',
'after' => ' | ',
'date_format' => 'M d',
} else {
'before'=> '<class="nodatebkg">',
'after' => '',
'date_format' => 'M d',
) );
?>

6 Aug 24, 2009 09:43

you don't need the date_if_changed() code if you use the $Item->issue_time() code

¥

7 Aug 24, 2009 10:40

Yes...that's what it looked like to me in the code you gave me but no matter what I tried I kept getting errors. Kept telling me it was expecting one type of bracket and getting another...but...I quadruple checked...then had my daughter check too...all the brackets were where they were supposed to be. Guess I'm just not smart enough to make this one work. I do appreciate your help though. I have a page up and will keep trying to get this code to work for me. THANKS


Form is loading...