Attachments In Message

Started by slinouille, June 03, 2008, 04:02:21 AM

Previous topic - Next topic

slinouille

Link to Mod



ATTACHMENTS IN MESSAGE v1.1
By Slinouille



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)
- "Attachments Positioning" (by quake101 - http://www.badassmustangs.com)

Post Help : Inline Attachments for SMF2 post at www.donationcoder.com
Mod page for Attachments Positioning at simplemachines

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
Visit VAG-Technique.fr
Take a look to my mods

Nathaniel

#1
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! :)


SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

slinouille

Thank you for comment and suggestion.

I'm always very pleased to have improvment suggestions ... thank you :)
Visit VAG-Technique.fr
Take a look to my mods

Ni©holąś™


klra

#4
Any plans to create a release for 1.1.5 ?

shumilica

Cool mod, only one question..
Is it compatible with WYSIWYG editor that smf2 has?
Today, if you're not confused it means you're not thinking clear!

sneis

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  :)

wet-nap

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

feline

Can't installed on 2.0 Beta 4 .. error in Display.template.php.

Du you make a release for Beta 4?

Fel

woolly bugger

1.1.6 won't install this mod for me?

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


dcmouser

Looks really nice, well done.  I think we may start using this instead of my original.
proud member of donationcoder.com (forum)

alado


ccbtimewiz

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

alado

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?

Sudhakar Arjunan

Can't installed on 2.0 Beta 4 .. error in Display.template.php.

Du you make a release for Beta 4?
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

CvH

#15
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


hansdampf

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?  ???

kragno

Hello.

Any chance this mod will work even with 1.1.7 version?

Please! :'(

gemigene

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
"Religion is metaphysical statism. I will be ruled by no man on earth, nor by any god in heaven"

slinouille

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
Visit VAG-Technique.fr
Take a look to my mods

Advertisement: