 |
boardom b2 message board
|
View previous topic :: View next topic |
Author |
Message |
suicidekills
Joined: 19 Aug 2004 Posts: 2 Location: Oregon
|
Posted: Tue Sep 14, 2004 10:17 pm Post subject: posts not grouped |
|
|
is there a way that i can ungroup the posts if they're posted on the same day?
like... if two posts are posted on the same day, instead of them being under one date header, they become two seperate posts...
is there a way to do that? i tried doing a search for like an hour and i didn't find anything clooose to that. |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 527 Location: Oslo, Norway
|
Posted: Wed Sep 15, 2004 9:59 am Post subject: |
|
|
The b2 loop only repeats the PHP the_date function 1 time pr. day, but your posts should be seperated anywho by individual id's that can be called by index.php?p=number of post
What I've done on my page is using a big <h1> for the date headers while a <h2> that is just as wee bit smaller for the title, making it look like seperated entries (which they are). And then I've got some extra <br />'s before the end of the b2-loop which makes them seperated by some white space.
It's probably possible to make the b2-loop repeat the the_date function on every post, but this requires some php coding skillZ. _________________ Sigg3 dot net - because you're worth it! | b2 Cafelog Resource Center |
|
Back to top |
|
 |
shellorz
Joined: 14 Sep 2004 Posts: 12 Location: France
|
Posted: Wed Sep 15, 2004 9:27 pm Post subject: |
|
|
If you want your posts to stand out, why not putting them in "blocks" by modifying your css file.
For instance, if the DIV class of your posts is "content", then you can use something in the like :
Code: |
.content {
position:relative;
/*min-width:120px;*/
margin-top:20px;
margin-right:10px;
border:1px solid red;
background-color:white;
padding:10px;
} |
If you wanna display the date for every post even for the same day, I think you can change the function the_date (in the b2templatefunctions.php file unde b2-incude) like this
Code: | function the_date($d='', $before='', $after='', $echo = 1) {
global $id, $postdata, $day, $previousday,$dateformat,$newday;
$the_date = '';
if ($day != $previousday) {
$the_date .= $before;
if ($d=='') {
$the_date .= mysql2date($dateformat, $postdata['Date']);
} else {
$the_date .= mysql2date($d, $postdata['Date']);
}
$the_date .= $after;
$previousday = $day;
}
$the_date = apply_filters('the_date', $the_date);
if ($echo) {
echo $the_date;
} else {
return $the_date;
}
}
|
change it to this :
Code: |
function the_date($d='', $before='', $after='', $echo = 1) {
global $id, $postdata, $dateformat;
$the_date = $before;
if ($d=='')
{
$the_date .= mysql2date($dateformat, $postdata['Date']);
}
else
{
$the_date .= mysql2date($d, $postdata['Date']);
}
$the_date .= $after;
$the_date = apply_filters('the_date', $the_date);
if ($echo) {
echo $the_date;
} else {
return $the_date;
}
}
|
That should work out. _________________ Make yourself at home but DON'T touch my Porn. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB 2 © 2001, 2002 phpBB Group
|