Attachments In Message

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

Previous topic - Next topic

snakeplissken

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.

Spuds

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

snakeplissken

I can run php5 so it shouldn't be a problem for me. I just never got round to doing it yet :)

Spuds

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


drhamza

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

Spuds

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.

chadon

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

Spuds

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

chadon


chadon

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. ;)

demize

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.

Spuds

@demize --- please supply a link to a page that is doing this ... thanks

111111

Spuds, thanks a lot for your work!

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

engr_dood

#93
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=).


Spuds

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

engr_dood

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!

Northtech


engr_dood

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

Spuds

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

engr_dood

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

Advertisement: