351 (edited by Frank H 2006-11-28 20:17)

Re: Attachment Mod 2.0.1 by Frank H

Sent a mail


Edit: I have sent two mails to the correct adress (assuming it was the correct one you sent twice wink)

Anyhow ... make sure PHP has write access to that folder(it should have, as it created it), and that the server isn't running safemode

Edit2: Seems like he has got it working smile

352 (edited by Kendjin 2006-11-29 10:49)

Re: Attachment Mod 2.0.1 by Frank H

Hello Frank,

Firstly, wonderful MOD, installed it on a local windows server and it runs like a dream. Sadly when we try to run it on a remote server, we are faced with a problem.

We set up the folder correctly, CHMOD to 777, set max file size to 2MB and proceeded to upload. To be fair at first it gave a different error saying it couldn't move from tmp to said folder. But a quick change to the directory in the admin panel and it was fixed.

Problem is this though... It seems to upload fine and attach to the post, but if you try to open/download the file all it displays is the header.

Any ideas as to what might be the cause?

http://telfordmultimedia.serverheaven.net (left a topic up with a few uploaded files so you can see the result, in the announcement forum)

353

Re: Attachment Mod 2.0.1 by Frank H

looks like your google analytics stuff is interfering ... as that's what's shown when one try to download the files ...

354 (edited by Kendjin 2006-11-29 21:07)

Re: Attachment Mod 2.0.1 by Frank H

Ok thanks, I'll try and see if I can get a proper server to host it to make sure it's just the ads. Mainly due to the fact we did have it running at one point.

EDIT: It appears to be the ads.

355

Re: Attachment Mod 2.0.1 by Frank H

hellow,
i have a problem with installation.
i am copy files  and changes code, but when i press post new topic i can read that:
"An error was encountered
Error: Unable to fetch attachment rules."
In admistartive panel the same way as error:
"An error was encountered
Error: Unable to count number of attachment files."

what is it may be?

senks
sorry for my english.

356

Re: Attachment Mod 2.0.1 by Frank H

you've got mail smile

Re: Attachment Mod 2.0.1 by Frank H

Hello,

At first, sorry for my English, I am a poor French student wink

I try, for my classroom's forum, to add you mod, which is very good. However, even if I try to modify what you asked on the readme.txt, it doesn't work. To be more precisely, when I attach a file with the input, after I send the message, the file is not uploaded, like if nothing happens.

I look at the database, there are not any information, just the structure.

Thanks for help, and sorry my English.
Hoping you will understand what I try to say smile

358

Re: Attachment Mod 2.0.1 by Frank H

Have you followed the installation guide I have made? (also the "Testing the mod" and "Setup the mod"?)

Did install_mod.php run without errors?

Re: Attachment Mod 2.0.1 by Frank H

Strangly, It works, but only for files which are not pictures.
I ran install_mod without errors.

360 (edited by Frank H 2006-12-03 17:18)

Re: Attachment Mod 2.0.1 by Frank H

sent a mail...

Edit: and it seems like it's solved smile

361

Re: Attachment Mod 2.0.1 by Frank H

hey frank how about catagories sections for this?
that would be a neat mod... to add to it...

Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

362

Re: Attachment Mod 2.0.1 by Frank H

Well when I rewrite it to use the extension system, I'll also make it more flexible ... perhaps even so flexible that the mod itself would be possible to extend further with the extension system ...

But I don't make any promises, but I'll try to make it really easy to fiddle with so thisngs like this is possible to add. (it will more or less become the 2nd ground up rewrite of the mod)

363

Re: Attachment Mod 2.0.1 by Frank H

@Frank

Thnx for your mod. It is not that I am lazy (probably I am not good in coding) but do you plan to release a  punbb version with your modification included?

I would love to see a punbb version with Pun portal and Attachment downloads included!!! That would rock.

Regards

P.s. This is my first post. I don't know if Punbb lincence allows the including of mods in punbb.

364

Re: Attachment Mod 2.0.1 by Frank H

no plans for that ... the extensions in PunBB1.3 will make the life much easier ...

365

Re: Attachment Mod 2.0.1 by Frank H

I know you're not wanting to modify your current code but Could you give me some help on how to grab the image on upload? I'm going to use some existing code to create a thumbnail of the attachment...and then I will be able to put the img thumb in the post.  I've done what little php I know, but couldn't get it to work.  I had my script generating the thumbnail, but the image was blank. I don't think I was grabbing the uploaded image part correctly; I'm not familar with the way your script creates all the directories and naming convention.

This would be helpful, since i've modded your script slightly so that multiple images can be uploaded at once.  There can be up to 10 image in one post, and if users could see the thumb first then they would know whether they wanted to see the fullsize image or not.

Thanks

366 (edited by Frank H 2007-01-14 10:33)

Re: Attachment Mod 2.0.1 by Frank H

I would think the best place to create the thumbnail would in the attachment functions file, after it's moved to the correct location.

Look for this in attach_create_attachment()   (include/attach/attach_func.php ~line 106)

        if(!move_uploaded_file($tmp_name,$pun_config['attach_basefolder'].$pun_config['attach_subfolder'].'/'.$unique_name))
            error('Unable to move file from: '.$tmp_name.' to '.$pun_config['attach_basefolder'].$pun_config['attach_subfolder'].'/'.$unique_name.'',__FILE__,__LINE__);
            //return false;
            
        if(strlen($mime)==0)
            $mime = attach_create_mime(attach_find_extention($name));
        
        // update the database with this info
        $result = $db->query('INSERT INTO '.$db->prefix.'attach_2_files (owner,post_id,filename,extension,mime,location,size) VALUES (\''.$pun_user['id'].'\',\''.$post_id.'\',\''.$db->escape($name).'\',\''.attach_get_extension($name).'\',\''.$db->escape($mime).'\',\''.$db->escape($pun_config['attach_subfolder'].'/'.$unique_name).'\',\''.$size.'\')')or error('Unable to insert attachment record into database.',__FILE__,__LINE__,$db->error());
        return true;
}

Adding it before the "return true;" would probably be the best place, it will only be created after the image/file has been uploaded correctly.

The file will be named: $pun_config['attach_basefolder'].$pun_config['attach_subfolder'].'/'.$unique_name


But I'll see if I make it possible for 1.3 to have this feature added 'afterwards'... as the mod will be rewritten... again wink

367

Re: Attachment Mod 2.0.1 by Frank H

Is it possible to automatic change the size of images when they are uploaded?

It would be great!

hej!

368

Re: Attachment Mod 2.0.1 by Frank H

no, it's not an image uploader per se (there is such a mod, perhaps that one has the ability to do it?) ... this mod is for all files, so I make no difference (except the image viewer that is wink)

but I suppose you can add such code in the same place as above for the thumbnails, but I won't incorporate it smile

369

Re: Attachment Mod 2.0.1 by Frank H

Frank H wrote:

but I suppose you can add such code in the same place as above for the thumbnails, but I won't incorporate it smile

I see. smile

Could someone please help me with this? To automatic change the size of images when they are uploaded?

hej!

Re: Attachment Mod 2.0.1 by Frank H

You might be able to create thumbnails on-the-fly with phpThumb and set it to cache them.

Looking for a certain modification for your forum? Please take a look here before posting.

371 (edited by FredrikK 2007-01-15 13:23)

Re: Attachment Mod 2.0.1 by Frank H

Thanks, but I'm sorry, I explain bad. I don't want thumbnails. I just want the image when it uploads to reduce to size 800*600 or something. smile

The problem is not only that my English sucks but also that I almost know nothing about php. http://www.brunna.se/index/img/smilies/dumbom.gif

hej!

Re: Attachment Mod 2.0.1 by Frank H

I've install de mod and everything works fine..except....after uploading a file the creation of the icoon doesnt seem to work. I have to put a link in the post myself...somebody any idea how to solve this problem?

373

Re: Attachment Mod 2.0.1 by Frank H

sounds like you haven't done all the edits in viewtopic.php, recheck those steps. (it should be visible above the signature)

Re: Attachment Mod 2.0.1 by Frank H

I'm ashame to say..you're right...thanks...I uploaded viewforum.php...stupid!!

375

Re: Attachment Mod 2.0.1 by Frank H

lol, sometimes it's easy (sometimes not) smile