This is something one of my members asked for. Apparently she is having trouble telling the difference between new stories, and stories that just have new chapters.
The new feature, is setting another New! for new stories only. For display purposes, I'd probably change the current New! to Updated! and move it next to the number of chapters. (I can already do that part.)
Do you think that this might be something I'd be able to mod myself, Tammy?
Whoever said nothing is impossible never tried slamming a revolving door.
url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word
Yeah that's easily something you can do yourself. You'll find the relevant code section in includes/storyblock.php.
if(!empty($recentdays)) {
$recent = time( ) - ($recentdays * 24 * 60 *60);
if($stories['updated'] > $recent) $tpl->assign("new", isset($new) ? file_exists(_BASEDIR.$new) ? "<img src="'$new'" alt='"._NEW."'>" : $new : _NEW);
}
Change that to be your "Updated!" as follows:
if(!empty($recentdays)) {
global $newupdate;
$recent = time( ) - ($recentdays * 24 * 60 *60);
if($stories['updated'] > $recent) $tpl->assign("new", isset($newupdate) ? file_exists(_BASEDIR.$newupdate) ? "<img src="'$newupdate'" alt='"._NEWUPDATE."'>" : $newupdate : _NEWUPDATE);
}
Then add right beneath it:
if($stories['updated'] == $stories['date']) {
$tpl->assign("new", isset($new) ? file_exists(_BASEDIR.$new) ? "<img src="'$new'" alt='"._NEW."'>" : $new : _NEW);
}
This isn't tested. We'll test it as a mod for now then add it as a feature later.
Okay, I added this to the variables file for a skin and the Updated! part came up right.
$newupdate = "<span class='new'>Updated!</span>";
The New! one for the new story wasn't showing up. I think it's because the Update! one is using the {new} variable for listings. When just the {new} is used, Updated! shows up there. I think it's the $tpl->assign("new" in the first part.
I put {newupdate} on all my liststings after {update}.
Edit: Whoo! I got the Update! part to come up where the {newupdate} was by changing that $tpl->assign("new" to $tpl->assign("newupdate"
Still don't know why New! isn't showing up for the stories though...
Whoever said nothing is impossible never tried slamming a revolving door.
url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word
Okay here's the corrected version. I warned you it wasn't tested. π
if(!empty($recentdays)) {
global $newupdate;
$recent = time( ) - ($recentdays * 24 * 60 *60);
if($stories['updated'] > $recent) {
if(date("$dateformat", $stories['updated']) == date("$dateformat", $stories['date'])) $tpl->assign("new", isset($new) ? file_exists(_BASEDIR.$new) ? "<img src="'$new'" alt='"._NEW."'>" : $new : _NEW);
else $tpl->assign("new", isset($newupdate) ? file_exists(_BASEDIR.$newupdate) ? "<img src="'$newupdate'" alt='"._NEWUPDATE."'>" : $newupdate : _NEWUPDATE);
}
}
You'll also need to add _NEWUPDATE to your languages/en.php file.
Oh! but I was just about to exclaim loudly that I DID IT! On my own. π Go me! Go me! Go me!
This is what I did:
Replace lines 95-100 of storyblock.php
with
if(!empty($recentdays)) {
global $newupdate;
$recent = time( ) - ($recentdays * 24 * 60 *60);
if($stories['updated'] > $recent) $tpl->assign("newupdate", isset($new) ? file_exists(_BASEDIR.$new) ? "<img src="'$new'" alt='"._NEWUPDATE."'>" : $newupdate : _NEWUPDATE);
}
if(!empty($recentdays)) {
global $new;
$recent = time( ) - ($recentdays * 24 * 60 *60);
if($stories['date'] > $recent) $tpl->assign("new", isset($new) ? file_exists(_BASEDIR.$new) ? "<img src="'$new'" alt='"._NEW."'>" : $new : _NEW);
}
I'm sure yours is better though. π
I have _NEWUPDATE in my language file. π
Whoever said nothing is impossible never tried slamming a revolving door.
url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word
Okay, yup, Tammy your's switches the New! and Update! depending on whether the story was recently added or not.
Mine were seperate, so the Updated! showed on every single one, and the New! showed only on new stories. Mine also needed more editing, all the variable files and listings off all the skins needed to be edited for it to show up properly.
Whoever said nothing is impossible never tried slamming a revolving door.
url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word
Well glad it works.
Yup! π
Tammy, would this mod interfere with the RSS feed? I just got a note from someone saying that they now only get New stories and not Updated stories on the feed.
Whoever said nothing is impossible never tried slamming a revolving door.
url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word
I haven't touched the RSS in 3.0. Actually, it's the same RSS as 2.0 pretty much. And no, this couldn't affect that.
I'm confused, I've done everything you guys said on my page and I don't see the NEW! or Updated! on my site.
I added the code to the story.php and also the _NEWUPDATED. I downloaded a new icon to the image folder but nothing. Can someone tell me what I'm doing wrong.
Version: 3.2.1
site: www.divasnluv.com
π
URL: http://www.divasnluv.com
Test site is: N/A
Version of eFiction: 3.4.2
Latest Patche(s): Yes
bridged?:No
modified?: No.
PHP: 5.2.1
MySQL:5.0.18
Did you see Updated! on any fics before you added the changes?
Do you have the correct variables shown on the skins?
The code might be different now as the script has been updated several times. Make sur ethat you are doing the right things and that everything is being put in the right place, regardless of the line numbers, rather than just adding it in.
Whoever said nothing is impossible never tried slamming a revolving door.
url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word
Quick question, Would I have any issue doing this mod after I update to 3.3? From the news thread, it doesn't seem so.
Just looking at it I'd say no.