Advertisement:

Author Topic: Question about inline attachments/pictures in a post  (Read 8344 times)

Offline flashsteam

  • Semi-Newbie
  • *
  • Posts: 90
    • flashsteam.com
Question about inline attachments/pictures in a post
« on: February 06, 2010, 01:44:18 AM »
Hi,

 Im a new admin running an SMF forum. Ive searched for awhile tonight looking for simple step by step instructions on how to post attachments inline in posts.

 If anyone can provide a link, I sure would appreciate it.

This is a link to my forum, and the post I would like to have inline attachments for.

www 4cyclesteamengine.com/flashsteam_forum/index.php?topic=9.msg34

As you can see they will only display under the post, I would like to provide a short narrative describing each picture in the post.

I tried to use the insert picture button, but it wont provide a valid link to display the picture.

I found this Mod

www custom.simplemachines.org/mods/index.php?mod=1179

But I cant install it, since my forum is version: SMF 1.1.11

Am I going about this the wrong way? Ive searched the whole ADMIN control panel, but it just seems as if I cannot place inline pictures in posts.


best

Jeremy

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Question about inline attachments/pictures in a post
« Reply #1 on: February 06, 2010, 11:17:22 AM »
Hi, welcome to SMF.

See if this mod will do what you want.

http://custom.simplemachines.org/mods/index.php?mod=1000

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

aishaweb

  • Guest
Re: Question about inline attachments/pictures in a post
« Reply #2 on: February 06, 2010, 11:27:51 AM »
Alternatively, you could use a free image hosting service such as photobucket, also doing it that way will save you some bandwidth and disc space.

Offline flashsteam

  • Semi-Newbie
  • *
  • Posts: 90
    • flashsteam.com
Re: Question about inline attachments/pictures in a post
« Reply #3 on: February 06, 2010, 01:09:48 PM »
Thanks for the welcome Kays.

 I was able to successfully install the mod and it does work, thank you. I like the ease of being able insert the attachments into the post using the [attachment=1] link next to the listed attachments.

 I noticed that the attachments under the post display aswell. I went to the attachment settings (in admin control panel) and unchecked the box that displays attachments under the post. When I did this, none of the images were open/visible, both inline in the post and under it.

Is there a way to make the images visible, only inline in the post, or have the images show as thumbnails under the post, while the inline images remain full size?

Aishaweb, I was considering something like that in order to use the insert inmage button. However, I have alot of server storage space and bandwidth. Ideally I would like to keep everything on the forums database. Thanks for the suggestion. 


best


Jeremy

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Question about inline attachments/pictures in a post
« Reply #4 on: February 06, 2010, 01:15:06 PM »
Quote
Is there a way to make the images visible, only inline in the post, or have the images show as thumbnails under the post, while the inline images remain full size?

If you enable thumbnails then they should appear at the bottom of the post.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Offline flashsteam

  • Semi-Newbie
  • *
  • Posts: 90
    • flashsteam.com
Re: Question about inline attachments/pictures in a post
« Reply #5 on: February 06, 2010, 03:04:32 PM »
When im in "Attachment settings" on the control panel.

"Display image attachments as pictures under post:"
"Resize images when showing under posts:"

If I check the box on the first option, the inline attachments will display in full size and so will the attachments under the post.

If I uncheck this option none of the pictures(the attachments) will display, both inline and under the post. Only the attachment links will show(in both places).

If I check the second box (if the first box is checked) the all the attachments will display in thumbnail size, again, both, with the inline images and under post images.

What I want, is for "only" the inline attachments to display, and the attachments under the post not too. If the links for the attachment remain that is fine. I feel it distracts from the post, if the attachments display in the post and under it. If the attachments are both to display I would preffer the under post attachments to be thumbnails and the inline posts be full size. I only suggest this because it is a secondary option that I would consider.

I would rather have the attachments display, only inline, in the post and not display attachments under it. Is there another Mod, that will give me the ability to do that? 

As it stands now, I can only see the inline attachments display, if the "Display image attachments as pictures under post:" is checked, so, I can only see both display or neither display. I want the inline attachments to display only.

best

Jeremy

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Question about inline attachments/pictures in a post
« Reply #6 on: February 06, 2010, 03:20:36 PM »
Blah.. So it mirrors the image below.

In display.template.php of the theme you are using look for:
Code: [Select]
if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'])
echo '
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
else
echo '
<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
}

and either comment it out or change to first line to:

Code: [Select]
if ($attachment['is_image'] && 1 != 1)


This should disappear the images and just leave the link.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Offline flashsteam

  • Semi-Newbie
  • *
  • Posts: 90
    • flashsteam.com
Re: Question about inline attachments/pictures in a post
« Reply #7 on: February 06, 2010, 03:37:16 PM »
Quote
Blah.. So it mirrors the image below.

lol

Quote
This should disappear the images and just leave the link.


That will be perfect, so this will only affect the "under post" attachments, just want to double check, before I start to messin around with the code.

best

Jeremy

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Question about inline attachments/pictures in a post
« Reply #8 on: February 06, 2010, 03:46:15 PM »
I haven't test it but it should disappear just the images below the post.


If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Offline flashsteam

  • Semi-Newbie
  • *
  • Posts: 90
    • flashsteam.com
Re: Question about inline attachments/pictures in a post
« Reply #9 on: February 06, 2010, 05:00:06 PM »
I was able to find the code and change it, In "display.template.php". It was in the first set of code on that page. I changed-

if ($attachment['is_image'])

to

if ($attachment['is_image'] && 1 != 1)

Nothing changed, both inline and bottom of post attachments still displayed, same as before.

best

Jeremy

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Question about inline attachments/pictures in a post
« Reply #10 on: February 06, 2010, 05:21:07 PM »
And you did that in the display.template.php in the theme you are using?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Offline flashsteam

  • Semi-Newbie
  • *
  • Posts: 90
    • flashsteam.com
Re: Question about inline attachments/pictures in a post
« Reply #11 on: February 06, 2010, 05:45:37 PM »
Im going to double check now. Funny you mention that, the template name seemed unfamiar.

best

Jeremy

Offline flashsteam

  • Semi-Newbie
  • *
  • Posts: 90
    • flashsteam.com
Re: Question about inline attachments/pictures in a post
« Reply #12 on: February 06, 2010, 06:15:11 PM »
Im using-

SMF Default Theme - Core

When I click "Themes and Layout" on the admin control panel, the hit modify theme, SMF Default Theme - Core does show on the "modify themes" as a choice, there were 2 other themes that did show, (that came with the installation) but I deleted them, hoping the default would list as a choice. It did not, so I cant get to "display.template.php of the theme you are using"  for my current theme.

 I was able to get to that, for the other theme (that I changed) and I deleted. Thru the modify themes, I just cant make it to "display.template.php" for my default theme. Since it does not show up as a choice to select, right now theres nothing there since I deleted the other themes im not using.

best

Jeremy

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Question about inline attachments/pictures in a post
« Reply #13 on: February 06, 2010, 06:34:42 PM »
If there's no file in the theme you are using then SMF will use that file from the default theme.

It's a bit easier if you use a FTP client. Download the file from the default theme, edit it and then upload it to the theme you are using.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Offline flashsteam

  • Semi-Newbie
  • *
  • Posts: 90
    • flashsteam.com
Re: Question about inline attachments/pictures in a post
« Reply #14 on: February 06, 2010, 08:46:23 PM »
I think im stuck...

 I can veiw the ftp files where I need to change the script, but cannot edit the page.

"Download the file from the default theme, edit it and then upload it to the theme you are using."

I never was taught how to do that, I guess its biting me in the ass now.

best

Jeremy
 

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Question about inline attachments/pictures in a post
« Reply #15 on: February 06, 2010, 09:08:24 PM »
Not a problem.

If your host allows you to use an FTP client, it's a very useful tool to have when taking care of a site.

See if this helps get you started. How do I use FTP? / What is FTP?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Offline flashsteam

  • Semi-Newbie
  • *
  • Posts: 90
    • flashsteam.com
Re: Question about inline attachments/pictures in a post
« Reply #16 on: February 07, 2010, 12:12:11 PM »
I was able to modify the script using my FTP client. It worked and im happy with the result, Thank-you very much Kays.

At first I tried to edit the script by just logging into my FTP server with IE, that didnt work, it would only allow me to veiw not edit.

This morning I checked the post here and followed the link on FTP. I have filezilla, so I opened the FTP site using that client. I then down loaded the "display template" file to a file on my computer, opened the file with notepad, was able to edit the script, then sent the file back thru filezilla, overwriting the "display template file" on the ftp server with the downloaded file that I edited.

It worked and im very happy with the result. Thanks again...

best

Jeremy

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Question about inline attachments/pictures in a post
« Reply #17 on: February 07, 2010, 12:19:42 PM »
You're welcome. I'm glad you got it sorted out. :)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Offline Shivakumar L Narayan

  • Newbie
  • *
  • Posts: 4
Re: Question about inline attachments/pictures in a post
« Reply #18 on: December 25, 2010, 11:20:22 AM »
Bumped into this when i was searching for posting images inline with the post. This one really helped and works like a charm.

Thanks a lot to Kays for it.

Cheers.

Offline jcarnes

  • Charter Member
  • Semi-Newbie
  • *
  • Posts: 25
  • Gender: Male
Re: Question about inline attachments/pictures in a post
« Reply #19 on: May 30, 2018, 02:24:38 PM »
I'm sorry to revive a very old topic, but it certainly *almost* solved my needs. Is there a way to modify this so that if there is no image within the text, that the images will still display below as attachments?

Seems if I "insert" an image URL in the text (with , the image looks great in line with the text BUT the image also appears below the forum article. Making the modification above, solves that issue by only putting a link in the attachment area. Now, however, when NOT inserting an image into the text, just as an attachment, there is only a link to the attachment, no thumbnail or image.

That's what I am looking to fix - if an image in text, then no attachment image; if no image in text, then show and attachment image.

Thanks for any help for someone who knows nothing about programming. :)