Advanced search  

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]

Pages: [1]   Go Down

Author Topic: 2 feature requests  (Read 4253 times)

0 Members and 1 Guest are viewing this topic.

nickfzx

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 285
2 feature requests
« on: June 30, 2007, 08:57:39 pm »

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
Code: [Select]
"subtitle" => "{{pComment}}"
might be willing to donate another pizza :) hint hint
Logged

nickfzx

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 285
Re: 2 feature requests
« Reply #1 on: June 30, 2007, 09:56:19 pm »

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:
Code: [Select]
    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 :)
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 19 queries.