NP_Age

Unclear: There are different versions of this plugin.

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: 1.0
Code: itemagecode
Demo: -
Forum Thread: Thread 2917

Installing

  • Copy and paste the code from the nucleus forum thread or from itemagecode into a file called NP_Age.php.
  • Upload the file into the nucleus plugin directory, than install or update the subscription list.
  • Include following usage code in your template where you want the output to appear.

How to use the plugin

This template plugin will calculate the age of your item. It has 2 parameters, the first being the detail level that you want your post to display the age calcuation. The second is the text before the calculation of the age.

There is also 4 options for this plugin for formatting. You can add formatting tags for around your text as well as your calcuation. Example usage in your template (not skin!) would be:

<%ItemAge(1,Item Is:)%> - Resulting in: Item Is: 1 year old
<%ItemAge(2,Item Is:)%> - Resulting in: Item Is: 1 year and 1 month old
<%ItemAge(3,Item Is:)%> - Resulting in: Item Is: 1 year, 1 month and 1 week old
<%ItemAge(4,Item Is:)%> - Resulting in: Item Is: 1 year, 1 month, 1 week and 1 day old 

This is the second version of the plugin with the first only showing days old. If you are interested in the older version code, please contact me. Special thanks to Xiffy for fixing up some problems with the plugin code.

Version History

Version 1 is the original code showing only age of item in days Version 2 gives more formatting options for text and calculation of age of item

TrenT

:: Back to Plugins Overview ::

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