Some problems implementing random block

AmonRa
AmonRa's picture

Joined: 2003-02-09
Posts: 6
Posted: Sun, 2003-02-09 16:52

Hello,

I am running phpNuke6.0, and gallery 1.3.3 (just updated) I've never used this random block but it would be usefull ...

Now i am getting 4 diffent kinds of errors ... These are on top of the page...
:???:

Warning: fopen("", "r") - No error in C:apache-serverhtdocsthemes3D-Fantasytheme.php on line 220

Warning: fread(): supplied argument is not a valid File-Handle resource in C:apache-serverhtdocsthemes3D-Fantasytheme.php on line 221

Warning: fclose(): supplied argument is not a valid File-Handle resource in C:apache-serverhtdocsthemes3D-Fantasytheme.php on line 222

The Readme file that was with the random block indicated that i had to add the following code at the top of the themesidebox() function:

if (@file_exists($content)) {
$fp = fopen ($content, "r");
$content = fread($fp, filesize($content));
fclose ($fp);
$content = "?>$content<?";
$content = eval($content);
} else if (eregi("^http", $content)) {
$fp = fopen ($content, "r");
$content = fread($fp, 65535);
fclose ($fp);
}

Then there is one error where the block has to be...

Fatal error: Failed opening required 'init.php' (include_path='.; apacheincludes;apachehtdocs;apachehtdocsphpmyadmin') in C:apache-serverhtdocsblocksblock-random.php on line 41

Anyone an idea ?
:smile:

 
nick_rembis

Joined: 2003-01-20
Posts: 524
Posted: Mon, 2003-02-10 04:28

you need pay close attention to the way you add that.....it needs to be added just like this:

function themesidebox($title, $content) {
if (@file_exists($content)) {
$fp = fopen ($content, "r");
$content = fread($fp, filesize($content));
fclose ($fp);
$content = "?>$content<?";
$content = eval($content);
} else if (eregi("^http", $content)) {
$fp = fopen ($content, "r");
$content = fread($fp, 65535);
fclose ($fp);
}

also,do not copy and paste this code,manually add what you see so as not to create any unneccesary end-of-line feeds

 
AmonRa
AmonRa's picture

Joined: 2003-02-09
Posts: 6
Posted: Mon, 2003-02-10 22:16

Hey,

thankx for the advice ... allthough i don't get the messages anymore, but the page only loads my header.html file ..... weird huh ?

 
AmonRa
AmonRa's picture

Joined: 2003-02-09
Posts: 6
Posted: Mon, 2003-02-10 22:37

Nevermind ... my fault ..... Now that i have added the block succesfull i get another message when i implement the block in the html, (administration)

These are the warnings i get,

Warning: main(init.php) [function.main]: failed to create stream: No such file or directory in c:apache-serverhtdocsblocksblock-random.php on line 41

Fatal error: main() [function.main]: Failed opening required 'init.php' (include_path='.; apacheincludes;apachehtdocs;apachehtdocsphpmyadmin') in c:apache-serverhtdocsblocksblock-random.php on line 41

It has to do with a directory setting ... but i still haven't figured out on how to change that ...

 
nick_rembis

Joined: 2003-01-20
Posts: 524
Posted: Tue, 2003-02-11 15:45

The 'block-random.php' file does not go in your nuke /blocks directory it goes in your /modules/Gallery directory :grin:

 
AmonRa
AmonRa's picture

Joined: 2003-02-09
Posts: 6
Posted: Tue, 2003-02-11 19:50

DOH!! :lol: