Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: flashsteam on February 06, 2010, 01:44:18 AM

Title: Question about inline attachments/pictures in a post
Post by: flashsteam 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
Title: Re: Question about inline attachments/pictures in a post
Post by: Kays 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
Title: Re: Question about inline attachments/pictures in a post
Post by: aishaweb 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.
Title: Re: Question about inline attachments/pictures in a post
Post by: flashsteam 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
Title: Re: Question about inline attachments/pictures in a post
Post by: Kays 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.
Title: Re: Question about inline attachments/pictures in a post
Post by: flashsteam 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
Title: Re: Question about inline attachments/pictures in a post
Post by: Kays 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:

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:


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



This should disappear the images and just leave the link.
Title: Re: Question about inline attachments/pictures in a post
Post by: flashsteam on February 06, 2010, 03:37:16 PM
QuoteBlah.. So it mirrors the image below.

lol

QuoteThis 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
Title: Re: Question about inline attachments/pictures in a post
Post by: Kays on February 06, 2010, 03:46:15 PM
I haven't test it but it should disappear just the images below the post.

Title: Re: Question about inline attachments/pictures in a post
Post by: flashsteam 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
Title: Re: Question about inline attachments/pictures in a post
Post by: Kays on February 06, 2010, 05:21:07 PM
And you did that in the display.template.php in the theme you are using?
Title: Re: Question about inline attachments/pictures in a post
Post by: flashsteam 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
Title: Re: Question about inline attachments/pictures in a post
Post by: flashsteam 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
Title: Re: Question about inline attachments/pictures in a post
Post by: Kays 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.
Title: Re: Question about inline attachments/pictures in a post
Post by: flashsteam 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
Title: Re: Question about inline attachments/pictures in a post
Post by: Kays 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? (http://docs.simplemachines.org/index.php?topic=480.0)
Title: Re: Question about inline attachments/pictures in a post
Post by: flashsteam 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
Title: Re: Question about inline attachments/pictures in a post
Post by: Kays on February 07, 2010, 12:19:42 PM
You're welcome. I'm glad you got it sorted out. :)
Title: Re: Question about inline attachments/pictures in a post
Post by: Shivakumar L Narayan 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.
Title: Re: Question about inline attachments/pictures in a post
Post by: jcarnes 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. :)
Title: Re: Question about inline attachments/pictures in a post
Post by: vbgamer45 on May 30, 2018, 05:24:26 PM
For 2.0 and 2.1 there is
https://custom.simplemachines.org/mods/index.php?mod=3770
Title: Re: Question about inline attachments/pictures in a post
Post by: Irisado on May 31, 2018, 04:25:06 AM
Based on your post history, your forum is running the 2.0 version of the software.  This topic is about the 1.1 version, it has been marked as solved, and is also eight years old.  Please post your query in a new topic in the 2.0.x Support board.  Topic locked.