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 comment only one pic  (Read 3479 times)

0 Members and 1 Guest are viewing this topic.

m-a-b

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
  • augs-burg.de
    • augs-burg.de
last comment only one pic
« on: February 08, 2005, 09:27:33 pm »

hi!

i have edited code in functions.inc.php to get the effect that a picture is only shown one time...

so i changed:
Code: [Select]
$query = "SELECT COUNT(*)......................
to:
Code: [Select]
$query = "SELECT COUNT(DISTINCT {$CONFIG['TABLE_COMMENTS']}.pid) from {$CONFIG['TABLE_COMMENTS']}, {$CONFIG['TABLE_PICTURES']}  WHERE approved = 'YES' AND {$CONFIG['TABLE_COMMENTS']}.pid = {$CONFIG['TABLE_PICTURES']}.pid $keyword $ALBUM_SET";
and
Code: [Select]
$select_columns = str_replace('pid', 'c.pid', $select_columns).', msg_id, author...................to
Code: [Select]
$select_columns = str_replace('pid', 'c.pid', $select_columns).', msg_id, author_id, msg_author, max(UNIX_TIMESTAMP(msg_date)) as msg_date, msg_body, aid';
also i changed:
Code: [Select]
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_COMMENTS']} as c, {$CONFIG['TABLE_PICTURES................to:
Code: [Select]
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_COMMENTS']} as c, {$CONFIG['TABLE_PICTURES']} as p WHERE approved = 'YES' AND c.pid = p.pid $keyword $TMP_SET GROUP BY pid ORDER by msg_date DESC $limit");
because there was a problem with the pos i also changed following: http://forum.coppermine-gallery.net/index.php?topic=14481.msg67846#msg67846

you can see the result here: http://www.freeforstyle.de/gallery/thumbnails.php?album=lastcom&cat=0

BUT:
There is still one problem - the right (last) picture-date and (last) posting-time of the comment is shown but the wrong text

the text is from the first comment of the picture

i hope someone can help me...

Biggi

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: last comment only one pic
« Reply #1 on: March 15, 2005, 10:24:54 pm »

I'm very interested in the solution according the last shown comment, too. These posted code-changings work quite good exept for the wrong comment which is shown on "last comments"-page.

Can someone help for the last step? Would be great! Thanks...
Logged

Biggi

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: last comment only one pic
« Reply #2 on: March 15, 2005, 11:12:27 pm »

Sorry, no help needed anymore. The code-changes give exactly the last comment on only one picture in "last comments". Everything works in my case...

Thanks to m-a-b!

 
Logged

Biggi

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: last comment only one pic
« Reply #3 on: March 17, 2005, 09:28:01 am »

Hmmmmmm - unfortunately I was too hasty...  In fact theres the wrong comment and the wrong author shown AND by clicking on one of the images another image is displayed  :o  After my first tests it seemed to be alright.

Maybe this is only a simple thing to compete this. So I would be happy if someone takes time for it. Thanks!

Biggi
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.