Re: Attachment Mod 1.0.1 by Frank H

I get this:

Warning: Unable to access ./include/common.php in /mnt/ja1/01/241/00000007/htdocs/test.php on line 3

Fatal error: Failed opening required './include/common.php' (include_path='') in /mnt/ja1/01/241/00000007/htdocs/test.php on line 3


Any clue?? Seems they only provide a very smal set of the php libraries, or the include path is somehow incorrect.

Looking for a good game?
Do it yourself - GLBasic, you can do!

Re: Attachment Mod 1.0.1 by Frank H

the include/common.php is the PunBB file ... so make sure that you put the test.php file in the same directory where you have all forum files ...

or alter
$pun_root = './';

to the correct path to the forum root ...

28

Re: Attachment Mod 1.0.1 by Frank H

Anyone update for Punbb 1.1.2 ?

Re: Attachment Mod 1.0.1 by Frank H

Duh!

Looking for a good game?
Do it yourself - GLBasic, you can do!

Re: Attachment Mod 1.0.1 by Frank H

I haven't released a proper 'release' on 1.1.2 as it's only a matter of a few lines that has been altered up or down (but I will rewrite some pars and do a version update ... perhaps during next week, as I'm too choked with work atm)

so edit install_mod.php and set 1.1.2 as version number, and when you update the forum (DO A BACKUP BEFORE!), be aware that the line numbers might be a little off... and do this little bugfix

I'll try to find time to do a proper update ... but ... things are just crazy atm here ...

Re: Attachment Mod 1.0.1 by Frank H

max_allowed_packet = 1048576 bytes
PHP post_max_size = 8M

Can the uploads be 8 MB or 1024 KB now??

...one must really think I'm an idiot, huh?
Can the mod be installed, so only users that have a "allow upload" tag can attach files?

-Gernot

Looking for a good game?
Do it yourself - GLBasic, you can do!

Re: Attachment Mod 1.0.1 by Frank H

GernotFrisch wrote:

max_allowed_packet = 1048576 bytes
PHP post_max_size = 8M

Can the uploads be 8 MB or 1024 KB now??

...one must really think I'm an idiot, huh?
Can the mod be installed, so only users that have a "allow upload" tag can attach files?

-Gernot

less than 10048576bytes I think (remember that there are other stuff sent aswell, so, set 1000000 bytes as a limit or so (and do a test with a file that large) ... I think the packet size will be the thing that limits the upload ... unfortunately it wasn't that large, but on the other hand... database size won't probably run away in size that fast either wink

The rights are controlled in the groups of:
Guests
Registered users
Moderators
Admins (always allowed to attach any files, only limit is the 'hardcoded' max size you just found out)


just make sure you do the bugfix I have posted (link in the previous post by me) ... othervise the guests are recognized as registered users... so it's important!

33

Re: Attachment Mod 1.0.1 by Frank H

I'm using the attachment mod with great success. I have just one problem (my problem, not yours, but you may be able to help).

I run a backup utility each night but, because more attachments are being added (which are still relevant so I can't delete any of them yet) the backups are becoming very large and take a long time to download.

I have spare databases on my server and would like the attachments to go to one of these. That way I could backup the database with all the rest of the forum stuff and not worry about the attachments.
Problem is, each database has a different name and password so the forum config file would only do for the rest of the forum tables. I'd need somehow to call a second config file which included the name, password, etc. of another database and also be able to direct attachments to be saved there.

I'm not a programmer so am merely looking for some guidance as to whether this is possible and, if so, how difficult it would be.

Thanks for any help you can offer.

I've been down so long it's beginning to look like up..

Re: Attachment Mod 1.0.1 by Frank H

Sounds very nice smile

I do have plans on updating the mod to support files to be saved on disk and thus only use the database for reference and file info. But I'm too occupied atm to think on it wink

Well, I guess it shouldn't be that hard ... what one needs to do is to create a new $db ... that's named something else ... like $db_files ... and create it like the ordinary $db is made ... but with the variables for the other passwords etc.
Afterwards one would need to fiddle in all the attachment mod code, and replace the things done in the 'attach_data' tables, to use that other $db_files ....

hmm ... but the more I think of it ... the more changes is needed ... so I think it might not be that easy after all ... hmm ... I'll think on it ... and see if I can come up with a fairly easy solution ...

35

Re: Attachment Mod 1.0.1 by Frank H

Problem using Mozilla and attachments,

I'm not sure if this a bug in the mozilla engine or if it is fixable by you great code.. smile

Anyways, the problem is that when an attachment has a space in the name, mozilla tryes to open a attament named only by the first word..

Let me demonstare, so you can understand.. smile

I have uploaded an attachment named: "very nice attacment.doc"

When i'm trying to open the attachment with Internet Explorer, it open the file nicely. BUT when i'm opening the same attachment with Mozilla, the browser tryes to open file called "very" and so doens't know how to open it... This is quite a proble though i'm using Mozilla myself and I'm using this BBS and your mod at work, so there are quite important documents that need to be opened with out trouble..

Thanks for a great mod! This has been very helpfull! smile

36 (edited by Frank H 2004-04-25 17:41)

Re: Attachment Mod 1.0.1 by Frank H

I have experienced it with other forums and things aswell (I'm using firefox) ... it might be an issue on the mod, but might aswell be an issue on firefox/mozilla, I don't know ... and I suggest noone should use space, but _ instead wink

I had plans to take a look on the whole mod in the near future, but, things didn't work out timewise, so I barely can do anything atm ... had plans for a big rewrite, and clean up stuff and redo some parts, but I haven't the time ... but ... hopefully I'll get some during the summer ... smile

(Edit 19/4: Going away for a week, so I'm unable to answer any questions until 26/4)
(Edit 25/4: I'm now back home ... so now I should be able to answer stuff wink)

37

Re: Attachment Mod 1.0.1 by Frank H

str_replace the file name maybe? replacing ' ' with '%20'
so it will still show up as a 'space'
this isnt tested.. just a thought.. hehe..

Re: Attachment Mod 1.0.1 by Frank H

hmm... you might be correct there I just noticed that it worked on a "vBulletin Version 3.0.1" board ... and it had %20 ... and worked

so, I'll do that aswell, as soon as I have the time (I'm planning to do a major rewrite of the mod at the beginning of summer, as there are some parts that desperately needs it wink)

or ... I tested now ... and when I tried to save a file I got %20 in the filename instead of space ... lol ... hmm ... so a string replacement wasn't the way to go...perhaps? wink

39

Re: Attachment Mod 1.0.1 by Frank H

str replace the ' ' with _ then... same diff basically..
str_replace crazy is the way to go  ;-)

40

Re: Attachment Mod 1.0.1 by Frank H

Hi,i wanna know whether this mod can be used on punbb ver 1.1.4,and how to install this mod?

41 (edited by Frank H 2004-05-01 08:35)

Re: Attachment Mod 1.0.1 by Frank H

well ... probably, as I use it on a 1.1.2 , some lines might be off due to changes between the versions. also, you need to add 1.1.4 in the array on the install_mod.php file ... and, you should do the fix for the bug that was found, information in the first post.

I will rewrite the mod during the summer, some parts really needs it ... but now, I haven't the time to do so, for at least a month more. Univ takes up too much time.


But try it on a standalone version ... to see if it works ... not on the forum you use ... if it wouldn't work ...

Re: Attachment Mod 1.0.1 by Frank H

most wanted mod.. but i still can`t install it sad

Frank u plane to make new versions of your mod?

Re: Attachment Mod 1.0.1 by Frank H

yes, when univ calmes down, don't have free time atm.

so in a month or so I hope to have alot more free time ... and then I'll do a proper rewrite.

44

Re: Attachment Mod 1.0.1 by Frank H

...eagerly awaiting the rewrite...

45

Re: Attachment Mod 1.0.1 by Frank H

Found a way to get aroud the bug with spaces in the filename.

I tested using sn0n:n idea of str_replace. It actually works (atleast with my firefox, mozilla and IE). You can use either %20 or _ which ever you want.

Just edit your attachment.php and add the following at line 86 after:
list($attach_mime,$attach_data) = $result;

                //Edit 7.5.2004 by seppo_@hotmail.com    
                //Fixes problem with spaces in the filenames
                $attach_filename = str_replace (" ", "%20", $attach_filename);

and before
if(!isset($_GET['download'])&&($attach_mime=="image/jpg"||$attach_mime=="image/jpeg"||$attach_mime=="image/pjpeg"||$attach_mime=="image/gif"||
$attach_mime=="image/png"||$attach_mime=="image/x-png")){

Re: Attachment Mod 1.0.1 by Frank H

I tried it aswell ... but got %20 in the filename instead of space ... hmm... I might have used with str_replace (' ', '%20', $attach_filename); ... and ' skips parsing of string, while " parse the string ... could be that perhaps?

gotta make a new try ...

Re: Attachment Mod 1.0.1 by Frank H

no, that makes the same for me ... %20 instead of space ... when saving the file to disk ... (if you tested on an image, click the image so you get a save dialog)

I'm using PHP: 4.1.2 & Apache/1.3.26 ... and Firefox 0.8

Re: Attachment Mod 1.0.1 by Frank H

can you make it upload the file to to my hosting(web space) not in sql

plz


thx

Re: Attachment Mod 1.0.1 by Frank H

will probably do that during the summer rewrite of the mod (alot will be changed, but will make a converter so the current format can be reused, so no files will be lost or anything smile)

Re: Attachment Mod 1.0.1 by Frank H

ok, made a little mod for those that want ... (Seppo, you should have placed the rewrite later, as you're doing an unneccessary step each time someone loads up to view an image wink)

Find (Line 98 in attachment.php)

            header("Content-Disposition: attachment; filename=$attach_filename");

Add before

            $attach_filename=rawurlencode($attach_filename);

some browsers will show %20 ... but not all ... and it's probably better than chopping the name wink
should also be able to handle other sofar unknown issues, as it will fix all sort of odd characters ... and replace them with the %num equivalent.