1 harken Mar 22, 2005 18:46
3 topanga Mar 22, 2005 21:49
4 graham Mar 22, 2005 22:30
This hack was done in part by EdB, and partly by me. I don't have time for full instructions, so I'll just put in the two sections of code to make this work. It's pretty obvious though.
This requires hacking core files, so if you're not happy with php, make sure you take a backup.
In b2evocore/_class_item.php put in the following code before the closing } ?>
/**
* EdB: hack-function to snag the image from a moblog post
* {@internal Item::moblog_quickie() }}
*/
function moblog_quickie()
{
$content = $this->content;
$img_end = '>';
$where_its_at = strpos($content, $img_end);
$where_its_at = ( $where_its_at + 1 );
$the_image = substr($content, 0, $where_its_at);
echo $the_image;
}
This goes into your skins/yourskinname/_main.php file
<?php
// Dirty trick until we get everything into objects:
$saved_blog = $blog;
$blog = 3; // Moblog
$Blog_B = Blog_get_by_ID( 3 ); // Moblog
$posts = 4;
?>
<?php
// You can restrict to specific categories by listing them in the two params below: '', array()
// '', array(9,15) will restrict to cats 9 and 15
// '9,15', array() will restrict to cats 9,15 and all their subcats
$BlogBList = & new ItemList( $blog, $show_statuses, '', $m, $w, '', array(), $author, $order, $orderby, $posts, '', '', '', '', '', '', '', '3', 'posts', $timestamp_min, $timestamp_max );
while( $Item = $BlogBList->get_item() )
{
?>
<a href="<?php $Item->permalink() ?>" title="<?php $Item->title('','',false); ?> - <?php $Item->issue_date(); ?> (<?php $Item->issue_time();?>)">
<?php //$Item->content( '#', false,'','','','' ); ?>
<?php $Item->moblog_quickie ();?>
</a>
<?php
}
// Restore after dirty trick:
$blog = $saved_blog;
?>
You'll need to change your stylesheet to make these smaller, but I'm not going to post that, because you can easily find that online, and I know somone will just copy the code. I don't want loads of sites looking like mine.
5 harken Mar 22, 2005 23:52
I appreciate it... Just so you know and not worried that I will have it look like yours...I have an artist that visits my site and I would like for her to be able to post a picture in a blog and have it appear in a "Picture of the Day" field on our page so everyone can see it. Again thanks. I'm sure I will have a question or two on this code... but It does look pretty "obvious".
6 hedera Jan 30, 2006 16:55
How can I have moblog to work in Phoenix Alpha??
Please help me.
7 balupton Jan 30, 2006 22:39
wow tin-men is a very nice looking site, i like how the images look inside the posts, and the panels.
Is that skin avaliable for download? as well as the plugins and hacks?
8 hedera Feb 03, 2006 10:33
Hedera wrote:
How can I have moblog to work in Phoenix Alpha??
Please help me.
Can nobady help me???? Please ;)
Hmm can you link his site so we can all check it out :-)