Advanced search  

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]

Pages: [1]   Go Down

Author Topic: File Information  (Read 4750 times)

0 Members and 1 Guest are viewing this topic.

dayjahone

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
File Information
« on: September 05, 2010, 07:37:05 am »

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.
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9096
  • aka Frantz
    • Ma galerie
Re: File Information
« Reply #1 on: September 05, 2010, 08:39:15 am »

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....
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: File Information
« Reply #2 on: September 05, 2010, 05:09:42 pm »

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

dayjahone

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: File Information
« Reply #3 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.  ???
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: File Information
« Reply #4 on: September 05, 2010, 05:47:21 pm »

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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9096
  • aka Frantz
    • Ma galerie
Re: File Information
« Reply #5 on: September 05, 2010, 05:50:54 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...
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: File Information
« Reply #6 on: September 05, 2010, 05:57:52 pm »

here you go
Code: [Select]
<?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

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: File Information
« Reply #7 on: September 05, 2010, 06:10:49 pm »

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.
Logged

dayjahone

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: File Information
« Reply #8 on: September 05, 2010, 06:13:21 pm »

I find no "print_r" in displayimage.php
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: File Information
« Reply #9 on: September 05, 2010, 06:19:47 pm »

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

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: File Information
« Reply #10 on: September 05, 2010, 06:53:18 pm »

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."
Logged

dayjahone

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: File Information
« Reply #11 on: September 05, 2010, 07:05:23 pm »

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;
}
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: File Information
« Reply #12 on: September 05, 2010, 07:16:37 pm »

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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: File Information
« Reply #13 on: September 05, 2010, 07:19:44 pm »

or use
Code: [Select]
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: File Information
« Reply #14 on: September 05, 2010, 07:23:52 pm »

Brilliant!!! Thank you so much!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: File Information
« Reply #15 on: September 06, 2010, 03:24:08 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:
Code: [Select]
global $lang_common;
unset($data[$lang_common['filename']]);
unset($data[$lang_common['filesize']]);
Logged
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 21 queries.