How to remove attachment paperclip?

Started by CheeseHead05, July 13, 2013, 09:44:42 PM

Previous topic - Next topic

CheeseHead05

How do you remove the paperclip that is under an attachment?

Colin

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

CheeseHead05


Colin

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

CheeseHead05


kat

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="*" />

Colin

Thanks K@.

That was really nice of you to include the single pixel file too.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

kat

No sweat, mate.

I use it on my forum, for something. I can't even remember what, now, though. :)

MrPhil

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?

Chalky

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

kat



Nothing about you is normal, Chalky. ;)

(That's a compliment, coming from me). :)

CheeseHead05

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.

Kindred

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?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

CheeseHead05

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.

Kindred

But, you just asked how to remove the link to the attachment....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

CheeseHead05

Exactly, I don't want a link present under the attachment. I ONLY want the attachment pic.

Kindred

What if the attachment is not an image? In that case, the link s the only way to see or use it.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

CheeseHead05

Yea I understand but my forum is for uploaded attachments straight into the forum.

kat

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 />';


CheeseHead05

Strangely, my notepad++ just found "echo"..Can you take a look at my display.temp?

kat

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.

CheeseHead05

#21
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.

Kindred

well, it would really depend on what mods and/or themes you have installed in each
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

CheeseHead05

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.


CheeseHead05

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?

GluenStuff

To add to this how can I make my attachments side by side as opposed to vertical ?

Chalky

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 mod.  It is no longer on the mod site but it is still available at Github.

kat

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?

* K@ goes a fiddlin'...

kat

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.

Advertisement: