News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

ability to show attached images inline

Started by dcmouser, January 01, 2006, 05:01:31 AM

Previous topic - Next topic

dcmouser

i was thinking just a simple bbcode type thing where you could put in your text something line [inlineattach=1] or [inlineattach=2] to have smf display the specified attached image # (or the download url if its a nonimage attachment) inline with the text  instead of at the end.  any attachments not inlined would be added to the end of the post as normal.
proud member of donationcoder.com (forum)


dcmouser

thanks col.,
that almost does it.  seems you can specify an attachment in an img bb code, so you could actually attach images, go back and edit the post and add in the created links inline.

one big flaw though, the images still appear at the bottom of the post as well, which is not good.  still a need for this i think.
proud member of donationcoder.com (forum)

Col

Yes, I just tried it out, and it is unsatisfactory. Inline images, without the mess at the foot of the post, and the messing about, is something I think should be added.

dcmouser

#4
i have finished the modifications to allow this - works perfectly and is a nice addition i think!

supports a couple of different kinds of inlining, you can include these tags anywhere in your message:


  • [attach=#] says insert normal attachment #specified there (ie will be url link if non image, or default img or thumbnail based on server settings)
  • [attachturl=#] says insert url link even if the attachment is an image (useful if you want to attach images as simple url download links but not show them as pictures anywhere in post)
  • [attachtimg=#] says insert full image even if server is set to show thumbnails by default
  • [attachthumb=#] says to insert a thumbnail of the image, EVEN if thumbnailing is off by default on server

all attachments which are inlined are automatically excluded from listing down at bottom footer
all attachments which are not inlined are shown at footer as per normal.


As always a huge thank you to smf developers for building such a well thought out piece of software - each time i make a modification to it i appreciate its logic more and more.

We will be releasing the code modifications for this feature on our smf mods page soon (see link below); our site is entirely funded by donations, if you like what our site is trying to do, please consider making a donation and joining our effort.



-mouser
www.donationcoder.com
smf modifications page -> http://www.donationcoder.com/Software/Other/SmfMods/index.html
proud member of donationcoder.com (forum)

Nomina

dcmouser, what's the status on this?  I've taken a look at your site, but haven't been able to find any code snippets.  I'm more than willing to forego the mod package if it means getting this feature up and running before the "future version" SMF is targeting for inclusion of similar functionality.

dcmouser

we've been using it constantly for the last 2 months, and it works great - really has improved our forum.
i've just been so busy that packaging the smf mods on our site has gotten low priority.  if this is something people want i can try to make the modified files and instructions available this weekend.

for a sample of it in action see here: http://www.donationcoder.com/Forums/bb/index.php?topic=1996.0
proud member of donationcoder.com (forum)

Nomina

Quite interested!  Again, no real need for a "packaged mod" on my end; snippets and instructions are more than sufficient.

dcmouser

we have updated the modifications for 1.1RC2 (will work on older versions as well), and documented it and made it available on our smf mod page:

http://www.donationcoder.com/Software/Other/SmfMods/index.html

as i said, it's not a package, but its super easy to install.

let me know if you have any questions.  improvements are welcome, just send me a message here and i'll incorporate the changes into the next official release.

we've also totally revamped our yearbook mod but that one requires some fancier changes to smf files so it may be a bit before we get that one documented and public.

mouser,
http://www.donationcoder.com/
http://forum.donationcoder.com/



as always, thanks to the amazing smf team and community here, you're really doing great stuff.  we just upgraded to 1.1RC2 and it's a beauty.
proud member of donationcoder.com (forum)

evillair

Works great, thank you!

I'm using SMF 1.1 RC2

future assassin

Damn was looking for this addon.

Thanks will give it a go and see how it works out.

dcmouser

how are people like this?
i'm happy to entertain requests for additional features.
proud member of donationcoder.com (forum)

hohar

thanks for developing this inline image feature!

i'm not experienced with php editing and thus have a question about intallation.

i have done some minor mods of my template index file using dreamweaver, so i know how to insert snippets of code.

i located the Display.template.php file in the themes folder and can view its code.  however, i'm confused as to where exactly to place your updated code and what code to replace.  i was confused when i read the installation.  it says:
"// and REPLACES the existing code between those two blocks.
   //
   //---------------------------------------------------------------------------


   //---------------------------------------------------------------------------"

then you go on to list your code show where your code ends.  it's still not clear to me where exactly i should start placing your code and what of the original code i should delete and where the original code should resume.  sorry if this is a lame question......i'm new at this!

also, will this code work for smf 1.1 RC3 as well as RC1?

thanks,

ryan


dcmouser

works perfectly with 1.1RC3 and we use this mod heavily at donationcoder.com, haven't had a single problem.

the upload on our site is for version 1.1RC2 but everything is the same.  if there is interest i'll add some comments to make it a tiny bit clearer for 1.1RC3, but essentially it's exactly the same.

i will upload the latest version tonight.
proud member of donationcoder.com (forum)

dcmouser

#14
I have updated my inline attachment mod here (it's the first link):
http://www.donationcoder.com/Software/Other/SmfMods/index.html

if you have requests or questions please post on the donationcoder.com forum, thx!

EDIT: The zip file now contains a proper smf package; i have uploaded it to the smf mod section as well, it's pending approval.
proud member of donationcoder.com (forum)

dcmouser

note this isnt a "package", you have to open up the zip and read the simple instructions.
perhaps someone can do us a favor and help me make a proper smf package from it?
proud member of donationcoder.com (forum)

dcmouser

#16
ammendment:
I have now included a package installer (and uninstaller) for us with smf 1.1RC3 which should make it paintless to install on 1.1RC3.

Mod page: http://mods.simplemachines.org/index.php?mod=493
proud member of donationcoder.com (forum)

dcmouser

For anyone unsure about how to use the mod:


  • After you install it, you just attach images to your post as normal.
  • And then inside your post use [attach=1] to indicate where you want the first attachment (image) to be shown, and [attach=2] where you want the second one to be shown.
  • See the README.txt for more options including [attachimg=] [attachthumb=] [attachurl=].
proud member of donationcoder.com (forum)

hohar

Quote from: dcmouser on October 14, 2006, 08:09:26 PM
For anyone unsure about how to use the mod:


  • After you install it, you just attach images to your post as normal.
  • And then inside your post use [attach=1] to indicate where you want the first attachment (image) to be shown, and [attach=2] where you want the second one to be shown.
  • See the README.txt for more options including [attachimg=] [attachthumb=] [attachurl=].


mouser, i'm sorry to be so inadequate at this.  but i've tried using this code on my forum and just can't get the attachments to show up inline.  i used the package installer to install your mod and it reported everything was installed correctly.  i'm not sure what the deal is.  i installed the previous version of your mod on my forum a few months ago and was able to get inline images, but it threw the formatting of my forum off when i did so.  i emailed you about this a while back.  now that i have your updated mod installed, i can't get the images to appear inline even though i think i'm inserting the code in the right way.  when i insert the code you specify, that code gets incorporated as part of my post instead of generating an inline image.  i sent you an email about this earlier today.  but anyway, here's a link to my forum in case you want to have a look.  again, i appreciate your work on this.......but i just can't get it to work.  i must be retarded.

thanks,

hohar

link to an example of my failed attempt at posting an inline image.....

http://hoharlabs.com/forum/index.php/topic,32.msg120.html#msg120 [nofollow]

smf version 1.1RC3, inline image latest update

hohar

oh, and by the way....  just so you know, i also uninstalled the previous version of your mod a few months ago after i couldn't get it working properly (probably because i was unclear as to exactly where to insert the code in the specified file).  so, it's not like i just installed the new version over top of the old one or anything.  has anyone confirmed that installing this mod using the package manager works?

Advertisement: