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 Photos for 6.5

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. It will also be constrained to a maximum width that you define, to avoid large images being posted and messing up your layout.

Working Under: UBB.Threads 6.5

Mod Status: Beta

Any pre-requisites: 6.5

Author(s): JoshPet

Date: 07/03/04

Credits: JoshPet, JustDave, ExcelsiorDDZ

Files Altered: showflat.php, showthreaded.php, main.inc.php

New Files: none

Database Altered: none

Info/Instructions: Minor instructions update for 6.5 - Also in 6.5 we can't add custom config variables, so in these instructions they are added into the main.inc.php file manually.

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
Attachments
116221-InlinePhotosv3.2.txt (0 Bytes, 503 downloads)

Sponsored Links
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Adding ImageMagick functionality to this mod for making thumbnails, watermarks, etc. would be awesome!

(hint, hint)

Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
Hmmm it's not working for me.... but where could be the problem ?

Important thing: the attached jpg image is not even being uploaded. I've set the permissions for my upload dir to 777 where else could I look ?

Thanks

Update: I just uninstalled this mod and it seems the upload doesn't work at all... Which file is responsible for the file upload ?
Update 2: Stupid me. I was using a wrong path to my upload dir in de configpanel! It's working now!

Joined: Mar 2002
Posts: 36
User
User
Offline
Joined: Mar 2002
Posts: 36
Great work, Josh, thanks!

But is there a way to restrict download to registered Users only? I tried your old hack adding to download.php the following line:

if ((!strstr($user['U_Groups'],"-5-")) && (!strstr($user['U_Groups'],"-8-"))) {
$html = new html;
$html -> not_right("You are not authorized to download.",$Cat);}

It works but with a little bug: inline pictures can be viewed by registered Users but when they click on the Attachment link, they get the same "You are not authorized to download" message.

Any hint for a dumb PHP newbie like me? Thanks!

Joined: Mar 2002
Posts: 36
User
User
Offline
Joined: Mar 2002
Posts: 36
Could somebody HELP? PLEASE?

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
This mod already has that functionality built in.

Where you put this:

$config['inline_anon'] = 'yes'; // Allow anonymous users to see inline images

Set that to 'no' so that anonymous users won't see inline images.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
nice mod

What do anon's see then? Would be nice if it gave them a graphic that when clicked says you have to be logged in/member to view it


- Allen wavey
- What Drives You?
Joined: Mar 2002
Posts: 36
User
User
Offline
Joined: Mar 2002
Posts: 36
[]JoshPet said:
This mod already has that functionality built in.

Where you put this:

$config['inline_anon'] = 'yes'; // Allow anonymous users to see inline images

Set that to 'no' so that anonymous users won't see inline images. [/]

Oh boy, my English really sucks, sorry guys.

What I actually needed help for is the bug of this mod: even registered Users who are logged in can't download Attachments, they can just see the inline picture but Attachment download is not possible for them. Any hint? Thanks and sorry for the confusion.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I'm confused. This mod doesn't do anything at all to the download.php file - this only displays attachments inline.

I'd try re-uploading a clean copy of download.php from your UBBThreads zip.

Joined: Mar 2002
Posts: 36
User
User
Offline
Joined: Mar 2002
Posts: 36
[]JoshPet said:
I'm confused. This mod doesn't do anything at all to the download.php file - this only displays attachments inline.

I'd try re-uploading a clean copy of download.php from your UBBThreads zip. [/]

I'm even dumber than I thought, I forgot to mention that I'm using the download restriction too. Sorry, Josh...this wasn't my day today.

So I guess the problem lies with the download.php mod.

Stupid question: may I contact you via PM to ask you about some mods and a photopost integration? Of course not for free, I'm thinking about hiring you.

Sponsored Links
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
You rule!

Joined: Dec 2002
Posts: 67
Power User
Power User
Joined: Dec 2002
Posts: 67
I often post little Flash movies and added some code to display them inline as well. I'm not sure about the etiquitte of modding mods, so I'll post this and you all can change it or do with it as you see fit.
Attachments
123537-InlinePhotos3_2_1.txt (0 Bytes, 440 downloads)

Last edited by Calpy; 12/03/2004 10:55 PM.
Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
Joined: Sep 2003
Posts: 803
Hi caplhy....

What if I wanted to leave the images as they are with no restrictions as to what they are or who can view them. but add the ability to use .swf or .fla in their custom sig?

Joined: Dec 2002
Posts: 67
Power User
Power User
Joined: Dec 2002
Posts: 67
Dr C, I'm not sure about that. If you allow html in the sigs, they could just embed the flash object themselves, but if you want to allow them to upload a flash object and have it display automatically, or even just have an interface for them to enter the url and have embed code generated, that's a little beyond my meager skillz at the moment.

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
Joined: Sep 2003
Posts: 803
Thanks for the reply..

I have a good friend that is going to show me how to do it and Ill post it here.

What we want to do is allow people to add a .swf file as a sig instead of the normal image.

you know how you can go in and create a img file and have it display as your image in all of your posts. we want to do that but with a .swf file.

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
Joined: Sep 2003
Posts: 803
This is exactly what we we want to do. this mod is for a phpbb forums though.

http://mods.postnuke.com/Article591.html

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
works fine on 6.5.1 before anyone asks


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Mar 2000
Posts: 528
Junior Member
Junior Member
Offline
Joined: Mar 2000
Posts: 528
Quick question. Works on 6.5, and there is really nothing in there that should be affected by 6.5.1 or the upcoming 6.5.2 (at least 'much' affected).

Since each forum is referenced by a keyword, how hard would it be to restrict this MOD to only ONE forum instead of every forum?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Not hard -


if ($Board == "keyword") {

// PUt the rest of the code inside this if statement


}

Joined: Mar 2003
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2003
Posts: 118
Hey I have a weird problem which i'm not sure why it would happen.


Going off the instructions (and verifying afterwards) I get this error on my site now. (Luckily it's a new unpublished site right now.)

Code
  [:"red"] <br />Warning: main(/ubbt.inc.php): failed to open stream: No such file or directory in /home/iraqiins/public_html/ubbthreads/includes/main.inc.php on line 13<br /><br />Warning: main(/ubbt.inc.php): failed to open stream: No such file or directory in /home/iraqiins/public_html/ubbthreads/includes/main.inc.php on line 13<br /><br />Warning: main(): Failed opening '/ubbt.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/iraqiins/public_html/ubbthreads/includes/main.inc.php on line 13<br /><br />Fatal error: Call to undefined function: getmicrotime() in /home/iraqiins/public_html/ubbthreads/includes/main.inc.php on line 16<br />
[/]

Line 13 is this: [:"blue"] include("$thispath/ubbt.inc.php");[/]

Line 16 is this: [:"blue"] $timea = getmicrotime();
[/]
(The original lines in main.inc.php)

My site worked before installing and looking at your script I didnt notice anything that should affect the calls in ubbt.inc.php.

Any idea why this would happen? The only mod my ubbt.inc.php has is the one needed for Josh's Who's Online mod. Which, the Who's Online mod and my whole site worked fine after testing that. Once I put in this mod my site gets the above errors.

Any ideas?


Thanks.

-Buddy

Joined: Dec 2002
Posts: 67
Power User
Power User
Joined: Dec 2002
Posts: 67
* Buddy, if you are using a different build of threads than I am, or if the code is calling variables that aren't in your database (due to added mods or mods that you haven't added yet) that might be it. Hopefully you have a backed-up version of things that you can revert to until an answer comes. Sorry I'm not more help here...

Joined: Mar 2003
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2003
Posts: 118
Well I even tried putting the original ubbt.inc.php file back but i get the same results. This error started after I uploaded the main.inc.php. I dont see how it's possible for it to cause those errors though.

I'm in no real hurry to get the site up. Just a side project i'm doing while i'm in Iraq. If Josh or someone doesnt know then i'll just start from scratch.

Thanks anyways.

Joined: Mar 2003
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2003
Posts: 118
BTW, I'm using 6.5.1

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Looks like $thispath isn't set at the top of main.inc.php

Joined: Mar 2003
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2003
Posts: 118
Well it has this...


// THIS NEEDS TO BE SET, OTHERWISE ADMIN SCRIPTS WILL NOT WORK
// THIS IS THE ACTUAL PATH TO YOUR PHP INSTALLATION
$thispath = "";


...at the top of main.inc.php


It was never filled in before. Do I need to fill it in now for some reason?

Joined: Mar 2003
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2003
Posts: 118
here is the site i'm working on www.iraqiinsider.com so you can see.

Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
>Do I need to fill it in now for some reason?
Yes!

It has to be
$thispath = "/home/iraqiins/public_html/ubbthreads";

Joined: Mar 2003
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2003
Posts: 118
Anno... thank you. That did the trick. Simple and I should have caught that.

Thank you very much.

Joined: Sep 2006
Posts: 75
Power User
Power User
Offline
Joined: Sep 2006
Posts: 75
Does anyone have this working for 6.5.4? We had it working for 6.5, but since upgrading yesterday, the photos just don't appear inline.

Joined: Sep 2006
Posts: 75
Power User
Power User
Offline
Joined: Sep 2006
Posts: 75
I've narrowed the problem down a bit. The script actually works fine - in Firefox. But not IE (6.0). Any ideas?

Joined: Sep 2006
Posts: 75
Power User
Power User
Offline
Joined: Sep 2006
Posts: 75
Thanks Josh for helping me with this. We ended up having to bypass the getimage function - which unfortunately gives us no control now over image size, but at least it works.

The above, in case anyone is wondering. smile

Rose

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Sorry for missing this, glad you got it working smile


- Allen wavey
- What Drives You?

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
Pilgrim
Pilgrim
NH, USA
Posts: 190
Joined: June 2000
Forum Statistics
Forums63
Topics37,570
Posts293,915
Members13,848
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,829
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 81
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-2022 VNC Web Services

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