Final_Extract - Removing blocks & items like menu buttons - Page 3 Final_Extract - Removing blocks & items like menu buttons - Page 3
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Final_Extract - Removing blocks & items like menu buttons

Started by Paver, January 24, 2006, 05:40:37 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Aeronautic

#40
Somehow I must have messed this up, but I can't figure out how.

Running the 2nd version of the plugin in CPG 1.4.9 - Hardwired

http://www.aeronauticpictures.com/royalty-free-stock-footage/

When I ran it with the default code it worked as expected. Then I removed the block of the home page part for guests and added the other blocks I wanted out for guests.

FYI: I only have admin and guests - nobody else will register and use the gallery.

My goal is for guests to see home, custom, search and album.

Any ideas where I went wrong? It is showing blocks to guests instead of hiding them. Yes, the plugin is enabled and installed. I tried uninstalling, unenabling and back again too.

Is this the "<!-- BEGIN block -->  <!-- END block -->" issue from theme.php?

Edit: It was this tag block issue. Changes made to hardwired/theme.php to add block tags. Now working at link above.

function final_extract_page_html($html)
{   
$user_group=USER_ID;
//define the user group
switch ($user_group){
case 1://admin show all menus
return $html;
break;
case 2://registred
//repeat the next line for each block you would like removed
final_extract_block($html, 'login');
    final_extract_block($html, 'home');
    return $html;
break;
case 3://guest
//repeat the next line for each block you would like removed
    final_extract_block($html, 'lastup');
    final_extract_block($html, 'toprated');
    final_extract_block($html, 'favpics');
    final_extract_block($html, 'lastcom');
    final_extract_block($html, 'topn');
    return $html;
default://all othe cases
    //repeat the next line for each block you would like removed
    final_extract_block($html, 'lastup');
    final_extract_block($html, 'toprated');
    final_extract_block($html, 'favpics');
    final_extract_block($html, 'lastcom');
    final_extract_block($html, 'topn');
return $html;
}


Thank you for the plugin and the help!

Edit: Found this post: http://forum.coppermine-gallery.net/index.php?topic=26893.msg160551#msg160551

Looks like it could be the call out in Hardwired. Will test and update.

Sami

Quote from: Aeronautic on October 03, 2006, 10:44:10 PM
Running the 2nd version of the plugin in CPG 1.4.9 - Hardwired

My goal is for guests to see home, custom, search and album.

BTW you can use Final extarct 2.3 with admin panel and group selection here:
http://forum.coppermine-gallery.net/index.php?topic=36605.0
‍I don't answer to PM with support question
Please post your issue to related board

Aeronautic


lily64

I am very distressed because I just used this Final Extract and as soon as I uploaded it and loaded the admin panel, the gallery ceased to function period.  I have spent countless hours getting this gallery customized for a client and don't understand why this would cause it to no longer function at all.

The gallery is here: http://www.liveedgepottery.com/cpg149/

lily64

Got it.  Went into PhpMyAdmin and deleted the Final Extract from the DB, which then freed it up.  I have no idea why this would cause this, but will not use it that's for sure unless there is a fix.

Thanks.

Hein Traag

Final Extract works perfectly. Really usefull tool to clean up the look of CPG for the users and guest users.

Dutch language file attached.

Cheers!
Hein

MaPzel

For some reason my pluginmgr does not work with my Joomla integration. After ftp uploading 'Final Extract' I want to install it, but the pluginmgr gives the following error:

Fatal error: Cannot redeclare deldir() (previously declared in /home/vhosts/twvhengelo.com/httpdocs/fotoalbum/pluginmgr.php:239) in /home/vhosts/twvhengelo.com/httpdocs/website/plugins/system/legacy/functions.php on line 713

Is it possible to insert the code from the plugin (codebase.php) into a custom theme.php? Or should the php code be inserted in an other file? I don't know exactly where the final html display codes are generated.

I already tried to insert the next code into my theme.php after 'function theme_display_fullsize_pic()' and just before '?>
<!DOCTYPE html PUBLIC.....'

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, 'login');
  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, 'upload_pic');
final_extract_block($html, 'register');
final_extract_block($html, 'faq');
final_extract_block($html, 'logout');
final_extract_block($html, 'upload_pic');
// final_extract_block($html, 'lastup');
//     final_extract_block($html, 'toprated');
//     final_extract_block($html, 'favpics');
// final_extract_block($html, 'search');
// final_extract_block($html, 'lastcom');
// final_extract_block($html, 'album_list');
// final_extract_block($html, 'topn');

return $html;
}


My album can be viewed here: http://www.twvhengelo.com/website/index.php?option=com_wrapper&view=wrapper&Itemid=57

Or http://www.twvhengelo.com/fotoalbum for displaying only the Coppermine installation

I'm running the Joomla 1.5.21 and Coppermine 1.4.27