2 feature requests 2 feature requests
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

2 feature requests

Started by nickfzx, June 30, 2007, 08:57:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nickfzx

ok I'm getting greedy.

would it be possible that when you call cpm_viewLastCommentedImages that you only get one entry per image...so that if the last 2 comments made were on the same picture you don't get two copies of the same image showing up when you run viewLastCommentedImages.

Also the second feature request is to add the option to have a short snippet of the last comment left on an image as the subtitle...the same as the default option in coppermine when viewing last commented images.

so you could do "subtitle" => "{{pComment}}"

might be willing to donate another pizza :) hint hint

nickfzx

so to get started on the comment snippet bit I thought I would have a quick go myself and thought I would share my findings.

this is the raw MYSQL query to get the text of the last comment left on a specific image:

$pid = current picture id

SELECT msg_body FROM coppermine_comments WHERE pid = $pid ORDER BY coppermine_comments.msg_date DESC LIMIT 1

this gets the whole comment but truncating it with php is very easy:
    function ShortenText($text) {

        // Change to the number of characters you want to display
        $chars = 25;

        $text = $text." ";
        $text = substr($text,0,$chars);
        $text = substr($text,0,strrpos($text,' '));
        $text = $text."...";

        return $text;

    }


I am not sure if I am going in the right direction (in terms of this being able to work with cpmfetch) so i'll wait for your input before doing anything else :)