forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: whmeeske on December 24, 2005, 06:13:50 pm

Title: How to hide the text in random/last added section?
Post by: whmeeske on December 24, 2005, 06:13:50 pm
In the mainpage of CPG 1.4.2 there is a section with random items and a section with last added items.
The difference with for example 1.3.4 is that in these sections extra text is shown (filename, comment).

How can I hide these text? Only the add-date must be shown in the last added section (like 1.3.4.).
Is there someone who knows if this can be done?
Title: Re: How to hide the text in random/last added section?
Post by: Blueiris on December 24, 2005, 10:42:08 pm
I think what you are looking for can be found in "Config" under "Thumbnail view," starting on the fourth line down. If you set all five thumbnail settings to "no," you should have what you are looking for.

   
Title: Re: How to hide the text in random/last added section?
Post by: whmeeske on December 24, 2005, 10:56:28 pm
I think what you are looking for can be found in "Config" under "Thumbnail view," starting on the fourth line down. If you set all five thumbnail settings to "no," you should have what you are looking for.
This affects all the thumbnail views, also in the albums. And there I want this information shown, but not on the main page.
So I guess this is not a solution for me.

Any other suggestions?
Title: Re: How to hide the text in random/last added section?
Post by: Blueiris on December 25, 2005, 06:04:48 am
Ah, now I understand! I'm not savvy enough to be able to give you a quick answer. I think I know how this can be done, but I'd want to test it out on my scratch gallery to see if I'm right.  Doubt I'll have enough peace on the holiday tomorrow to get much done, but if no one more knowlegeable than I jumps in with a solution in the meantime, I'll experiment a bit on Sunday and see if my idea works.
Title: Re: How to hide the text in random/last added section?
Post by: whmeeske on December 27, 2005, 10:38:11 pm
OK, thanks for thinking with me  :)

I don't understand why this is changed. In older versions it was good, but now the mainpage is too crowdy with all the extra text shown there.
Title: Re: How to hide the text in random/last added section?
Post by: Joachim Müller on December 27, 2005, 11:40:16 pm
the feature has frequently been requested by others, and you can savely turn it off. The "why" question is irrelevant.
Title: Re: How to hide the text in random/last added section?
Post by: whmeeske on December 28, 2005, 11:43:09 am
the feature has frequently been requested by others, and you can savely turn it off.
Then you probably can tell me how to turn it off? I can't find it in the documentation.
Title: Re: How to hide the text in random/last added section?
Post by: kegobeer on December 28, 2005, 12:53:37 pm
Config -> Thumbnail view
Title: Re: How to hide the text in random/last added section?
Post by: Joachim Müller on December 28, 2005, 02:29:50 pm
Please RTFM before asking questions: http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_thumbnail_view
Title: Re: How to hide the text in random/last added section?
Post by: whmeeske on December 28, 2005, 03:16:18 pm
Please RTFM before asking questions: http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_thumbnail_view
I did read the documentation  >:(
The config of the thumbnails affects the view of ALL the thumbs. But that is NOT what I want.
In an album I want the extra text shown (filename, times viewed etc). In the mainpage I want this information NOT to be shown in the parts "Random pictures" en "Last added".
I described this earlier in this topic, so why should I repeat myself?
Title: Re: How to hide the text in random/last added section?
Post by: Joachim Müller on December 28, 2005, 03:43:37 pm
happy coding then ::)
Title: Re: How to hide the text in random/last added section?
Post by: ecto on December 28, 2005, 04:07:37 pm
whmeeske, I have a little mini-hack for you. It may not be the prettiest solution, but it works. It's not a complete hack for what you want, more like a proof of concept.. it could be done a lot more nicely with config settings and so on.

Btw, I saw that there's a plugin hook after build_caption is called from get_pic_data(), so maybe this can be done with a plugin?

Disclaimer; as always, don't edit stuff if you don't know what you're doing. And as I said.. this is not a complete hack, nor are the instructions super-complete either.

This is all in include/functions.inc.php.

Find (line 1226 for Random files, line 1058 for Last additions (they look a little different))
Code: [Select]
                if ($set_caption) build_caption($rowset,array('ctime'));Replace with
Code: [Select]
                if ($set_caption) build_caption($rowset,array('ctime'),array('hits'));

Find (line 814)
Code: [Select]
        if ($CONFIG['views_in_thumbview'] || in_array('hits',$must_have)) {Replace with
Code: [Select]
        if (!in_array('hits', $mustnt_have) && $CONFIG['views_in_thumbview'] || in_array('hits',$must_have)) {Do the above with all the caption fields you want to be able to exclude (they might look a bit different from the above one)

Then find (line 800)
Code: [Select]
function build_caption(&$rowset,$must_have=array())Replace with
Code: [Select]
function build_caption(&$rowset,$must_have=array(),$mustnt_have=array())
So what this does is when build_caption() is called you pass an array to it, called $mustnt_have, then when the caption is built you do an extra check to ensure that that part of the caption isn't built if it's in the $mustnt_have array. So if you also don't want the uploader name to show in the above example, you would pass:

Code: [Select]
array('hits','uploader')instead of just:
Code: [Select]
array('hits')
And then you would also change (line 826)
Code: [Select]
        if ($CONFIG['display_uploader']to include the $mustnt_have stuff:
Code: [Select]
        if (!in_array('uploader', $mustnt_have) && $CONFIG['display_uploader']
Happy coding  :D
Title: Re: How to hide the text in random/last added section?
Post by: whmeeske on December 28, 2005, 04:18:42 pm
@GauGau:
Is it possible to make a new feature in a next version where you can make a difference between thumbs on the mainpage and thumbs on an album page?
I'm not pleased that this has been changed, in older versions it worked all very well. But it's not my intention to downgrade.

Anyway thanks for the help.
Maybe I'll try to implement the given adjustments by ecto, after I've made a backup of include/functions.inc.php  ;)
Title: Re: How to hide the text in random/last added section?
Post by: Joachim Müller on December 28, 2005, 07:46:55 pm
not planned
Title: Re: How to hide the text in random/last added section?
Post by: whmeeske on January 05, 2006, 12:53:23 am
@ecto :

I've experimented with your instructions for the mini-hack.
It works fine, so I'd like to thank you for your advise  :)

It has also another positive thing: by experimenting with it I've learned a further more of how the PHP scripts work ;)
Title: Re: How to hide the text in random/last added section?
Post by: ecto on January 05, 2006, 01:08:25 am
Glad to help :)

Good thing you learned something, too!