Technical Support on Template error Technical Support on Template 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

Technical Support on Template error

Started by pols1337, May 02, 2015, 08:53:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pols1337

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:

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?

allvip

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


allvip

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


/******************************************************************************
** 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).

allvip

#3
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:


                        <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

pols1337

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.