Droplet -> SiteModifiedAdvancedX

pcwacht

I needed a list of pages whith last x modified pages

Used the droplet SiteModifiedX but wasn't happy with it -> http://www.websitebakers.com/pages/droplets/official-library/information/site-modified-x.php
The snippet Last Modified Pages Advanced was more what I need -> http://www.websitebakers.com/pages/code-snippets/listings/last-mod-pages-adv..php

So I merged the two ;)


<?php 
global $database$wb;
$links "";
$heute floor(time() / 86400);
$bisher = -1;

if(!isset(
$x)){$x=10;};
if (
PAGE_ID>0) {
  
$query $database->query("SELECT modified_when, link,page_title WHERE visibility='public'  FROM ".TABLE_PREFIX."pages order by modified_when desc limit $x");
  while(
$mod_details=$query->fetchRow()){
    
$tag =floor($mod_details['modified_when'] / 86400);  
    
$aktuell $heute $tag;
    if (
$aktuell 3) { $aktuell 3; }
    if (
$aktuell 3) { 
      
$aenderungsdatumdate("H:i "$mod_details['modified_when']);
    } else {
      
$aenderungsdatumdate("d. M Y "$mod_details['modified_when']);
    }
    
$weblink=$mod_details['link'];
    
$cutzeichen=strrpos($weblink,"/");
    
$weblinktext substr($weblink,0,$cutzeichen);
    if (
$weblinktext == "")
    {
      
$weblink_text "(in Mainmenu)";
    }
    else
    {
      
$weblink_text "(in " .  str_replace('/'' > '$weblinktext) . ")";
    }
    if (
$bisher <> $aktuell)
    {
      
$bisher $aktuell;
      switch (
$aktuell)
      {
         case 
0$links.= "<h4 class='lastchanges'>Today:</h4>\n"; break;
         case 
1$links.= "<h4 class='lastchanges'>Yesterday:</h4>\n"; break;
         case 
2$links.= "<h4 class='lastchanges'>Day before yesterday:</h4>\n"; break;
         case 
3$links.= "<h4 class='lastchanges'>Older then three days:</h4>\n"; break;
      }
    }
    
$links.=  $aenderungsdatum ." &nbsp; <a href=\"" .  WB_URL PAGES_DIRECTORY "$weblink.php\"><b>" $mod_details['page_title'] . "</b></a> "$weblink_text "<br />\n";
  }
  return 
$links;
}



It can use one optional parameter $x for number of pages to show, if omitted 10 are shown.
call: [[SiteModifiedAdvancedX?x=15]]


Have fun,
John
[url="http://www.ictwacht.nl"]http://www.ictwacht.nl[/url] = Dutch ICT info
[url="http://www.pcwacht.nl"]http://www.pcwacht.nl[/url] = My first
both still work in progress, since years.....