Most Recent Block w...
 
Notifications
Clear all

Most Recent Block w/ Date & Times?

10 Posts
3 Users
0 Reactions
2,315 Views
(@lonebard)
Posts: 74
Trusted Member
Topic starter
 

Is it possible to modify the "most recent" block so that it also displays the date and time the story was posted? By default it only displays this...

"TITLE by AUTHOR RATING
SHORT DESCRIPTION"

Thanks for any help in achieving this.


 
Posted : 01/09/2008 3:53 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
 

eFic doesn't log when a chapter was posted, so the only date that could display would probably be the last updated or posted originally? Unless you added a chapter date. 🙂

Try {updated} as a skin variable.

ETA:

You'll have to include it in the blocks admin panel/tpl file.


archive: dramione.org
site: accio.nu

Available for skin/mod commission! 🙂

 
Posted : 01/09/2008 4:17 pm
(@carissa)
Posts: 791
Member Moderator
 

My most recent block displays when a chapter was added (not updated). Let me see if I can figure out how I did it...


 
Posted : 01/09/2008 4:56 pm
(@carissa)
Posts: 791
Member Moderator
 

In your recent.php, find around line 16


include(_BASEDIR."includes/storyblock.php");

and add this after


$tpl->assign("recent_update"  , date("m/d", $stories['updated']) );

You'll have to make sure your recent block is set to "use tpl" and add {recent_update} to your index.tpl

"m/d" will only display the month and the date. For other date strings, see this page: http://us2.php.net/manual/en/function.date.php


 
Posted : 01/09/2008 5:17 pm
(@lonebard)
Posts: 74
Trusted Member
Topic starter
 

I followed your instructions Carissa but I dont notice any changes.

I added the code for the recent update,I also edited both the skin and the base index.tpl to add the {recent_update} (just because I wasnt sure which one needed it) and yes I changed the block to use the tpl.


 
Posted : 01/09/2008 9:13 pm
(@carissa)
Posts: 791
Member Moderator
 

Check for a variables.php file in your skin and any lines mentioning the recent block.


 
Posted : 01/09/2008 9:45 pm
(@lonebard)
Posts: 74
Trusted Member
Topic starter
 

$blocks["recent"]["status"] = 2;
$blocks['recent']['tpl'] = 0;

this? I'm assuming I need to edit the 0 into a 1?


 
Posted : 02/09/2008 9:59 am
(@carissa)
Posts: 791
Member Moderator
 

Yes, or if you're going to want the date to appear in every skin, then just remove that line.


 
Posted : 02/09/2008 10:45 am
(@lonebard)
Posts: 74
Trusted Member
Topic starter
 

Well that had an effect. When I change that variable the recent block comes up almost empty. all I see is "on" which I have a feeling comes from my skin index.tpl which has this section...

      <div class="block">
      <div class="title">{recent_title}</div>
      <div class="content">{recent_content} on {recent_update}</div>
    </div>

So why would it only display the "on" and not the content from the tags?


 
Posted : 02/09/2008 7:16 pm
(@carissa)
Posts: 791
Member Moderator
 

Because you switched to use tpls so that means you'll have to use the variables. Mine looks like this:


     <div class="block">
       <div class="title">{recent_title}</div>
<!-- START BLOCK : recentblock -->
<div class="title">{recent_update} - {title} by {author} [{rating}]</div>
<div class="content">{summary}</div>
<!-- END BLOCK : recentblock -->
    </div>

Adjust as necessary.

ETA: To fix coding.


 
Posted : 02/09/2008 10:47 pm
Share: