NP_CurrentAge.php

General Plugin info
Author: TrenT
Current Version: -
Download: -
Code: -
Demo: -
Forum Thread: here

original source: in the Nucleus Forum at http://forum.nucleuscms.org/viewtopic.php?t=4728 (Author: TrenT)

Available TemplateVars

This template plugin is used to calculate the current age of the poster. It is similar in the formatting options to NP_ItemAge with formatting tags for both the text and the calculation in your template.

There are 5 parameters for this plugin:

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

<%CurrentAge(4,2004,08,19,Today I'm)%>

This would display: Today I'm 2 months, 2 weeks, and 6 days old

The 1st parameter is detail with:

  • '1' being just year,
  • '2' being year and months,
  • '3' being year, months and weeks
  • '4' being years, months, weeks and days.

Formatting options in the plugin options.

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…..

Installing

Copy and paste the code from the nucleus forum at this posting into a file called NP_CurrentAge.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.

Version History

Version 1 is the original code. Version 2 is the newest code

TrenT

:: Back to Plugins Overview ::

currentage.txt · Last modified: 2006/07/05 13:03 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki