Advanced search  

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

Pages: [1]   Go Down

Author Topic: Editing Displayed File Information  (Read 5047 times)

0 Members and 1 Guest are viewing this topic.

mike_control

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Editing Displayed File Information
« on: October 27, 2004, 03:41:26 am »

Hi.

I'm wondering if I could completely remove certain fields from the file information.
These fields are:

Filename.
Album Name.
Keywords.
File Size.
Dimensions.
Displayed.
Favorites.

Basically, everything besides my custom fields and url :)

Any help would be appreciated greatly.

Thanks.

Fake Edit: Oh, before I forget, I'm also wondering if I could remove comment_count and hit_count being displayed in index.php
« Last Edit: December 02, 2004, 09:32:50 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Editing Displayed File Information
« Reply #1 on: October 27, 2004, 07:21:08 am »

take a look into displayimage.php (use a plain text editor), find
Code: [Select]
// Display picture information
function html_picinfo()
and edit the code after it to accomplish what you're looking for (this is the place where all the file information is gathered). Comment out the lines that compose something like $info['foobar'] =... to get rid of the line with foobar information.

Joachim

P.S. We have a "one question per thread" policy...
Logged

stereo

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Editing Displayed File Information
« Reply #2 on: November 28, 2004, 02:42:02 pm »

still dealing with the picinfo editing thing... can't find a way to comment out or delete any of the pic data. Keep having errors. For example removing the filename and it's complete tablecells. Can you be any more specific? thanks.
jeroen
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Editing Displayed File Information
« Reply #3 on: November 28, 2004, 04:09:24 pm »

To remove the filename, all you need to do is change this line of code;
Code: [Select]
$info[$lang_picinfo['Filename']] = htmlspecialchars($CURRENT_PIC_DATA['filename']);
To this;
Code: [Select]
//$info[$lang_picinfo['Filename']] = htmlspecialchars($CURRENT_PIC_DATA['filename']);
And the other lines can be similarly removed, i.e, to remove the favorites, this code;
Code: [Select]
$info[$lang_picinfo['addFavPhrase']] = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . "\">" . $lang_picinfo['addFav'] . '</a>';
    } else {
       $info[$lang_picinfo['addFavPhrase']] = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . "\">" . $lang_picinfo['remFav'] . '</a>';
    }

Needs to be changed to this;
Code: [Select]
//  $info[$lang_picinfo['addFavPhrase']] = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . "\">" . $lang_picinfo['addFav'] . '</a>';
    } else {
       // $info[$lang_picinfo['addFavPhrase']] = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . "\">" . $lang_picinfo['remFav'] . '</a>';
    }
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

stereo

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Editing Displayed File Information
« Reply #4 on: November 28, 2004, 04:21:54 pm »

Feel silly to have used the wrong uncomment characters ... and it's so easy. thanks a lot.
Logged

peter_g

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Editing Displayed File Information
« Reply #5 on: October 03, 2005, 01:39:41 am »


i am a newbie to php (more windows, c# experience) and am helping out someone hosting a site with coppermine.  i commented out some code for displaying file info in displayimage.php

i've done that...  and saved it on the server.   is there anything else i need to do for it take effect.   i dont see the change on the web site.

any help... pls

peter
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Editing Displayed File Information
« Reply #6 on: October 03, 2005, 07:56:52 am »

without knowing what you actually changed and a link to the page you're refering to it's hard to tell what goes wrong. Maybe the old page content is still cached in your browser? Have you tried force-refreshing the page ([Ctrl]+[F5])?
Logged

peter_g

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Editing Displayed File Information
« Reply #7 on: October 03, 2005, 05:13:44 pm »

hi gaugau

thanks for replying.      here's a snippet of displayimage.php ...   the complete "main" section of code with the change i made (search for 
 "//  hide picture info - peter")

but here's the 1 line i commented out from "main"   t

  //  hide picture info - peter
  //  $pic_info = html_picinfo();
      $pic_info = '';


however the real problem is, and this is the better fix, is that
the admin config option to hide picture information  by default is not working (on our server anyway).  ie, whether set to yes/no it still displays the file information for photos by default ("file information is visible by default")

your help is appreciated!

peter
-----------------------------------------------------------------

/**
 * Main code
 */

$pos = isset($HTTP_GET_VARS['pos']) ? (int)$HTTP_GET_VARS['pos'] : 0;
$cat = isset($HTTP_GET_VARS['cat']) ? (int)$HTTP_GET_VARS['cat'] : 0;
$album = isset($HTTP_GET_VARS['album']) ? $HTTP_GET_VARS['album'] : '';
// Build the album set if required
if (!is_numeric($album) && $cat) { // Meta albums, we need to restrict the albums to the current category
    if ($cat < 0) {
        $ALBUM_SET .= 'AND aid IN (' . (- $cat) . ') ';
    } else {
        $ALBUM_SET_ARRAY = array();
        if ($cat == USER_GAL_CAT)
            $where = 'category > ' . FIRST_USER_CAT;
        else
            $where = "category = '$cat'";

        $result = db_query("SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE $where");
        while ($row = mysql_fetch_array($result)) {
            $ALBUM_SET_ARRAY[] = $row['aid'];
        } // while
        get_subcat_data($cat, $CONFIG['subcat_level']);
        // Treat the album set
        if (count($ALBUM_SET_ARRAY)) {
            $set = '';
            foreach ($ALBUM_SET_ARRAY as $album_id) $set .= ($set == '') ? $album_id : ',' . $album_id;
            $ALBUM_SET .= "AND aid IN ($set) ";
        }
    }
}
// Retrieve data for the current picture
if ($pos < 0) {
    $pid = - $pos;
    $result = db_query("SELECT aid from {$CONFIG['TABLE_PICTURES']} WHERE pid='$pid' $ALBUM_SET LIMIT 1");
    if (mysql_num_rows($result) == 0) cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
    $row = mysql_fetch_array($result);
    $album = $row['aid'];
    $pic_data = get_pic_data($album, $pic_count, $album_name, -1, -1, false);
    for($pos = 0; $pic_data[$pos]['pid'] != $pid && $pos < $pic_count; $pos++);
    $pic_data = get_pic_data($album, $pic_count, $album_name, $pos, 1, false);
    $CURRENT_PIC_DATA = $pic_data[0];
} elseif (isset($HTTP_GET_VARS['pos'])) {
    $pic_data = get_pic_data($album, $pic_count, $album_name, $pos, 1, false);
    if ($pic_count == 0) {
        cpg_die(INFORMATION, $lang_errors['no_img_to_display'], __FILE__, __LINE__);
    } elseif (count($pic_data) == 0 && $pos >= $pic_count) {
        $pos = $pic_count - 1;
        $human_pos = $pos + 1;
        $pic_data = get_pic_data($album, $pic_count, $album_name, $pos, 1, false);
    }
    $CURRENT_PIC_DATA = $pic_data[0];
}
// Retrieve data for the current album
if (isset($CURRENT_PIC_DATA)) {
    $result = db_query("SELECT title, comments, votes, category, aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='{$CURRENT_PIC_DATA['aid']}' LIMIT 1");
    if (!mysql_num_rows($result)) cpg_die(CRITICAL_ERROR, sprintf($lang_errors['pic_in_invalid_album'], $CURRENT_PIC_DATA['aid']), __FILE__, __LINE__);
    $CURRENT_ALBUM_DATA = mysql_fetch_array($result);

    if (is_numeric($album)) {
        $cat = - $album;
        $actual_cat = $CURRENT_ALBUM_DATA['category'];
        breadcrumb($actual_cat, $breadcrumb, $breadcrumb_text);
        $cat = - $album;
    } else {
        $actual_cat = $CURRENT_ALBUM_DATA['category'];
        breadcrumb($actual_cat, $breadcrumb, $breadcrumb_text);
    }
}

if (isset($HTTP_GET_VARS['fullsize'])) {
    display_fullsize_pic();
    ob_end_flush();
} elseif (isset($HTTP_GET_VARS['slideshow'])) {
    slideshow();
    ob_end_flush();
} else {
    if (!isset($HTTP_GET_VARS['pos'])) cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
    $picture_title = $CURRENT_PIC_DATA['title'] ? $CURRENT_PIC_DATA['title'] : strtr(preg_replace("/(.+)\..*?\Z/", "\\1", htmlspecialchars($CURRENT_PIC_DATA['filename'])), "_", " ");

    $nav_menu = html_img_nav_menu();
    $picture = html_picture();
    $votes = html_rating_box();
 
 //  hide picture info - peter
 //  $pic_info = html_picinfo();
      $pic_info = '';

    $comments = html_comments($CURRENT_PIC_DATA['pid']);
    if ($CURRENT_PIC_DATA['keywords']) { $meta_keywords = ""; }

    pageheader($album_name . '/' . $picture_title, $meta_keywords, false);
    // Display Breadcrumbs
    if ($breadcrumb && !(strpos($CONFIG['main_page_layout'],"breadcrumb")===false)) {
        theme_display_breadcrumb($breadcrumb, $cat_data);
    }
    // Display Filmstrip if the album is not search
    if ($album != 'search') {
        $film_strip = display_film_strip($album, (isset($cat) ? $cat : 0), $pos, true);
    }
    theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip);
    pagefooter();
    ob_end_flush();
}
Logged

Nibbler

  • Guest
Re: Editing Displayed File Information
« Reply #8 on: October 03, 2005, 06:55:18 pm »

Are you using the Kubrick theme ?
Logged

peter_g

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Editing Displayed File Information
« Reply #9 on: October 03, 2005, 10:22:50 pm »

it's filika

thanks...

« Last Edit: October 04, 2005, 04:05:16 am by peter_g »
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 20 queries.