Follow us on Facebook and Twitter!

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:
// 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:
// 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
  Install on dynamic pages starams5 1 1,739 19-Jun-2017, 09:04 PM
Last Post: Steven
Sad Recent Comments..again noblues 2 1,930 26-Sep-2013, 06:44 PM
Last Post: noblues
  Recent Comments CommiC 6 4,673 23-Jun-2013, 12:09 AM
Last Post: CommiC
  Improved Manage Comments Addon MuffinMan 5 3,378 21-Apr-2013, 09:30 PM
Last Post: MuffinMan
  using permalinks on recent comments module otuzel 2 2,313 12-Mar-2013, 11:11 PM
Last Post: otuzel
  Recent Comments Add On Help brande 3 2,990 27-Jan-2013, 10:31 PM
Last Post: Steven
  recent comment add on style brande 0 1,555 23-Jan-2013, 08:08 PM
Last Post: brande
  Add-ons Recent Comments not working ! besric 4 3,703 07-Nov-2012, 05:16 PM
Last Post: besric
  Auto populate your pages table corculator 0 2,260 25-Feb-2012, 02:12 PM
Last Post: corculator
  Auto populate your comments table corculator 0 1,873 25-Feb-2012, 01:25 PM
Last Post: corculator

Forum Jump:


Users browsing this thread: 1 Guest(s)