displayimage.php 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

displayimage.php

Started by schürmann, October 12, 2006, 06:40:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

schürmann

hallo,

da ich ja eine kastrierte coppermine benutze musste ich die displayimage.php ein bisschen abändern, um die funktion im profil "alle bilder anzeigen" benutzen zu können.

habe das feld "NAME DES ALBUMS" für die anzeige "alle bilder anzeigen" geändert und das feld "DATEINAME" auf den profillink reduziert.

jetzt bitte nicht lachen! alles instinktiv ohne php kenntnisse!

kann ich die folgende vercoderei in der displayimages so lassen?



// 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;

    if ($CURRENT_PIC_DATA['owner_id'] && $CURRENT_PIC_DATA['owner_name']) {
        $owner_link = '<a href ="profile.php?uid=' . $CURRENT_PIC_DATA['owner_id'] . '">' . $CURRENT_PIC_DATA['owner_name'] . '</a> ';
    } else {
        $owner_link = '';
    }

    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['Filename']] = '' . $owner_link .$ipinfo . '<a href="thumbnails.php?album=lastupby&amp;uid=' . $CURRENT_PIC_DATA[''] . '">' . $CURRENT_PIC_DATA[''] . '</a></span>';
    $info[$lang_picinfo['Album name']] = '<span class="alblink">' . $ipinfo . '<a href="thumbnails.php?album=lastupby&amp;uid=' . $CURRENT_PIC_DATA['owner_id'] . '">' . $CURRENT_PIC_DATA['owner_name'] . '</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]);
            }
        }
    }

    $info[$lang_picinfo['File Size']] = ($CURRENT_PIC_DATA['filesize'] > 10240 ? ($CURRENT_PIC_DATA['filesize'] >> 10) . '&nbsp;' . $lang_byte_units[1] : $CURRENT_PIC_DATA['filesize'] . '&nbsp;' . $lang_byte_units[0]);
    $info[$lang_picinfo['File Size']] = '<span dir="ltr">' . $info[$lang_picinfo['File Size']] . '</span>';
    $info[$lang_picinfo['Date Added']] = localised_date($CURRENT_PIC_DATA['ctime'],$lastup_date_fmt);
    $info[$lang_picinfo['Dimensions']] = sprintf($lang_display_image_php['size'], $CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']);
    $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['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);
    }

    if ($CONFIG['read_iptc_data']) $iptc = get_IPTC($path_to_pic);

    if (isset($iptc) && is_array($iptc)) {
array_walk($iptc, 'sanitize_data');
        if (isset($iptc['Title'])) $info[$lang_picinfo['iptcTitle']] = $iptc['Title'];
        if (isset($iptc['Copyright'])) $info[$lang_picinfo['iptcCopyright']] = $iptc['Copyright'];
        if (!empty($iptc['Keywords'])) $info[$lang_picinfo['iptcKeywords']] = implode(' ',$iptc['Keywords']);
        if (isset($iptc['Category'])) $info[$lang_picinfo['iptcCategory']] = $iptc['Category'];
        if (!empty($iptc['SubCategories'])) $info[$lang_picinfo['iptcSubCategories']] = implode(' ',$iptc['SubCategories']);
    }
    // Create the absolute URL for display in info



bewundern kann mann oder frau das ganze hier:http://www.borderlineart.name/de/modules.php?name=Gallery&act=displayimage&album=2&pos=3  ;D

danke fürs lesen!!!



vile grüsse...


schürmann






Stramm

sag doch einfach was Du geändert hast... ist etwas müßig den code mit der orig Funktion zu vergleichen

schürmann

hallo stramm,

danke fürs lesen...

habe einmal diesen original code:

    $info[$lang_picinfo['Filename']] = htmlspecialchars($CURRENT_PIC_DATA['filename']);
    $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>';


in diese vercoderei geändert:

$info[$lang_picinfo['Filename']] = '' . $owner_link .$ipinfo . '<a href="thumbnails.php?album=lastupby&amp;uid=' . $CURRENT_PIC_DATA[''] . '">' . $CURRENT_PIC_DATA[''] . '</a></span>';
    $info[$lang_picinfo['Album name']] = '<span class="alblink">' . $ipinfo . '<a href="thumbnails.php?album=lastupby&amp;uid=' . $CURRENT_PIC_DATA['owner_id'] . '">' . $CURRENT_PIC_DATA['owner_name'] . '</a></span>';




grüssle...


schürmann

habe eine neue idee,

ist es möglich wenn ich das bezeichnungs feld 1 in den benutzerdefinierten felder für zusätzliche dateiinformationen ausfülle eine automatisch abfrage nach den neuesten datein erfolgen kann. gibts es eine feste class/id wo solche linkabfrage eingebaut werden kann. das gleiche für das zweite bezeichnung feld 2 für die kommentare wäre auch super.


möglich?



grüsse


schürmann


Stramm

ich verstehe Deinen Code nicht... kannst Du mir die Logik dahinter erklären? $CURRENT_PIC_DATA[''] ist z.B. nichts, nix, nada -> kannst Du also auch einfach weglassen


Deine neue Idee geht auch nicht in mein Köpfle. Benutzerdef. Felder für die Bildbeschreibung, Du füllst eins aus (? wo ?) und automatisch erfolgt eine Abfrage nach den neusten Dateien (??? häh) (?? wo, und was wird dann angezeigt ??)

Versuch mal Dein Vorhaben anschaulicher zu umschreiben, evtl. mit Bildchen (dann kapiers ich vielleicht auch)