Walkinman: Ok, I looked at the other threads and they do not describe the main reason why this Template Error shows up with the new theme.php addbutton() system. I'll try to write up something documentation-like to explain this. The sys_menu and the sub_menu in the theme.php are not clearly organized into blocks you can copy & modify willy-nilly since other sections expect certain blocks to exist and unless you copy those blocks too and modify them, your theme breaks. This correlation between separate sections makes it difficult to easily remove or modify something. It will be clear once I organize my thoughts.
For now, try this. In your theme.php file, look for this line:
addbutton($sub_menu_buttons,'{FAV_LNK}','{My Lightbox}','{FAV_TGT}','My Lightbox',$template_sub_menu_spacer);
and change the 5th parameter from 'My Lightbox' to 'favpics' as shown:
addbutton($sub_menu_buttons,'{FAV_LNK}','{My Lightbox}','{FAV_TGT}','favpics',$template_sub_menu_spacer);
That parameter is the name used in the BEGIN & END tags. The assemble_template_buttons() function creates the BEGIN & END tags you cannot find. In the "old" days, you would type in those tags manually as HTML. (You can do that with the current system as well, which is why I'm sure gseb mentioned that. The functions addbutton() and assemble_template_buttons() create the HTML blocks automatically for you.) You have to use 'favpics' as your BEGIN & END label since you reference that later.
Another solution is to keep the code I mentioned above as is and replace this line:
template_extract_block($template_sub_menu, 'favpics');
with this line:
template_extract_block($template_sub_menu, 'My Lightbox');
for the same reason.
It's recommended to do the first solution I give because Coppermine might assume you have a 'favpics' block and use that somewhere in the core code. Right now it doesn't, but there are other buttons that are used in the core code and you cannot merely rename or remove the labels. If you want to remove a button, for example the 'My Profile' button in the sys_menu, you have to use this line:
addbutton($sys_menu_buttons,'','','','my_profile','');
for the same reason others have said to keep the BEGIN & END tags and remove the stuff in between. With this new addbutton() system, you have to keep the tag 'my_profile' and remove the stuff in between which is the three parameters in front of that tag in the addbutton() function. Does that make sense?
So get into a good habit and don't touch that 5th parameter in the addbutton() function. Leave that label alone since it's merely used as a comment label (for BEGIN & END tags); it won't show up in the web page except as a comment. Remove the stuff before it if you don't want that button, and add a new button as desired. Or modify the button, but keep that label as is so Coppermine knows where to find it, if it needs it.
That summarizes most of what needs to be said about using addbutton() successfully in theme.php. I'll see if I can contribute a coherent doc section / post describing the overall picture and a few more details.