Sorry, this page is only available in one language

SiteParentModifiedX

Suggested dropletname: SiteParentModifiedX

Published by: rsmith

Create information and link on when your site was last updated for the last 'X' public pages and that share the same root_parent
 

global $database, $wb;
$links="";
if(!isset($x)){$x=10;};
if(!isset($rootparent)){$rootparent=0;};
$links="Last $x Updated Pages <ul>";
if (PAGE_ID>0) {
	$query=$database->query("SELECT modified_when, link,page_title FROM ".TABLE_PREFIX."pages where visibility='public' and root_parent='$rootparent' order by modified_when desc limit $x");
	while($mod_details=$query->fetchRow()){
	$links=$links." <li><b><a href='".PAGES_DIRECTORY.$mod_details[1].PAGE_EXTENSION."'>".$mod_details[2]."</b> ".date("m/d/Y",$mod_details[0]). " : ".date("H:i",$mod_details[0])."</a></li>";
	}
	$links=$links."</ul>";
	return $links;
}

Optional parameters

x=(amount of links)
rootparent=(page_id)

Example

[[SiteParentModifiedX?x=5]]



| Overview | Next droplet »