Recent Topics

Post list widget to show date?

Started by on May 24, 2008 – Contents updated: May 24, 2008

May 24, 2008 17:10    

I'm upgrading my blog to the latest b2evo version, and I'm wondering: is it possible to have the date the post was made, next to the list?

I'm using Post List widget to show my recent posts on my homepage, and would really love to have the date showing next to it, like the latest news section on this website:

http://www.thedoogles.com/

I've got the post list widget working fine, I just don't know how to get the date of the post to show.

Any help would be wonderful!

By the way, I'm really loving the 2.0 version, it's such a great improvement!

May 31, 2008 03:47

1. Open inc\widgets\widgets\_coll_post_list.widget.php and replace the function on line 123

PHP

function display$params )
    {    
        $params['show_date'] = 1;
        $this->init_display$params );
        
        // List of posts:
        $this->disp_item_list'posts' );
 
        return true;
    }

2. Open inc\widgets\model\_widget.class.php and replace the *while* loop on line 485

PHP

while( $Item = & $ItemList->get_item() )
{
    echo $this->disp_params['item_start'];
    
    if( isset($this->disp_params'show_date' ]) )
    {
        $Item->issue_datearray(
                'before'      => '',
                'after'       => ' ',
                'date_format' => '#',
            ) );
    }
    
    $Item->titlearray(
            'link_type' => 'permalink',
        ) );
    if( $this->disp_params'disp_excerpt' ] )
        echo '<p>'.$Item->dget'excerpt''htmlbody' ).'</p>';// no formatting in excerpts
 
    echo $this->disp_params['item_end'];
}

Search the forum or php manual on how to set date_format

May 31, 2008 07:58

Thanks so much! It works perfectly!

May 31, 2008 14:20

any idea how to make post list widget display by view count ? and if possible according to starrating ? (:

May 31, 2008 17:17

Starrating has its own top list (I've never used it).

any idea how to make post list widget display by view count

I'll try it

Jun 02, 2008 14:15

sam2kb wrote:

Starrating has its own top list (I've never used it).

i ve tried, but couldnt get it working :P gives mysql errors anyway it aint that important

any idea how to make post list widget display by view count

sam2kb wrote:

I'll try it

thanks

Jun 08, 2008 04:24

I'll try it

Sorry, I'm too busy to get it done, have to finish 2 websites.

You need to edit the following lines in starrating plugin 170-200, nothing else.
The plugin uses an old ItemList function, try ItemListLight instead. Check how the linkblog widget does it.

Good luck

Jun 08, 2008 05:31

Where can I find this "Post List" Widget?

Jun 08, 2008 06:11

Blog settings->Widgets->Add Widget


Form is loading...

Run your own website! – This forum is powered by b2evolution CMS, a complete engine for your website.