Mod Suggestion/Ques...
 
Notifications
Clear all

Mod Suggestion/Question: Update Date on Every Chapter?

6 Posts
3 Users
0 Likes
1,441 Views
 kali
(@kali)
Posts: 307
Reputable Member
Topic starter
 

I searched around and didn't see a topic on this.

I was wondering how feasible it would be to store and retrieve the update date on every chapter in the story index view?

I know the date isn't stored with the chapter as is (so this wouldn't work on prior chapters) but would it be fairly simple to mod the script to insert that data and recall it?

Thanks!

ETA: Wait, found something.
Could I borrow the 'submittime' from here ( https://efiction.org/forums/index.php?topic=6011.0) and somehow get the proper code to display in the storyindex? Could someone give me an idea on what pages I'd need to edit? Viewstory.php I would guess>

Skins made by Kali are no longer supported!

 
Posted : 17/09/2009 7:25 pm
(@lyndsie)
Posts: 1262
Member Moderator
 

Without trying it it sounds pretty simple (haha, famous last words). I think you'd just need to add a field to fanfiction_chapters and add some code telling it what to insert in there (you could probably use the story update date code as a model). Then do a tpl->assign to create the skin variable.

 
Posted : 17/09/2009 7:35 pm
(@lyndsie)
Posts: 1262
Member Moderator
 

viewstory.php is where you'd do to the tpl->assign to create the variable to put in viewstory.tpl. (I'd guess.)

The actual code about what to put in the database would probably go in stories.php, where new chapters are created.

For the database, I'd do datetime, not null, default: 0000-00-00 00:00:00. (I pulled that from the field 'updated' in fanfiction_stories.)

ETA: sorry for the double posting. This one's in response to kali's edit, which occurred after my first post.

 
Posted : 17/09/2009 7:40 pm
 kali
(@kali)
Posts: 307
Reputable Member
Topic starter
 

Cool, thanks. If I actually figure out WTF I'm doing I'll share.

Skins made by Kali are no longer supported!

 
Posted : 17/09/2009 8:50 pm
(@lyndsie)
Posts: 1262
Member Moderator
 

I'd try working it out to see how accurate my statements were, but my test site's down for the count since I stupidly did not change the nameservers prior to initiating a registrar change, so the domain's pointing at the wrong thing. :

ETA: Miracle of miracles! I just checked again and my domain finally transferred! YAY.

ETA2: So I'm looking through stories.php (which is always my least favorite to prowl through) and I'm there's lots of places fanfiction_stories.updated appears: previewing, new story, new chapter, and so on. I was trying to get an idea of how to go about that and started there. I don't think you'd need to change any of that. You want to leave that going about its business and add one for new chapters only. So I think looking around the areas where you find "if($newchapter)" would be a good place to start to add queries for the new database field to be updated. Also you may want to put something like line 743 into the editchapter() function (so the field updates on edits as well as creation of new chapters).

 
Posted : 17/09/2009 9:23 pm
(@tammy)
Posts: 2577
Member Moderator
 

You'd also need to edit the validate.php file in the admins folder.  Don't forget the update shouldn't go through until it's vaildated.

 
Posted : 18/09/2009 1:13 am
Share: