in your functions.inc file, replace the function plugin_centerblock_inmemoriam() with this one:
Text Formatted Code
//creates a centerblock on the index page
function plugin_centerblock_inmemoriam($where=1,$page=1,$topic =''){
global $INM_CONF, $_TABLES, $INM_TABLES, $_USER;
$pi_name = $INM_CONF['pi_name']; // Plugin name
$retval = '';
if (DB_getItem($INM_TABLES['settings'], 'anonview') == 0 && $_USER['uid'] <= 1){
return '';
}
// Retrieve Centerblock Settings
$result = DB_query("SELECT id, cntrblktype, cntrblkpage, cntrblkpos FROM {$INM_TABLES['albums']} WHERE featured='1'" . COM_getPermSQL('and'));
// Check user has rights to view this cb, if so, do it.
if (DB_numRows($result) == 1) {
list($id,$type,$cntrblkpage,$cntrblkpos) = DB_fetchArray($result);
// If enabled only for homepage and this is not page 1 or a topic page, then set disable flag
if ($cntrblkpage == 'none'){
if ($page > 1 OR $topic != ""){
$cntrblkenable = 0;
} else $cntrblkenable = 1;
// If enabled for all pages and this is not page 1, then set disable flag
} elseif ($cntrblkpage == 'all'){
if ($page > 1 ){
$cntrblkenable = 0;
} else $cntrblkenable = 1;
// If enabled for a single topic and this is it, then enable
} elseif ($cntrblkpage == $topic){
$cntrblkenable = 1;
}
// Check if there are no featured articles in this topic and if so then place it at the top of the page
if ($topic != "") {
$wheresql = "WHERE tid='$topic' AND featured > 0";
} else {
$wheresql = "WHERE featured = 1";
}
$query = DB_query("SELECT count(*) as count FROM {$_TABLES['stories']} $wheresql");
$result = DB_fetchArray($query);
if ($result['count'] == 0 && $cntrblkpos == 2) {
$cntrblkpos = 1;//top of page
}
if ($cntrblkenable AND $cntrblkpos == $where) {
if (DB_getItem($_TABLES['plugins'],'pi_enabled', 'pi_name = "' .$pi_name. '"')){
$retval = inm_featuredAlbum($id,$type);
return $retval;
}
}
}
}