Advanced search  

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

Pages: [1]   Go Down

Author Topic: The good old "Failed to find block 'file_line'" and some new cause  (Read 2523 times)

0 Members and 1 Guest are viewing this topic.

Horst

  • Guest

Hello everybody,

here my situation:

1. I include a custom header (header.php) via the admin menu.
2. In the custom header a custom PHP script (shoutbox.php) is included.
3. This shoutbox.php is calling a database.
4. --> Template Error Failed to find block 'file_line'. Coppermine is showing me:

Code: [Select]
Template error
Failed to find block 'file_line'(#(<!-- BEGIN file_line -->)(.*?)(<!-- END file_line -->)#s) in :

        <tr>
                <td class="tableb" align="center">
                        <font size="3"><b>{MESSAGE}</b></font>


                        <br /><br />
                </td>
        </tr>



After a long time of reading forum and debugging I can name the following line of "shoutbox.php" as the cause of the error:


Code: [Select]
$link = mysql_connect($myConfig['db_addr'], $myConfig['db_user'], $myConfig['db_pass']);
if ($link)
{
// select db
$db_selected = mysql_select_db($myConfig['db_db']);  // <---------------- this one
}

Without this database call the header is working fine and does not produce any errors and also my template is ok. The reason of the error is definitely the "mysql_select_db()" call!

How to solve this?  ??? I really need to call the database there.

Horst
« Last Edit: July 19, 2006, 12:44:17 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: The good old "Failed to find block 'file_line'" and some new cause
« Reply #1 on: July 19, 2006, 01:37:41 am »

Is the shoutbox usign a different db to Coppermine? If so then you need to make sure it uses its own db connection exclusively.

Tell it to behave itself and use its own connection

Code: [Select]
$db_selected = mysql_select_db($myConfig['db_db'], $link);
You'll need to do that for all the mysql_query() calls too.

If not, then you need to tell it to make it's own connection to the db instead of sharing coppermine's.

Code: [Select]
$link = mysql_connect($myConfig['db_addr'], $myConfig['db_user'], $myConfig['db_pass'], true);
Logged

Horst

  • Guest
Re: The good old "Failed to find block 'file_line'" and some new cause
« Reply #2 on: July 19, 2006, 10:25:43 am »

Bingo!!! Great, i changed my database callings and querys and also the database opening calls the way you showed me and - it works fine  ;D.

Thank you.

Horst
Logged
Pages: [1]   Go Up
 

Page created in 0.036 seconds with 17 queries.