Well, COM_olderstuff is the function, but it does not return anything.
So I made an identical function with a return at the bottom, and it works. You might want to add it to your lib-custom
Text Formatted Code
function TEST_olderStuff()
{
global $_TABLES, $_CONF;
$sql = "SELECT sid,tid,title,comments,UNIX_TIMESTAMP(date) AS day FROM {$_TABLES['stories']} WHERE (perm_anon = 2) AND (date <= NOW()) AND (draft_flag = 0)" . COM_getTopicSQL( 'AND', 1 ) . " ORDER BY featured DESC, date DESC LIMIT {$_CONF['limitnews']}, {$_CONF['limitnews']}";
$result = DB_query( $sql );
$nrows = DB_numRows( $result );
if( $nrows > 0 )
{
$dateonly = $_CONF['dateonly'];
if( empty( $dateonly ))
{
$dateonly = '%d-%b'; // fallback: day - abbrev. month name
}
$day = 'noday';
$string = '';
for( $i = 0; $i < $nrows; $i++ )
{
$A = DB_fetchArray( $result );
$daycheck = strftime( '%A', $A['day'] );
if( $day != $daycheck )
{
if( $day != 'noday' )
{
$daylist = COM_makeList( $oldnews, 'list-older-stories' );
$daylist = preg_replace( "/(1512)|(15)|(12)/",
'', $daylist );
$string .= $daylist . '<br>';
}
$day2 = strftime( $dateonly, $A['day'] );
$string .= '<b>' . $daycheck . '</b> <small>' . $day2
. '</small>' . LB;
$oldnews = array();
$day = $daycheck;
}
$oldnews[] = '<a href="' . COM_buildUrl( $_CONF['site_url']
. '/article.php?story=' . $A['sid'] ) . '">' . $A['title']
. '</a> (' . $A['comments'] . ')';
}
if( !empty( $oldnews ))
{
$daylist = COM_makeList( $oldnews, 'list-older-stories' );
$daylist = preg_replace( "/(1512)|(15)|(12)/", '', $daylist );
$string .= $daylist;
$string = addslashes( $string );
DB_query( "UPDATE {$_TABLES['blocks']} SET content = '$string' WHERE name = 'older_stories'" );
}
}
return $string;
}
There might be a better way of doing this. Dirk would know better.