Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 06:16 am EDT

Geeklog Forums

Prevoius 7 Stories Block?


Status: offline

RickW

Forum User
Full Member
Registered: 01/28/04
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
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
Text 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
 Quote

Status: offline

tmarquez

Forum User
Regular Poster
Registered: 06/17/03
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
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
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::
 Quote

All times are EDT. The time is now 06:16 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