how could i "$print" comments count on displayimage.php how could i "$print" comments count on displayimage.php
 

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

how could i "$print" comments count on displayimage.php

Started by mywedding, July 16, 2007, 11:26:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mywedding

hi dears,

i tried many times :) , but i could not that, my problem is below
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.alioyun.net%2Flistdetails.jpg&hash=9e1b201da4c8318290ce05a6f1887dc650027316),

i changed some codes,those were , i dont want to see,

can you help me, my added codes are bold , then what i was wrong or missing :)
$info[$lang_picinfo['Comment']] = sprintf($lang_get_pic_data['n_comments'], $comments_nr['comment']);


[size=12pt]// Display picture information
function html_picinfo()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $THEME_DIR, $FAVPICS, $REFERER;
    global $album, $lang_picinfo, $lang_display_image_php, $lang_byte_units, $lastup_date_fmt, $lang_get_pic_data;

   

    if (GALLERY_ADMIN_MODE && $CURRENT_PIC_DATA['pic_raw_ip']) {
        if ($CURRENT_PIC_DATA['pic_hdr_ip']) {
            $ipinfo = ' (' . $CURRENT_PIC_DATA['pic_hdr_ip'] . '[' . $CURRENT_PIC_DATA['pic_raw_ip'] . ']) / ';
        } else {
            $ipinfo = ' (' . $CURRENT_PIC_DATA['pic_raw_ip'] . ') / ';
        }
    } else {
        if ($owner_link) {
            $ipinfo = '/ ';
        } else {
            $ipinfo = '';
        }
    }

   
    $info[$lang_picinfo['Album name']] = '<span class="alblink">' . $owner_link . $ipinfo . '<a href="thumbnails.php?album=' . $CURRENT_PIC_DATA['aid'] . '">' . $CURRENT_ALBUM_DATA['title'] . '</a></span>';

    if ($CURRENT_PIC_DATA['votes'] > 0) {
        if (defined('THEME_HAS_RATING_GRAPHICS')) {
            $prefix = $THEME_DIR;
        } else {
            $prefix = '';
        }
        if (GALLERY_ADMIN_MODE) {
          $width = 800;
          $height = 500;
        } else {
          $width = 400;
          $height = 250;
        }

        $detailsLink = $CONFIG['vote_details'] ? ' (<a href="#" onclick="MM_openBrWindow(\'stat_details.php?type=vote&amp;pid='.$CURRENT_PIC_DATA['pid'].'&amp;sort=sdate&amp;dir=&amp;sdate=1&amp;ip=1&amp;rating=1&amp;referer=1&amp;browser=1&amp;os=1\',\'\',\'resizable=yes,width='.$width.',height='.$height.',top=50,left=50,scrollbars=yes\'); return false;">'.$lang_picinfo['details'].'</a>)' : '';
        $info[sprintf($lang_picinfo['Rating'], $CURRENT_PIC_DATA['votes'])] = '<img src="' . $prefix . 'images/rating' . round($CURRENT_PIC_DATA['pic_rating'] / 2000) . '.gif" align="middle" alt="" />'.$detailsLink;
    }

        if ($CURRENT_PIC_DATA['keywords'] != "") {
        $info[$lang_picinfo['Keywords']] = '<span class="alblink">' . preg_replace("/(\S+)/", "<a href=\"thumbnails.php?album=search&amp;search=\\1\">\\1</a>" , $CURRENT_PIC_DATA['keywords']) . '</span>';
    }

    for ($i = 1; $i <= 4; $i++) {
        if ($CONFIG['user_field' . $i . '_name']) {
            if ($CURRENT_PIC_DATA['user' . $i] != "") {
                $info[$CONFIG['user_field' . $i . '_name']] = make_clickable($CURRENT_PIC_DATA['user' . $i]);
            }
        }
    }

   
    $detailsLink = ($CURRENT_PIC_DATA['hits'] && $CONFIG['vote_details'] && GALLERY_ADMIN_MODE) ? ' (<a href="#" onclick="MM_openBrWindow(\'stat_details.php?type=hits&amp;pid='.$CURRENT_PIC_DATA['pid'].'&amp;sort=sdate&amp;dir=&amp;sdate=1&amp;ip=1&amp;search_phrase=1&amp;referer=1&amp;browser=1&amp;os=1\',\'\',\'resizable=yes,width=800,height=500,top=50,left=50,scrollbars=yes\'); return false;">'.$lang_picinfo['details'].'</a>)' : '';
    $info[$lang_picinfo['Displayed']] = sprintf($lang_display_image_php['views'], $CURRENT_PIC_DATA['hits']);

:) $info[$lang_picinfo['Comment']] = sprintf($lang_get_pic_data['n_comments'], $comments_nr['comment']); :)



    $info[$lang_picinfo['Displayed']] .= $detailsLink;
    $path_to_pic = $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'];

    if ($CONFIG['read_exif_data']) $exif = exif_parse_file($path_to_pic);

    if (isset($exif) && is_array($exif)) {
array_walk($exif, 'sanitize_data');
        $info = array_merge($info,$exif);
    }[/size]


many thx
Dreams are free, so free your dreams, "Astrid Alauda"

Nibbler

You need to actually count the comments. Add this before your code.


$sql = "SELECT COUNT(*) AS comment FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid = {$CURRENT_PIC_DATA['pid']}";
$result = cpg_db_query($sql);
$comments_nr = mysql_fetch_assoc($result);

mywedding

many thx for your big help (https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fbluecocuk84.sitemynet.com%2Fmynet_resimlerim%2Fheart.gif&hash=86ceb4aa3fa31235592f94c4cf8b9c6af19cbd50)  :-*

and then , i need some info , how could i make bold , those "comment" and "Displayed" , like < 1044times > and < 6 comments > ,

that all, i havent any question :) , regards , asiye
Dreams are free, so free your dreams, "Astrid Alauda"