How to hide the text in random/last added section? How to hide the text in random/last added section?
 

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

How to hide the text in random/last added section?

Started by whmeeske, December 24, 2005, 06:13:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

whmeeske

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?

Blueiris

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.

   
You can lead a horse to water, but you can't make him drink - he's got to discover that it's wet for himself.

whmeeske

Quote from: 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.
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?

Blueiris

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.
You can lead a horse to water, but you can't make him drink - he's got to discover that it's wet for himself.

whmeeske

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.

Joachim Müller

the feature has frequently been requested by others, and you can savely turn it off. The "why" question is irrelevant.

whmeeske

Quote from: GauGau on December 27, 2005, 11:40:16 PM
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.

kegobeer

Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Joachim Müller


whmeeske

Quote from: GauGau 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
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?

Joachim Müller


ecto

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))
                if ($set_caption) build_caption($rowset,array('ctime'));
Replace with
                if ($set_caption) build_caption($rowset,array('ctime'),array('hits'));


Find (line 814)
        if ($CONFIG['views_in_thumbview'] || in_array('hits',$must_have)) {
Replace with
        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)
function build_caption(&$rowset,$must_have=array())
Replace with
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:

array('hits','uploader')
instead of just:
array('hits')

And then you would also change (line 826)
        if ($CONFIG['display_uploader']
to include the $mustnt_have stuff:
        if (!in_array('uploader', $mustnt_have) && $CONFIG['display_uploader']

Happy coding  :D

whmeeske

@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  ;)

Joachim Müller


whmeeske

@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 ;)

ecto

Glad to help :)

Good thing you learned something, too!