Skin Tools | > Module written by Matt Mecham | > Date started: 22nd January 2004 | | > Module Version Number: 1.0.0 | > DBA Checked: Tue 25th May 2004 +-------------------------------------------------------------------------- */ if ( ! defined( 'IN_ACP' ) ) { print "
{$html}
";
$this->altered = "
";
$this->inherited = "
";
//-----------------------------------------
// check (please?)
//-----------------------------------------
if ( ! $SEARCH_word )
{
$ibforums->main_msg = "You must enter a search word";
$this->searchreplace_start();
}
//-----------------------------------------
// Get set stuff
//-----------------------------------------
$this_set = $DB->simple_exec_query( array( 'select' => '*', 'from' => 'skin_sets', 'where' => 'set_skin_set_id='.$SEARCH_set ) );
if ( ! $this_set['set_skin_set_id'] )
{
$ibforums->main_msg = "No such set was found in the DB";
$this->searchreplace_start();
}
//-----------------------------------------
// Get templates from DB
//-----------------------------------------
if ( $SEARCH_all )
{
$templates = $ibforums->cache_func->_get_templates( $this_set['set_skin_set_id'], $this_set['set_skin_set_parent'], 'all' );
}
else
{
$DB->simple_construct( array( 'select' => '*', 'from' => 'skin_templates', 'where' => 'set_id='.$SEARCH_set ) );
$DB->simple_exec();
while ( $r = $DB->fetch_row() )
{
$templates[ $r['group_name'] ][ strtolower($r['func_name']) ] = $r;
}
}
if ( ! count( $templates ) )
{
$ibforums->main_msg = "Couldn't locate any templates to search in!";
$this->searchreplace_start();
}
//-----------------------------------------
// Go fru dem all and search
//-----------------------------------------
foreach( $templates as $group => $d )
{
foreach( $templates[ $group ] as $tmp_name => $tmp_data )
{
if ( strstr( strtolower( $tmp_data['section_content'] ), strtolower( $SEARCH_word ) ) )
{
$final[ $group ][] = $tmp_data;
$matches[ $group ]++;
}
}
}
//-----------------------------------------
// Print..
//-----------------------------------------
if ( ! count($final) )
{
$ibforums->html .= "
";
}
else
{
$g['easy_preview'] = "
";
}
$groups[] = $g;
}
//-----------------------------------------
// Sort by easy_name
//-----------------------------------------
usort($groups, array( 'ad_skintools', 'perly_alpha_sort' ) );
//-----------------------------------------
// Start the output
//-----------------------------------------
$ibforums->html .= "![]() |
{$group['easy_name']} ({$search_match} matches) | {$group['easy_preview']} |
";
}
$temp .= "
