Page 1 of 1

Fatal error: Call to undefined function: make_output()

Posted: Thu May 13, 2004 10:07 pm
by jolac
Hi Everybody

I am getting 2 errors... can anyone help... please

Parse error: parse error in /var/www/html/includes/functions.inc.php on line 34

Fatal error: Call to undefined function: make_output() in /var/www/html/index.php on line 9

THIS IS LINE 34
while ($result = $db->sql_fetchrow($query))


AND THIS IS THE INDEX.PHP FILE
**********
<?php
// Index.php
// Displays home page

require_once('includes/functions.inc.php');
require_once('includes/classes.inc.php');

// Build output from template
$output = make_output("index", $output_array);
print $output;

?>
********

any ideas ? is it trying to get a template from the database... from a row in a table which is not there ? :?:

Thanks for your replies

Jolac

Posted: Thu May 13, 2004 11:10 pm
by feyd
Fatal error: Call to undefined function: make_output() in /var/www/html/index.php on line 9

says it all for that one.

Posted: Fri May 14, 2004 12:16 am
by jolac
Hi Thanks for the reply

that is the error I get when I change

define('IN_PHPBB', true);

to

if (!defined("IN_PHPBB") define('IN_PHPBB', true);

If I DO use error_reporting the error on the actual page after login is

Notice: Constant IN_PHPBB already defined in
/var/www/html/includes/functions.inc.php on line 4

if I DON'T use error reporting the error is

Warning:
file(/var/www/html/templates/account/menumap_buyer_buyer_buyer_buyer_buyer_b
uyer_buyer_buyer_buyer_buyer_buyer_seller_profitshare_profitshare_profitshar
e_profitshare.html): failed to open stream: No such file or directory in
/var/www/html/includes/functions.inc.php on line 33

obviously there is no template file with such a long name... so it may be some sort of loop... but I really don't know... and nobody else seems to know either... thus far.

Would you have any ideas or can you point me in the right direction

Thanks

Jolac

Posted: Fri May 14, 2004 7:40 am
by Weirdan
change this line:

Code: Select all

if (!defined("IN_PHPBB") define('IN_PHPBB', true);
to

Code: Select all

if (!defined("IN_PHPBB")) define('IN_PHPBB', true);
note the parethesis... it was parse error indeed, therefor functions after that line was never defined.

Posted: Fri May 14, 2004 9:33 am
by jolac
Hi

Thanks for your suggestion I tried it but it still gives the same error as before... thanks anyway... if you can suggest anything else I would love to try it as im really stumped....

I can't figure out why the errror is giving this long file name... it's as if the mysql database is looking for a file by that name... but there is no file with such a long name... some kind of loop mabey ? this ones really got me beat.

Thnaks

Jolac

Posted: Fri May 14, 2004 4:04 pm
by Weirdan
I have posted debug_print_backtrace() function in this thread. You can use it as follows:

Code: Select all

//................
function make_output ($template, $replacements = Array())
{
//debugging
if($template=='/var/www/html/templates/account/menumap_buyer_buyer_buyer_buyer_buyer_buyer_buyer_buyer_buyer_buyer_buyer_seller_profitshare_profitshare_profitshare_profitshare.html') {
 echo '<pre>'; debug_print_backtrace() ; echo '</pre>';
}
   global $db, $User, $phpbb_root_path;
   // Set to "on" to see template names in HTML source 
//................. rest of your make_output function...
It should show you where was make_ouput function called from with exactly that wrong argument.

You need to copy the function debug_print_backtrace to, say, your functions.inc.php file from the thread I mentioned.

Posted: Fri May 14, 2004 5:32 pm
by jolac
Hi

Thanks I will try this now... but I have a question as I really want to get it right first time... I see where I need to put this part in functions.inc.php

Code: Select all

//................ 
function make_output ($template, $replacements = Array()) 
{ 
//debugging 
if($template=='/var/www/html/templates/account/menumap_buyer_buyer_buyer_buyer_buyer_buyer_buyer_buyer_buyer_buyer_buyer_seller_profitshare_profitshare_profitshare_profitshare.html') { 
echo '<pre>'; debug_print_backtrace() ; echo '</pre>'; 
} 
   global $db, $User, $phpbb_root_path;
do I use both pieces of code in the functions.inc.php file ? and if so where do I put this part which is from your other thread.

Code: Select all

function debug_print_backtrace() { 
    $x = debug_backtrace(); 
    array_shift($x); 
    foreach($x as $level => $entry) { 
        if(isset($entry['args'])&&is_array($entry['args'])) 
        foreach($entry['args'] as $key=>$row) { 
            if(is_array($row)||is_object($row)) 
                $entry['args'][$key] = ' ArrObj( '.serialize($row).' ) '; 
        } 
        echo @$level.' => '.@$entry['class'].@$entry['type'].@$entry['function'].'('.@join(',',@$entry['args']).')'.' ['.@$entry['file'].' : '.@$entry['line'].']'."\n"; 
    } 
}

Thanks a lot for this... it will help me track it down much quicker

Best regards

Jolac

Posted: Sat May 15, 2004 4:16 pm
by Weirdan
jolac wrote: Thanks I will try this now... but I have a question as I really want to get it right first time...
do I use both pieces of code in the functions.inc.php file ?
You do. The part I posted here is not complete function, it's part of your make_output function which needs to be modified. You need to add if I posted. Lines around if block are there to make you see where if block should be put.
jolac wrote: and if so where do I put this part which is from your other thread.
Somewhere in functions.inc.php, just make sure it's not inside of any other functions.