IMAGE ID IMAGE ID
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

IMAGE ID

Started by nako, September 15, 2005, 12:38:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nako

Hello,
my question is: where in displayimage.php i can write image id (like  id=zzz) for my fullscreened pictures?
There's is code:
<?php
    if (isset($HTTP_GET_VARS['picfile'])) {
        if (!GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

      $picfile = $HTTP_GET_VARS['picfile'];
        $picname = $CONFIG['fullpath'] . $picfile;
        $imagesize = @getimagesize($picname);
        echo "<a href=\"javascript: window.close()\"><img src=\"" . path2url($picname) . "\" $imagesize[3] class=\"image\" border=\"0\" alt=\"\" title=\"$picfile\n" . $lang_fullsize_popup['click_to_close'] . "\"/></a><br />\n";
    } elseif (isset($HTTP_GET_VARS['pid'])) {
        $pid = (int)$HTTP_GET_VARS['pid'];
        $sql = "SELECT * " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='$pid' $ALBUM_SET";
        $result = db_query($sql);

        if (!mysql_num_rows($result)) cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);

        $row = mysql_fetch_array($result);
        $pic_url = get_pic_url($row, 'fullsize');
        $geom = 'width="' . $row['pwidth'] . '" height="' . $row['pheight'] . '"';
        echo "<a href=\"javascript: window.close()\"><img src=\"" . $pic_url . "\" $geom class=\"image\" border=\"0\" alt=\"\" title=\"" . htmlspecialchars($row['filename']) . "\n" . $lang_fullsize_popup['click_to_close'] . "\"></a><br />\n";
    }

    ?>

So where here i can write image id?

nako


Nibbler

I don't understand the question.

nako

The code for original size image is:
<a href="javascript: window.close()"><img src="albums/userpics/10002/NAME.JPG" width="800" height="600" class="image" border="0" alt="" title="NAME.JPG
Click on image to close window"></a>

And i need to add here "id=somename", like:
<a href="javascript: window.close()"><img src="albums/userpics/10002/NAME.JPG" id=somename width="800" height="600" class="image" border="0" alt="" title="NAME.JPG
Click on image to close window"></a>

The question is, where in displayimage and what i must add?

Joachim Müller

an id is just an id, not sure what you're trying to accomplish. Anyway, to add an id attribute, edit displayimage.php, find        echo "<a href=\"javascript: window.close()\"><img src=\"" . path2url($picname) . "\" $imagesize[3] class=\"image\" border=\"0\" alt=\"\" title=\"$picfile\n" . $lang_fullsize_popup['click_to_close'] . "\"/></a><br />\n";and replace with        echo "<a href=\"javascript: window.close()\"><img src=\"" . path2url($picname) . "\" $imagesize[3] class=\"image\" border=\"0\" alt=\"\" title=\"$picfile\n" . $lang_fullsize_popup['click_to_close'] . "\" id=\"somename\" /></a><br />\n";
Then find        echo "<a href=\"javascript: window.close()\"><img src=\"" . $pic_url . "\" $geom class=\"image\" border=\"0\" alt=\"\" title=\"" . htmlspecialchars($row['filename']) . "\n" . $lang_fullsize_popup['click_to_close'] . "\"></a><br />\n";and replace with        echo "<a href=\"javascript: window.close()\"><img src=\"" . $pic_url . "\" $geom class=\"image\" border=\"0\" alt=\"\" title=\"" . htmlspecialchars($row['filename']) . "\n" . $lang_fullsize_popup['click_to_close'] . "\" id=\"somename\" /></a><br />\n";

nako

Thx, that's it :D
It was needed for javascript turning image     Black and White|Colored