age

NP_Age.php

This template plugin can be used to calculate how old the poster was relative to the item timestamp.

General Plugin info
Author: TrenT
Current Version: -
Download: :np_age_v1.0.zip
Code: plugin source code
Demo: -
Forum Thread: http://forum.nucleuscms.org/viewtopic.php?t=2938

Original source: in the Nucleus Forum at Thread 2938 (Author: TrenT)

This template plugin is used to calculate the age of the poster at the time an item was posted. It is similar in the formatting options to NP_ItemAge with formatting tags for both the text and the calculation in your template.

Installing

Copy and paste the code from the nucleus forum at http://forum.nucleuscms.org/viewtopic.php?t=2938 into a file called NP_Age.php. Upload the file into the nucleus plugin directory, than install or update the subscription list. Include usage code (shown above) in your template where you want the output to appear.

How to use the plugin

There are 5 parameters for this plugin:

<%Age(detail level,year poster born,month poster born,day poster born,text before calculation)%>

Example usage in template (not skin!) would be:

<%Age(1,1977,2,6,Posted When I Was:)%> results in: Posted When I Was: 1 year old
<%Age(2,1977,2,6,Posted When I Was:)%> results in: Posted When I Was: 1 year old and 9 months old
<%Age(3,1977,2,6,Posted When I Was:)%> results in: Posted When I Was: 1 year, 9 months, and 1 week old
<%Age(4,1977,2,6,Posted When I Was:)%> results in: Posted When I Was: 1 year, 9 months, 1 week, and 6 days old

This is my second version of this plugin as I got rid of the formatting in years, days, hours and seconds because they were useless.....

Version History

  • Version 1 is the original code.
  • Version 2 is the newest code (only available in the forum, changes in the code: sql table support added, but also less function - should be fixed from the author - kg).

Plugin review

NP_Age version 1.0 works with Nucleus 3.31 - 2007-10-27 kg

Back to Plugins Overview

 
age.txt · Last modified: 2007/10/27 15:28 by kg