Barristan is the winner!
Thanks, man.
While I have this thread here, and apparently the attention of some who know PHP, I'm going to work on a couple other mods I have had planned. If I run into trouble I'll be posting it here.
Does this "hook" work by sort of intercepting the arrays, modifying them, and then sending them to the template?
/**
* Remove Forums from Board Index
* @file tbRfbiBoardIndex.php Skin overloader (skin_boards)
*
* @copyright (c) 2006 - 2013 Invision Byte
* @link http://www.invisionbyte.net/
* @author Terabyte
* @since 17/12/2010
* @updated 07/08/2011
* @version 2.0.0 (20000)
*/
class tbRfbiBoardIndex extends skin_boards(~id~)
{
public function boardIndexTemplate( $lastvisit="", $stats=array(), $cat_data=array(), $show_side_blocks=true, $side_blocks=array() )
{
/* Prepare.. */
$this->settings['tb_rfbi_forums'] = IPSText::cleanPermString( $this->settings['tb_rfbi_forums'] );
if ( $this->settings['tb_rfbi_forums'] && is_array($cat_data) && count($cat_data) )
{
/* ..and explode! */
$idsToHide = array_flip( explode(',', $this->settings['tb_rfbi_forums']) ); // Flip it!
foreach( $cat_data as $catIndex => $catData )
{
/* Take care of the categories */
if ( isset($idsToHide[ $catData['cat_data']['id'] ]) )
{
unset( $cat_data[ $catIndex ], $idsToHide[ $catData['cat_data']['id'] ] );
/* Count check */
if ( !count($idsToHide) )
{
break;
}
}
/* Take care of forums */
elseif ( is_array($catData['forum_data']) && count($catData['forum_data']) )
{
foreach( $catData['forum_data'] as $fIndex => $fData )
{
if ( isset($idsToHide[ $fIndex ]) )
{
unset( $cat_data[ $catIndex ]['forum_data'][ $fIndex ], $idsToHide[ $fIndex ] );
/* Count check */
if ( !count($idsToHide) )
{
break 2;
}
}
/* Take care of subforums */
elseif ( is_array($fData['subforums']) && count($fData['subforums']) )
{
foreach( $fData['subforums'] as $subIndex => $subData )
{
if ( isset($idsToHide[ $subData[0] ]) )
{
unset( $cat_data[ $catIndex ]['forum_data'][ $fIndex ]['subforums'][ $subIndex ], $idsToHide[ $subData[0] ] );
/* Count check */
if ( !count($idsToHide) )
{
break 3;
}
}
}
}
}
}
}
}
return parent::boardIndexTemplate( $lastvisit, $stats, $cat_data, $show_side_blocks, $side_blocks );
}
}
Okay I can't figure it out without spending days and days studying PHP. Does anyone know how I can modify the above code to hide an entire forum category (ID: 45) from the index page, excluding (allowing it to show) for all members in a particular group (ID: 17)?
The settings for this hook only allow me to hide categories, forums , and subforums from the index page for all groups. I want to add a conditional to hide it from all but one, or a list of groups.
Yeah I get the general idea, but I need to know the actual variables/arrays and how to get them.
Yeah I get the general idea, but I need to know the actual variables/arrays and how to get them.
I think you'll have to find out how to obtain the current user and his group because nobody seems to know how to do that ![]()
0 members, 1 guests, 0 anonymous users