Display a list with the latest updated blogs.
| General Plugin info | |
|---|---|
| Author: | Rodrigo Moraes |
| Current Version: | 0.1 |
| Download: | - |
| Code: | plugin_code |
| Demo: | - |
| Forum Thread: | here |
<?php class NP_Updated extends NucleusPlugin { function getName() { return 'Updated'; } function getAuthor() { return 'Rodrigo Moraes'; } function getURL() { return 'http://www.tipos.com.br/'; } function getVersion() { return '0.1'; } function supportsFeature($SqlTablePrefix) { return 1; } function getDescription() { return 'Show a list with the latest updated blogs.'; } function doSkinVar($skinType) { global $blog, $member; $timeNow = $blog->getCorrectTime(); $query = "SELECT iblog, iauthor, itime FROM ".sql_table('item')." where idraft = 0 and itime<=". mysqldate($timeNow) ." ORDER BY itime DESC limit 60"; $res = mysql_query($query); $updated = 1; while(($row = mysql_fetch_object($res)) && ($updated <= 30)) { $iblog = $row->iblog; $iauthor = $row->iauthor; $dateformat = date("d.m | H:i", strtotime($row->itime)); $mem = new MEMBER; $mem->readFromID(intval($row->iauthor)); $author = $mem->getDisplayName(); $blogname = getBlogNameFromID($iblog); $blogname = htmlentities($blogname); $blogname = str_replace("'",'’',$blogname); if (!$iauthorcopy[$iauthor]) { $bloglink = createBlogLink($iblog, ''); echo "<a href=\"".$bloglink."\" title=\"$blogname\">"; echo $author." - ".$dateformat; echo "</a><br />"; $updated++; $iauthorcopy[$iauthor] = $iauthor; } } } // doSkinVar } // class ?>
version 0.1: initial release (although I have been using it for years
).
Post bug reports and suggestions here at the Nucleus forum: http://forum.nucleuscms.org/viewtopic.php?t=4833