News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Attachments Positioning

Started by quake101, April 10, 2008, 11:06:49 PM

Previous topic - Next topic

quake101

Link to Mod



ATTACHMENTS POSITIONING v1.2
By Quake101



Introduction
The mod adds the ability to position your attachments in your post using [attachment=1] bbcode
Where 1 is the first attachment in that post.
It is ONLY possible to position attachments which are tied to that POST only.

Features
o Adds [attachment=n] bbcode 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 1.1.x and SMF 2.0 Beta 3 Public only.

Donate
Has this modification helped you? Support the developer by Donating

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

Changelog
0.5 BETA - 27th October 2007
o Initial release per request
1.0 - 30th October 2007
o First PUBLIC release
1.1 - 1st December 2007
o Fixed [Insert] link number
1.2 - 13 April 2008
o Fixed displaying of image attachments twice that use [attachment=n] bbcode
o Made 2.0 Beta 3 Public compatible
o Added Portuguese & Brazilian language support (Thanks joomlamz)

kissa

Hi
Nice to see that someone, was willing to improve this mod.
Hav you fixed anything yet, or is this just the same version KarlBenson did?


quake101

Quote from: kissa on April 11, 2008, 06:27:59 AM
Hi
Nice to see that someone, was willing to improve this mod.
Hav you fixed anything yet, or is this just the same version KarlBenson did?

Kissa,

I just took over this mod from karlbenson and I'm currently working on the next release. This is the same version that karlbenson did, just released under my name. I hope to have the double displaying of image attachments fixed in the next release. I currently don't have a time line of when I'll have this fixed, but I'm hoping for 1/2 weeks. :)

Apllicmz

nice
i translate portuguese & brazilian...

Thank you

<file name="$themedir/languages/Modifications.portuguese.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['attachment'] = ' [ Anexo] ';
$txt['attachment_nopermission'] = ' [ Atalho: Você não está autorizado a visualizar anexos ] ';
$txt['attachment_invalid'] = ' [ Atalho inválido ou não existe ] ';
$txt['attachment_disabled'] = ' [ Anexos Desabilitados ] ';
$txt['attachment_insert'] = 'Inserir Atalho';
]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.portuguese-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['attachment'] = ' [ Anexo ] ';
$txt['attachment_nopermission'] = ' [Atalho: Voc&#234; n&#227;o est&#225; autorizado a visualizar anexos ] ';
$txt['attachment_invalid'] = ' [ Atalho inv&#225;lido ou n&#227;o existe ] ';
$txt['attachment_disabled'] = ' [ Anexos Desabilitados ] ';
$txt['attachment_insert'] = 'Inserir Atalho';
]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.brazilian.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['attachment'] = ' [ Anexo] ';
$txt['attachment_nopermission'] = ' [ Atalho: Você não está autorizado a visualizar anexos ] ';
$txt['attachment_invalid'] = ' [ Atalho inválido ou não existe ] ';
$txt['attachment_disabled'] = ' [ Anexos Desabilitados ] ';
$txt['attachment_insert'] = 'Inserir Atalho';
]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.brazilian-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['attachment'] = ' [ Anexo ] ';
$txt['attachment_nopermission'] = ' [Atalho: Voc&#234; n&#227;o est&#225; autorizado a visualizar anexos ] ';
$txt['attachment_invalid'] = ' [ Atalho inv&#225;lido ou n&#227;o existe ] ';
$txt['attachment_disabled'] = ' [ Anexos Desabilitados ] ';
$txt['attachment_insert'] = 'Inserir Atalho';
]]></add>
</operation>
</file>



Jacque

Can't wait for the double display fix.

Plans for 2.0 compatibility?

rumfa

#5
Hey, i would like to use the (attachment 1) as an file url. What line of code schould be changed to make this possible.
I would like to have the option to show whole images when i want in that way. Now all the images are cropped, while somethimes (when writing anarticle) i would like to show the whole pic. Doing it with an image url and placing it i (img) tag would be great...

So in place to copy the image and crop it to the post, i would use (attachments 1) as the file url only.

quake101

Version 1.2 has been released.

ivo2296

Quote from: quake101 on April 13, 2008, 11:10:33 PM
Version 1.2 has been released.

Any chance for upgrade from v1.1 to v1.2 without uninstalling v1.1? I would like manual to edit my files.

Thanks a lot!

quake101

Quote from: ivo2296 on April 14, 2008, 02:12:39 PM
Quote from: quake101 on April 13, 2008, 11:10:33 PM
Version 1.2 has been released.

Any chance for upgrade from v1.1 to v1.2 without uninstalling v1.1? I would like manual to edit my files.

Thanks a lot!

I had a feeling someone might ask this... I highly recommend the uninstall/install method as it is cleaner. For those who wish to edit their file manually may do the following:

Go to the mod download page (Here). Select v1.2 of the package, then select what version of SMF you are currently running and press submit. This will display the package edits for your version of SMF.

The only changes made from v1.1 to v1.2 is ./Sources/Display.php and ./Themes/default/Display.template.php files.

ivo2296

Quote from: quake101 on April 14, 2008, 02:33:36 PM
Quote from: ivo2296 on April 14, 2008, 02:12:39 PM
Quote from: quake101 on April 13, 2008, 11:10:33 PM
Version 1.2 has been released.

Any chance for upgrade from v1.1 to v1.2 without uninstalling v1.1? I would like manual to edit my files.

Thanks a lot!

I had a feeling someone might ask this... I highly recommend the uninstall/install method as it is cleaner. For those who wish to edit their file manually may do the following:

Go to the mod download page (Here). Select v1.2 of the package, then select what version of SMF you are currently running and press submit. This will display the package edits for your version of SMF.

The only changes made from v1.1 to v1.2 is ./Sources/Display.php and ./Themes/default/Display.template.php files.

Thanks, i asked cause the uninstall of v1.1 gave me error in Display.php but i deleted its code manually and now i have v1.2 which works perfect.

Thanks one more time for your time!

ivo2296

#10
Again me :)

i got in forum's error log now:

http://www.xxxx.com/index.php?dummy=1&amp;topic=23849.320
8: Undefined index: dontshowattachment
File: /home/xxxx/public_html/Themes/default/Display.template.php (main sub template - eval?)
Line: 523
Line: 514

P.S. That error comes when i view the old attachments before the installation of the mod.

quake101

Quote from: ivo2296 on April 14, 2008, 03:08:35 PM
Again me :)

i got in forum's error log now:

http://www.xxxx.com/index.php?dummy=1&amp;topic=23849.320
8: Undefined index: dontshowattachment
File: /home/xxxx/public_html/Themes/default/Display.template.php (main sub template - eval?)
Line: 523
Line: 514

P.S. That error comes when i view the old attachments before the installation of the mod.
Ahh, thanks for pointing that out. I fixed the current v1.2 package, please download and reinstall.

ivo2296


Croco

the insert attachment seems not to work with WYSIWYG editor can anyone confirm this ?
I am back. I will try to catch up with some stuff soon.
Regards,
Croco

My sites
Andareena.com
Andareen.net(Under Constraction :P)

New plans coming soon


Good links for you to visit:
Docs
Search

quake101

Quote from: ^_^ on April 15, 2008, 01:51:20 PM
the insert attachment seems not to work with WYSIWYG editor can anyone confirm this ?

What version of SMF?

Croco

I am back. I will try to catch up with some stuff soon.
Regards,
Croco

My sites
Andareena.com
Andareen.net(Under Constraction :P)

New plans coming soon


Good links for you to visit:
Docs
Search

quake101

You are correct. When the WYSIWYG editor is enabled on SMF 2.0 Beta 3 Public, the insert attachment link does not work. I'm currently working on this bug and hope to have it fixed soon. Current workaround is to disable the WYSIWYG editor.

kissa


FragaCampos

Hello there. Thanks a lot for taking over this mod.

I had karlbenson's version installed and everytime i used the tags i had the same attach repeated twice in the same post, in the post, and below the post.
I thought you had already fixed this
QuoteFixed displaying of image attachments twice that use [attachment=n] bbcode
, but i just installed it and i see that it still happens. I have the attachment's link in and below the post.

quake101

If you are not using the default theme you will need to manually edit your Display.template.php

Advertisement: