PDA

View Full Version : help using admincp/misc.php?do=update forum


meowmeow
06-07-2004, 01:50 PM
I want to run the same function thats run when you click the
'update forum info' button in admincp/import&maintenance/update counters
and I think that is the "update forum" in the misc.php
how can I execute this function from another script i wrote???

Xenon
06-07-2004, 05:40 PM
you have to require functions_databuild.php

and then this function will help you:

// ###################### Start updateforumcount #######################
// updates forum counters and last post info
function build_forum_counters($forumid)

meowmeow
06-08-2004, 09:28 AM
ok did that...
i have this:
require ("../../includes/functions_databuild.php");
and this
for( $i = 0 ; $i < count($forums) ; $i++)
{
$row1 = $forums[$i];
build_forum_counters($row1['id_mg']);
}

but i get an error:
"Fatal error: Call to undefined function: fetch_foruminfo() in /www/forum/htdocs/includes/functions_databuild.php on line 78"

it doesnt find the fetch_foruminfo() function for some reason! Do i maybe have to put the script i wrote in the same directory as the functions_databuild.php???

Xenon
06-08-2004, 11:36 AM
erm, you have to make sure, that you have global.php required in your script as well, as that file includes other important files as well..

meowmeow
06-08-2004, 11:42 AM
and when i have
include ("../../global.php");

i get this error:

Fatal error: Failed opening required './includes/init.php' (include_path='.:/usr/local/lib/php') in /www/forum/htdocs/global.php on line 18
or
Parsing functions.php Time before: 1086698586.0523
Fatal error: Failed opening required './includes/functions.php' (include_path='.:/usr/local/lib/php') in /www/forum/htdocs/global.php on line 37

when i tried to comment out the first include.
it always seems to be an include of an include! what am i doin wrong?

Xenon
06-08-2004, 11:46 AM
your script is in the wrong directory.

you can place it in the forum directory itself, or you do a chdir() before you do the include.