NP_New.php

Using this plugin, you can display new stories since last visit.

General Plugin info
Author: anand, admun (Edmond Hui)
Current Version: 0.3
Download: -
Code: newcode
Demo: -
Forum Thread: -

Installation

  1. Save the code as NP_New.php
  2. Upload/put the file in your plugins directory.
  3. Install the plugin
  4. Edit options to suit your taste and language.
  5. Go to general settings in the nucleus management page and make sure the last visit settings in the cookie area are turned on.
  6. Edit skin ( see usage below ).
  7. Thats it!

Options

The options are simple and self explanatory:

  • What should be the message prefix ? (default: Welcome back)
  • What do we call the guest ? (default: Guest)
  • What should be the message suffix ? (default: You last visited on)
  • What should be the date format ? (default: Y-m-d, H:i:s)
  • What should be the message when there are no new posts ? (default: No new posts since your last visit.)
  • What should be the new post message ? (default: new posts since your last visit :)
  • Title for entry which has no title ? (default: Untitled)
  • Number of entries ? (default: 10)

Usage

Put <%New%> in your skin at the place you want the display.

History

  • v0.1 (February 10, 2003)
    • Initial release
  • v0.2
    • Added cookie check as suggested on wiki
  • v0.3
    • use sql_table
    • add supportsFeature

Notes

  • Using this plugin on a blog that doesn't track last visit date results in all the entries being displayed as new for each visit. Moreover, first time visitors will get a zero (in epoch time) last time visit.

In order to prevent that, I've added a simple if statement in the plugin doSkinVar method :

(php)
function doSkinVar($skinType) {
	 if ( ! is_null( cookieVar('lastVisit') ) &&  ! cookieVar('lastVisit') == 0 ) {
		// ...
		// Original method content
		// ...
	}
}
  • (feel free to add your own notes here)
new.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