forum.coppermine-gallery.net
Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: m-a-b 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:
$query = "SELECT COUNT(*)......................
to: $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
$select_columns = str_replace('pid', 'c.pid', $select_columns).', msg_id, author...................
to
$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:
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_COMMENTS']} as c, {$CONFIG['TABLE_PICTURES................
to: $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...
-
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...
-
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!
-
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