Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: CheeseHead05 on July 13, 2013, 09:44:42 PM

Title: How to remove attachment paperclip?
Post by: CheeseHead05 on July 13, 2013, 09:44:42 PM
How do you remove the paperclip that is under an attachment?
Title: Re: How to remove attachment paperclip?
Post by: Colin on July 13, 2013, 09:46:07 PM
For all of them or just one post?
Title: Re: How to remove attachment paperclip?
Post by: CheeseHead05 on July 13, 2013, 10:09:17 PM
All of them.
Title: Re: How to remove attachment paperclip?
Post by: Colin on July 13, 2013, 10:11:03 PM
What theme are you using?
Title: Re: How to remove attachment paperclip?
Post by: CheeseHead05 on July 13, 2013, 10:13:29 PM
Greengrass 1. A custom theme..
Title: Re: How to remove attachment paperclip?
Post by: kat on July 14, 2013, 03:33:29 PM
The "Don't need to code anything" way, would be to replace the image Themes/default/theme/images/icons/clip.gif with a single pixel, transparent gif file.

To save you farting about, creating one, there's one, attached. :)

If you wanna fiddle with the code, find this line, in Display.template.php:

<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" />&nbsp;' . $attachment['name'] . '</a> ';

and delete this bit:

<img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" />
Title: Re: How to remove attachment paperclip?
Post by: Colin on July 14, 2013, 04:04:28 PM
Thanks K@.

That was really nice of you to include the single pixel file too.
Title: Re: How to remove attachment paperclip?
Post by: kat on July 14, 2013, 04:15:09 PM
No sweat, mate.

I use it on my forum, for something. I can't even remember what, now, though. :)
Title: Re: How to remove attachment paperclip?
Post by: MrPhil on July 14, 2013, 04:24:25 PM
Quote from: K@ on July 14, 2013, 03:33:29 PM
To save you farting about, creating one, there's one, attached. :)
I can't see it. Where is it?
Title: Re: How to remove attachment paperclip?
Post by: Chalky on July 14, 2013, 04:31:19 PM
LOL!!!  ;D

I had to open the file to see what it looked like, but K@ will tell you that's pretty normal for me  :P
Title: Re: How to remove attachment paperclip?
Post by: kat on July 14, 2013, 04:38:14 PM
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.katzy.dsl.pipex.com%2FSmileys%2Fgiggle.gif&hash=5e80a98c3d04c08d8574cd705bb1f58802253210)

Nothing about you is normal, Chalky. ;)

(That's a compliment, coming from me). :)
Title: Re: How to remove attachment paperclip?
Post by: CheeseHead05 on July 14, 2013, 10:07:28 PM
K@,

I took your code and it deleted the paperclip alright, lol, but how do I delete the entire line besides the paperclip..

For example,

Shoes.jpg (97.67 kB, 480x480 - viewed 1 times.)

Sorry for not being thorough in my description request.
Title: Re: How to remove attachment paperclip?
Post by: Kindred on July 14, 2013, 10:36:53 PM
Mmm...   What?

You plan to completely remove all reference to attachments?
If you want to do that, why don't you just disable attachments entirely?
Title: Re: How to remove attachment paperclip?
Post by: CheeseHead05 on July 14, 2013, 10:45:51 PM
Kindred,

y would I want to do that?? That's a cool feature of a forum. I just want the info in ref to the attachment gone, not the attachment itself.
Title: Re: How to remove attachment paperclip?
Post by: Kindred on July 14, 2013, 10:47:59 PM
But, you just asked how to remove the link to the attachment....
Title: Re: How to remove attachment paperclip?
Post by: CheeseHead05 on July 14, 2013, 10:59:56 PM
Exactly, I don't want a link present under the attachment. I ONLY want the attachment pic.
Title: Re: How to remove attachment paperclip?
Post by: Kindred on July 14, 2013, 11:13:15 PM
What if the attachment is not an image? In that case, the link s the only way to see or use it.
Title: Re: How to remove attachment paperclip?
Post by: CheeseHead05 on July 14, 2013, 11:25:41 PM
Yea I understand but my forum is for uploaded attachments straight into the forum.
Title: Re: How to remove attachment paperclip?
Post by: kat on July 15, 2013, 04:55:34 AM
Most odd. But, hey! It's your forum. :)

You'll need to remove this entire block, then:

echo '
<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" />&nbsp;' . $attachment['name'] . '</a> ';

if (!$attachment['is_approved'] && $context['can_approve'])
echo '
[<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';
echo '
(', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';

Title: Re: How to remove attachment paperclip?
Post by: CheeseHead05 on July 15, 2013, 05:42:38 PM
Strangely, my notepad++ just found "echo"..Can you take a look at my display.temp?
Title: Re: How to remove attachment paperclip?
Post by: kat on July 16, 2013, 07:28:28 AM
Yeah, that block's there, OK.

Now, just in case I've misedited it, rename the file that's there, now, to something like "Display.template0.php". Then, upload the attached file and check it out.

If it works, OK, you can then delete the renamed file, or keep it there, for a while, just in case.

If something goes wrong, simply delete the new file and rename the old one back.
Title: Re: How to remove attachment paperclip?
Post by: CheeseHead05 on July 18, 2013, 08:03:53 PM
K@,

U solved my issue! Thanks!

One question tho,

I have 4 forums, each named differently, now for my other 3, I used your "revised" version of the display.template to fix the attachment description and of course it worked. My question to u is are all the display.templates the same as far as codes? Or is the one u gave me specifically for that particular forum?

Matter fact, can you give me the lines that you removed? I think the lines would be the same in each display.template unlike the rest of the info.
Title: Re: How to remove attachment paperclip?
Post by: Kindred on July 18, 2013, 08:34:03 PM
well, it would really depend on what mods and/or themes you have installed in each
Title: Re: How to remove attachment paperclip?
Post by: CheeseHead05 on July 18, 2013, 09:30:25 PM
Kindred,

I was thinkin the same thing, I think imma just use the same mods and of course the same theme for all to make it easy on me.
Title: Re: How to remove attachment paperclip?
Post by: kat on July 19, 2013, 05:50:04 AM
Quote from: CheeseHead05 on July 18, 2013, 08:03:53 PM
K@,

U solved my issue! Thanks!

Yay! :)
Title: Re: How to remove attachment paperclip?
Post by: CheeseHead05 on July 26, 2013, 05:44:55 PM
K@,

Hope Im not asking for too much, but I added a new forum with a new theme and wanted to know if you could take a look at my display.template so that I can again remove the attachment paperclip and description?
Title: Re: How to remove attachment paperclip?
Post by: GluenStuff on July 27, 2013, 03:49:03 PM
To add to this how can I make my attachments side by side as opposed to vertical ?
Title: Re: How to remove attachment paperclip?
Post by: Chalky on July 27, 2013, 04:02:26 PM
GluenStuff:

1.  Please start your own topics.  This one is marked solved already so there was a high chance your request would be missed.
2.  Have a look at the ILA- Inline Attachments  (https://github.com/Spuds/ILA)mod.  It is no longer on the mod site but it is still available at Github.
Title: Re: How to remove attachment paperclip?
Post by: kat on July 27, 2013, 04:06:26 PM
Quote from: CheeseHead05 on July 26, 2013, 05:44:55 PM
K@,

Hope Im not asking for too much, but I added a new forum with a new theme and wanted to know if you could take a look at my display.template so that I can again remove the attachment paperclip and description?

/me goes a fiddlin'...
Title: Re: How to remove attachment paperclip?
Post by: kat on July 27, 2013, 04:08:59 PM
There ya go!

Once again, though...

Quote from: K@ on July 16, 2013, 07:28:28 AM
Just in case I've misedited it, rename the file that's there, now, to something like "Display.template0.php". Then, upload the attached file and check it out.

If it works, OK, you can then delete the renamed file, or keep it there, for a while, just in case.

If something goes wrong, simply delete the new file and rename the old one back.