[SOLVED] No Story T...
 
Notifications
Clear all

[SOLVED] No Story Text Suddenly

7 Posts
3 Users
0 Reactions
1,611 Views
 kali
(@kali)
Posts: 307
Reputable Member
Topic starter
 

URL to your eFiction: http://www.jonasbrothersfanfictionarchive.com
Version of eFiction: 3.4.3
Have you bridged eFiction, if so with what?: SMF
Version of PHP: 4
Version of MySQL: can be found out from your host
Have you searched for your problem: yes
If so, what terms did you try: no story text
State the nature of your problem: After several months of taking stories, today the site decided not to take story text when a user posts a new chapter. Even weirder because if you go back and edit the chapter, it will happily take the story text.
We're storing the stories as files. No, the settings haven't accidentally been switched to storing in the database. Yes, the stories folder is set to 777. As far as we know, nothing has changed.
Do you have a test account for us? testuser/banana


Skins made by Kali are no longer supported!

 
Posted : 03/11/2008 11:04 pm
(@babaca)
Posts: 722
Member Moderator
 

Is it consistent? Or was it just one story doing that? If it was just one story did it maybe have the word 'curl' in the story?


******************************************
Mucking around in eFiction since circa 2001 (ver. 1.0)
Now running v.3

 
Posted : 04/11/2008 12:50 pm
 kali
(@kali)
Posts: 307
Reputable Member
Topic starter
 

No, it's consistent and appears to be happening with some reviews too. We're inclined to blame it on something Dreamhost did (they were mucking with our private server) but we also deleted some stories and things so maybe we got ourselves out of sync or something?

Edit: Is there supposed to be a 0.txt file in the stories folder?


Skins made by Kali are no longer supported!

 
Posted : 04/11/2008 1:14 pm
(@tammy)
Posts: 2577
Member Moderator
 

No there shouldn't. 


 
Posted : 04/11/2008 2:22 pm
 kali
(@kali)
Posts: 307
Reputable Member
Topic starter
 

Fantastico. WTF is my site doing? Apparently the 0.txt is what's being created when you try to upload a new chapter. It doesn't produce a properly numbered one until you go in and edit.


Skins made by Kali are no longer supported!

 
Posted : 04/11/2008 2:47 pm
 kali
(@kali)
Posts: 307
Reputable Member
Topic starter
 

Alright, so I've discovered that the database query when a new chapter is posted works just fine. It knows what the correct chapter id is.

The problem is that the for whatever reason, the site just refuses to properly name the chapter text file correctly. It writes the file just fine, you can open it and the text is there, but it always names is "0.txt"


$insertchapter = dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_chapters (title, inorder, notes, endnotes, validated, wordcount, sid, uid) VALUES
[line break to save forum formatting]
('".addslashes(($chaptertitle != "" ?  $chaptertitle : $title))."', '$inorder', '".addslashes(format_story($notes))."',
[line break to save forum formatting]
'".addslashes(format_story($endnotes))."', '".($validated ? 1 : 0)."', '$wordcount', '$sid', '$uid')");
$chapid = dbinsertid( );
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);
if(($newchapter && $insertchapter != false) || $insertstory != false) {
if($newchapter) {
unset($_POST['submit']);
$output = write_message(_ACTIONSUCCESSFUL).editstory( $sid );
}
else {
if(!$admin) $output = write_message(_STORYADDED).viewstories( );
else $output .= write_message(_ACTIONSUCCESSFUL).editstory( $sid );
}
}
else $output .= write_error(_FATALERROR." "._TRYAGAIN);
}

Is the code in stories.php Did this somehow get changed?


Skins made by Kali are no longer supported!

 
Posted : 05/11/2008 2:59 pm
(@tammy)
Posts: 2577
Member Moderator
 

Seems like you're not getting an insert id from mysql.  Not sure why that would be happening though.


 
Posted : 16/11/2008 11:22 am
Share: