Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: slinouille on June 03, 2008, 04:02:21 AM

Title: Attachments In Message
Post by: slinouille on June 03, 2008, 04:02:21 AM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1179)



ATTACHMENTS IN MESSAGE v1.1
By Slinouille (http://custom.simplemachines.org/mods/index.php?action=search;author=68142)



Introduction
The mod adds the ability to position your attachments in your post using specific bbcodes.
Several types of attachement is possible such as : fullsize, thumbnail, link, ...
For each element attached, it is possible to select the attachement type and the position in the message.

Original mods
Based on mods :
- "Inline Attachments" (by mouser - http://www.donationcoder.com (http://www.donationcoder.com))
- "Attachments Positioning" (by quake101 - http://www.badassmustangs.com (http://www.badassmustangs.com))

Post Help : Inline Attachments for SMF2 post at www.donationcoder.com (http://www.donationcoder.com/Forums/bb/index.php?topic=13011.msg109353#msg109353)
Mod page for Attachments Positioning at simplemachines (http://custom.simplemachines.org/mods/index.php?mod=1159)

Features
o Adds bbcodes [attachimg=n], [attach=n], [attachthumb=n], [attachurl=n] or [attachmini=n] to position attachments within the post (where n is the number of the attachment in the post, eg first = 1, second = 2)
o Adds [Insert Attachment 1] next to each attachment/upload box to insert the bbcode.
o The default listing of attachments at the bottom of the post is unaffected.
o Text string is shown as alternative when quoted or in code
o Error Text string shown for invalid/missing/deleted attachments
o Reloads the attachments for Ajax Editing
o Text string shown in place of attachment for Recent posts/Previewing and Topic&Reply History

There are no admin settings with this mod.  To disable the mod you must uninstall it.

Installation
Simply install the package to install this modification on the SMF Default Core theme.
Manual edits will be required for other themes.

This mod is compatible with SMF 2.0 Beta 3 Public and above only.

Support
Please use the modification thread for support with this modification.

Changelog
1.1 - 5th May 2008
o Improvments done in order to ease the files inlining.
o Compliance check with SMF 2.0 Beta 3.1 Public.

1.0 - 27th April 2008
o Initial release
Title: Re: Attachments In Message
Post by: Nathaniel on June 03, 2008, 04:13:50 AM
This looks like quite a nice mod! :)

It worked very well on my forum, even with about 10 other mods.

Possible expansions for this mod could include, adding the new bbc codes to the list of bbc codes that you can turn on or off, as well as some buttons along with the topic area to actually add the bbc code into the post, like the normal buttons that are there.

J'aime la tranduction française! :)


Title: Re: Attachments In Message
Post by: slinouille on June 03, 2008, 04:47:21 AM
Thank you for comment and suggestion.

I'm always very pleased to have improvment suggestions ... thank you :)
Title: Re: Attachments In Message
Post by: Ni©holąś™ on June 03, 2008, 05:22:42 AM
Congratulations.Nice mod.. :)
Title: Re: Attachments In Message
Post by: klra on August 29, 2008, 12:33:15 PM
Any plans to create a release for 1.1.5 ?
Title: Re: Attachments In Message
Post by: shumilica on September 05, 2008, 06:11:36 AM
Cool mod, only one question..
Is it compatible with WYSIWYG editor that smf2 has?
Title: Re: Attachments In Message
Post by: sneis on September 08, 2008, 04:20:40 PM
Hei

Board version 1.1.6
Attachments In Message - Installation Instructions for 2.0 Beta 4 --> Manual edits

What do I changes to skip the fil-name (marked 1)
What do I changes to move "report this post to the moderator(s)?" and  "Show the IP to this user for this post - because you can moderate?" too left (marked 2)

Thanks  :)
Title: Re: Attachments In Message
Post by: wet-nap on September 22, 2008, 01:09:51 PM
hello,

looks to be a very useful mod and one that will hopefully save me from having to switch to vbulletin, thanks for packaging these up into one mod. any chance there will be a SMF 2b4 compatible update soon? i'm too much a newbie to try manually installing it.

cheers
Title: Re: Attachments In Message
Post by: feline on September 22, 2008, 01:23:42 PM
Can't installed on 2.0 Beta 4 .. error in Display.template.php.

Du you make a release for Beta 4?

Fel
Title: Re: Attachments In Message
Post by: woolly bugger on September 28, 2008, 12:56:29 PM
1.1.6 won't install this mod for me?

Is there any plans to make it work with the Package manager?

Title: Re: Attachments In Message
Post by: dcmouser on October 08, 2008, 08:50:50 PM
Looks really nice, well done.  I think we may start using this instead of my original.
Title: Re: Attachments In Message
Post by: alado on October 18, 2008, 12:50:31 PM
for version 1.1.6 is a mod?
Title: Re: Attachments In Message
Post by: ccbtimewiz on October 18, 2008, 12:58:46 PM
QuoteThis mod is compatible with SMF 2.0 Beta 3 Public and above only.
Title: Re: Attachments In Message
Post by: alado on October 18, 2008, 01:14:20 PM
Quote from: ccbdarkwiz on October 18, 2008, 12:58:46 PM
QuoteThis mod is compatible with SMF 2.0 Beta 3 Public and above only.
and for version 1.1.6 is not there?
Title: Re: Attachments In Message
Post by: Sudhakar Arjunan on October 18, 2008, 04:35:50 PM
Can't installed on 2.0 Beta 4 .. error in Display.template.php.

Du you make a release for Beta 4?
Title: Re: Attachments In Message
Post by: CvH on October 26, 2008, 06:13:30 PM
SMF 2.0b4
also get errors at installing (edit the code to be searched)
seems to work well besides that you see here as picture

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fs7b.directupload.net%2Fimages%2F081027%2Frjevs2ge.png&hash=39127cabcbc2f6eccc31b829ebf817b687ff6bcf)
Title: Re: Attachments In Message
Post by: hansdampf on November 04, 2008, 11:10:30 AM
I'm getting errors in ./Themes/default/Post.template.php during the installation of this mod:


Search:
        foreach ($context['current_attachments'] as $attachment)
            echo '
                                    <input type="checkbox" name="attach_del[]" value="', $attachment['id'], '"', empty($attachment['unchecked']) ? ' checked="checked"' : '', ' class="check" /> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''), '<br />';


Replace:
    // AttachmentsInMessage Mod: Add link in order to create inline link into the message box.
    foreach ($context['current_attachments'] as $attid => $attachment)
        echo '
                                <input type="checkbox" name="attach_del[]" value="', $attachment['id'], '"', empty($attachment['unchecked']) ? ' checked="checked"' : '', ' class="check" /> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''), '    <a href="javascript:void(0);" onclick="replaceText(\'[attachimg=',($attid+1),']\', document.forms.postmodify.', $context['post_box_name'], '); return false;">[', $txt['mod_aim_insert'] ,' ', ($attid+1),' ', $txt['mod_aim_insert_next'] ,']</a><br />';


and...

Search:
                                        function addAttachment()
                                        {
                                            if (allowed_attachments <= 0)
                                                return alert("', $txt['more_attachments_error'], '");

                                            setOuterHTML(document.getElementById("moreAttachments"), \'<br /><input type="file" size="48" name="attachment[]" /><span id="moreAttachments"><\' + \'/span>\');
                                            allowed_attachments = allowed_attachments - 1;

                                            return true;
                                        }


Replace:
                    var count_attachments = ', count($context['current_attachments']) ,' + 1;
                    function createLink(count_attachments)
                    {
var insert_value = document.getElementById(\'inline_format\'+count_attachments).value;
if ( insert_value != "" ) {
                        replaceText("["+insert_value+"="+count_attachments+"]", document.forms.postmodify.', $context['post_box_name'], ');
}
return false;
                    }
 
                    function addAttachment()
                    {
                        if (allowed_attachments <= 0) return alert("', $txt['more_attachments_error'], '");

                        count_attachments = count_attachments + 1 ;
                        setOuterHTML(document.getElementById("moreAttachments"), \'<br /><input type="file" size="48" name="attachment[]" />   <select id="inline_format\'+count_attachments+\'" onchange="createLink(\\\'\'+ count_attachments +\'\\\')" style=""><option value="" selected>', $txt['mod_aim_title'], '</option><option value="attachimg">', $txt['mod_aim_option1'], '</option><option value="attach">', $txt['mod_aim_option2'], '</option><option value="attachthumb">', $txt['mod_aim_option3'], '</option><option value="attachurl">', $txt['mod_aim_option4'], '</option><option value="attachmini">', $txt['mod_aim_option5'], '</option></select>  <span id="moreAttachments"></span>\');

                        allowed_attachments = allowed_attachments - 1;

                        return true;
                    }



Any ideas?  ???
Title: Re: Attachments In Message
Post by: kragno on December 03, 2008, 08:52:29 AM
Hello.

Any chance this mod will work even with 1.1.7 version?

Please! :'(
Title: Re: Attachments In Message
Post by: gemigene on December 28, 2008, 03:57:53 PM
Quote from: kragno on December 03, 2008, 08:52:29 AM
Hello.

Any chance this mod will work even with 1.1.7 version?

Please! :'(

I second that...

Cheers,
Gene
Title: Re: Attachments In Message
Post by: slinouille on January 24, 2009, 02:00:55 AM
Hello,

Sorry I've not enough time to manage a SMF1.x version.
But if someone wants to do it, he/she is welcome  :)

SliN
Title: Re: Attachments In Message
Post by: coldfusionpower on January 28, 2009, 02:10:41 PM
Hi there ..

just installed it at SMF2.0.4 . nice mod man. this is what im looking for ... but some prob at the custom theme im using .. working great at default theme ...

1. attachment filenames go to the top of the page
2. at the file upload browse, the options is not there ...
3. how can i insert a logo and codes for the BBC ? it would be easier if there's a bbc button at the posting bbc section .. easier then have to memorize the bbc codes .. :P . u can see below thumbnail ......

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi127.photobucket.com%2Falbums%2Fp128%2Fcoldfusionpower85%2Feaecm%2520smf%2Fth_imagebug1.jpg&hash=c8d8995b45d4f6a2eb2198819403e09f25e93732) (http://s127.photobucket.com/albums/p128/coldfusionpower85/eaecm%20smf/?action=view&current=imagebug1.jpg)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi127.photobucket.com%2Falbums%2Fp128%2Fcoldfusionpower85%2Feaecm%2520smf%2Fth_imagebug2.jpg&hash=539b792a1188312e0784e36f52a747d5dab7887b) (http://s127.photobucket.com/albums/p128/coldfusionpower85/eaecm%20smf/?action=view&current=imagebug2.jpg)


p/s: when installing, i cant find the exact code for display.template.php for the custom theme... attached is the backup display.template.php and the modded.
Title: Re: Attachments In Message
Post by: svobodniy on January 28, 2009, 02:35:16 PM
1) How to delete attachment names from the top of the message?
2) How to add info for the images?
Title: Re: Attachments In Message
Post by: svobodniy on January 30, 2009, 06:18:04 PM
 ??? ??? ???
Title: Re: Attachments In Message
Post by: slinouille on January 31, 2009, 01:55:02 AM
@svobodniy:
I don't understand what you want to delete ? can you screen capture it ?
Same for point 2, what can of info you want add? but actually the mod doesn't do that, it just offer's the possibility to put attachments in the message instead of at the bottom

@coldfusionpower:
- concerning the display, it smeels like the integration of the code has not been done at the "good" areas. As you have a custom theme, please check that the portion of "original" source code that are keeped are the one you have in your custom theme. Search for comments like "// Original code" and check if they correspond to your original code  ;)
- concerning the options : I think it's a txt problem ... check your modification language file
- concerning the bbc code, I've thinked about that but didn't found any time to work on it ... if you found a solution please PM me  :D

SliN
Title: Re: Attachments In Message
Post by: coldfusionpower on January 31, 2009, 03:13:01 AM
Quote from: slinouille on January 31, 2009, 01:55:02 AM
@coldfusionpower:
- concerning the display, it smeels like the integration of the code has not been done at the "good" areas. As you have a custom theme, please check that the portion of "original" source code that are keeped are the one you have in your custom theme. Search for comments like "// Original code" and check if they correspond to your original code  ;)
- concerning the options : I think it's a txt problem ... check your modification language file
- concerning the bbc code, I've thinked about that but didn't found any time to work on it ... if you found a solution please PM me  :D

SliN

option :
ok i opened the modification.english and yup . codes is not there .. already put it in but still nothing ...

display:
display is fixed now ...
Title: Re: Attachments In Message
Post by: slinouille on January 31, 2009, 03:22:17 AM
Strange concerning your options ...have you cleared the cache using the maintenance option ?
Title: Re: Attachments In Message
Post by: coldfusionpower on January 31, 2009, 04:09:24 AM
haha .. my bad .. i know i forgot something ... thanks ! working great now ! .. will try to search around for the BB code .. it would be a nice addition to the mod ..
Title: Re: Attachments In Message
Post by: dcmouser on February 07, 2009, 10:58:30 AM
really nice.
Title: Re: Attachments In Message
Post by: timned88 on February 13, 2009, 08:58:00 AM
i am receiving reports that uses of mac safari are experiencing issues where images are being pushed off to the right of the frame and aligned incorrectly. 

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.themagicinpixels.com%2Fforum%2Findex.php%3Faction%3Ddlattach%3Btopic%3D3744.0%3Battach%3D4136%3Bimage&hash=3dbdb957a5c646b2ec4957e1908f8519459cfda7)

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.themagicinpixels.com%2Fforum%2Findex.php%3Faction%3Ddlattach%3Btopic%3D3744.0%3Battach%3D4135%3Bimage&hash=62adb636363a344a3a385dc77432df66bea1d620)

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.themagicinpixels.com%2Fforum%2Findex.php%3Faction%3Ddlattach%3Btopic%3D3744.0%3Battach%3D4126%3Bimage&hash=1e74dc4beb34a2c81484a6b8d41c7c2d2e36565f)

these issues only seem to affect mac users running safari.  i have tested with iphone, firefox, windows safari, and IE 6 & 7 with no problems.  could you take a look at this for me?
Title: Re: Attachments In Message
Post by: Alexthelight on May 14, 2009, 07:55:51 AM
Mod Inline (Image) Attachments Mod it allows you to embed images in your posts - but when quoting, the message is not seen pictures. And plus - if you do not preview pictures in a message, they do not appear in the message.
It is possible to do both at IPB - there before you send the message it is possible to upload an image to the server and then easily be displayed on the image link where to + is not displayed then at the bottom of the message.
Forum 2.0 RC1
Title: Re: Attachments In Message
Post by: slinouille on May 14, 2009, 08:04:43 AM
@Alexthelight: hum ... sorry I really didn't understand what you have written.
What is the problem exactely concerning the "Attachments In Message" mod on your forum?
What is IPB?
Title: Re: Attachments In Message
Post by: Alexthelight on May 25, 2009, 10:32:07 AM
I use google translator
1. When I quote the message is get out the bug
(https://www.simplemachines.org/community/index.php?action=dlattach;topic=242654.0;attach=99825)
If not included Display image attachments as pictures under post ang Resize images when showing under posts
(https://www.simplemachines.org/community/index.php?action=dlattach;topic=242654.0;attach=99828)
then the message will be, the image does not appear
(https://www.simplemachines.org/community/index.php?action=dlattach;topic=242654.0;attach=99830)
IPB is Invision Power Board
a picture before sending a message, you can download for hosting and then insert a direct link to any location within the message
Title: Re: Attachments In Message
Post by: chadon on May 29, 2009, 01:02:07 PM
Edit:
Never mind, the bug is from SMF RC1-1:
http://www.simplemachines.org/community/index.php?topic=313915.0



Has this mod been tested with SMF RC1-1?
I installed it in two forums and have an error when large photos are uploaded:

Parse error: syntax error, unexpected T_ELSE in /home/account-name/public_html/forum/Sources/Subs-Graphics.php on line 227

The error disappears when the attachment settings are set with image resize and image display under posts are set to off. So it has something to do with the thumbnail files.

I tried to uninstall the mod and the error is still showing.
The line 227 on Subs-Grahics.php contains the word else in this portion of the code:

      // Walk the right path.      if (!empty($modSettings['currentAttachmentUploadDir']))
      {
         if (!is_array($modSettings['attachmentUploadDir']))
            $modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
         $path = $modSettings['attachmentUploadDir'][$dir];
      }
      else
         $path = $modSettings['attachmentUploadDir'];


I have a third forum where this mod has never been installed and there is no problem.

All 3 forums are running with SMF 2.0 RC1-1  and the mod worked perfectly before the last upgrade with SMF beta 4.

Title: Re: Attachments In Message
Post by: drhamza on June 12, 2009, 12:17:40 PM
THANKS ALOT, very great mod, there is this problem

Quote from: shumilica on September 05, 2008, 06:11:36 AM
Cool mod, only one question..
Is it compatible with WYSIWYG editor that smf2 has?
:(
Title: Re: Attachments In Message
Post by: kai920 on July 29, 2009, 10:41:06 AM
QuoteReloads the attachments for Ajax Editing

For some reason this is not working on my 2.0 RC1.2 forum. Any ideas? The text updates but I still see [attachthumb=xx] text until I refresh the page.

Thanks for the mod!
Title: Re: Attachments In Message
Post by: Hostile on August 28, 2009, 01:21:01 PM
Are there any plans for this to be updated for 1.1.10?  This is a feature that, imho, should already be included with the forum and my users are accustomed to it from our phpBB3 forum.

thanks. :)
Title: Re: Attachments In Message
Post by: Bruno36 on September 15, 2009, 04:25:34 AM
Bonjour!
Je n'arrive pas a trouver display.php Dans la ligne

Hello!
I can not find a display.php In line

// Now for the attachments, signature, ip logged, etc...
echo '
<div id="msg_', $message['id'], '_footer" class="attachments smalltext">';

// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<hr width="100%" size="1" class="hrcolor" />
<div style="overflow: ', $context['browser']['is_firefox'] ? 'visible' : 'auto', '; width: 100%;">';
$last_approved_state = 1;
foreach ($message['attachment'] as $attachment)
{
// Show a special box for unapproved attachments...
if ($attachment['is_approved'] != $last_approved_state)
{
$last_approved_state = 0;
echo '
<fieldset>
<legend>', $txt['attach_awaiting_approve'], '&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]</legend>';
}

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 />';
}
echo '
<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ';

if (!$attachment['is_approved'])
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 />';
}

// If we had unapproved attachments clean up.
if ($last_approved_state == 0)
echo '
</fieldset>';

echo '
</div>';
}


J'ai SMF 2.0 RC1.2
Title: Re: Attachments In Message
Post by: digger on November 11, 2009, 02:24:32 PM
What about RC2?
Title: Re: Attachments In Message
Post by: doughboy99 on November 11, 2009, 04:00:54 PM
Yes Please!!
Title: Re: Attachments In Message
Post by: russ skinner on November 11, 2009, 05:05:16 PM
RC2 would be fantastic.
Title: Re: Attachments In Message
Post by: drhamza on November 11, 2009, 11:30:56 PM
yeah, and please try to make it wysiwyg compatible, thanks a lot for the great mod... this one should be an essential feature in smf ;)
Title: Re: Attachments In Message
Post by: Bruno36 on November 20, 2009, 02:59:31 AM
Hello!

An update is planned for SMF 2.0 RC2
Title: Re: Attachments In Message
Post by: drhamza on November 20, 2009, 08:19:00 AM
it's already updated :D
Title: Re: Attachments In Message
Post by: alado on December 04, 2009, 07:55:28 AM
I look forward to RC2
Title: Re: Attachments In Message
Post by: russ skinner on December 04, 2009, 10:08:43 AM
Bruno36,

That's great to hear.  Without doubt the most utilised mod on the forum I look after.

Any idea on timing?

Russ
Title: Re: Attachments In Message
Post by: drhamza on December 04, 2009, 03:22:19 PM
fixing the wysiwyg error would be awesome, and updating it to RC2 :D
great mod, should be added to the standard smf features in my opinion ;)
Title: Re: Attachments In Message
Post by: purper on December 09, 2009, 12:03:46 PM
I really would like this to be changed for RC2, but the autor is last seen june 25, 2009! :(
Someone else might wanna give this a try?
Title: Re: Attachments In Message
Post by: C4G-TK on December 13, 2009, 08:28:53 PM
Quote from: drhamza on December 04, 2009, 03:22:19 PM
great mod, should be added to the standard smf features in my opinion ;)

Quote from: purper on December 09, 2009, 12:03:46 PM
I really would like this to be changed for RC2, but the autor is last seen june 25, 2009! :(

Agreed x2
Title: Re: Attachments In Message
Post by: chadon on December 13, 2009, 08:45:00 PM
What makes SMF so great is all the mods available. What makes it so bad is when the mods' authors stop supporting them. :(

I also agree, if there is one mod that should be a standard feature, it's this one.
Title: Re: Attachments In Message
Post by: MATTEK on December 13, 2009, 08:51:26 PM
Quote from: drhamza on November 20, 2009, 08:19:00 AM
it's already updated :D

The link to mod does not say compatible with rc2 2.0
Title: Re: Attachments In Message
Post by: C4G-TK on December 13, 2009, 09:14:57 PM
I'll try it.  Give me a second.

UPDATE
I get all edits in Display.template and Post.template showing errors when using 1.3.0 which is the most recent package.  Anyone else try?




Display.template code is changed to this:

// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<div id="msg_', $message['id'], '_footer" class="attachments smalltext">
<div style="overflow: ', $context['browser']['is_firefox'] ? 'visible' : 'auto', ';">';

$last_approved_state = 1;
foreach ($message['attachment'] as $attachment)
{
// Show a special box for unapproved attachments...
if ($attachment['is_approved'] != $last_approved_state)
{
$last_approved_state = 0;
echo '
<fieldset>
<legend>', $txt['attach_awaiting_approve'], '&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]</legend>';
}

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 />';
}
echo '
<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ';

if (!$attachment['is_approved'])
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 />';
}

// If we had unapproved attachments clean up.
if ($last_approved_state == 0)
echo '
</fieldset>';

echo '
</div>
</div>';
}





The edits code for Post.template has changed to this:

Edit 1:
foreach ($context['current_attachments'] as $attachment)
echo '
<dd class="smalltext">
<label for="attachment_', $attachment['id'], '"><input type="checkbox" id= "attachment_', $attachment['id'], '" name="attach_del[]" value="', $attachment['id'], '"', empty($attachment['unchecked']) ? ' checked="checked"' : '', ' class="input_check" /> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''), '</label>
</dd>';
echo '
</dl>';


Edit 2:
<input type="file" size="60" name="attachment[]" class="input_file" />';

Edit 3:
function addAttachment()
{
allowed_attachments = allowed_attachments - 1;
if (allowed_attachments <= 0)
return alert("', $txt['more_attachments_error'], '");

setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment[]" class="input_file" /><\' + \'/dd><dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')<\' + \'/a><\' + \'/dd>\');

return true;
}





At least these are the TESTS that failed on my forum.


Quote from: drhamza on November 20, 2009, 08:19:00 AM
it's already updated :D

  So, I'm unsure how it could be updated.
Title: Re: Attachments In Message
Post by: drhamza on December 13, 2009, 11:24:28 PM
sorry, i thought it was already updated :$
Title: Re: Attachments In Message
Post by: C4G-TK on December 13, 2009, 11:32:18 PM
BTW, the edits I posted are what is IN RC2 and NOT the edits needed to be made in order for this to work in RC2. 


Quote from: C4G-TK on December 13, 2009, 09:14:57 PM
I'll try it.  Give me a second.

UPDATE
I get all edits in Display.template and Post.template showing errors when using 1.3.0 which is the most recent package.  Anyone else try?




Display.template code is changed to this:

// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<div id="msg_', $message['id'], '_footer" class="attachments smalltext">
<div style="overflow: ', $context['browser']['is_firefox'] ? 'visible' : 'auto', ';">';

$last_approved_state = 1;
foreach ($message['attachment'] as $attachment)
{
// Show a special box for unapproved attachments...
if ($attachment['is_approved'] != $last_approved_state)
{
$last_approved_state = 0;
echo '
<fieldset>
<legend>', $txt['attach_awaiting_approve'], '&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]</legend>';
}

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 />';
}
echo '
<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ';

if (!$attachment['is_approved'])
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 />';
}

// If we had unapproved attachments clean up.
if ($last_approved_state == 0)
echo '
</fieldset>';

echo '
</div>
</div>';
}





The edits code for Post.template has changed to this:

Edit 1:
foreach ($context['current_attachments'] as $attachment)
echo '
<dd class="smalltext">
<label for="attachment_', $attachment['id'], '"><input type="checkbox" id= "attachment_', $attachment['id'], '" name="attach_del[]" value="', $attachment['id'], '"', empty($attachment['unchecked']) ? ' checked="checked"' : '', ' class="input_check" /> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''), '</label>
</dd>';
echo '
</dl>';


Edit 2:
<input type="file" size="60" name="attachment[]" class="input_file" />';

Edit 3:
function addAttachment()
{
allowed_attachments = allowed_attachments - 1;
if (allowed_attachments <= 0)
return alert("', $txt['more_attachments_error'], '");

setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment[]" class="input_file" /><\' + \'/dd><dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')<\' + \'/a><\' + \'/dd>\');

return true;
}





At least these are the TESTS that failed on my forum.


Quote from: drhamza on November 20, 2009, 08:19:00 AM
it's already updated :D

  So, I'm unsure how it could be updated.
Title: Re: Attachments In Message
Post by: purper on December 14, 2009, 03:29:34 AM
Quote from: chadon on December 13, 2009, 08:45:00 PM
What makes SMF so great is all the mods available. What makes it so bad is when the mods' authors stop supporting them. :(

I also agree, if there is one mod that should be a standard feature, it's this one.

well, the great thing about mods being available is that everyone can edit and modify them. So maybe someone is able to convert it to RC2? Unfortunately I have no knowledge about php etc. so I rely on smarter members of Simple Machines forum?
Title: Re: Attachments In Message
Post by: C4G-TK on December 31, 2009, 06:47:46 PM
Did anybody update this yet and care to share what they did to make it work on RC2?
Title: Re: Attachments In Message
Post by: ChaosEnergy on January 02, 2010, 06:48:50 AM
i am stuck in one line...i m no coder, so i copied/pasted...but the post.template area is to much for my no knowledge
hope somebody will find...

i can surely send my current edits
i know which line is wrong..but all others are ok...
Title: Re: Attachments In Message
Post by: Spoogs on January 02, 2010, 07:21:30 AM
This may help for an RC2 version http://custom.simplemachines.org/mods/index.php?mod=2285
I dont use the mod so not sure how similar it may or may not be
Title: Re: Attachments In Message
Post by: kai920 on January 08, 2010, 12:57:29 AM
Quote from: C4G-TK on December 31, 2009, 06:47:46 PM
Did anybody update this yet and care to share what they did to make it work on RC2?

I'll be trying to make this work for RC2, stay tuned. Any testers willing to test it out once I 'fix' up the package?
Title: Re: Attachments In Message
Post by: C4G-TK on January 08, 2010, 01:10:43 AM
Quote from: kai920 on January 08, 2010, 12:57:29 AM
Quote from: C4G-TK on December 31, 2009, 06:47:46 PM
Did anybody update this yet and care to share what they did to make it work on RC2?

I'll be trying to make this work for RC2, stay tuned. Any testers willing to test it out once I 'fix' up the package?

sure, I'm home sick with a cold this week, so I'll be around off and on.
Title: Re: Attachments In Message
Post by: kai920 on January 08, 2010, 07:53:10 AM
Here's a first attempt, using the attached install.xml it should install on a fresh RC2 install properly.

One problem I've noticed so far, maybe you can help debug... when I click "more attachments" the second time I start seeing multiple (more attachments) links. I've attached a screenshot.

Let me know what other problems you find.

edit Updated with new install.xml that takes care of above issue.

PS. I've created a RC2 compatible package, but am I allowed to re-distribute it?
Title: Re: Attachments In Message
Post by: kai920 on January 08, 2010, 12:37:17 PM
Was Display.php properly edited? No changes were required from 1.2 on this mod, and I believe that's the part that parses those [attach... ] tags.

Is this a vanilla version of RC2 you're testing on?
Title: Re: Attachments In Message
Post by: kai920 on January 08, 2010, 01:06:29 PM
Sure, PM me with a test account.

Those mod_aim_xxx errors sounds like it can't find language strings?

You got any other mods installed?
Title: Re: Attachments In Message
Post by: C4G-TK on January 08, 2010, 01:38:51 PM
I went ahead and deleted my replies.  I thought your XML was the only edits needed in order to install the MOD, so those were the only edits that I did.  Error in communication.  Will do all the edits and get back to you after my doctor's appt!   Sorry for the confusion!
Title: Re: Attachments In Message
Post by: NeoXII on January 10, 2010, 07:29:42 PM
Hi! Great Mod!
why my Attachments in message can't be open with Highslide Image Viewer....

Thank You  :)
Title: Re: Attachments In Message
Post by: C4G-TK on January 13, 2010, 12:22:29 AM
Kai 

In the original mod, for this edit it says ADD BEFORE... but yours says to ADD AFTER.  Could this be why I can't get the mod to work on my site?  Shouldn't it be ADD BEFORE?   I'm going to keep trying to get this working.

This is the edit I'm referring to...
     In your XML:

<file name="$sourcedir/Display.php">
<operation>
<search position="after"><![CDATA[
return $output;
}]]></search>
Title: Re: Attachments In Message
Post by: kai920 on January 13, 2010, 12:56:25 AM
Where did you find that "before"? I just downloaded AttachmentsInMessage.1.3.0___SMF2RC1.zip from the mod site, and this is what it says:


<file name="$sourcedir/Display.php">
<operation>
<search position="after"><![CDATA[


And as mentioned, I didn't make any changes to the Display.php edits in the xml file.
Title: Re: Attachments In Message
Post by: timned88 on January 19, 2010, 09:23:52 AM
i installed this on rc2 using the modified xml file from a few posts previous and now the attachments are rendering twice...
the first time is in the correct location, the second time is where it would show without the mod being used.  please help!
Title: Re: Attachments In Message
Post by: timned88 on January 20, 2010, 06:03:14 PM
Cool!  Can't wait to check it out. 
Title: Re: Attachments In Message
Post by: kai920 on January 20, 2010, 09:12:36 PM
Good stuff spuds, I'll test it out.
Title: Re: Attachments In Message
Post by: C4G-TK on January 22, 2010, 01:42:32 PM
Thanks Spuds.

Installed and am using on RC2.  Had no errors show in the log. 

Been busy going back through some old posts and changing the codes to [attch in order to show previous attachments though.  This is probably the only thing that I can find as being trouble since this mod doesn't keep the same coding.  If I updated, I probably would have used the same codes in order for it to be backwards compatible with the existing mod.

Nice work and thanks for the work!
Title: Re: Attachments In Message
Post by: timned88 on January 22, 2010, 09:37:24 PM
i installed it as well.  so far so good.
Title: Re: Attachments In Message
Post by: Spuds on January 23, 2010, 12:20:16 AM
Quote from: C4G-TK on January 22, 2010, 01:42:32 PM
Been busy going back through some old posts and changing the codes to [attch in order to show previous attachments though.  This is probably the only thing that I can find as being trouble since this mod doesn't keep the same coding.  If I updated, I probably would have used the same codes in order for it to be backwards compatible with the existing mod.

That sounds a bit odd ... I thought I kept all the same codes as the original mod plus added some new functionality.  If you could provide a link or example post where you had to change things that would be very helpful.   I'll go through the code to see if I made a type somewhere.

I'm also attaching a new revision, you must uninstall the old version and then install the new one.  It has several bug fixes plus some new functionality.  I've been chatting with mouser, the author or the original mod, and have added some things to this version that were available in the original.

o + [attach] tag for quick entry [attach] some text  [attach] some more text is the equivalent of [attach=1] some text [attach=2] some more text.  The mod will always use the next unused attachment, unused being defined as not used by an attach=#.
o + the above quick entry works for all tags [attachurl=1] is the same as [attachurl]
o + check to allow [attach=#1] entries so [attach=#2] is seen as [attach=2]
o ! fixed what [attach=#] should be doing, or was doing?. If there is a thumbnail available [attach=?] will display it as a click-able thumb, if no thumbnail is available it will display the image in full size up to the allowed forum size (if bigger it will be click-able), if not an image just display the url link. 
o + first attempt at updating quoted text that has inline attachment tags to be links back to the post with the attachment or at least the top post.
o ! lost of small fixes that I did not keep track of
Title: Re: Attachments In Message
Post by: C4G-TK on January 23, 2010, 03:20:07 AM
http://www.channel4gaming.com/index.php?topic=1047.0

Here's a pic.  The attachments that were in there just show up as words now.  I modify the post and change the code and it shows them again.
Title: Re: Attachments In Message
Post by: Spuds on January 23, 2010, 12:14:32 PM
Quote from: C4G-TK on January 23, 2010, 03:20:07 AM
http://www.channel4gaming.com/index.php?topic=1047.0

Here's a pic.  The attachments that were in there just show up as words now.  I modify the post and change the code and it shows them again.

Got it ... I believe what was happening is that you had the configuration setting for max width of posted pictures set to zero (disabled), unfortunately I forgot to check for that variable being empty before using it in validation so it decided that the max image width was zero ... looking at the HTML of your page it looks like the mod did everything it should but the images in that space got set to width=0 doh!

Anyway here is a new version to test 1.02, should clean up that error.

Title: Re: Attachments In Message
Post by: C4G-TK on January 23, 2010, 12:32:20 PM
Ohhh, cool deal!
Will look at it tonight when I get ready to do work.
(If I get ready to do work today...lol)
Title: Re: Attachments In Message
Post by: purper on January 25, 2010, 10:13:38 AM
Spuds, I need to compliment on you're efforts here! Really good to see someone with knowledge to step in! :D
Thanks for you're time and help here!

Keep up the good work! :D
Title: Re: Attachments In Message
Post by: timned88 on January 25, 2010, 01:52:34 PM
i really do love this mod.  great job once again.
Title: Re: Attachments In Message
Post by: C4G-TK on January 30, 2010, 01:24:10 PM
@Spuds

I'm just getting one error.  It isn't a major error pulling.  Just wanted to post it.  Seems to be pulling whether a person is guest or member.

Title: Re: Attachments In Message
Post by: Spuds on January 30, 2010, 08:53:43 PM
Thanks for the report, I had noticed the same thing in my logs the other day.  I made a fix and need to go check my logs to see if it fixed it, and if so I'll post an update.

Basically what I think is happening is when you view a post with no inline attachments then the exclusion array ($ila_dont_show_attach_below) is not set so PHP tosses out one of its warnings.
Title: Re: Attachments In Message
Post by: Tanks on February 01, 2010, 02:17:56 AM
I need to follow this - will try it out when you post the update :)
Title: Re: Attachments In Message
Post by: snakeplissken on February 01, 2010, 12:43:22 PM
One more error to be fixed that cropped up on an occasion.


in ILA_Subs.php
            "'[" . $tag . "]' . str_ireplace('[attach', '[attach', '$1') . '[/" . $tag . "]'",



I think it should be str_replace.
Title: Re: Attachments In Message
Post by: Spuds on February 01, 2010, 02:09:21 PM
Quote from: Snake Plissken on February 01, 2010, 12:43:22 PM
One more error to be fixed that cropped up on an occasion.

in ILA_Subs.php
            "'[" . $tag . "]' . str_ireplace('[attach', '[attach', '$1') . '[/" . $tag . "]'",


I think it should be str_replace.

I'm guessing you are on php4 then? .... I'll can make some updates so its can do a case insensitive search/replace for that version of php
Title: Re: Attachments In Message
Post by: snakeplissken on February 01, 2010, 02:24:14 PM
I can run php5 so it shouldn't be a problem for me. I just never got round to doing it yet :)
Title: Re: Attachments In Message
Post by: Spuds on February 01, 2010, 10:19:40 PM
Here is the latest update ...

This fixes the couple of error log warnings that were reported and should now work fine with php4.   I thought that compat.php had a replacement function for str_ireplace but no luck, it has lots of others but not that one ... so I added one into the ila_subs file to take care of that issue.  Let me know if you find any other problems ....

Title: Re: Attachments In Message
Post by: drhamza on February 02, 2010, 01:55:15 AM
perfect!! but there's this problem that i hate in most of the mods :(
when i press [Insert Attachment 1 in the message] while wysiwyg is enabled in the post, nothing happens, can this be solved?
btw, wysiwyg enabled by default in my forum... and no i can't disable it :P
Title: Re: Attachments In Message
Post by: Spuds on February 02, 2010, 10:47:00 AM
Yeah I hate that as well, but about all that can be done is to make the message as nice as possible.   The problem is that with attachments, they don't upload to the server until you hit submit, until then they are on your local computer and not really web url accessible to the editor.

Actually I imaging that there might be some JavaScript way to grab the local file after its been browsed for and inserted, maybe during a preview but that's probably an entire mod in itself.
Title: Re: Attachments In Message
Post by: chadon on February 02, 2010, 02:16:52 PM
Hi,

I had reports about bugs with this mod. I installed yesterday's update and I am having trouble with two tags. I had the same problem with the previous version.

"Normal attachment" gives the following code and shows the code instead of an image once the post is submitted.
Code: [=1]

"Insert as full-size image" works perfectly with firefox but doesn't show any image with IE8.
Code: [attach=1]


Edit:
Here is the code I have in my post.template.php file:

                            <option selected="selected">', $txt['ila_title'], '</option>
                            <option value="attachimg">', $txt['ila_option1'], '</option>
                            <option value="attach">', $txt['ila_option2'], '</option>
                            <option value="attachthumb">', $txt['ila_option3'], '</option>
                            <option value="attachurl">', $txt['ila_option4'], '</option>
                            <option value="attachmini">', $txt['ila_option5'], '</option>


The option selected has no value and the "attach" value doesn't seem to be valid with IE. I removed the two options but if someone could tell me what the first value should be and how to fix the ila_option2 , I would appreciate it. Thanks. ;)

My forum is running SMF 2.0 RC2 with the Curve theme.
Title: Re: Attachments In Message
Post by: Spuds on February 03, 2010, 05:47:36 PM
Quote from: chadon on February 02, 2010, 02:16:52 PM
"Normal attachment" gives the following code and shows the code instead of an image once the post is submitted.
Code: [=1]

Thats a bug that I have fixed in rev4.  Normal attachment should have no value and not insert anything into the message body.  Choosing that option the attachment should be below the message, as if ILA was never installed, like a normal smf attachment.

Quote
"Insert as full-size image" works perfectly with firefox but doesn't show any image with IE8.
Code: [attach=1]

Strange indeed ... please supply a link to an example of this so I can take a look.

I also fixed an error where the option text was not inserting the correct attach code, for example when you selected insert full sized image it put in attach when it should have been attachimg .. again fixed in rev 4
Title: Re: Attachments In Message
Post by: chadon on February 04, 2010, 07:20:38 AM
Here is a link with a [attach=1] code in the first post:
http://www.mustangv8.com/fr/ebay-craiglist-leboncoin/ford-mustang-2-coupe-ghia/
Title: Re: Attachments In Message
Post by: chadon on February 04, 2010, 06:41:42 PM
Wow! New versions are coming every days and you are not even the author of the mod. Thanks you very much, it's now working perfectly.
I really hope you will take over this mod because without you and because of all the tags left by this mod on my forum, I would still be using SMF RC1.
Thank you again for your contributions to the community. ;)
Title: Re: Attachments In Message
Post by: demize on February 07, 2010, 03:35:25 PM
Quote from: Spuds on February 04, 2010, 02:17:27 PM
o Thumbnail or Full [attach=x] Your image will be shown as a click-able thumbnail, but if none exists it will fall back in to showing the full image.  If the full image is larger than allowed by the forum then it will be click-able
One problem here: The thumbnail isn't actually click-able, but it is a link. This is in Google Chrome on 2.0 RC2. All that happens when I click the thumbnail is the link it's supposed to be going to changes. I tried on Internet Explorer, just now too, same thing.
Title: Re: Attachments In Message
Post by: Spuds on February 07, 2010, 10:58:44 PM
@demize --- please supply a link to a page that is doing this ... thanks
Title: Re: Attachments In Message
Post by: 111111 on February 08, 2010, 01:37:48 PM
Spuds, thanks a lot for your work!

Is it possible to make this mode enabled in preview? now users can see only tags  ::) please
Title: Re: Attachments In Message
Post by: engr_dood on February 13, 2010, 02:28:52 PM
Spuds, thank you very much for supporting this mod.

I'm currently running SMF 1.1.11 with the "Attachments Positioning" mod by quake101.  I noticed it uses the custom tag [attachment=] for the attachments.  I've been thinking of upgrading the forum to 2.0 RC2 and using the mod being discussed here moving forward, because this mod, and 2.0 RC2 both look far superior to my current setup.  However, I don't know what will happen with existing posts.  It appears the custom tag names are different between the quake101 attachment positioning mod for 1.x and the mod being discussed here ([attachment=] vs. [attach=]).  Am I stuck because of the different tag names used, or is there backward compatibility with the tags of the quake101 mod for 1.x?  Or might it be possible to sneak around this by, say, editing the .sql file of the forum database backup and doing a search and replace of the tags? (by replacing [attachment= with [attach=).

Title: Re: Attachments In Message
Post by: Spuds on February 13, 2010, 09:04:12 PM
Quote from: 111111 on February 08, 2010, 01:37:48 PM
Spuds, thanks a lot for your work!

Is it possible to make this mode enabled in preview? now users can see only tags  ::) please

I tried to explain that in an earlier post ...  The problem is that with attachments, they don't upload to the server until you hit submit, until then they are on your local computer and not available via web the web so there is nothing to preview.  Even when you do hit submit there are a number of reasons why the attachment might be rejected on upload which makes trying to do some Javascript trick preview impracticable.   
I did look into making preview work if you were modifying a post  in which the attachments were already uploaded but at the point of the preview code the needed attachment information is not yet available through normal SMF variables ... in other words for now  :(

Quote from: engr_dood on February 13, 2010, 02:28:52 PM
Am I stuck because of the different tag names used, or is there backward compatibility with the tags of the quake101 mod for 1.x?  Or might it be possible to sneak around this by, say, editing the .sql file of the forum database backup and doing a search and replace of the tags? (by replacing [attachment= with [attach=).

I'm pretty sure all that will be needed to support the existing attachment tags is one line of code in the ILA-Subs.php file and to add 'attachment' as an available bbc code in Subs.php (where attach attachimg attachurl et al were added during the mod install)

When you get to the point you can test let me know and I'll upload a revision which should work
Title: Re: Attachments In Message
Post by: engr_dood on February 13, 2010, 09:46:01 PM
Quote from: Spuds on February 13, 2010, 09:04:12 PM
I'm pretty sure all that will be needed to support the existing attachment tags is one line of code in the ILA-Subs.php file and to add 'attachment' as an available bbc code in Subs.php (where attach attachimg attachurl et al were added during the mod install)

When you get to the point you can test let me know and I'll upload a revision which should work

Awesome!  I will try to get something going later this week.

Thank you so much!
Title: Re: Attachments In Message
Post by: Northtech on February 14, 2010, 09:06:05 PM
Spuds, thank you for mod. :)
Title: Re: Attachments In Message
Post by: engr_dood on February 17, 2010, 03:39:52 PM
Quote from: Spuds on February 13, 2010, 09:04:12 PMWhen you get to the point you can test let me know and I'll upload a revision which should work

Hi Spuds,

I have a snapshot of our forum installed on a LAN computer here, so I can do as much testing as needed without impacting the users.  So I'm ready to try it out now.

Thanks!
Andy
Title: Re: Attachments In Message
Post by: Spuds on February 17, 2010, 04:29:03 PM
Quote from: engr_dood on February 17, 2010, 03:39:52 PM
Hi Spuds,

I have a snapshot of our forum installed on a LAN computer here, so I can do as much testing as needed without impacting the users.  So I'm ready to try it out now.

Thanks!
Andy

Here is a version which should fire on [attachment=x] tags as well as all of the current tags.  Note I did not change the help or post pulldown items to reflect this since its really only intended to help in mod transitions.

Also fixed a small problem with highslide attachments ... I was not properly setting the rel=  attribute for highslide so all attachments in a topic were considered a slide show instead of just the attachments of a single post. 

Give it a whirl and let me know how it works out
Title: Re: Attachments In Message
Post by: engr_dood on February 17, 2010, 07:44:45 PM
Okay, I've installed it successfully, and it shows the attachments as thumbnails as before.  But when clicked, they still show up as thumbnails and don't expand as with the old software.  In the sql dump of the database I see stuff that looks like this:

(12, 13, 4, 0, 0, 'bax.png', 'a0c5c7c09ee86d05b2a59c6c69421995f63524ab', 9446, 8, 445, 812),
(13, 0, 4, 0, 3, 'bax.png_thumb', 'd63b723abd1f863d7ed5bdf3b7402d2ee305fecd', 13125, 0, 82, 150),

Edit:  Here's something interesting.  When I go into the mod settings and uncheck "(ILA) Enable the in line attachment modification", the thumbnails all appear bunched together at the end of the post.  But now when I click on these, they do expand.  Odd.
Title: Re: Attachments In Message
Post by: engr_dood on February 18, 2010, 03:20:41 PM
Quote from: Spuds on February 18, 2010, 01:40:32 PM
Here is the latest revision, it should fix the problem you, and others, were having with images not expanding when they were clicked.

It works!  Thanks a bunch.

If you need someone to do more testing, I have a snapshot of our forum here on my LAN.  I can do whatever testing is needed without affecting users of the main forum, and I'm willing to do so.
Title: Re: Attachments In Message
Post by: engr_dood on February 18, 2010, 08:01:03 PM
I've done some more testing and found a problem with non-graphic files and [attach=].  Actually I've only tested this with a zip file, but I'm assuming it's related to non-graphics files rather than zip files in particular.  I tried creating a new post, attaching an inline zip file using [attach=], and this caused the post rendering to be just a blank area after pressing the Post button.  IOW, there was no icon/button to be able to modify the post to take the offending tags out.  The entire post (and page) was blank below the post's title bar.  If I log out of the forum and just view the post as a guest, the post renders just fine (guests are disallowed from viewing attachments), and what's seen is just the [attach=] tags.

So I went back and looked at some posts that had already been created with the 1.1.11 software and quake101 mod, which contained zip files posted with [attachment=].  Sure enough, the rendering of these was just a blank area as well.  I've attached to this post a graphic capture of a post that triggered the problem, as viewed with 1.1.11 and the quake101 mod.  That file link along with the graphic is always included in the quake101 mod, which I find convenient.  This graphic also illustrates a bug with the quake101 mod in which the zip file is shown twice, once as inline and once as a normal attachment at the end of the post.  It was actually only attached once, with a single [attachment=].
Title: Re: Attachments In Message
Post by: engr_dood on February 19, 2010, 06:28:29 PM
The rendering of the non-image files is looking good now.  Thanks!

I just noticed another minor bug though.  The combo box next to the "Browse" button for the first attachment has strings and corresponding inserted codes in the following order:
1) String = "Normal SMF Attachment", code = none
2) String = "Inline mode - Thumbnail if available, else Full", code = "[attach=1]"
3) String = "Inline mode - Thumbnail Always", code = "[attachthumb=1]"
4) String = "Inline mode - Full-size image", code = "[attachimg=1]"
5) String = "Inline mode - Text link", code = "[attachurl=1]"
6) String = "Inline mode - Short Text Link", code = "[attachmini=1]"

This all looks right.  But the combo boxes for the second and higher-numbered attachments have the strings in a different order, with codes that don't match the strings in two cases.  They look like this for the second attachment:
1) String = "Normal SMF Attachment", code = none
2) String = "Inline mode - Thumbnail Always", code = "[attach=2]"  (should be "[attachthumb=2]")
3) String = "Inline mode - Full-size image", code = "[attachimg=2]"
4) String = "Inline mode - Thumbnail if available, else Full", code = "[attachthumb=2]" (should be "[attach=2]")
5) String = "Inline mode - Text link", code = "[attachurl=2]"
6) String = "Inline mode - Short Text Link", code = "[attachmini=2]"
Title: Re: Attachments In Message
Post by: engr_dood on February 19, 2010, 10:08:04 PM
Fixed on both counts.  Woohoo!  ;D ;D ;D ;D

Combo box ordering is good and the codes match for all combo boxes now.  Text message about guests and attachments is good.

BTW and FWIW, I"m using Firefox 3.6.  I have IE8 installed but haven't tried it yet.  Tomorrow I'll do some more exhaustive testing with both browsers.  This is looking really, really good.  I'm the admin of a forum for electrical engineers who post lots of schematics, graphs and things like that, interspersed with text.  This is a key part of how we communicate, and really important to us.  I was worried about a potential dead-end situation with 1.1.11 and the quake101 mod - which hasn't been updated in a long time.  This looks like the way forward.

Thanks much!
Title: Re: Attachments In Message
Post by: engr_dood on February 21, 2010, 12:35:09 PM
Hi Spuds,

I've had a chance to do some more thorough testing.  It looks like there's still a glitch with the matching of the codes and strings in the first combo box displayed.  This shows up the exact same way in both Firefox 3.6 and IE8 (which needs compatibility mode to fix a scrolling issue).  Now the strings are in the same order for all combo boxes, but the first combo box has two codes swapped.  Here are the strings and codes for the first combo box.

1) String = "Normal SMF Attachment", code = none
2) String = "Inline mode - Thumbnail if available, else Full", code = "[attach=1]"
3) String = "Inline mode - Full-size image", code = "[attachthumb=1]" (should be attachimg)
4) String = "Inline mode - Thumbnail Always", code = "[attachtimg=1]" (should be attachthumb)
5) String = "Inline mode - Text link", code = "[attachurl=1]"
6) String = "Inline mode - Short Text Link", code = "[attachmini=1]"

For the second and subsequent combo boxes, the strings are in the same order, but the codes for attachthumb and attachimg are not swapped - they are correct.  There's a second bug I found, but I'll describe it in a separate post to minimize clutter.
Title: Re: Attachments In Message
Post by: engr_dood on February 21, 2010, 01:02:48 PM
The second bug is a bit tricky.  It's tricky because I thought I had the steps to repeat down pat, but seemed to get inconsistent and somewhat random results.

It happens when I have multiple inline attachments mixed in with a normal SMF attachment that isn't the last attachment added.  If I post such a message, then go back and modify it, the attachment list with the checkboxes (for removing attachments or adding the inline code) sometimes lists the files out of order, which ends up assigning the incorrect attachment number to one or more files.  Here's an example of some files which were added in order sorted by name, with the given attachment properties.

Attachment 1: cherry_block.png (used attach=1)
Attachment 2: include_Zin_block_1.jpg (used attachimg=2)
Attachment 3: include_Zin_block_2.jpg (used attachthumb=3)
Attachment 4: include_Zin_effects.jpg (normal SMF attachment)
Attachment 5: TMC_block.png (used attachmini=5)

You can see the file names are in sorted order.  I did this to keep track of which was which.  I then posted the message and came back to modify it.  I've attached an image that shows the results I got.  Note that TMC_block.png is shown as attachment 4 (should be 5) and include_Zin_effects.png is shown as attachment 5 (should be 4).

I've had stranger results, especially in IE8, that I can't repeat now.  One time the files actually showed up in reverse sort order, not just with two swapped files.
Title: Re: Attachments In Message
Post by: engr_dood on February 21, 2010, 11:16:38 PM
Oh ye of little faith  ;D.

I just tried it, and so far it's looking good.  The attachment numbers and file names now match up when doing the post modify in my preliminary tests with Firefox 3.6.  And the first combo box strings and tags match too.  I'll do some much more thorough testing with IE8 and Firefox tomorrow and report back.

Thanks again!
Title: Re: Attachments In Message
Post by: engr_dood on February 22, 2010, 02:08:53 PM
Okay, I've done some more checking of this.  I wanted to disassociate the file name sort order from the order the attachments were added, so I made up 6 files as follows:

Attachment 1: d_01.png
Attachment 2: a_02.jpg
Attachment 3: g_03.jpg
Attachment 4: b_04.jpg
Attachment 5: f_05.png
Attachment 6: c_06.jpg

So the numbers at the end of the file name match up with the attachment number (order), though the file name sorting is random.

Then I posted the following in Firefox 3.6:

Some text.
[attach=1]
Some text.
[attachimg=2]
Some text.
[attachthumb=3]
Some text.
[attachurl=4]
Some text.
[attachmini=6]

Where attachment 5 (f_05.png) was of the "Normal SMF attachment" type, and the attachment types of 1-4 and 6 are as determined by the codes above.  I posted it, and all the attachments were of the correct type and in the correct location - that is, d_01.png was really attachment 1, a_02.jpg was really attachment 2, and so on.

Then I chose the option to modify the post, and unfortunately, the name/post number associations were all scrambled.  For Firefox 3.6, they looked as in the attachment below named attach_scrambled_FF36.png.  Then I looked at the same post in IE8 by choosing the modify option, and they had the identical scrambling.

So I then posted the exact same thing with IE8, going through the same procedure.  The results were that the file name/post number associations were scrambled, but in a different way.  That result is shown in the attachment below named attach_scrambled_IE8.png.  Then I looked at that post using Firefox 3.6 using the modify option and the scrambling was identical to what it looked like in IE8.

Not sure what to make of this.
Title: Re: Attachments In Message
Post by: engr_dood on February 22, 2010, 08:18:55 PM
Quote from: Spuds on February 22, 2010, 07:17:52 PM
I have a couple of questions that I hope will get me going in the right direction.

1) Once you submit the post and go back and view it, are the attachments in the correct order or are they wrong from the get go

When viewing the post itself, it's perfect.  All attachments are the ones I intended, verified by right-clicking on them as if I were to download them, and viewing the file names.  The next step is to click the "Modify" button, then "Additional Options".  Then the list is found to be scrambled the very first time I look at it.  But in all cases, the post is exactly as it should be - all files in the correct order, all posting options (thumbnail, full size etc.) correct, and so forth.  So it is only the list, not the post itself, that is scrambled, and it is this way the first time I look at it.  Edit: I usually do some previewing before pressing Save though.

Quote from: Spuds on February 22, 2010, 07:17:52 PM2) I'm assuming your test is with a new message and new attachments ... Could you go into phpmyadmin (or whatever database front end you use)  open your smf database and then find the ????_attachments table.  Once there sort on the id_attach column .... are the attachments (the latest uploaded ones will have the highest id_attach numbers) in order of how you first submitted them.  ie attachment 1 should have the lowest id_attach number and so on .... (the sort in the above post that I was referring to was one the id_attach not the name)

Here's a portion of the table.  First col is id_attach, second col is id_thumb.  I've removed the columns in between id_thumb and the file name.  id_msg is the same for all of these (it's 317).

377 378 d_01.png    
378 0 d_01.png_thumb
379 380 a_02.jpg
380 0 a_02.jpg_thumb
381 382 g_03.jpg
382 0 g_03.jpg_thumb
383 384 b_04.jpg
384 0 b_04.jpg_thumb
385 386 f_05.png
386 0f_05.png_thumb
387 388 c_06.jpg
388    0 c_06.jpg_thumb

This is indeed the order in which they were added to the list.

Edit:  Here's the capture from phpMyAdmin (glad I installed this thing!)
Title: Re: Attachments In Message
Post by: engr_dood on February 23, 2010, 01:18:32 PM
This is getting closer, but still not quite there.  The bad news is that there's still an out-of-order condition, but the good news is that I get the same results every time I post the same thing, both with Firefox 3.6 and IE8.  So the behavior seems to be deterministic now.  Here's the post (same as previous):

Some text.
[attach=1]
Some text.
[attachimg=2]
Some text.
[attachthumb=3]
Some text.
[attachurl=4]
Some text.
[attachmini=6]

The capture of the attachment list is below.  The last file posted appears first, and the rest are in order, every time.  Checking the attachments table in phpMyAdmin shows the files to be in the correct order, with attachment ID order agreeing with the order the files were added to the list.
Title: Re: Attachments In Message
Post by: 111111 on February 23, 2010, 01:54:48 PM
Spuds, help me please with one bug. Often in logs i find such errors. Every time, as somebody visited Print page.

URL: http://********/action=printpage
8: Undefined index: topic_first_message
File: Sources/ILA-Subs.php
String: 203

Also sometimes when somebody reply in topic i find this error again, but i cannot exactly say in what moment this error appeared.
But error always the same on string 203.

Now i find the same but url action another: action=post;msg=111;f4a27b5975cb=acb891bc15d7687a0d76a965c333b2b8

8: Undefined index: topic_first_message
File: Sources/ILA-Subs.php
String: 203
Title: Re: Attachments In Message
Post by: engr_dood on February 23, 2010, 03:40:49 PM
Oh, I didn't think to look in the error log - good idea.  I did a bunch of testing (starting today 2/23) of Alpha 10, and there are no errors dated 2/23 despite there being several posts with multiple attachments that show the sorting quirk.  But with Alpha 9, I got quite a few of these errors showing up:

8: Undefined index: thumbnail
File: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/Sources/ILA-Subs.php
Line: 267
Title: Re: Attachments In Message
Post by: 111111 on February 23, 2010, 06:19:39 PM
engr_dood, this error i also had and i fixed it. it appeares only when not an image in attach.
on string 267 need this:

if ($attachment['is_image'])
{


hope it helps you:

if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'])
{
// If the image is too large to show inline, make it a popup window.
if (((!empty($modSettings['max_image_width']) && $attachment['real_width'] > $modSettings['max_image_width']) || (!empty($modSettings['max_image_height']) && $attachment['real_height'] > $modSettings['max_image_height'])))
$attachment['thumbnail']['javascript'] = $attachment['thumbnail']['javascript'];
else
$attachment['thumbnail']['javascript'] = 'return ILAexpandThumb(' . $uniqueID . ');';
}
}
Title: Re: Attachments In Message
Post by: 111111 on February 24, 2010, 03:08:29 AM
Thanks a lot, Spuds! Now logs are empty. But i find one strange bug. Strange, because not only this mod with such bug.
When in somebody's profile i click Show posts, for example such url in your profile http://www.simplemachines.org/community/index.php?action=profile;area=showposts;u=11359
And on this page with posts of user this mod doesn't work =( Show only tags. And what is interesting that another mod "Hide Tag Special" has almost the same bag.

UPDATE: Now I find in logs one error. I can repeat it every time i clicked show posts in profile.

http://*******/index.php?pretty;action=profile&amp;area=showposts;u=2
8: Undefined index: current_topic
File: /var/www/alexsus/data/www/game-edition.ru/Sources/ILA-Subs.php
String: 206
Title: Re: Attachments In Message
Post by: engr_dood on February 24, 2010, 01:35:38 PM
Quote from: Spuds on February 23, 2010, 08:39:59 PM
This version should fix both of these, but there may be others so keep looking in the logs.   These are nothing more than notice errors.

This is looking great now.  The file ordering display worked perfectly in all my tests.  Case closed on this aspect I think.  Congratulations and thanks for your perseverance!  It's looking like our forum will be able to upgrade to 2.0 RC2 soon, thanks to your efforts with this mod.

There's a couple of things I had in mind regarding usability.  You've stated previously that graphical preview is a non-trivial problem and more of a long-term thing, if at all.  That's cool, but maybe there's some things that could be done to improve the user experience in this area without causing you a boatload of effort?  I was thinking of something along these lines in preview:

Text.  More text.  Text.  More text.  Text.  More text.  Text.  More text.  Text.  More text. 
[Attachment 1: file_01.png as expandable thumbnail]
Text.  More text.  Text.  More text.  Text.  More text.  Text.  More text.  Text.  More text.
[Attachment 2: file_02.jpg as full-size graphic]
Text.  More text.  Text.  More text.  Text.  More text.  Text.  More text.  Text.  More text. 
[Attachment 3 not found.  There are only 2 attachments.]

Would this be time-consuming to implement?  This would at least tell the user that the right files are in the right places (or not), and what their display mode is without having to post the message.  Regarding the nature of the error message about attachment 3, it comes from a book on UI guidelines for developers I read a while back.  I used to work on Windows GUI programming for engineering desktop apps for a few years.  One of the guidelines was along the lines of what I call "politically correct error messages".  The guideline is to not scold the user with words like "error" or "warning", but to simply provide helpful information regarding the nature of the problem and how to fix it if possible.  Anyway, I can't think of the word "warning" without thinking about the robot in Lost In Space flailing his arms and saying "Danger!  Warning!"  ;D.

My other concern was about [attach=] vs. [attachthumb=].  I could be misunderstanding this, but apparently the distinction between the two is related to how the internal error of a missing thumbnail is handled.  Looking at the normal SMF attachment scenario, there is no such option.  I guess the software just figures out the best way to handle it and does so without the user's knowledge.  This is the way it should be I think.  It seems to me that having this distinction between [attach=] and [attachthumb=] violates another UI guideline, namely, "don't burden the users with implementation details of the software".  In this case, that's the handling of the missing thumbnail condition.  So I would propose to have the following choices in the combo box:

End-of-post expandable thumbnail
Inline expandable thumbnail
Inline full-size image
Inline text link
Inline short text link

I've replaced "Normal SMF attachment" with "End-of-post expandable thumbnail", since many users may not know what a normal SMF attachment is.  I'd propose that "Inline expandable thumbnail" become [attach=].  I'd also propose that [attachthumb=] be deprecated, but accepted if typed in manually by the user ("be liberal in what you accept and conservative in what you provide").  That is, remove combo-box support for this tag to avoid confusing the users with the implementation issue of how a missing thumbnail should be handled.

That's all of the concerns I have, which I hope aren't burdensome.


Title: Re: Attachments In Message
Post by: engr_dood on February 24, 2010, 09:23:41 PM
Fantastic!  Thanks again!
Title: Re: Attachments In Message
Post by: engr_dood on March 01, 2010, 06:13:06 PM
Quote from: Spuds on February 28, 2010, 11:25:03 PM
OK here is another version for testing, still have work to do but this is a good step in the final direction.

This is working really well.  I can't find any bugs in it.

Having the graphics display in places like recent post view and others really gives a nice professional appearance.  The mod I'm using now for 1.1.11 doesn't do that.
Title: Re: Attachments In Message
Post by: gbsothere on March 02, 2010, 11:31:42 AM
Quote from: slinouille on January 24, 2009, 02:00:55 AM
Hello,

Sorry I've not enough time to manage a SMF1.x version.
But if someone wants to do it, he/she is welcome  :)

SliN




I wasn't sure whether to ask this here or to post this on the "Paid" board, but I am very interested in paying someone to backport this to 1.1.X  (our board is 1.1.11). 

We were using the TinyPics option (found in Tips And Tricks) but this morning, someone apparently hacked TinyPic's site and every image in our forum hosted by TinyPics had become Porn images.  *sigh*  A mess, let me tell you! At least, with attachments, not hosted links, I have some measure of control, since our forum is heavily guarded against spammers and hackers.

If this is not the appropriate place to request a paid backport, please point me in the right direction.

:-\
Title: Re: Attachments In Message
Post by: engr_dood on March 02, 2010, 12:05:22 PM
Quote from: gbsothere on March 02, 2010, 11:31:42 AM
I wasn't sure whether to ask this here or to post this on the "Paid" board, but I am very interested in paying someone to backport this to 1.1.X  (our board is 1.1.11).

Hi gbsothere,
I'm using 1.1.11 at the moment as well.  The multiple attachment mod for it that I'm using is the quake101 mod, "ATTACHMENTS POSITIONING v1.2" (http://custom.simplemachines.org/mods/index.php?mod=1159).  Spuds has written his mod for version 2 so it will accept the [attachment=] custom tags of the quake101 mod (different from the [attach=] custom tags used by the original Slinouille mod that started this thread, and subsequently used by Spuds).  So you could start with 1.1.11 and the quake101 mod, and when you're ready to upgrade to SMF 2, the Spuds mod will get you there with your graphics preserved.  I"ve tested this and it works great.  Hats off to Spuds for this backward compatibility feature.

At present there is no graphical WYSIWYG preview for either of these mods, but I compensate for that by having a longer editing period than what might otherwise be needed.
Title: Re: Attachments In Message
Post by: gbsothere on March 02, 2010, 12:13:16 PM
Quote from: engr_dood on March 02, 2010, 12:05:22 PM
Hi gbsothere,
I'm using 1.1.11 at the moment as well.  The multiple attachment mod for it that I'm using is the quake101 mod, "ATTACHMENTS POSITIONING v1.2" (http://custom.simplemachines.org/mods/index.php?mod=1159).  Spuds has written his mod for version 2 so it will accept the [attachment=] custom tags of the quake101 mod (different from the [attach=] custom tags used by the original Slinouille mod that started this thread, and subsequently used by Spuds).  So you could start with 1.1.11 and the quake101 mod, and when you're ready to upgrade to SMF 2, the Spuds mod will get you there with your graphics preserved.  I"ve tested this and it works great.  Hats off to Spuds for this backward compatibility feature.

At present there is no graphical WYSIWYG preview for either of these mods, but I compensate for that by having a longer editing period than what might otherwise be needed.




Thanks so much, engr_dood, for bringing this to my attention.  We're in a bit of a precarious place, as far as upgrading to 2.x just now, but I do have 2.x test boards, so I'll play around with this and see if I can make it fly.   :)

Thanks, again!
Title: Re: Attachments In Message
Post by: russ skinner on March 02, 2010, 03:09:02 PM
Would just like to add a big thanks Spuds for running with this one and getting it back into operation - great job!

Why this feature is not part of the core I'll never know - it's without doubt the most utilized mod on the forum I look after.

Russ
Title: Re: Attachments In Message
Post by: recived on March 04, 2010, 03:50:35 AM
mod not work 2.0rc2. who knows how to install this version of the forum? Please update mod to 2.0rc2.
Title: Re: Attachments In Message
Post by: Northtech on March 04, 2010, 08:01:10 AM
Quote from: recived on March 04, 2010, 03:50:35 AM
mod not work 2.0rc2. who knows how to install this version of the forum? Please update mod to 2.0rc2.
:o
http://www.simplemachines.org/community/index.php?topic=242654.msg2522701#msg2522701
Title: Re: Attachments In Message
Post by: engr_dood on March 04, 2010, 05:34:00 PM
Quote from: Spuds on March 03, 2010, 11:36:15 PM
Here we go with what I'm going to call Beta 1.0 ... Beta meaning I'm done adding any new functions to this version and will just focus on bugs with what we currently have.

This is looking really good here.  The pseudo-preview looks great.  I have an online beta version of my update that I will ask my users to test now.  The only thing I have a question about is whether the "#" sign is synonymous with "number" in all cultures.  IOW, will people from the EU and elsewhere see "Attachment #1" as "Attachment number 1".  This is very, very minor, and I just love how well this is working out.

Thanks once again Spuds for your efforts  ;D.
Title: Re: Attachments In Message
Post by: engr_dood on March 04, 2010, 05:39:15 PM
Quote from: recived on March 04, 2010, 03:50:35 AM
mod not work 2.0rc2. who knows how to install this version of the forum? Please update mod to 2.0rc2.

recived, please download the version by Spuds, which can be found in this post (http://www.simplemachines.org/community/index.php?topic=242654.msg2522701#msg2522701) in this very thread.  Please do not use the version on the mods page.  The Spuds version is working fine for me in 2.0 RC2, and I've done considerable testing.  In fact, Spuds has implemented many improvements over the version on the mods page.  It is the attachment ILA-1.0Beta.zip of the post I linked above.
Title: Re: Attachments In Message
Post by: engr_dood on March 05, 2010, 05:43:09 PM
I've found a minor glitch with this version (ila-1.0Beta).  If I log on with my admin account and click on "View the most recent posts on the forum" at the lower left, I can view attachments of the most recent posts in that mode just fine.  But when I log in with a normal account and choose to view the most recent posts, I see the message, "[ You are not authorized to view attachments ]" where the graphic should be.  This normal account has no primary membergroup, but when I log in as admin and look at "additional membergroups" for that user, I see "Invited Participant", which does have permission to view attachments.

So it appears to be permissions-related, but this only shows up when choosing "View the most recent posts on the forum".  When reading posts in the normal way, I can see attached graphics just fine with the non-admin account.
Title: Re: Attachments In Message
Post by: 111111 on March 05, 2010, 11:30:53 PM
Spuds, report you a small bugfix:

// ILA in line attachment changes
if (empty($parse_tags) && empty($context['uninstalling']))
{
global $sourcedir;

if (stripos($message, '[attach') !== false)
{
if (!function_exists('ila_save_bbc'))
require_once($sourcedir . '/ILA-Subs.php');
ila_hide_bbc($message);
}
}
// End ILA in line attachment changes


function_exists('ila_save_bbc') - as i understood, such fuction this mod don't use. replace it by ila_hide_bbc
Title: Re: Attachments In Message
Post by: Spuds on March 06, 2010, 10:29:56 AM
Quote from: 111111 on March 05, 2010, 11:30:53 PM
Spuds, report you a small bugfix:

function_exists('ila_save_bbc') - as i understood, such function this mod don't use. replace it by ila_hide_bbc

111111 ... thanks for seeing that ... it does not affect functionality but it is causing an unnecessary file validation each pass.  I'll get that fixed in the next update.

Quote from: engr_dood on March 05, 2010, 05:43:09 PM
So it appears to be permissions-related, but this only shows up when choosing "View the most recent posts on the forum".  When reading posts in the normal way, I can see attached graphics just fine with the non-admin account.

Hummm ... Thats probably an RC2 problem (famous last words) but I'll trace that access and see if I've missed a permission flag somewhere.  Thanks for the detailed report.

Title: Re: Attachments In Message
Post by: engr_dood on March 06, 2010, 02:03:31 PM
Quote from: engr_dood on March 05, 2010, 05:43:09 PMSo it appears to be permissions-related, but this only shows up when choosing "View the most recent posts on the forum".  When reading posts in the normal way, I can see attached graphics just fine with the non-admin account.

Oops.  This is a bit misleading.  It also happens when viewing the member list, then choosing to view all posts of a given user (using a non-admin account).
Title: Re: Attachments In Message
Post by: Spuds on March 06, 2010, 10:14:19 PM
Here is the latest beta .... I've made the following changes in this update:


As always ... uninstall the old and then install this version ...
Title: Re: Attachments In Message
Post by: engr_dood on March 07, 2010, 03:34:56 PM
I can now see the thumbnails with a non-admin account when doing "View most recent posts in the forum", and viewing all posts of a given user.  However, when I click on the thumbnail in these two scenarios, one of two things happens (and I can't figure out the exact scenario that makes the difference).

1) The thumbnail is expanded to a full-size graphic, but then that graphic is only seen by itself, not along with the rest of the post.
or,
2) A dialog box comes up for the purpose of downloading the file.

I think what's going on is the dialog only shows up in graphics that were posted under 1.1.11 with the quake101 mod, but I can't be absolutely sure.
Title: Re: Attachments In Message
Post by: Spuds on March 07, 2010, 11:32:15 PM
Quote from: engr_dood on March 07, 2010, 03:34:56 PM
I can now see the thumbnails with a non-admin account when doing "View most recent posts in the forum", and viewing all posts of a given user.  However, when I click on the thumbnail in these two scenarios, one of two things happens (and I can't figure out the exact scenario that makes the difference).

1) The thumbnail is expanded to a full-size graphic, but then that graphic is only seen by itself, not along with the rest of the post.
or,
2) A dialog box comes up for the purpose of downloading the file.

I think what's going on is the dialog only shows up in graphics that were posted under 1.1.11 with the quake101 mod, but I can't be absolutely sure.

Argh ! ... well at least they are showing up for everyone now.  I had not noticed this expand issue as I use a jquery/lightbox mod to expand the thumbnails and that was working for me.   

Anyway I think what is happening is that the ilaexpandthumbnail javascript is not being loaded when viewing posts from user/new posts since/etc since the javascript function was added as part of smf's topic.js   When viewing those compiled post lists, its not a single topic so that javascript file does not get loaded.  I've pulled that function into its own js file and load it in the headers (I hope) so its available no matter where we are trying to view ila posts.  That should fix the images from not expanding inline when clicked but not sure about the option to download dialog you are getting.

Title: Re: Attachments In Message
Post by: engr_dood on March 08, 2010, 12:00:04 AM
Quote from: Spuds on March 07, 2010, 11:32:15 PMI've pulled that function into its own js file and load it in the headers (I hope) so its available no matter where we are trying to view ila posts.  That should fix the images from not expanding inline when clicked but not sure about the option to download dialog you are getting.

It fixed all cases! (I noted which posts were doing which).

It's looking mighty good now!  It blows away my existing 1.1.11 setup.  At this point, I guess there's a feature freeze with it, so now it's just a case of doing more testing, right?  I will keep trying more oddball combinations of things to test.
Title: Re: Attachments In Message
Post by: Spuds on March 08, 2010, 10:09:13 AM
Quote from: engr_dood on March 08, 2010, 12:00:04 AM
It fixed all cases! (I noted which posts were doing which).

It's looking mighty good now!  It blows away my existing 1.1.11 setup.  At this point, I guess there's a feature freeze with it, so now it's just a case of doing more testing, right?  I will keep trying more oddball combinations of things to test.

Thats great news! ... Yup bug detection and elimination are the goal at this point, I think its pretty stable at this point, largely due to all the testing you have done, but there are probably still a few gotchas.  If everything keeps looking good I may release it as its own mod and at some point beef up the admin section so there is a little more configuration available.
Title: Re: Attachments In Message
Post by: engr_dood on March 08, 2010, 01:45:27 PM
I've done a bit more testing, and so far nothing amiss with functionality.  I did see these error log entries though (shortened a bit).

8: Undefined variable: ila_attachments_context
File: ILA-Subs.php
Line: 116

8: Undefined variable: ila_attachments_context
File: ILA-Subs.php
Line: 110
Title: Re: Attachments In Message
Post by: Spuds on March 08, 2010, 03:41:12 PM
Quote from: engr_dood on March 08, 2010, 01:45:27 PM
I've done a bit more testing, and so far nothing amiss with functionality.  I did see these error log entries though (shortened a bit).

8: Undefined variable: ila_attachments_context
File: ILA-Subs.php
Line: 116

8: Undefined variable: ila_attachments_context
File: ILA-Subs.php
Line: 110

Notice errors ... found a couple of other ones in my log .... with the last update the program allows a new flow and I did not initilize some vars .... I've attached a new version although I did not increment the number yet so its still shows a 1.02.  Clear the log and give this a go.
Title: Re: Attachments In Message
Post by: engr_dood on March 08, 2010, 04:01:02 PM
Hmm.  Now when I do a new post with a non-admin account, on the initial preview before the files are up on the server, I get this message for the graphic:

[ You are not authorized to view attachments ]

Once it's posted, I can see the graphics with a non-admin account just fine.

When I do the preview of a new post with an admin account, it's fine, showing the preview frame with file name and other info as it should.  Viewing the most recent posts in the forum is fine, even with a non-admin account.  This issue seems confined to the initial preview.
Title: Re: Attachments In Message
Post by: engr_dood on March 08, 2010, 06:29:52 PM
Working great now, and with an empty error log too.  Very cool!  :D
Title: Re: Attachments In Message
Post by: engr_dood on March 08, 2010, 11:47:41 PM
RC3?  LOL!  I didn't realize it was coming together while all this was happening.  I can't keep up! ;D  I guess I'll make an RC3 beta test forum and phase out the RC2 test forum then.
Title: Re: Attachments In Message
Post by: engr_dood on March 09, 2010, 10:52:29 AM
I just installed this RC3-compatible version into my RC2 test platform.  The first 1.03 Beta you posted uninstalled fine.  The second 1.03 Beta installed fine, worked fine and had no errors in the error log.  So I thought I'd update my test platform to RC3, and in preparing for that I attempted to uninstall the second ILA 1.03 Beta.  When attempting to do this, I got uninstall errors.  I've attached a screen shot of what happened.

How can I go about recovering from this?

Edit:  I still have the first 1.03 Beta if it's necessary to use it.
Title: Re: Attachments In Message
Post by: engr_dood on March 09, 2010, 07:27:02 PM
Uninstall is fixed.  Thanks!  :D

I'll set up an RC3 test board now and let you know how it works out.
Title: Re: Attachments In Message
Post by: Massl on March 10, 2010, 04:31:40 PM
Thanks for this mod Spuds  ;)
All ok on SMF 2.0 RC 3.
Title: Re: Attachments In Message
Post by: engr_dood on March 10, 2010, 05:11:25 PM
Quote from: Max_74 on March 10, 2010, 04:31:40 PM
Thanks for this mod Spuds  ;)
All ok on SMF 2.0 RC 3.

Same here.  Working fine on 2.0 RC3.  I'm going to upgrade our forum tomorrow :)
Title: Re: Attachments In Message
Post by: engr_dood on March 11, 2010, 06:47:26 PM
Hi Spuds,

I've spotted a minor bug with this version.  It appears that guests can view attachments that are within quoted posts.  An example can be seen here (http://www.diy-audio-engineering.org/index.php?topic=26.msg699#msg699).

What's odd is that I could swear the first time I saw that post, the graphics didn't appear at all - but I can't repeat this, even looking at it from another computer.
Title: Re: Attachments In Message
Post by: engr_dood on March 12, 2010, 10:42:25 AM
Quote from: Spuds on March 11, 2010, 08:37:18 PMI do a question on the guest issue, could you modify that message and look (not WYSIWYG) and let me know if that quote has an [attach style tag or as I suspect an [Img style tag.

It is indeed an [img tag.  I should have checked that!  Sorry!  :-[

Thanks for the updated version :).
Title: Re: Attachments In Message
Post by: engr_dood on March 12, 2010, 01:07:02 PM
Quote from: Spuds on March 12, 2010, 11:58:09 AMNow with that I just need to see how that sequence of events occurred ... that img tag was one that ILA rendered for an earlier post that someone else then quoted at which point the attach tag had been replaced with the img tag.

Yes, it seems that the respondent quoted the original poster and discovered the original graphic was not quoted.  But then the respondent somehow knew that the very same graphic was on the original poster's web site, and "fixed" the quote so it contained an [img tag referencing this graphic.  I only looked at the original post, which had an [attachment=] tag.  I didn't stop to think that the respondent would be so familiar with the original poster's web site!

Quote from: Spuds on March 12, 2010, 11:58:09 AMThis is the main reason why I did not render the attach tags in quotes and only show links in quotes as the original attach tag can get lost.

I think the "link in quote" approach is a good one.  I don't know about you, but I often find quoting of images to be quite annoying, especially if it's some large JPG photo.  In this particular case, the quoted graphic was small in dimensions and byte count, so it was not a problem at all.  But I see that as the exception rather than the rule.

Edit:  It looks like images placed with an "img" tag are visible to guests in RC3, so I guess this is a non-problem.
Title: Re: Attachments In Message
Post by: engr_dood on March 15, 2010, 02:29:26 PM
Thanks for the update!

Quote from: Spuds on March 14, 2010, 11:33:22 PM
Fixed an error with the way highslide links (if enabled) are built that was accidentally introduced in that last alpha version

Well, I'm going to show my newbie status here.  What's a highslide link?  I'd like to test this, but I'm not sure what it's about.

Quote from: Spuds on March 14, 2010, 11:33:22 PMMajor updates to the way quotes and especially nested quotes are handled.

I tried quoting a post that contained an [attachment=n] tag, which I also tried with [attach=n].  When previewing the reply containing this quote, the attachment tags [attachment=n] or [attach=n] are shown just like that, not as a link.  After posting, a link is shown.  Is this the intended behavior?  If so, that's okay, I'll just let the users know this is how it works.
Title: Re: Attachments In Message
Post by: engr_dood on March 23, 2010, 01:46:26 PM
I'm just now noticing a bug I hadn't seen before.  I did a post containing one JPG file and one PNG file, using [attach=].  When I clicked on the JPG thumbnail, it got smaller!  Then I clicked on it a few more times and still wasn't able to get the picture to show full size.  Finally I did something, I'm not sure what it was - maybe a right-click - and the picture was then able to be seen at full size again.

With that post, if I refresh the page to show the thumbnail again, I notice the first time I click on the thumbnail it gets smaller than its normal thumbnail size for a moment, then enlarges to its full size.  But earlier when I tried this, it just got smaller and didn't show full size.  So I'm not sure what's going on here.  Edit:  I'm beginning to wonder now if it may have been just a case where the server was slow?

Edit:  I just found another bug.  I modified the post I was referring to above, and added another quote from the person to whom I was responding.  But I made an error, forgetting the "slash" inside the closing quote tag.  After previewing and fixing the problem, the attachments showed up as end-of-post attachments, and in the places where the [attach=] tags were located, what was shown was a link, as if they were within quotes - even after the quote tags had been fixed to have the correct matching.  I've uninstalled 1.05 beta and am using 1.04 beta for now.
Title: Re: Attachments In Message
Post by: engr_dood on March 23, 2010, 10:57:26 PM
Quote from: Spuds on March 23, 2010, 08:28:55 PM
Likely a slow server or a large file attachment, once clicked it can take a little time for java script to load and expand it ... I've seen the getting slightly smaller effect before, lots of factors involved such as did SMF create a thumb, did the user specify a smaller width, is min thumbnail size set in the AP,  did we have to create the thumb, how does javascipt handle img widths, what is the img format, bla bla bla ..... Don't know if I'll figure out all the various combos that can cause this, I've seen and fixed several in the past but its low on the list.

No problem there.  It was just the situation that the graphic shrunk and stayed that way that threw me off.  I noticed that once it enlarges, subsequent mouse clicks cause it to shrink or enlarge much faster.  Could very well just be a slow server and impatience on my part.

Quote from: Spuds on March 23, 2010, 08:28:55 PMOn the other error, I've tried a bunch of ways to duplicate this and can't.  Could you give me a blow by blow of what you did exactly (including how you put in the quotes, ie insert quote or via the editor quote and cut/paste).

Okay, I've been able to repeat this on my test forum.  Here's the post I start out with:

[quote author=megajocke link=topic=46.msg649#msg649 date=1268091212]
Glad you liked it! ;D Then, I guess you could place the gate tracks just outside the power supplies and widen the output trace if you need low inductance. An alternative could be pasting a board with the gate drive tracks on top of the output fill :) [/quote]

Some text.  JPEG graphic below.
[attach=1]
Some more text.  PNG graphic below.
[attach=2]
Some text after the graphic.


This is just a normal well-formed post and both post and preview work fine.  The graphics show up exactly as they should in both post and preview.  Now after posting I modify the post, and with copy and paste, I copy the first quote above and paste it at the end of the post.  But I delete the "slash" from the closing quote.  This is shown below.  Notice the malformed "close quote" tag at the very end (scrolling all the way to the right at the bottom).

[quote author=megajocke link=topic=46.msg649#msg649 date=1268091212]
Glad you liked it! ;D Then, I guess you could place the gate tracks just outside the power supplies and widen the output trace if you need low inductance. An alternative could be pasting a board with the gate drive tracks on top of the output fill :) [/quote]

Some text.  JPEG graphic below.
[attach=1]
Some more text.  PNG graphic below.
[attach=2]
Some text after the graphic.

[quote author=megajocke link=topic=46.msg649#msg649 date=1268091212]
Glad you liked it! ;D Then, I guess you could place the gate tracks just outside the power supplies and widen the output trace if you need low inductance. An alternative could be pasting a board with the gate drive tracks on top of the output fill :) [quote]


This is where I get into trouble.  I've attached a screen shot of what the preview looks like here, in the file "malformed_quote.png".  You can see the graphics don't show up, but instead there are links.  As expected, the quotes are messed up because of the malformed tag.

So then I fix up the malformed "close quote" tag and preview again.  I've attached a capture of the preview in the file "malformed_quote_fixed.png".  You can see the quoting looks correct now, but the graphics are still shown as links.  The text of the post is below.  It's exactly the same as the one above, but with the "slash" added back in to the "close quote" tag at the very end of the post.

[quote author=megajocke link=topic=46.msg649#msg649 date=1268091212]
Glad you liked it! ;D Then, I guess you could place the gate tracks just outside the power supplies and widen the output trace if you need low inductance. An alternative could be pasting a board with the gate drive tracks on top of the output fill :) [/quote]

Some text.  JPEG graphic below.
[attach=1]
Some more text.  PNG graphic below.
[attach=2]
Some text after the graphic.

[quote author=megajocke link=topic=46.msg649#msg649 date=1268091212]
Glad you liked it! ;D Then, I guess you could place the gate tracks just outside the power supplies and widen the output trace if you need low inductance. An alternative could be pasting a board with the gate drive tracks on top of the output fill :) [/quote]


Now I post the result to see what it looks like.  The final post is captured in "final_post.jpg" below.  You can see there are links where the inline graphics should be, and the graphics are at the end of the post.

Hopefully you'll be able to reproduce this.
Title: Re: Attachments In Message
Post by: engr_dood on March 30, 2010, 07:58:50 PM
Thanks!  That effort seems to have really paid off.  I have tried all kinds of crazy things in my test forum - mismatching quotes, pasting attach tags inside nested and/or mismatched nested quotes where they don't belong, and other nonsensical stuff.  So far I just can't make it misbehave.  It seems quite robust.

I'm going to install it in the main forum.  Thanks again  ;D.

Edit:  Note to other readers - Spuds has posted a new thread on this mod here (http://www.simplemachines.org/community/index.php?topic=376767.msg2587745#msg2587745).
Title: Re: Attachments In Message
Post by: Nickhead on June 28, 2010, 03:58:43 PM
it appears my highslide module is keeping this mod from installing correctly.  the text for this mod to change does not match what is in the manual edit box, so i dont know how to edit the code. 

*     5.     Execute Modification     ./Sources/Display.php     Test successful
      1.    Add Before    ./Sources/Display.php    Test successful
*    6.    Execute Modification    ./Themes/default/Display.template.php    Test failed
      1.    Replace    ./Themes/default/Display.template.php    Test failed
*    7.    Execute Modification    ./Themes/default/Post.template.php    Test failed
      1.    Replace    ./Themes/default/Post.template.php    Test failed
      2.    Replace    ./Themes/default/Post.template.php    Test failed
      3.    Replace    ./Themes/default/Post.template.php    Test failed
Title: Re: Attachments In Message
Post by: C4G-TK on June 28, 2010, 06:49:44 PM
Quote from: Nickhead on June 28, 2010, 03:58:43 PM
it appears my highslide module is keeping this mod from installing correctly.  the text for this mod to change does not match what is in the manual edit box, so i dont know how to edit the code. 

*     5.     Execute Modification     ./Sources/Display.php     Test successful
      1.    Add Before    ./Sources/Display.php    Test successful
*    6.    Execute Modification    ./Themes/default/Display.template.php    Test failed
      1.    Replace    ./Themes/default/Display.template.php    Test failed
*    7.    Execute Modification    ./Themes/default/Post.template.php    Test failed
      1.    Replace    ./Themes/default/Post.template.php    Test failed
      2.    Replace    ./Themes/default/Post.template.php    Test failed
      3.    Replace    ./Themes/default/Post.template.php    Test failed


Well, are you using the package that was attached a few posts above?  If so, go to the following site and parse the mod there for help on what edits need done.  Just follow the instructions on the page and upload the package for your edits.  Very simple to do. 

Hope that helps!


http://resourcez.biz/PackageParser/index.php
Title: Re: Attachments In Message
Post by: Nickhead on June 29, 2010, 01:55:25 AM
i attach the mod and get this via the parser:

Modifications to SMF files

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 82: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xE7 0x75 0x27 0x3B in /home/gmtaws/public_html/resourcez/PackageParser/index.php on line 450

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: $txt['mod_aim_option1'] = 'Ins&eacute;rer comme aper�u'; in /home/gmtaws/public_html/resourcez/PackageParser/index.php on line 450

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/gmtaws/public_html/resourcez/PackageParser/index.php on line 450

Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/gmtaws/public_html/resourcez/PackageParser/index.php:450 Stack trace: #0 /home/gmtaws/public_html/resourcez/PackageParser/index.php(450): SimpleXMLElement->__construct('<?xml version="...') #1 /home/gmtaws/public_html/resourcez/PackageParser/index.php(419): parseModificationXML('/tmp/install.xm...', Object(SimpleXMLElement), 'all') #2 /home/gmtaws/public_html/resourcez/PackageParser/index.php(94): parsePackageInfoXML('/tmp/package-in...', 'install', 'all') #3 /home/gmtaws/public_html/resourcez/PackageParser/index.php(780): parseArchive() #4 {main} thrown in /home/gmtaws/public_html/resourcez/PackageParser/index.php on line 450
Title: Re: Attachments In Message
Post by: C4G-TK on June 29, 2010, 02:02:43 AM
Which version of SMF are you using?

Which mod package are you using?
(If you got it from the thread and not the mod site, tell me which reply#, please.


BTW, I was telling you the easy way to do it, but the other way would be to unzip the package that you are using and look for the install file and open it in something like Notepad +++ in order to read what edits need to be done.
Title: Re: Attachments In Message
Post by: Nickhead on June 29, 2010, 03:04:34 AM
2.0 RC 3
1.3

on a previous install it worked, but this time its not.  when i try a manual edit, the code suggested to 'find', does not match that of what is in my file due to the highslide code being 'near' or in the 'middle' of the code i am supposed to replace.

this is an assumption on my part, but dont know the proper code with this 'extra' code in the way. 

hence why i uploaded the files that 'failed' upon pre-install test.

my apologies for rushing my earlier posts.
Title: Re: Attachments In Message
Post by: C4G-TK on June 29, 2010, 01:10:33 PM
THAT's the problem.

The version on the mod site is compatible with RC1 and not RC3.  Too many changes between RC1 and RC3.  You could probably get away with it if it was just between RC2 and RC3, but not between RC1 and RC3.

Use the package that is attached by Spuds in reply #176 if you are using RC3.  (It's about 8 or 9 posts before this.)  It installed cleanly on my RC3 forum and if you have any problems with a failed test, do what I said previously by going to the other website to parse that package.

If you have problems, let me know.  I will be in and out today before heading to the movies for a midnight showing of Twilight.  Otherwise, if I don't see anything today, I'll check back tomorrow to help you.
Title: Re: Attachments In Message
Post by: madman71 on September 22, 2010, 05:30:23 PM
Running RC3

I was forced to install this manually because for some reason,  the  package installer does not see my theme to install it.

Anyway, it works, but the language is missing from the drop down dialog box.(see attachment)  Obviously i missed something.

What file do i need to edit? I dont need to know what to edit, just which file. I can figure it out from there.

Title: Re: Attachments In Message
Post by: chef4o on October 22, 2010, 08:37:30 AM
OK, I'm on RC3, but have problem with the code...

I can't attach more that 1 image a time, when I click on "More attached files" it brings me in the beginning of the page...

So what should I do to make it work?
Title: Re: Attachments In Message
Post by: Blade_Runner on December 11, 2010, 11:18:03 AM
Why isn't the latest 1.4 version available on the download page?
Title: Re: Attachments In Message
Post by: Spuds on December 11, 2010, 07:58:06 PM
Quote from: Blade_Runner on December 11, 2010, 11:18:03 AM
Why isn't the latest 1.4 version available on the download page?
If you are referring to the one that I updated, it was released as its own mod, its for SMF 2.0 only .... get it here:

http://custom.simplemachines.org/mods/index.php?mod=2481
Title: Re: Attachments In Message
Post by: Blade_Runner on December 12, 2010, 06:38:59 AM
Quote from: Spuds on December 11, 2010, 07:58:06 PM
Quote from: Blade_Runner on December 11, 2010, 11:18:03 AM
Why isn't the latest 1.4 version available on the download page?
If you are referring to the one that I updated, it was released as its own mod, its for SMF 2.0 only .... get it here:

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

I installed the mod linked above. Great mod!
The download page for this "Attachments In Message" mod is a little misleading.
Latest Version:    1.4
Compatible With:    2.0 RC4
Title: Re: Attachments In Message
Post by: Aldanin on February 14, 2011, 11:12:27 PM
Not work on SMF2.0 RC5.
Do somebody finish codings for RC5?
Title: Re: Attachments In Message
Post by: [unplugged] on May 07, 2011, 10:30:14 AM
I have just installed this mod and it's nice. A few things to note however:

The $txt strings in the language file are labelled  "ila_" while the code in the template is labelled "mod_aim" for each of the strings.
The option for inline thumbnail inserts the full size image, while the option for the full size image inserts the thumbnail. :D
The option for inline text link just inserts the expandable thumbnail.
If I select an option and then decide to just use the default "End-of-post expandable thumbnail", it will add the [End-of-post expandable thumbnail=1] code into the post.
Title: Re: Attachments In Message
Post by: agridoc on December 04, 2011, 06:05:27 AM
I see that only version 1.3.0 for 2.0 RC1 is available although ver. 1.4.0 is mentioned in modsite and I know a big SMF forum that uses it with RC4.

What is the reason of removal of 1.4.0 from mod downloads?

I also see that slinouille' s last log is back on Dec. 2010.
Title: Re: Attachments In Message
Post by: FrizzleFried on April 17, 2012, 05:33:11 PM
Any way to get this mod to show up with SMF ARTICLES?   The standard attachment box shows up there.

Thanks!
Title: Re: Attachments In Message
Post by: NeoXII on April 19, 2012, 04:53:16 PM
Quote from: Spuds on March 30, 2010, 12:01:10 PM
........It also adds the rendering of the tags in quotes in preview mode and fixes a couple of error log entries that could get thrown.   

Hi Spuds,
excuse me..... can you report here the code to fix the rendering of the tags in quotes in preview? In my forum I can't see image when I reply to a post if this post have image inside...... I see only [attach=1]

Thank You very much!  :)
Title: Re: Attachments In Message
Post by: shazoo! on January 31, 2013, 09:45:07 AM
Has anyone gotten this to work in 2.0.3?
Title: Re: Attachments In Message
Post by: demlak on May 26, 2013, 09:56:15 PM
anyone tried to run this mod with the SCEditor4SMF (//http://)?
i cannot get the inline attachments to work with this editor..
but they worked with the standard editor
I don´t know if this is a bug of this or the other mod.. so i will post there also..
Title: Re: Attachments In Message
Post by: demlak on May 27, 2013, 08:27:54 AM
awww... im sorry =)
this seems to be a problem only to the editor when we want to post calendar entrys..
i don´t have a vergin install of SMF.. so i cannot test if this depends on other mods.. calendar relevant mods that are installed in here:
Event Registration Mod for SMF2
Event Reminder Mod for SMF2
Add Date to Calendar Entry Threads

and we use a theme called "IceCube" from Dzinerstudio
Title: Re: Attachments In Message
Post by: Arantor on May 27, 2013, 08:30:50 AM
Attachments don't entirely work in raw SMF when you're setting up a calendar entry, as per Post.php:

// !!! This won't work if you're posting an event.
if (allowedTo('post_attachment') || allowedTo('post_unapproved_attachments'))
{


(then follows the rest of the attachment code)
Title: Re: Attachments In Message
Post by: demlak on May 27, 2013, 08:32:32 AM
well.. it worked very well before installing the SCEditor..
Title: Re: Attachments In Message
Post by: Arantor on May 27, 2013, 08:33:26 AM
Yeah, it's not really supposed to work at all. And SCEditor has a lot of strange behaviour in it - both the mod and the version that's actually in 2.1 (they did a *lot* of work integrating it, far more than the mod version does)
Title: Re: Attachments In Message
Post by: demlak on May 27, 2013, 08:36:12 AM
any idea how to integrate images like with this mod?
we need images to be not extern.. and it would be nice to align them with text..
so this mod was great, before installing SCEditor.. but we also want SCeditor =)
Title: Re: Attachments In Message
Post by: Arantor on May 27, 2013, 08:37:22 AM
To be brutally honest as I see it your choices are to get the paid WYSIWYG mod from Nibogo which uses SCEditor or wait for 2.1... I doubt you will ever see the bugs fixed in the free mod. (More than one mod of his was removed from the mod site because it was buggy.)
Title: Re: Attachments In Message
Post by: demlak on May 27, 2013, 08:43:43 AM
so the inline attachment mod works with the paid version of sceditor by nibogo?

edit: also on calendar entrys?
Title: Re: Attachments In Message
Post by: Arantor on May 27, 2013, 09:05:19 AM
I don't know, I never tried it, but Nibogo does actually attempt to fix bugs, and I would imagine it would work with the calendar at least...
Title: Re: Attachments In Message
Post by: Pedy on July 26, 2013, 07:08:42 AM
Hi, is anyone working on this mode for version 2.0.4 I really want to have images inline in the text (like for posts with some manual, so the image can have the right place) and this looks like it can do what i want and is the only one who can fulfill my wish. (I want there pictures to be an attachment, because a lot of people on my forum will not be able to upload picutures somewhere and then post it)

Or is there another way how can be picture as an attachment posted inline to the text?

Thanks in advance!

Title: Re: Attachments In Message
Post by: sathirtythree on February 09, 2014, 07:09:48 PM
any chance this mod will be brought up to date for 2.0.7? I'm trying to install and getting find/replace errors.
Title: Re: Attachments In Message
Post by: TheListener on February 09, 2014, 07:14:29 PM
Quote from: sathirtythree on February 09, 2014, 07:09:48 PM
any chance this mod will be brought up to date for 2.0.7? I'm trying to install and getting find/replace errors.

Have you looked at the mods parser to see which edits are necessary?
Title: Re: Attachments In Message
Post by: peterwaalker on March 03, 2014, 12:47:27 PM
how can i install this mod on smf version 2.0.7 with custom theme.
If this mod is not the actual one for me, can you please refer me to the one that will install flawlessly without edits.
Always thankful
Title: Re: Attachments In Message
Post by: 420SA on October 29, 2014, 11:40:36 AM
Hi there

I'm trying to install this mod into SMF 2.0.8 but I get the following errors below. Please could you assist. Thank you in advance!

6.   Execute Modification   ./Themes/default/Display.template.php   Test failed
   1.   Replace   ./Themes/default/Display.template.php   Test failed
*   7.   Execute Modification   ./Themes/default/Post.template.php   Test failed
   1.   Replace   ./Themes/default/Post.template.php   Test failed
   2.   Replace   ./Themes/default/Post.template.php   Test failed
   3.   Replace   ./Themes/default/Post.template.php   Test failed
Title: Re: Attachments In Message
Post by: mossite on December 15, 2014, 08:30:23 PM
can anyone install this mod for me. i have tried to install it but it did not install
Thanks
Title: Re: Attachments In Message
Post by: xjellyfishx on February 06, 2015, 12:14:29 AM
Anyone manage to implement this mod?

Seems to have several tests failed implementing this.
Title: Re: Attachments In Message
Post by: Motorhed on April 21, 2015, 03:11:06 PM
This is one of the most useful SMF mods out there. It's a real shame it seems to be abandoned like this. Is there an alternative that lets you place images in the same way while not displaying them again beneath the post as a tumbnail?
Title: Re: Attachments In Message
Post by: margarett on April 21, 2015, 03:45:12 PM
Sure. There are 2 known and popular inline attachments MODs: one from Spuds (search it on GitHub) and another from dougiefresh (find it in our modsite)
;)
Title: Re: Attachments In Message
Post by: RSI on April 21, 2015, 08:52:21 PM
I would use Doug's mod because I doubt the ILA mod (Spuds mod) will be updated again. Those guys have moved on to their own forum software. I'm still using the old ILA mod until SMF v2.1 is finally released then I will probably switch to Doug's mod located at http://custom.simplemachines.org/mods/index.php?mod=3770