Welcome to Geeklog Friday, December 15 2017 @ 03:31 am EST


Status: offline

RickW

Forum User
Full Member
Registered: 28/01/2004
Posts: 240
Location:United States
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?
www.antisource.com

Status: offline

machinari

Forum User
Full Member
Registered: 22/03/2004
Posts: 1512
PHP Formatted Code

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

Status: offline

tmarquez

Forum User
Regular Poster
Registered: 17/06/2003
Posts: 70
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.
T.Marquez Jr. - Webmaster - www.indianapolisfilm.net - Geeklog 1.4.0sr5-1

Status: offline

koalasoft

Forum User
Full Member
Registered: 09/03/2005
Posts: 242
Location:Mexico
I try run in Geeklog 1.5.1 .. but ..only view 1 new :-(
**Cuando el Alumno esta listo, el Maestro Aparece ** ::Geeklog support in Spanish::

All times are EST. The time is now 03:31 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content