Fatal error: Call to undefined function: make_output()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jolac
Forum Newbie
Posts: 17
Joined: Wed May 12, 2004 6:38 pm

Fatal error: Call to undefined function: make_output()

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
jolac
Forum Newbie
Posts: 17
Joined: Wed May 12, 2004 6:38 pm

Post 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
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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.
jolac
Forum Newbie
Posts: 17
Joined: Wed May 12, 2004 6:38 pm

Post 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
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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.
jolac
Forum Newbie
Posts: 17
Joined: Wed May 12, 2004 6:38 pm

Post 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
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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.
Post Reply