Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Mod Name / Version: Inline Photo Hack for 6.2 version 2
    Version 2 adds the option to constrain the width of the displayed attachment, thus protecting your layout.

Description: This hack will display the attached image to
registered users that are loggin in provided that the attachment
contains the correct extensions.
The Photo will appear below the body of the message.

Working under: UBB.threads 6.1 and verifited to work with 6.2

Any pre-requisites: none

Author(s): JustDave, ExcelsiorDDZ, JoshPet

Credits: JoshPet suggested and JustDave developed for version 5.
ExcelsiorDDZ modified for version 6. JoshPet revised instructions for version 6.1 and 6.2.
Many others have worked on variations of this over time.

Files Altered: showflat.php and showthreaded.php

Database Altered: No.

New Files: None
Attachments
62520-InlinePhotosFor6.2v2.txt (0 Bytes, 168 downloads)

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
ExcelsiorDDZ did a version of this with instructions so that attachments displayed inline for guests as well.

These instructions would work. But if you want guests to see the attachments, remove the:

if ($user['U_Username']) {

and the next

}


Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Thanks Josh! I just added this one to Da Forum

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Problem: You are running this hack, and it's great until some ejit (to steal Allen's word) comes along and posts a picture which is 9 billion pixels wide, and screws up your layout.

Solution: Version 2 of this hack - attached to main post which allows you to specify a maximum width in pixels for inline attachments. If the image is less that the maximum, it'll appear actual size. If the attached image is more than the maximum, then it'll get constrained with the "width" tag to preserve your layout.

I think this will fix the only problem with using this hack.

Thanks to Dave_L for recently pointing out the getimagesize function to someone over at infopop community. It sort of gave me the inspiration to get this done.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
These instructions will work for 6.2.1

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Moved to finished mods forum.

Joined: Apr 2002
Posts: 474
Enthusiast
Enthusiast
Offline
Joined: Apr 2002
Posts: 474
Just had a strange incident with this mod.. For registered users clicking on the one certain thread prevented any access. It just hung.

But unregistered users or guests had access to the thread. (sans any inline graphics)

I am assuming because, this thread had several attachments perhaps it choked on all the graphics.?

I had to remove it because of complaints...

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Not sure why it hung.

There is a bug with certain images edited in the latest photoshop (when they "save for web) that freaks out IE on the PC. I learned about that the hard way.
I kept having to go into my photo galleries with my mac and delete the offending graphics.

The inline not showing for unregistered users is by design to save bandwidth. If they want to see without clicking, they can register.

I didn't write the original... but that's just carried along. It would be easy enough to make it work with anonymous users too though.

You'd just remove the if ($Username) part and the } at the end of the clause.

Joined: Apr 2002
Posts: 474
Enthusiast
Enthusiast
Offline
Joined: Apr 2002
Posts: 474
I under stand the point about not having guests see images inline. That's cool. but oodly registerd users were prevented from even opening a thread. And it broke on Safari, Chameria, IE and OmniWeb...
Just an fyi...

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
But it was just a specific thread?

That's really odd... doesn't soudn like the photoshop thing, as that only affected IE on the PC.

We're using it here, and I'm using it at several other sites.

I'd see if you could pin it to a specific file, then see if there's anything wierd about it.... for example, is it named .jpg but it's really a different file type. That migth freak out the browser.

Sponsored Links
Joined: Apr 2002
Posts: 474
Enthusiast
Enthusiast
Offline
Joined: Apr 2002
Posts: 474
I may try it again but upgrading and adding 18+ modifications this weekend wore me out

Joined: Feb 2003
Posts: 64
Power User
Power User
Offline
Joined: Feb 2003
Posts: 64
Is it possible to use this mod to show inline video? I need something that does exactly what this mod does, but allows video (or just audio) files to be displayed inline.

Possible?

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Works just fine with 6.3

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Cool.

I tweaked this a bit to include an option to switch on and off the display for anonymous viewers.

Reposted here as version 3.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)