Cool Plugin, but I still can not hide the Buttons
home, lastcom, topn and favpics
Any Suggestions?
Thanks for help
here is my codebase.php
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2005 Coppermine Dev Team
v1.1 originaly written by Gregory DEMAR
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
********************************************
Coppermine version: 1.4.1
$Source: /cvsroot/cpg-contrib/master_template/codebase.php,v $
$Revision: 1.3 $
$Author: donnoman $
$Date: 2005/12/08 05:46:49 $
**********************************************/
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
$thisplugin->add_filter('page_html','final_extract_page_html');
function final_extract_block(&$template, $block_name, $subst='')
{
$pattern = "#(<!-- BEGIN $block_name -->)(.*?)(<!-- END $block_name -->)#s";
if ( preg_match($pattern, $template, $matches)){
$template = str_replace($matches[1].$matches[2].$matches[3], $subst, $template);
return $matches[2];
}
}
function final_extract_page_html($html)
{
//repeat the next line for each block you would like removed
final_extract_block($html, 'home');
final_extract_block($html, 'my_gallery');
final_extract_block($html, 'allow_memberlist');
final_extract_block($html, 'my_profile');
final_extract_block($html, 'enter_admin_mode');
final_extract_block($html, 'leave_admin_mode');
final_extract_block($html, 'register');
// final_extract_block($html, 'faq');
// final_extract_block($html, 'login');
// final_extract_block($html, 'logout');
// final_extract_block($html, 'custom_link');
final_extract_block($html, 'album_list');
final_extract_block($html, 'lastup');
final_extract_block($html, 'lastcom');
final_extract_block($html, 'topn');
final_extract_block($html, 'toprated');
final_extract_block($html, 'favpics');
final_extract_block($html, 'search');
return $html;
}
?>