News:

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

Main Menu

Post and PM Inline Attachments

Started by dougiefresh, July 26, 2014, 09:14:08 PM

Previous topic - Next topic

RSI

That wasn't the only problem, it'a not creating any backup in the Packages/backups folder so there in no uninstall feature. You can't uninstall it once you install it. [Uninstall] isn't there anymore and it also stills says 3.2 and not 3.3

RSI

That works pretty good now ;) At first I thought there was a new problem, but then I realized it was me :-X


roshaoar

Quote from: dougiefresh on May 02, 2015, 07:33:57 PM
Does this make it look proper?  Thanks in advance!
Hmmmm, not really -  The parent div already has class smallclass so added to a span as well makes it doubly small :). Just need to make it consistent with the highslide-heading class that highslide throws the thumbnail and text into.

dougiefresh

Okay, keeping that last mod to Sources/Subs-InlineAttachments.php, find this line:
Code (Find) Select
$html = '<div class="smalltext"' . $divfloat . '>' . $html . '<br/><a href="' . $image . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ('. $attachment['size']. ($attachment['is_image'] ? '. ' . $src_width . 'x' . $src_height . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)</div>';
and replace it with this line:
Code (Replace) Select
$html = '<div' . $divfloat . '>' . $html . '<br/><span class="smalltext"><a href="' . $image . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ('. $attachment['size']. ($attachment['is_image'] ? '. ' . $src_width . 'x' . $src_height . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)</span></div>';
This should solve the text-size problem....

roshaoar

Thanks Dougie! It's very very very close - if you look at http://extreme-macro.co.uk/forums/index.php?topic=10.0 the only remaining difference for me (ie10) seems to be the spacing between brand, camera and orientation. There seems to be some added space there that's not in the one above. I havn't looked into it yet whether it's browser or something else.

roshaoar

fyi I'm starting to wonder if I have something else different to you, different highslide or something else. For example my source isn't getting overflow:none over the div, nor is it getting the title in the alt. Anyhow I've put tests in my source for now and if I discover what's going on - ie what the difference is/was - I'll come back to it and post a follow up...

dougiefresh

Quote from: roshaoar on May 03, 2015, 09:31:31 AM
Thanks Dougie! It's very very very close - if you look at http://extreme-macro.co.uk/forums/index.php?topic=10.0 the only remaining difference for me (ie10) seems to be the spacing between brand, camera and orientation. There seems to be some added space there that's not in the one above. I havn't looked into it yet whether it's browser or something else.
Please attach your Sources/Display.php and Themes/default/Display.template.php so I can see what is happening in your files....

What Highslide mod are you using?  Maybe I can build in better support for it....

roshaoar

Highslide is Highslide Viewer 1.7 from here. Have attached files, but latest observation is that it's more something to do with the html that's being returned. Subs-InlineAttachments.php has &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in our problem area, whereas the other has blank spaces and one &nbsp;. So the other's blank spaces don't get seen as spaces in the html and there's just one &nbsp;. Does that ring any bells? The style is actually perfectly fine, the problem is the blasted spaces :)




dougiefresh

Uploaded v3.3.2 - May 3rd, 2015
o Minor font size adjustment to the code displaying the EXIF information.

@roshaoar: Unfortunately, I posted the newest version, then saw your post.  I think that's something to do with the parser converting spaces to &nbsp;, not my mod.  So I guess the solution would be to remove the extra spaces....

roshaoar

Epic. The solution was in exif.php: I added:

case "Make":
  $val= str_replace(' ', '', $val);
  break;
case "Model":
  $val= str_replace('  ', '', $val);
  break;

RSI

Not to throw another wrench into the system, but how hard would it be to add an update feature in between (Insert Attachment 1) and (Clear Attachment) ?

In other words,  (Insert Attachment 1) (Update) (Clear Attachment)

Not sure if the Attachment number would throw it off, but one of the other great mods to another BB forum software was an update button that would just overwrite the same attachment in a post if it had the same file name to where it wouldn't change the counts, etc.


dougiefresh

Quote from: RSI on May 04, 2015, 10:55:03 AM
Not to throw another wrench into the system, but how hard would it be to add an update feature in between (Insert Attachment 1) and (Clear Attachment) ?

In other words,  (Insert Attachment 1) (Update) (Clear Attachment)

Not sure if the Attachment number would throw it off, but one of the other great mods to another BB forum software was an update button that would just overwrite the same attachment in a post if it had the same file name to where it wouldn't change the counts, etc.
So if you had two attachments in a post, both named "Blah.png", and the first one was an inline attachment (let's say attachment # 1), then pressing Update on the second copy of "Blah.png" (let's say attachment # 2) would change the [attach=1] to [attach=2], correct?

RSI

Quote from: dougiefresh on May 04, 2015, 03:13:55 PM
So if you had two attachments in a post, both named "Blah.png", and the first one was an inline attachment (let's say attachment # 1), then pressing Update on the second copy of "Blah.png" (let's say attachment # 2) would change the [attach=1] to [attach=2], correct?

However it could be made to work. The other BB SW mod would just overwrite the old attachment and it would still be attached with the same attachment number as before. In other words you would update [attachment=1] and it would still be [attachment=1] after updating it and the views count would remain the same with no change.

Granted, in this situation it may require something completely different using a different approach all together, but I wouldn't do anything that might screw the current mod up because it appears to be working really good now. It would just be really cool if it also had the update (or edit) feature built-in to it.

Also, instead of using (Insert Attachment 1) (Update) (Clear Attachment), using (Insert Attachment 1) (Clear Attachment) (Update) or (Edit) might be a better arrangement.

dougiefresh

Quote from: RSI on May 04, 2015, 03:29:59 PM
However it could be made to work. The other BB SW mod would just overwrite the old attachment and it would still be attached with the same attachment number as before. In other words you would update [attachment=1] and it would still be [attachment=1] after updating it and the views count would remain the same with no change.

Granted, in this situation it may require something completely different using a different approach all together, but I wouldn't do anything that might screw the current mod up because it appears to be working really good now. It would just be really cool if it also had the update (or edit) feature built-in to it.

Also, instead of using (Insert Attachment 1) (Update) (Clear Attachment), using (Insert Attachment 1) (Clear Attachment) (Update) or (Edit) might be a better arrangement.
While I think that it's an interesting idea for attachment management, I don't feel that it falls within the scope of this mod, as it would require what would probably be MAJOR changes to the attachment handling code....  The goal of this mod is to simply put the image attachments inline with the post/PM....

RSI

Quote from: dougiefresh on May 04, 2015, 03:36:43 PM
While I think that it's an interesting idea for attachment management, I don't feel that it falls within the scope of this mod, as it would require what would probably be MAJOR changes to the attachment handling code....  The goal of this mod is to simply put the image attachments inline with the post/PM....

Yeah, maybe a future and separate Attachment Update or Attachment Edit mod.

Anyway, thanks again for all your hard work on this.

roshaoar

Just a fyi, but this mod 3.3.2 seems to break Recent Forum Topics Boardindex 1.0 fairly spectacularly. My comments starting here are all due to a conflict between these two. Pipke and I couldn't work out what the problem was so I started afresh and with this mod added, that one breaks. I have a testboard set up for this conflict - pipke has access, let me know if you want access too so you guys can iron out the problem between you there.

roshaoar

Fyi - dem at http://extreme-macro.co.uk/boards/. Dougie I made you a login, see your PMs.

-Johan

dougiefresh

I read the other thread, starting where you pointed me to.  Let me see what I figure out....

roshaoar

Thanks Dougie. If there's anything I can do let me know. I'm out of my depth here though.

dougiefresh

@roshaoar: I installed both mods on a clean forum.  I commented out the line from Subs-InlineAttachments.php that sets the topic ID variable (line 137), cleared the error log, then refreshed the board index.  The Recent Forum Topics BoardIndex mod seems to function normally with that particular line commented out.... 

Can you confirm that commenting that line is the (temporary) solution?  Thanks!

Advertisement: