News:

Wondering if this will always be free?  See why free is better.

Main Menu

Hide "Attachments" from the profile area.

Started by NekoJonez, April 29, 2013, 10:21:56 AM

Previous topic - Next topic

NekoJonez

Just like the title says. Is it possible to hide the "attachments" features from the profile area?

I'm using SMF 2.0.4
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

Arantor

Why would you want to hide what attachments a user has made from people visiting that user's profile?

mashby

Hmm...didn't know attachments were viewed on the user's profile. Aren't they included at the bottom of the post in the topic where they are attached?
Always be a little kinder than necessary.
- James M. Barrie

Arantor

Sure they are. But if you go to Profile > Show Posts, you'll find you can view the posts by that user, the topics by that user and the attachments posted by that user.

NekoJonez

Quote from: Arantor on April 29, 2013, 10:46:26 AM
Why would you want to hide what attachments a user has made from people visiting that user's profile?

Since I have the attachments disabled. I don't want my users to upload files to my site.
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

kat

I'm confused.

If they're disabled, there won't be any. So, how will anyone be able to see them?

Am I being dim?

NekoJonez

They still show under "Show posts" => "Attachments".
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

Arantor

If you selected 'Disable attachments', that would actually seem to be a bug that it does not disable the menu item. I would agree it should remain if you selected 'disable new attachments' though.

kat

If "attachments" WAS enabled, but they're disabled, now, you'd be be removing the option to view those.

I suspect that removing the thing would only be an edit to a file, though, wouldn't it?

Possibly, removing it from this line in Profile.template.php?

', (!isset($context['attachments']) && empty($context['is_topics']) ? $txt['showMessages'] : (!empty($context['is_topics']) ? $txt['showTopics'] : $txt['showAttachments'])), ' - ', $context['member']['name'], '

Arantor

QuoteIf "attachments" WAS enabled, but they're disabled, now, you'd be be removing the option to view those.

The attachments option for enabling has three choices, enabled, disabled and disabled for new attachments only - if it's enabled or only disabled for new attachments, you'd still show the attachments area in the profile.

No, that template edit won't do it. You'd have to change this line in Sources/Profile.php:
'attach' => array($txt['showAttachments'], array('profile_view_own', 'profile_view_any')),

Off hand I'd suggest:
'attach' => array($txt['showAttachments'], array('profile_view_own', 'profile_view_any'), 'enabled' => !empty($modSettings['attachmentEnable'])),

Oldiesmann

Quote from: JonezJeA on April 29, 2013, 01:11:00 PM
Quote from: Arantor on April 29, 2013, 10:46:26 AM
Why would you want to hide what attachments a user has made from people visiting that user's profile?

Since I have the attachments disabled. I don't want my users to upload files to my site.

The attachments area in the profile simply shows which files (if any) the user has uploaded. If attachments are disabled, users will not be able to upload files, except for avatars if you have that option enabled (that's separate from attachments).
Michael Eshom
Christian Metal Fans

Arantor

Yes... but the option is STILL SHOWN even if attachments are disabled...

kat

But, if it WAS enabled, but isn't now?

The only way get rid of it would be to edit that file, no?

Arantor

QuoteBut, if it WAS enabled, but isn't now?

It's enabled by default. But that's why you get three options, rather than just enable/disable it.

Mick.

I believe that's what he wants.   Remove the 'Attachments' button from the profile--->view posts.

Arantor

To which a change that should do it (for *all* cases based on the relevant admin setting) has already been suggested.

kat

I meant just for this one, specific need. :)

Arantor

I'd argue it's actually a logic bug in SMF as a whole.

kat

I wouldn't argue against. Although, if anyone clicks on it, they're not gonna see anything, unless attachments had been allowed, previously.

Hardly "Mission-critical". Just a bit daft.

Arantor

Which is why you pick the 'disable for new attachments' option if you want to stop new attachments and keep access to the old ones... the one that's been there since SMF 1.1 at least...

Advertisement: