Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: last 10 comments  (Read 3287 times)

0 Members and 1 Guest are viewing this topic.

lasa

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
    • Fotos.LaSa.nl
last 10 comments
« on: November 15, 2003, 07:43:31 pm »

Hi,

How can I display the last 10 comments in text-only on a non-coppermine page? Just on the homepage, so the visitors can see the latest actions, and click on it.

Laurens.

DJMaze

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
last 10 comments
« Reply #1 on: November 15, 2003, 08:40:50 pm »

run a SQL query on the cpg_comments table and in that query add "ORDER BY msg_date DESC" then retrieve the first X rows where X is the total you want to show.

example:
Code: [Select]
$sql = "SELECT msg_author, msg_body, msg_date FROM cpg_comments ORDER BY msg_date DESC LIMIT 10";
$result = $db->sql_query($sql);
while ($value = $db->sql_fetchrow($result)) {
    echo $value['msg_body'] . " by " . $value['msg_author] . " on " . $value['msg_date'] . "<br>";
}
Logged
There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0

lasa

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
    • Fotos.LaSa.nl
Thnx!
« Reply #2 on: November 15, 2003, 10:26:55 pm »

Thnx very much, after a little bit modifying, it works now.
Do you know how I can let the comment link to the concerned photo?

Laurens.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
last 10 comments
« Reply #3 on: November 16, 2003, 11:25:39 am »

[list=1]
  • this is a support request, not a feature request; I therefor move this thread to the support board
  • only one issue per thread![/list:o]lasa: you were close to a ban in the past; behave yourself and stick to the rules (post on the right boards etc.)

    GauGau
Logged

lasa

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
    • Fotos.LaSa.nl
last 10 comments
« Reply #4 on: November 16, 2003, 11:30:28 am »

1. Sorry for that.
2. I want to expand this feature. So I have to create for every issue of this feature an new topic?
3. Thnx for moving the topic...
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 18 queries.