[Solved]: added cpgmark now get - Failed to find block 'upload_pic' error [Solved]: added cpgmark now get - Failed to find block 'upload_pic' error
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[Solved]: added cpgmark now get - Failed to find block 'upload_pic' error

Started by HighlanderICT, May 22, 2008, 09:18:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

HighlanderICT

As it says in the title, I went to enable CPGMark plugin on a (bridged) gallery that was working fine .... as soon as I added it, I know get this error.

Template error
Failed to find block 'upload_pic'(#(<!-- BEGIN upload_pic -->)(.*?)(<!-- END upload_pic -->)#s) in :


<!-- BEGIN home -->
        <a href="{HOME_TGT}" title="{HOME_TITLE}">{HOME_LNK}</a> <img src="themes/classic/images/orange_carret.gif" width="8" height="8" border="0" alt="" />
  <!-- END home -->  <!-- BEGIN my_gallery -->
        <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a> <img src="themes/classic/images/orange_carret.gif" width="8" height="8" border="0" alt="" />
  <!-- END my_gallery -->  <!-- BEGIN allow_memberlist -->
        <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a> <img src="themes/classic/images/orange_carret.gif" width="8" height="8" border="0" alt="" />
  <!-- END allow_memberlist -->  <!-- BEGIN my_profile -->
        <a href="{MY_PROF_TGT}" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a> <img src="themes/classic/images/orange_carret.gif" width="8" height="8" border="0" alt="" />
  <!-- END my_profile -->  <!-- BEGIN enter_admin_mode -->
        <a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}">{ADM_MODE_LNK}</a> <img src="themes/classic/images/orange_carret.gif" width="8" height="8" border="0" alt="" />
  <!-- END enter_admin_mode -->  <!-- BEGIN leave_admin_mode -->
        <a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a> <img src="themes/classic/images/orange_carret.gif" width="8" height="8" border="0" alt="" />
  <!-- END leave_admin_mode -->  <!-- BEGIN <img src="themes/classic/images/orange_carret.gif" width="8" height="8" border="0" alt="" /> -->
        <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a>
  <!-- END <img src="themes/classic/images/orange_carret.gif" width="8" height="8" border="0" alt="" /> -->  <!-- BEGIN register -->
        <a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a> <img src="themes/classic/images/orange_carret.gif" width="8" height="8" border="0" alt="" />
  <!-- END register -->  <!-- BEGIN faq -->
        <a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a> <img src="themes/classic/images/orange_carret.gif" width="8" height="8" border="0" alt="" />
  <!-- END faq -->  <!-- BEGIN login -->
        <a href="{LOGIN_TGT}" title="{LOGIN_TITLE}">{LOGIN_LNK}</a>
  <!-- END login -->  <!-- BEGIN logout -->
        <a href="{LOGOUT_TGT}" title="{LOGOUT_TITLE}">{LOGOUT_LNK}</a>
  <!-- END logout -->


As you can see in the code ... all of the blocks start and finish with
<!-- BEGIN block id --> & <!-- END block id -->

EXCEPT upload_pic which seems to have had the spacer and the line added inside the comment.....

<!-- BEGIN <img src="themes/classic/images/orange_carret.gif" width="8" height="8" border="0" alt="" /> -->
        <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a>
  <!-- END <img src="themes/classic/images/orange_carret.gif" width="8" height="8" border="0" alt="" /> -->


I did not change anything in template.html or theme.php and have read through the various threads about this error on here including the FAQ and cannot figure out what went wrong ......

I have deleted the plugin manually as well as dropping the tables it added to mySQL but still get this error .... cannot figure it out at all .....

theme.php has following in it

  // HTML template for template sys_menu spacer
$template_sys_menu_spacer ='<img src="themes/classic/images/orange_carret.gif" width="8" height="8" border="0" alt="" />';

  // HTML template for template sys_menu buttons
  $template_sys_menu_button = <<<EOT
  <!-- BEGIN {BLOCK_ID} -->
        <a href="{HREF_TGT}" title="{HREF_TITLE}">{HREF_LNK}</a> {SPACER}
  <!-- END {BLOCK_ID} -->
EOT;

  // HTML template for template sys_menu buttons
    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}
    addbutton($sys_menu_buttons,'{HOME_LNK}','{HOME_TITLE}','{HOME_TGT}','home',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{MY_GAL_LNK}','{MY_GAL_TITLE}','{MY_GAL_TGT}','my_gallery',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{MEMBERLIST_LNK}','{MEMBERLIST_TITLE}','{MEMBERLIST_TGT}','allow_memberlist',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{MY_PROF_LNK}','{MY_PROF_TITLE}','{MY_PROF_TGT}','my_profile',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{ADM_MODE_LNK}','{ADM_MODE_TITLE}','{ADM_MODE_TGT}','enter_admin_mode',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{USR_MODE_LNK}','{USR_MODE_TITLE}','{USR_MODE_TGT}','leave_admin_mode',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{UPL_PIC_LNK}','{UPL_PIC_TITLE}','{UPL_PIC_TGT}',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{REGISTER_LNK}','{REGISTER_TITLE}','{REGISTER_TGT}','register',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{FAQ_LNK}','{FAQ_TITLE}','{FAQ_TGT}','faq',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');
    addbutton($sys_menu_buttons,'{LOGOUT_LNK}','{LOGOUT_TITLE}','{LOGOUT_TGT}','logout','');
    // Login and Logout don't have a spacer as only one is shown, and either would be the last option.


template.html has this

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="{LANG_DIR}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
<title>{TITLE}</title>
{META}
<link rel="stylesheet" href="themes/classic/style.css" type="text/css" />
<script type="text/javascript" src="scripts.js"></script>
<!-- $Id: template.html 4100 2007-12-02 23:05:48Z nibbler999 $ -->
</head>
<body>
<!--  <p>{CUSTOM_HEADER}  </p> -->
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td>

<!--   <h2>{GAL_NAME}</h2><h3>{GAL_DESCRIPTION}</h3> -->  
  <div align="center">{SYS_MENU}<br />{SUB_MENU}</div></td>
    </tr>
  </table>
<!--
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="center" valign="top"> {LANGUAGE_SELECT_FLAGS} </td>
    </tr>
    <tr>
      <td align="center" valign="top"> {THEME_SELECT_LIST}
        {LANGUAGE_SELECT_LIST} </td>
    </tr>
  </table>
-->
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td> {ADMIN_MENU}{GALLERY} </td>
    </tr>
  </table>
  <p>{CUSTOM_FOOTER}{VANITY}</p>
</body>




The only thing I could find that seemed strange was in the codebase.php file of the cpgmark plugin ..... where it has this
function cpgmark_add_admin_button($href,$title,$target,$link)
{
  global $template_sys_menu, $template_sys_menu_spacer;

  $new_template=$template_sys_menu;
  $button=template_extract_block($new_template,'upload_pic');
 
   $params = array(
      '{UPL_PIC_LNK}' => $target,
      '{UPL_PIC_TITLE}' => $title,
      '{UPL_PIC_TGT}' => $href,
      'upload_pic' => $link,
   );
   $new_button="<!-- BEGIN $link -->".template_eval($button,$params)."<!-- END $link -->\n";
   template_extract_block($template_sys_menu,'upload_pic',"<!-- BEGIN upload_pic -->" . $button . "<!-- END upload_pic -->\n" .$new_button);
}




need some serious help figuring this out .... thanks in advance to anyone who can !

HighlanderICT

have to say thanks to myself !!!!

seems cpgmark stripped out the block ID and I didnt notice it !!!

file was changed to

    addbutton($sys_menu_buttons,'{UPL_PIC_LNK}','{UPL_PIC_TITLE}','{UPL_PIC_TGT}',$template_sys_menu_spacer);

when it should have been

    addbutton($sys_menu_buttons,'{UPL_PIC_LNK}','{UPL_PIC_TITLE}','{UPL_PIC_TGT}', 'upload_pic' $template_sys_menu_spacer);