176

Re: Attachment Mod 2.0.1 by Frank H

Frank H wrote:

yep, I believe that should be correct

smile

Frank H wrote:

remember that you still have the quirks of 1.2.6 mentioned in this installation guide aswell

Followed, and installed now.  Thanks smile smile

rgds

Si

177 (edited by crazy 2005-09-14 13:06)

Re: Attachment Mod 2.0.1 by Frank H

Hi,

I installed 1.2.7 version and install this mod after.
I read the Installation this mod for 1.2.6. Change corrections and Change files step by step.
Fine, no erros, but no works. The link to file and icon attach no appears and same file is not in the folder. Why?

I trie download v.1.2.6 but don't find it


Thanks for any help

regards

178

Re: Attachment Mod 2.0.1 by Frank H

crazy wrote:

The link to file and icon attach no appears and same file is not in the folder.

I didn't get that?  (I'm sick with flue or something, but I still think it's a bit unclear)

Please email me to the adress in my signature and I'll try to help out ... describe what works and what doesn't work, and I'll do my very best to help out smile

179

Re: Attachment Mod 2.0.1 by Frank H

keldar wrote:

Followed, and installed now.  Thanks smile smile

rgds

Si

nice to hear you got it working smile

(myself I haven't upgraded yet ... no go to be in flue clouds and try to do an update big_smile ... but the security patches didn't affect me, so I can take it easy wink)

180

Re: Attachment Mod 2.0.1 by Frank H

Frank H wrote:

well ... there's no such strings in the attachment lang files

Either write your message in there (easiest if you only have one language, just replace $lang_attach['Not allowed to post attachments'] with 'your errormessage' ), or add the appropiate lines in the lang files as the other stuff in there is written, somehting like this:

'Not allowed to post attachments' => 'what you want to say'

its working now..
but i found other thing > with the error msg in place, whenever a post is made with unallowed attachmet, post will be posted but then it become a ghost post i.e. when clicked, it says bad link or no longer available. i have to then manually take out the topic from mysql.

any way to put the error msg being inserted as part of the post itself?

181

Re: Attachment Mod 2.0.1 by Frank H

hmm... I thought I had put the attachment things after Rickards stuff, obvoisly not ... then, perhaps its not so good to use it?

182

Re: Attachment Mod 2.0.1 by Frank H

for now i am using this which prevented the ghost link.

message($lang_attach['Error Message'],1);

183

Re: Attachment Mod 2.0.1 by Frank H

If you are a member on the board, and you are logged on. Does the image apper, so you dont need to klick on the attatchment link?

I couldent find any preview.

184

Re: Attachment Mod 2.0.1 by Frank H

no preview, works the same way for all users allowed to view (making previews will hog resources)

you can put an image in a post by checking what url the image has ...

185

Re: Attachment Mod 2.0.1 by Frank H

Someone that have succesfully added this mod to the 1.2.7 version? Pls post your files, i cant get it to work.

186

Re: Attachment Mod 2.0.1 by Frank H

I did a little mod to this mod, I hope you don't mind frank. I have set it so that if it is an image file to just show the image in the post.

Just open viewtopic.php and look for (around line 332.:

$attach_output .= '<br />'."\n\t\t\t\t\t\t".attach_icon($attachment_extension).' <a href="./attachment.php?item='.$attachment_id.'">'.$attachment_filename.'</a>, '.$lang_attach['Size:'].' '.number_format($attachment_size).' '.$lang_attach['bytes'].', '.$lang_attach['Downloads:'].' '.number_format($attachment_downloads);

and replace that with:

                if ($attachment_extension=='jpg' || $attachment_extension=='jpeg' || $attachment_extension=='gif' || $attachment_extension=='png') {
                    $attach_output .= '<br />'."\n\t\t\t\t\t\t".'<a href="./attachment.php?item='.$attachment_id.'"><img src="./attachment.php?item='.$attachment_id.'&download=1" border="0"></a><br>'.$attachment_filename.', '.$lang_attach['Size:'].' '.number_format($attachment_size).' '.$lang_attach['bytes'].', '.$lang_attach['Downloads:'].' '.number_format($attachment_downloads);
                } else {
                    $attach_output .= '<br />'."\n\t\t\t\t\t\t".attach_icon($attachment_extension).' <a href="./attachment.php?item='.$attachment_id.'">'.$attachment_filename.'</a>, '.$lang_attach['Size:'].' '.number_format($attachment_size).' '.$lang_attach['bytes'].', '.$lang_attach['Downloads:'].' '.number_format($attachment_downloads);
                }

Maybe someone can modify it some more to create a thumbnail using GD.

187 (edited by Frank H 2005-10-02 13:57)

Re: Attachment Mod 2.0.1 by Frank H

I wrote it so it would be possible to mod, and tried to make loads of comments and stuff smile

the gdstuff I decided not to implement, due to the extra load ... but I suppose it shouldn't be that hard



as a sidenote, I run it successfully on a 1.2.8 version ... so it still works smile
and a future thing I might do is to tweak the filename generator to make backups even simpler (to add some smalll stuff at the front of the filename to help sorting it, but still keep the random letters at the end to make bruteforcing hard) + optimize the viewtopic code ...
But, I suppose I won't have much time until PunBB 1.3 is released to make any changes unless any security issues arise...

188

Re: Attachment Mod 2.0.1 by Frank H

For a newbie like myself, I am not really willing to try modify the scripts myself. 

Has anyone made an installation guide for 1.2.8?  I see messages indicating that it runs successfully.

Colya

189

Re: Attachment Mod 2.0.1 by Frank H

It's the same changes as those for 1.2.6 that is mentioned on the installation guide. I don't think the security fixes after 1.2.6 has affected the mod in any way.

Re: Attachment Mod 2.0.1 by Frank H

Hi,

I have installed this mod into version 1.2.9

It all seems to work fine except that I can only upload .txt files. When I try something like a Word document, nothing gets uploaded and the post has no link to the attachment.

Any ideas?

Thanks
Jon

191

Re: Attachment Mod 2.0.1 by Frank H

have you followed the installationguide mentioned on the first post in this thread. It has a section on how to setup the board for larger files than 2000 bytes (as most servers differs, one need to setup it according to your server, and setting it too high default will make files 'go lost' without any clue why)

so, make sure you've set the variables correctly

192 (edited by af3 2005-11-07 07:01)

Re: Attachment Mod 2.0.1 by Frank H

af3 wrote:

for now i am using this which prevented the ghost link.

message($lang_attach['Error Message'],1);

err did not work.

frank -- this will give a message to tell the poster abt the invalid size, etension etc but did not prevent creation of a topic (with ghost post link, something like .. viewtopic.php?pid=0#p0). Do you have any suggestion to fix this?
thanks.

193

Re: Attachment Mod 2.0.1 by Frank H

Hello,
I'm running punBB 1.2.6 and would like to upgrade to 1.2.10. I have the attachment mod installed so how can I update without losing my attachments?
Sorry if its a silly question smile

Elad

194

Re: Attachment Mod 2.0.1 by Frank H

depends on how you are planning on doing the upgrade ... if you're using the hdiffs, you don't have to do anything (as 1.2.7 -> 1.2.10 are just small updates) ... just that some of the linenumbers might differ

but ... backups are always nice to do wink

195

Re: Attachment Mod 2.0.1 by Frank H

af3 wrote:

frank -- this will give a message to tell the poster abt the invalid size, etension etc but did not prevent creation of a topic (with ghost post link, something like .. viewtopic.php?pid=0#p0). Do you have any suggestion to fix this?
thanks.

Not without adding a bunch of code ... I thought about it a bit, and never figured out a good way to fix it ...

196

Re: Attachment Mod 2.0.1 by Frank H

Any idea when an update for 1.2.10 will be created?

197

Re: Attachment Mod 2.0.1 by Frank H

never ... unless a security issue is discovered (the 1.2.6 installation guide should work fine for 1.2.10 ...)

198

Re: Attachment Mod 2.0.1 by Frank H

Frank H wrote:
af3 wrote:

frank -- this will give a message to tell the poster abt the invalid size, etension etc but did not prevent creation of a topic (with ghost post link, something like .. viewtopic.php?pid=0#p0). Do you have any suggestion to fix this?
thanks.

Not without adding a bunch of code ... I thought about it a bit, and never figured out a good way to fix it ...

if i can delete from database the created ghost topic automatically, then this should be fine :-) any way to insert mysql command in the attachment script if the upload size is excessive or ext. not allowed?

199

Re: Attachment Mod 2.0.1 by Frank H

I have this mod up and working, but a user just pointed out an issue.  He tried to upload a very large file and it didn't work.  I tried it and it works fine.  I figured it was his error, but after logging in as a regular user, I can't upload the file either.

So, I'm able to do it as an admin, but not as a user.  Permission are set for the forum, so it isn't that.  I can select the file, it takes a while for the post to happen so it is uploading the file, but the post appears with no attachment.

As far as I can tell the file size limit isn't set by the user type (admin vs. member).  Am I missing something?

200

Re: Attachment Mod 2.0.1 by Frank H

Nevermind.  I didn't realize that it had to be set for each group in each forum.  I have seven user groups and seventeen forums.  That was a pain, but they are all reset now.