Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Technical Support on Template error  (Read 3046 times)

0 Members and 1 Guest are viewing this topic.

pols1337

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 244
Technical Support on Template error
« on: May 02, 2015, 08:53:22 pm »

Hello, there was a recent power failure in my data center so my server was reset.  After being reset, my CPG 1.5.34 shows an error that I've never seen before:

Code: [Select]
Template error
Failed to find block 'file_line' (#<!-- BEGIN file_line -->(.*?)<!-- END file_line -->#s) in :
                    <div class="{CSS_CLASS}">
                        <h2>{HEADER_TXT}</h2>
                        <span class="cpg_user_message">{MESSAGE}</span>


                        <br /><br />
                    </div>


Screenshot attached as well.  Can someone advise?  Part of me is thinking that its my anycontent.php file that's missing or wrong, but I'm kind of stumped on what to do so any guidance is much appreciated.  Should I try to reupload all of the files?
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Technical Support on Template error
« Reply #1 on: May 02, 2015, 10:33:31 pm »

Sometimes the hosting provider moves your website to another server or the server had a crash etc and the coppermine files got corrupted.
I think replacing (overwrite) the coppermine files with new ones may help.
Is not so hard.
How to overwrite: http://documentation.coppermine-gallery.net/en/upgrading.htm#upgrade_any

Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Technical Support on Template error
« Reply #2 on: May 02, 2015, 10:46:19 pm »

The code you posted is in function <<<$template_cpg_die>>> :

Code: [Select]
/******************************************************************************
** Section <<<$template_cpg_die>>> - START
******************************************************************************/
// HTML template used by the cpg_die function
$template_cpg_die = <<<EOT
                    <div class="{CSS_CLASS}">
                        <h2>{HEADER_TXT}</h2>
                        <span class="cpg_user_message">{MESSAGE}</span>
<!-- BEGIN file_line -->
                        <br />
                        <br />
                        {FILE_TXT}{FILE} - {LINE_TXT}{LINE}
<!-- END file_line -->
<!-- BEGIN output_buffer -->
                        <br />
                        <br />
                        <div align="left">
                                {OUTPUT_BUFFER}
                        </div>
<!-- END output_buffer -->
                        <br /><br />
                    </div>

EOT;
/******************************************************************************
** Section <<<$template_cpg_die>>> - END
******************************************************************************/

If the function code from themes/your_theme_name/theme.php (If you have the function there, but proabibly you don't. A function is added to themes/your_theme_name/theme.php only when you want to change it) or include/themes.inc.php got corrupted then you get that error.

I recommend you to upgrade (overwrite with new files) even if you already have the latest version.
How knows how many other files got coruptted during the recent power failure in your data center.

It happend to me too and I did the upgrade (overwrite with new files).
« Last Edit: May 02, 2015, 11:09:55 pm by allvip »
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Technical Support on Template error
« Reply #3 on: May 02, 2015, 11:00:41 pm »

BTW: When you edit a function like this you shoud never remove <!-- BEGIN ... --> or <!-- END ... -->. You will get an error like in your attachment.

Let's say to remove from your theme:

Code: [Select]
                        <br />
                        <br />
                        {FILE_TXT}{FILE} - {LINE_TXT}{LINE}

You remove by adding function <<<$template_cpg_die>>> to themes/your_theme_name/theme.php and edit it like this:


/******************************************************************************
** Section <<<$template_cpg_die>>> - START
******************************************************************************/
// HTML template used by the cpg_die function
$template_cpg_die = <<<EOT
                    <div class="{CSS_CLASS}">
                        <h2>{HEADER_TXT}</h2>
                        <span class="cpg_user_message">{MESSAGE}</span>
<!-- BEGIN file_line --> MUST NOT BE REMOVED
                     REMOVE   <br />
                     REMOVE   <br />
                    REMOVE    {FILE_TXT}{FILE} - {LINE_TXT}{LINE}

<!-- END file_line -->  MUST NOT BE REMOVED
<!-- BEGIN output_buffer -->
                        <br />
                        <br />
                        <div align="left">
                                {OUTPUT_BUFFER}
                        </div>
<!-- END output_buffer -->
                        <br /><br />
                    </div>

EOT;
/******************************************************************************
** Section <<<$template_cpg_die>>> - END
******************************************************************************/

I talked about that even here: http://forum.coppermine-gallery.net/index.php/topic,77938.msg376688.html#msg376688
« Last Edit: May 02, 2015, 11:08:27 pm by allvip »
Logged

pols1337

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 244
Re: Technical Support on Template error
« Reply #4 on: May 03, 2015, 05:32:23 am »

Thanks for the replies!

I didn't edit the files myself, but it would make sense the files got corrupted.  Will overwrite with a new set of CPG files. 
Logged
Pages: [1]   Go Up
 

Page created in 0.034 seconds with 21 queries.