URL to your eFiction: http://deefanfiction.altervista.org/index.php
Version of eFiction: 3.5.1.
Have you bridged eFiction, if so with what?: No
Version of PHP: 5
Version of MySQL: I don't know
Have you searched for your problem: Yes
If so, what terms did you try: syntax error, edit stories
State the nature of your problem: I can't edit stories
Do you have a test account for us? No, but can make if necessary.
The site is updated with the last version, no modules or other have been added.
When I try to edit a story, I get this error:
Parse error: syntax error, unexpected $end in /membri/deefanfiction/stories.php on line 947
After turning the debug option on, I also get this error at the top of every page:
Notice: Undefined index: rss in /membri/deefanfiction/includes/pagesetup.php on line 92
I have no idea what to do...
That warning about rss when you turned debug on is fairly common. As far as I understand RSS still works, so that warning isn't critical.
Have you upgraded recently? One thing you should do is try re-uploading all the files to make sure they were uploaded properly in the first place. (It's fairly common for just even one to be missed, and can cause issues.) I'd start with stories.php.
I upgraded today, and tried reuploading the files, but it still gives me the error.
What version did you upgrade from?
What version did you upgrade from?
I think it was 3.5
EDIT: apparently now I can edit them just fine, but I've got a new problem. When I go to "Version check" this message comes out:
You are currently running eFiction version 3.5.1.
The current version of eFiction is Destination host forbidden
You need to update.
I have the same problem the OP has, I didn't want to start a new thread about it but here's my info:
URL to your eFiction: http://blacklashed.net/
Version of eFiction: 3.5.1.
Have you bridged eFiction, if so with what?: No (not that I'm aware of)
Version of PHP: 5.2.8
Version of MySQL: 5.0.77
Have you searched for your problem: Yes
If so, what terms did you try: error, edit stories
State the nature of your problem: I can't edit stories
Do you have a test account for us? No
When I try to edit a story, I get this error:
Warning: fopen(stories/1/115.txt) [function.fopen]: failed to open stream: No such file or directory in /home/blank/public_html/stories.php on line 583
ETA:
Warning: chmod() [function.chmod]: No such file or directory in /home/blank/public_html/stories.php on line 260
It seems chapter notes will work but not the not the story content box.
It happened all of a sudden. Before it seemed to edit fine and then it suddenly stopped working. Each time I tried to edit nothing would show up, then I got started getting the error message. My site was off the server for a couple of days (I don't know what other term to use) and I believe something was changed but not sure what.
and like the OP I have no clue what to do.
*icon - http://justinchatwinfan.com/
mmlands, I think your issue is being caused by something else, even if the result is the same. (At least it looks that way right off the bat.)
Line 583 of stories.php is this:
if($out = fopen (STORIESPATH."/".$story['uid']."/$chapid.txt", "r"))
from this section:
if($store == "mysql") $storytext = $story['storytext'];
else {
if($out = fopen (STORIESPATH."/".$story['uid']."/$chapid.txt", "r"))
while (!feof($out)) {
$storytext .= fgets($out, 10000);
}
}
Starting with the simplest thing first, do you have the correct Stories Path listed in Admin > Settings > Submission Settings? (No slashes in it.)
Some clarification: do you mean to say that the server your site is hosted on was down for a while? If so, it was likely because the host made changes to the server, changes that could be causing the issue. Sometimes it happens where a version of PHP (usually the older, though) aren't compatible with the way the scripts written. Just to check, I made sure that the functions in there are valid for PHP 5, and they are.
Another thing to check is that the text actually is there. Does it display normally? If so, that's a good indicator that it's there. Check the file permissions on the .txt files and the folders (by sid) in the stories folder. Maybe they don't have proper permissions to let you edit them.
mmlands, I think your issue is being caused by something else, even if the result is the same. (At least it looks that way right off the bat.)
Line 583 of stories.php is this:
if($out = fopen (STORIESPATH."/".$story['uid']."/$chapid.txt", "r"))from this section:
if($store == "mysql") $storytext = $story['storytext'];
else {
if($out = fopen (STORIESPATH."/".$story['uid']."/$chapid.txt", "r"))
while (!feof($out)) {
$storytext .= fgets($out, 10000);
}
}Starting with the simplest thing first, do you have the correct Stories Path listed in Admin > Settings > Submission Settings? (No slashes in it.)
Some clarification: do you mean to say that the server your site is hosted on was down for a while? If so, it was likely because the host made changes to the server, changes that could be causing the issue. Sometimes it happens where a version of PHP (usually the older, though) aren't compatible with the way the scripts written. Just to check, I made sure that the functions in there are valid for PHP 5, and they are.
Another thing to check is that the text actually is there. Does it display normally? If so, that's a good indicator that it's there. Check the file permissions on the .txt files and the folders (by sid) in the stories folder. Maybe they don't have proper permissions to let you edit them.
Thank you for replying. To answer your question, yes it was down for a couple of days. The only text is not showing up. If I try to paste into the content box or using the word paste box, it takes but once I submit, I get the error message and the text does not show up in the next chapter. Nothing is there.
I found the section you highlighted in the story folder but I'm still not sure exactly what I should be looking for. I have no clue about these things, I'm learning as I go. You said to check permissions on the .txt files and folders in the stories folder-->that's greek to me I have no clue what you mean.
This is what I see in that particular section that you mentioned:
while($chap = dbassoc($chapters)) {
$chapid = $chap['chapid'];
$storytext = "";
if($out = fopen (STORIESPATH."/$olduid/$chapid.txt", "r"))
while (!feof($out)) {
$storytext .= fgets($out, 10000);
}
fclose($out);
unlink(STORIESPATH."/$olduid/$chapid.txt");
if($storytext) {
if( !file_exists( STORIESPATH."/$uid/" ) ) {
mkdir(STORIESPATH."/$uid", 0755);
chmod(STORIESPATH."/$uid", 0777);
}
$handle = fopen(STORIESPATH."/$uid/$chapid.txt", 'w');
if ($handle) {
fwrite($handle, $storytext);
fclose($handle);
}
chmod(STORIESPATH."/$uid/$chapid.txt", 0644);
}
dbquery("UPDATE ".TABLEPREFIX."fanfiction_chapters SET uid = '$uid'
ETA: I just noticed something. This part:
$storytext = "";
if($out = fopen (STORIESPATH."/$olduid/$chapid.txt", "r"))
while (!feof($out)) {
Do I need to put something in between the quotations?
*icon - http://justinchatwinfan.com/
Alright I had the wrong section before, but still I don't see what needs to be changed.
This is what it looks like in my story.php folder:
if($store == "mysql") $storytext = $story['storytext'];
else {
if($out = fopen (STORIESPATH."/".$story['uid']."/$chapid.txt", "r"))
while (!feof($out)) {
$storytext .= fgets($out, 10000);
}
}
and yes, I checked the archive admin settings and everything looks the way it should.
*icon - http://justinchatwinfan.com/
What I meant was to look in the folders on your server and see what the permissions are set to. So, find the stories folder and look in there. The folders in the stories folder are numbered corresponding to the sid of the story. Those folders have files inside of them that correspond to the chapid of the chapters of the story in question (whatever folder you're looking in). My folders are at 755 and the files are at 644. If you have stricter permissions that could be causing issues.
Yes I figured out what you were saying but no, the permissions seem fine. I was searching around the forum and figured maybe the story folder wasn't updated.
I'm referring to this thread
https://efiction.org/forums/index.php?topic=6957.0
These are all the error messages I get when I try to add a new chapter, a new story or edit a story or delete a chapter but for some reason, chapter notes will post (not end notes) and the word count is high (as if the story is there but it's not showing):
Warning: fopen(stories/1/115.txt) [function.fopen]: failed to open stream: Permission denied in /home/my name/public_html/stories.php on line 532
Warning:fopen(stories/1/115.txt) [function.fopen]: failed to open stream: No such file or directory in /home/myname/public_html/stories.php on line 583
Warning: unlink(stories/1/119.txt) [function.unlink]: No such file or directory in /home/myname/public_html/stories.php on line 919
I checked my the story folder under my user number, the text is there, the permissions seem fine. Here are the permissions:
Read (all three boxes are checked)
write (user box is checked)
Execute (none of the boxes are checked
Permission numbers 6 4 4
I feel like it's something else; I'm getting beyond frustrated.
*icon - http://justinchatwinfan.com/
Okay, so first I want to clarify something. I was on the phone while I was typing that last post, which is not a good idea. : P How the stories folder is laid out is there the folders inside are numbered by the author's uid, and all the stories inside, the .txt files, are the chapids.
Anyway, so your first warning there tells us a lot. It says "permission denied" and gives a specific file location. When I put that on the end of your eFic site's URL, I get a 404 Not Found error: http://blacklashed.net/stories/1/115.txt. (You can do this with any chapter so long as you know the uid and chapid for a chapter that exists.) What really should be happening is that we should be seeing the .txt file, or maybe be asked to download it. (I think it depends on your browser.) Here is an example of this in work at my test site: http://efictiontest.verilyviridian.com/stories/1/10.txt
This means two likely things:
1) The file doesn't exist, which you verified it does
2) The server isn't allowing us access to it
I think that this same issue happened with someone else that I remember helping. I'll see if I can find the thread. I think they talked to their host and the issue was resolved with an .htaccess file or something like that.
Problem solved
Found the solution here:
https://efiction.org/forums/index.php?topic=7043.msg37913#msg37913
I switched the submission settings from files to Mysql and wallah everything seems to be working fine. Thank you for your help.
*icon - http://justinchatwinfan.com/
I didn't check, but did you have a lot of stories already? I've never tried switching them like that to see what happens first-hand, but I imagine it's not good, because the existing story text isn't in the database, either. Unless you were using the database before, and somehow it accidentally got switched to folders in the settings (and thus is the cause of the problem)? For a smaller archive this might not be a big deal to redo but larger ones it could be problematic.
I didn't check, but did you have a lot of stories already? I've never tried switching them like that to see what happens first-hand, but I imagine it's not good, because the existing story text isn't in the database, either. Unless you were using the database before, and somehow it accidentally got switched to folders in the settings (and thus is the cause of the problem)? For a smaller archive this might not be a big deal to redo but larger ones it could be problematic.
I don't have that many on the archive right now, everything seemed to be working fine after I made that switch.
*icon - http://justinchatwinfan.com/
