Posts: 8
Threads: 1
Joined: Jul 2013
Hi Steven,
I want to display the most recent Pages(!).
For example:
Recent Pages:
Page Three at 6:16pm (24nd-Jul)
Page Two at 6:16pm (23nd-Jul)
Page One at 6:16pm (22nd-Jul)
...
Well, i want to display the data from
http://www.domain.com/comments/admin-fol...nage_pages in reverse order limited to the last 5 pages.
I hope you can help me.
kr, kooler
Posts: 2,890
Threads: 59
Joined: Jun 2010
Hi kooler,
The first solution is if you want to hyperlink the page:
PHP Code:
<?php
// Start of 'Recent Pages' *************************************************************************************************
echo "<h3>Recent Pages</h3>";
$pages = mysql_query("SELECT * FROM `" . $cmtx_mysql_table_prefix . "pages` ORDER BY `dated` DESC LIMIT 5");
while ($page = mysql_fetch_array($pages)) {
echo "<a href='" . $page["url"] . "'>" . $page["reference"] . "</a>" . " at " . date("g:ia (jS-M)", strtotime($page["dated"]));
echo "<br/>";
}
// End of 'Recent Pages' ***************************************************************************************************
PHP Code:
<?php
// Start of 'Recent Pages' *************************************************************************************************
echo "<h3>Recent Pages</h3>";
$pages = mysql_query("SELECT * FROM `" . $cmtx_mysql_table_prefix . "pages` ORDER BY `dated` DESC LIMIT 5");
while ($page = mysql_fetch_array($pages)) {
echo $page["reference"] . " at " . date("g:ia (jS-M)", strtotime($page["dated"]));
echo "<br/>";
}
// End of 'Recent Pages' ***************************************************************************************************