Subject: Prevoius 7 Stories Block?

Posted on: 30/07/05 02:45pm
By: RickW

On my front page, I show the newest 3 Articles intros.

What I would like to do, is have a 4th block that lists the next 7 stories without intros.

Anybody have some custom code for this?

Prevoius 7 Stories Block?

Posted on: 30/07/05 08:39pm
By: machinari

function phpblock_nextSeven()
{
    global $_TABLES, $_CONF;
    $result = DB_query("SELECT sid,title FROM {$_TABLES['stories']} 
        WHERE (draft_flag = 0) AND (date <= NOW()) AND (frontpage='1')"
        . COM_getPermSQL ('AND') . " ORDER BY date desc LIMIT 10");
    $nrows  = DB_numRows($result);

    if( $nrows > 0 ){
        $string = '';
        $seven = array();

        for( $i = 0; $i < $nrows; $i++ ){
            $A = DB_fetchArray( $result );
            if ($i >= 3){
                $string .= $seven . '<br>';
                $seven[] = '<a href="' . COM_buildUrl( $_CONF['site_url']
                        . '/article.php?story=' . $A['sid'] ) . '">' . $A['title']
                        . '</a>';
            }
        }
        if( !empty( $seven )){
            $sevenlist = COM_makeList( $seven, 'list-next7-stories' );
        }
    }
    return $sevenlist;
}


this returns the next 7 stories after the most recent 3.
HTH

Re: Prevoius 7 Stories Block?

Posted on: 22/11/06 10:48pm
By: tmarquez

Wanted to thank you machinari. I was able to utilize your excellent example to make a "NEWS" section of my web site that I think looks great. (Of course I'm biased). I used a static page with your code and modified it a few times to pull from the various topics I have. At first I was attempting to accomplish the same look using RSS feeds, but your example proved to be better inspiration. Thanks.

Re: Prevoius 7 Stories Block?

Posted on: 27/09/08 02:53pm
By: koalasoft

I try run in Geeklog 1.5.1 .. but ..only view 1 new :-(

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=55954