logo
WSN Links PHP Directory Software
Features Showcase Reviews Demos Purchase Manual Support
 

javascript export error
two files to export causes error

Version: 3.12


javascript export error
ms_ukyankee
Beginner

Usergroup: Customer
Joined: Feb 05, 2004
Location: UK
Total Topics: 3
Total Posts: 9
Posted 09/27/04 - 06:07 AM:
quote post
#1
When I have two files for js export, each on it's own line, I get this once every day after it tries to export them.

Warning: fopen(javascript/top5rated.jsjavascript/top5newest.js): failed to open stream: No such file or directory in /home/public_html/cookbook/filefunctions.php on line 73

Warning: fwrite(): supplied argument is not a valid stream resource in /home/public_html/cookbook/filefunctions.php on line 74

Warning: fclose(): supplied argument is not a valid stream resource in /home/ukyank/public_html/cookbook/filefunctions.php on line 75

Warning: fopen(javascript/top5rated.jsjavascript/top5newest.jsjavascr ipt/): failed to open stream: No such file or directory in /home/public_html/cookbook/filefunctions.php on line 73

Warning: fwrite(): supplied argument is not a valid stream resource in /home/public_html/cookbook/filefunctions.php on line 74

Warning: fclose(): supplied argument is not a valid stream resource in /home/public_html/cookbook/filefunctions.php on line 75

I've upgraded to 3.12, still happening. I also get this when saving the export page.

Warning: fopen(../javascript/): failed to open stream: Is a directory in /home/public_html/cookbook/filefunctions.php on line 73

Warning: fwrite(): supplied argument is not a valid stream resource in /home/public_html/cookbook/filefunctions.php on line 74

Warning: fclose(): supplied argument is not a valid stream resource in /home/... etc.

Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 09/28/04 - 11:13 AM:
quote post
#2
That means the files are not writable or don't exist and there aren't permissions to create them.

javascript/top5rated.jsjavascript/top5newest.js

is a rather odd path and I'm not sure what you're trying to do with it.
ms_ukyankee
Beginner

Usergroup: Customer
Joined: Feb 05, 2004
Location: UK
Total Topics: 3
Total Posts: 9
Posted 10/01/04 - 08:57 AM:
quote post
#3
I didn't put that path in there, it joined the two lines together when it tried to create the file and created a file of that name, that's my point. I've attached a screenshot of the export config.

On saving it still generates the error:
Warning: fopen(../javascript/): failed to open stream: Is a directory in /home/public_html/cookbook/filefunctions.php on line 148

Warning: fwrite(): supplied argument is not a valid stream resource in /home/public_html/cookbook/filefunctions.php on line 149

Warning: fwrite(): supplied argument is not a valid stream resource in /home/public_html/cookbook/filefunctions.php on line 150

The directory is chmoded 777. I chmoded the files as well. It creates the js files fine when you first set it up, but when it runs daily, it joins the two lines together as posted above.

My config lines were not duplicate as in image, I copied to illustrate.

Edited by ms_ukyankee on 10/02/04 - 02:41 AM. Reason: removed part of server path info
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 10/01/04 - 01:32 PM:
quote post
#4
Open commonfuncs.php and replace
if ($inadmindir) $writeto = '../';

$writeto .= 'javascript/'. $names[$x];

with
if ($inadmindir) $writeto = '../'; else $writeto = '';

$writeto .= 'javascript/'. $names[$x];



Let me know if it works.
ms_ukyankee
Beginner

Usergroup: Customer
Joined: Feb 05, 2004
Location: UK
Total Topics: 3
Total Posts: 9
Posted 10/05/04 - 06:40 AM:
quote post
#5
It didn't work. It has stopped appending the two file names together since I reconfigured it after the upgrade though.

First display of the day gets this again:

Warning: fopen(/javascript/top5newest.js): failed to open stream: No such file or directory in /home/public_html/cookbook/filefunctions.php on line 148

Warning: fwrite(): supplied argument is not a valid stream resource in /home/public_html/cookbook/filefunctions.php on line 149

Warning: fwrite(): supplied argument is not a valid stream resource in /home/public_html/cookbook/filefunctions.php on line 150

Warning: fclose(): supplied argument is not a valid stream resource in /home/public_html/cookbook/filefunctions.php on line 151

I changed this line:
if (!$check) { @chmod($filename, 0666); $check = fwrite($fd, $data); }


to chmod to 0777 instead of 0666 because it seemed to be changing it back to 666 after I had chmoded to 777.

Still getting the same errors when saving the export config, and the files are being written properly.

Is it possible to force the javascript writing somehow so that I can test more easily outside of admin area?

Just to clarify, I was supposed to create a javascript directory within the links directory, right?

Edited by ms_ukyankee on 10/05/04 - 06:48 AM
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 10/05/04 - 02:03 PM:
quote post
#6
You have a file there at /javascript/top5newest.js ?

to chmod to 0777 instead of 0666 because it seemed to be changing it back to 666 after I had chmoded to 777.

There is never any reason to chmod a file to 777 (unless it's a CGI executable, which php is not). 666 is correct.

I was supposed to create a javascript directory within the links directory, right?

No, there's supposed to already be one.
ms_ukyankee
Beginner

Usergroup: Customer
Joined: Feb 05, 2004
Location: UK
Total Topics: 3
Total Posts: 9
Posted 10/05/04 - 11:57 PM:
quote post
#7
The directory wasn't there when I installed so I created it anyway.

/javascript/top5newest.js is there, and is being over written correctly when I save the export config.
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 55
Total Posts: 5703
Posted 10/06/04 - 03:12 PM:
quote post
#8
It works for me. Put

if ($forceexport) exporttoplists();

at the top of timedactions.php and used index.php?forceexport=1 to test.
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

Admin Control Panel

   
Home    |    Features    |    Showcase    |    Reviews    |    Demos    |    Purchase    |    Manual    |    Support
© 2008 Paul Knierim. All rights reserved.