Used an Affiliates add on that I found on this site, and it's not working. I need something to create a links block on my page
dadesentinel.com. Any advice would be great.
Text Formatted Code
function phpblock_Affiliate()
{
global $_CONF, $_TABLES, $LANG10;
$result = DB_query( "SELECT lid,url,title,hits from {$_TABLES['links']} WHERE category = 'Affiliates' ORDER BY title" );
$nrows = DB_numRows( $result );
$affil_templates = new Template( $_CONF['path_layout'] . 'stats' );
$affil_templates->set_file( array(
'itemstats'=>'itemstatistics.thtml',
'statrow'=>'singlestat.thtml'
));
if( $nrows > 0 )
{
//uncomment if you would like the links/stats headers to display
//$affil_templates->set_var( 'item_label', $LANG10[19] );
//$affil_templates->set_var( 'stat_name', $LANG10[20] );
for( $i = 0; $i < $nrows; $i++ )
{
$A = DB_fetchArray( $result );
$affil_templates->set_var( 'item_url', $_CONF['site_url'] . '/portal.php?url=' . $A['url'] . '&what=link&item=' . $A['lid'] );
$affil_templates->set_var( 'item_text', stripslashes( str_replace( '$', '$', $A['title'] )));
// uncomment if you would like the stats to display next to the affiliate
//$affil_templates->set_var( 'item_stat', $A['hits'] );
$affil_templates->parse( 'stat_row', 'statrow', true );
}
$affil_templates->parse( 'output', 'itemstats' );
$retval .= $affil_templates->finish( $affil_templates->get_var( 'output' ));
}
else
{
$retval .= $LANG10[21];
}
return $retval;
}