News:

Wondering if this will always be free?  See why free is better.

Main Menu

Attachments Positioning

Started by karlbenson, October 31, 2007, 04:43:37 PM

Previous topic - Next topic

karlbenson

Link to Mod



ATTACHMENTS POSITIONING v1.0
By Karl Benson


Link to Mod | Comment On This Mod

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 only.

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

shadow82x

Great mod I must say. :) I'm glad you finally finished this. A very efficient mod too. Any 2.0 beta package?
Colin B
Former Spammer, Customize, & Support Team Member

shumar

Excellent mod, already installed and in using...
Thank you.

karlbenson

No 2.0 beta 1 version for the moment.

Minare

Thanks bro

For turkish users - Turk kullanıcılar :

<file name="$themedir/languages/Modifications.turkish.php">
<operation>
<search position="end" />
<add><![CDATA[
$txt['attachment'] = ' [ Eklentiler ] ';
$txt['attachment_nopermission'] = ' [ Eklentiler: Eklentileri Görmeye İzniniz Yok ] ';
$txt['attachment_invalid'] = ' [ Geçersiz yada silinmiş eklenti ] ';
$txt['attachment_disabled'] = ' [ Eklenti Kapalı ] ';
$txt['attachment_insert'] = 'Eklenti Ekle';
]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.turkish-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['attachment'] = ' [ Eklentiler ] ';
$txt['attachment_nopermission'] = ' [ Eklentiler: Eklentileri Görmeye İzniniz Yok ] ';
$txt['attachment_invalid'] = ' [ Geçersiz yada silinmiş eklenti ] ';
$txt['attachment_disabled'] = ' [ Eklenti Kapalı ] ';
$txt['attachment_insert'] = 'Eklenti Ekle';
]]></add>
</operation>
</file>

Yağız...

Great mod karlbenson - Thanks Minare :)

karlbenson

thanks for the language strings.

I'll try to add them asap.

MinasC

way to go karlbenson , here's the greek translation :

$txt['attachment'] = ' [ Συνημμένο ] ';
$txt['attachment_nopermission'] = ' [ Συνημμένο: Δεν σας επιτρέπεται να βλέπετε συνημμένα ] ';
$txt['attachment_invalid'] = ' [ Συνημμένο Άκυρο ή Ανύπαρκτο ] ';
$txt['attachment_disabled'] = ' [ Τα Συνημμένα είναι Απενεργοποιημένα ] ';
$txt['attachment_insert'] = 'Εισαγωγή Συνημμένου';

digger

Nice idea.
But not good to see all attachments twice.

Daggers

Quote from: digger on November 01, 2007, 07:14:43 PM
Nice idea.
But not good to see all attachments twice.

I have to agree :(

Its a great mod and should become a default add in for the next SMF but to have the images displayed twice sort of defeats the object ..... imho!


Gary

Karl when you get a 2.0 version going, let me know. ;) My members were pretty much begging for this.

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

ltdeta

here german language:


<file name="$boarddir/Themes/wowdk/languages/Modifications.german.php">
<operation>
<search position="end" />
<add><![CDATA[
$txt['attachment'] = ' [ Anhang ] ';
$txt['attachment_nopermission'] = ' [ Anhang: Du hast keine Berechtigung Anh&auml;nge zu betrachten ] ';
$txt['attachment_invalid'] = ' [ Anhang ist ung&uuml;ltig oder existiert nicht ] ';
$txt['attachment_disabled'] = ' [ Anh&auml;nge deaktiviert ] ';
$txt['attachment_insert'] = 'Anhang einf&uuml;gen';
]]></add>
</operation>
</file>


can you hide the attachments at the bottom used as bbcode?

or at least disable the preview for the attachments at the bottom used in the posting?



Mysticalhead

#12
Quote from: ltdeta on November 03, 2007, 12:10:58 PM

can you hide the attachments at the bottom used as bbcode?

or at least disable the preview for the attachments at the bottom used in the posting?



That's exactly what would rule. I like this mod a lot, but I don't need to see the file twice, esp. since I post alot of images. Can that be done?

Oh. Heck. I'm using TinyPortal if that makes a difference, but after I used this mod the first time I  get

Quote from: error
$txt['attachment'] = ' [ Attachment ] '; $txt['attachment_nopermission'] = ' [ Attachment: You are not allowed to view attachments ] '; $txt['attachment_invalid'] = ' [ Attachment Invalid Or Does Not Exist ] '; $txt['attachment_disabled'] = ' [ Attachments Disabled ] '; $txt['attachment_insert'] = 'Insert Attachment';

loading above my header.  Uninstalled the package and it's fine again. oh well.
Could it be the blood?
...maybe it's the blood you like.

karlbenson

Apologies for not responding.

Please see my signature.

Thanks

tam2oo5

Can i have the manual edits for the post template?

maxi1973

 :( Still problems with your adsl connection?? we are waiting for your support to hide attachments at the bottom of the post. We are waiting you!!!!!

Gary

Fixing ISP issues can sometimes take upwards of several months...
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

rsw686

I sent karlbenson an email about a week ago with modifications that make the inline images not show in the footer. I also added some extra options to force the fullsize picture to be show, not show the download link, or even force it to show in the footer as well. Hopefully when he gets his internet connection back he will take a look and maybe implement these into the mod.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

database404

#18
I love this mod - it makes things so much easier on my site.

However, when first posting attachments, the links to add attachments seem to get "stuck" on 2 - meaning, when you upload Attachment 3, there is still a link to "Insert Attachment 2" next to it - and so on for every other attachment. When clicked, it will spit out [attachment=2], obviously. Although it isn't a major issue, it's confusing my users. :D

Example screenshot:

maxi1973

Waiting for Karlbenson, i post here a temporary modification for hide the duplicated images at the end of the post.

Open Display.template.php of your favorite theme; search for this code:

// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<hr width="100%" size="1" class="hrcolor" />';

foreach ($message['attachment'] as $attachment)
{
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> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
}
}

and replace with this code:

// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<hr width="100%" size="1" class="hrcolor" />
<div style="overflow: auto; width: 100%;">';
foreach ($message['attachment'] as $attachment)
{
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> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br /> -->';
}

echo '
</div>';
}


At this moment i've not found a solution for "Insert Attachment x" problem... i still see the max number as 2 (Insert Attachment 2 also if images are 5!!).
Karlbenson come back, we need you!!!  ;) ;)

Advertisement: