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: diferent questions  (Read 5674 times)

0 Members and 1 Guest are viewing this topic.

zom

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 83
diferent questions
« on: January 25, 2004, 12:36:43 pm »

1/ How to limit to a certain number the comments displayed under an image? for exemple the last 10.

2/ How to reinit to 0 all the count of stats (images most seen ...)

3/ I would like to insert by frame in my home (html page) some top 5 images what should contain the page called by the sript ?

thanks


 :)
Logged
Thanks to everyone

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: diferent questions
« Reply #1 on: January 25, 2004, 02:42:54 pm »

Next time: only one question per thread! :evil:

Quote from: "zom"
2/ How to reinit to 0 all the count of stats (images most seen ...)
log in as admin, admin mode, choose a category, click "edit pics" next to the album thumbnail: notice the "Reset view counter" thingy?

Quote from: "zom"
3/ I would like to insert by frame in my home (html page) some top 5 images what should contain the page called by the sript ?
take a look at http://forum.coppermine-gallery.net/index.php?topic=625

GauGau
Logged

zom

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 83
diferent questions
« Reply #2 on: January 26, 2004, 08:22:25 am »

thanks gaugau I'm sorry for asking 3 questions in the same subject.
I was ignorant about the rule 1 question per subject.


for

1/ How to limit to a certain number the comments displayed under an image? for exemple the last 10 ?

is there a way ? :)
Logged
Thanks to everyone

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
diferent questions
« Reply #3 on: January 26, 2004, 09:52:37 am »

out-of-the-box: no (and I don't know of a hack which could do this). If you need it, you'll have to code it.

GauGau
Logged

Nibbler

  • Guest
diferent questions
« Reply #4 on: January 26, 2004, 09:03:48 pm »

If you open displayimage.php line 308-ish and replace:

Code: [Select]

$result = db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id ASC");



with:


Code: [Select]

$result_prelim = db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id ASC");
$numrows = (max(mysql_num_rows($result_prelim) - 10,0));
$result = db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id ASC LIMIT " .$numrows. ",10");


Change the 10 in both places to however many comments you want to display.

That will give what you want, but it's a bit of mess, there must be a better way.
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.