File Information File Information
 

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

File Information

Started by dayjahone, September 05, 2010, 07:37:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dayjahone

I have some custom file information fields, which is great, by the way, but there is some information that I don't want displayed in the image view (ie. Filename, Album name: Filesize, Dimensions, Displayed, and URL). I tried searching, but didn't come up with anything. I imagine this is simple, but I'm not having any luck. Please help. Thanks.

François Keller

you must make the changes in your theme.php file. Search for the function who display the intermediate picture and midify as you want. If you don't find this function search in the theme.php file from the sample theme and copy paste the code in your theme.php file.

P.S. Post a link to your gallery....
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

dayjahone

I can't find it anything. I'm using the curve theme. http://weestyles.com/gallery

dayjahone

I looked through all 4400 lines of theme.php in the sample theme and still couldn't figure out where it was. Everything is well commented, so I must be a moron.  ???

Stramm

That's not a themeing issue. Here you just can specify the look of the picinfo but not the contents. One need to write a plugin to do that (hook: file_info) or modify core code.


François Keller

Quote from: dayjahone on September 05, 2010, 05:35:48 PM
I looked through all 4400 lines of theme.php in the sample theme and still couldn't figure out where it was. Everything is well commented, so I must be a moron.  ???
No, my bad, i didn't look into the file and write my answer to fast, sorry, Stramm is right...
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Stramm

here you go
<?php
/**********************************************
  Coppermine 1.5.x Plugin - Test
**********************************************/

if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

// Add filter for picinfo
$thisplugin->add_filter('file_info','fileinfo_change');

function 
fileinfo_change($data)
{
    global 
$CONFIG;
//print_r($data);
unset ($data['Filename']);
    return 
$data;
}
?>

you'll need to write a config file for it... or just copy one from another pluginb and modify the contents.

uncomment the print_r() function to see all entries at the top of displayimage.php. See what you want tto have removed and do it similar to what you see I've done for the 'Filename'. The unset() function 'removes' the data.

dayjahone

Wow, now I'm completely lost. I thought I could just delete a few lines. I need to write a plugin?!?!? No idea how to do that.

dayjahone

I find no "print_r" in displayimage.php

Stramm

the code above is the entire plugin. Here you see the print_r() function. Remove the two slashes at the beginning and it'll start working when you open an image (displayimage.php). It's just meant to find out the array names. So if you know everything you want to remove comment it out again.

I'm uploading the entire plugin for you. It's just named test with no fancies but it's working.

dayjahone

OK, almost there! Thank you so much for holding my hand through this! The only two I can't get rid of are "Filesize" and "Rating."

dayjahone

This is what I have now:

function fileinfo_change($data)
{
    global $CONFIG;
   //print_r($data);
   unset ($data['Filename']);
   unset ($data['Album name']);
   unset ($data['Keywords']);
   unset ($data['filesize']);
   unset ($data['Dimensions']);
   unset ($data['Displayed']);
   unset ($data['URL']);
   unset ($data['Rating']);   
    return $data;
}

Stramm

write filesize with an initial capital letter

to remove the rating is more difficult. If you do not want to display it then it's the easiest way to disable it (group control panel)

Stramm

or use unset ($data);
if you want to remove everything

be aware that the per entry solution just removes the entries for your language. If a user uses eg. spanish, then you'll have to remove the spanish entreis, too. Switch to spanish to see that.

dayjahone

Brilliant!!! Thank you so much!

Αndré

Quote from: Stramm on September 05, 2010, 07:19:44 PM
be aware that the per entry solution just removes the entries for your language. If a user uses eg. spanish, then you'll have to remove the spanish entreis, too. Switch to spanish to see that.
In this case I'd use the following approach:
global $lang_common;
unset($data[$lang_common['filename']]);
unset($data[$lang_common['filesize']]);