This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Recent Comments resp. Pages
#1

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
Reply
#2

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' ***************************************************************************************************

Have you completed the interview?
Reply
#3

It works perfectly fine.

Many Thanks!
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
28-Mar-2023, 12:17 PM
Last Post by Steven
19-Jun-2017, 08:04 PM
Last Post by noblues
26-Sep-2013, 05:44 PM
Last Post by Steven
27-Jan-2013, 09:31 PM
Last Post by brande
23-Jan-2013, 07:08 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)