376 (edited by FredrikK 2007-01-16 17:25)

Re: Attachment Mod 2.0.1 by Frank H

Frank H, is't possible when the uploaded file is deleted show this somehow in the post? It's hard to explain, but something like this,



When a file still exist it's look just like normal:

http://www.brunna.se/index/img/attach/audio.png Depeche mode - Just Cant Get Enough.mp3, Size: 423 362 bytes, Downloads: 3



When a file is deleted it will look someting like this:

X Depeche mode - Just Cant Get Enough.mp3 (deleted)



Edit: It would be great. Because now when a file is deleted and you cant tell there where a file there previously and the post make no sense. smile

hej!

377

Re: Attachment Mod 2.0.1 by Frank H

Well, if someone delete it ,it shouldn't be there IMHO, just like posts, threads, forums, categorys, users, groups etc. smile
(And if the post itself then looks odd, why not alter it at the time one delete the file, as you're already in edit mode?)

Anyhow, it sounds like fluff to me, so I won't add such a thing. But I guess there's always a possibility for a mod on the mod wink
(just like I don't add javascripts to handle the uploads and such)

378

Re: Attachment Mod 2.0.1 by Frank H

People... can i use this hack on my PunnyBunny 1.2.14 ?

PunnyBunny..

379

Re: Attachment Mod 2.0.1 by Frank H

yes, follow the installation guide, and you'll be fine. smile  (all parts of that page must be done, but read through it first, and backup the files before starting smile)

380

Re: Attachment Mod 2.0.1 by Frank H

thanks!

PunnyBunny..

381 (edited by thesaint 2007-01-19 11:19)

Re: Attachment Mod 2.0.1 by Frank H

works only got a strange bug now...when a guest add comment, i get 6 times the same posting...

PunnyBunny..

382

Re: Attachment Mod 2.0.1 by Frank H

try it here...

http://www.shiftzone.com/forum/post.php?fid=34

Post something and you get allot of repeating..

PunnyBunny..

383

Re: Attachment Mod 2.0.1 by Frank H

You messed up in the install, apply this changeset again
http://dev.punbb.org/changeset/172

384

Re: Attachment Mod 2.0.1 by Frank H

Not me smile check the install file from frank...i think

#
#---------[ 43. FIND (line: 187) ]--------------------------------------------
#

$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], false) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());


#
#---------[ 44. REPLACE WITH ]--(if you have added the latest changeset, just change the true to false, and add comment)---
#

$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], false) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error()); //Attachment Mod, changed the true to false...

but when you look at the original, without the attachment mod

    $result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
PunnyBunny..

385 (edited by Frank H 2007-01-19 11:54)

Re: Attachment Mod 2.0.1 by Frank H

well, I told about it in the installation guide, did you read the "Installing the mod on PunBB 1.2.6+"?
In there you find:

Secondly, step 43 & 44 is altered. Just change the true to false after the query (and add the comment behind , so you have a mark that the attachment mod has altered that line)

Edit: aaah, you're meaning the actual text in readme.txt is wrong... hmm... gotta take a look...

386

Re: Attachment Mod 2.0.1 by Frank H

http://cms.frankh.shacknet.nu/index.php … ;Itemid=32
The documentation, which Frank linked to above

Secondly, step 43 & 44 is altered. Just change the true to false after the query (and add the comment behind , so you have a mark that the attachment mod has altered that line)

387

Re: Attachment Mod 2.0.1 by Frank H

I just checked the readme.txt, what you pasted is not what the readme.txt says, (the false is set to true in that one) ...

Where did you download the readme.txt?

388 (edited by thesaint 2007-01-19 12:01)

Re: Attachment Mod 2.0.1 by Frank H

Frank i have this :

$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], false) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error()); //Attachment Mod, changed the true to false...

Just like in the readme text...i see nothing wrong

downloaded from punres....

PunnyBunny..

389

Re: Attachment Mod 2.0.1 by Frank H

no, re-check the original readme.txt, and compare it to what you pasted as "#---------[ 43. FIND (line: 187) ]--------------------------------------------"

You'll see that those differ at the end ....

either way, it's the  false) or error   instead of   true) or error    that should be changed and the comment that needs to be added to that row ... then it should work ...


now I need to get back to work wink

390

Re: Attachment Mod 2.0.1 by Frank H

okay fixt it....everything works now!

Okay another strange thing, zip"ace"rar <---doesn't work in ALLOWED FILES when you hit the submit (edit this ruleset) button only zip stays or must i use , ?

PunnyBunny..

391

Re: Attachment Mod 2.0.1 by Frank H

hmm ... that's a bug! smile

gotta look closer at it ... good notice (and the first one to notice it I think smile)

392 (edited by Frank H 2007-01-19 16:59)

Re: Attachment Mod 2.0.1 by Frank H

Ok, it was a really easy bug, it just showed the first value (but in the htmlsource, all items were there) ... it was just a neglected  htmlspecialchars() on the output variable smile

Bugfix:

#
# OPEN ------------------------------------------------------
#

AP_Attachment_Mod.php

#
# FIND (line 597) -------------------------------------------
#

                                            <input type="text" name="file_ext" value="'.$attach_file_extarray[$key].'" size="80" />

#
# REPLACE WITH ----------------------------------------------
#

                                            <input type="text" name="file_ext" value="'.htmlspecialchars($attach_file_extarray[$key]).'" size="80" />

#
# SAVE, UPLOAD-----------------------------------------------
#

I'm leaning towards updating the download, including the fixes that has been made ... we will see how much time I have during the weekend smile

393

Re: Attachment Mod 2.0.1 by Frank H

haha okay, im going to update, thanks smile

PunnyBunny..

394 (edited by trongha 2007-01-23 03:45)

Re: Attachment Mod 2.0.1 by Frank H

savas wrote:

File: /home/misak/public_html/savasweb/install_mod.php
Line: 117

PunBB reported: Unable to copy .htaccess file to new subfolder with name '/home/misak/public_html/savasweb/attachments/1f6c169793a42ccf104a9ddbe7c8902c'


run the install.php
please help!

Taur wrote:

Hello, I have a same problem as you discussed here...

File: /www/doc/www.vlci.org/www/install_mod.php
Line: 117

PunBB reported: Unable to copy .htaccess file to new subfolder with name '/www/doc/www.vlci.org/home/attachments/d9811d52c73e11f35e2f1e8659bc472a'

attach_func        if(!mkdir($pun_config['attach_basefolder'].$newfolder,0777))
install_mod        if(!mkdir($basepath.$newfolder,0777))

created folder chmod 0750 (still)

Can you help me?

Upload .htaccess file to => /home/misak/public_html/savasweb/attachments/
Upload .htaccess file to => /www/doc/www.vlci.org/home/attachments/

Blakeyrat wrote:

Hey Frank, thanks a ton for your MOD it's bound to be really helpful as soon as I can get it working.  smile

Here's the problem I have.  Per your instructions, I've filled in the full path to the files directory based on the path given by phpinfo(), which is:

/home/blakeyrat/domain.com/forum/files/

When I click "install", I get the following error:

File: /home/.servername/blakeyrat/domain.com/forum/install_mod.php
Line: 119

PunBB reported: Unable to copy index.html file to new subfolder with name '/home/.servername/blakeyrat/domain.com/forum/files/da3d9666984ab2938a8f4af1b24daa7f'

As you can see, the path given by phpinfo() and the path given by this error message are different... the error one contains an extra folder that I don't see otherwise.  The weird thing is that if I modify the path I enter to include that extra folder, I get the exact same error.  I'm assuming this is the result of some kind of redirection my host is doing?  Is there any way to use a relative path instead of an absolute path?

Edit:

Just noticed this.  It can create the folder successfully, but it can't write *inside* of the folder.  So it looks like it's a plain old permissions issue.  That said, I still don't know what's going on... the permissions of /files is correct, shouldn't the permissions of folders created inside of it be the same?

The folder created has permissions of 750

Is this a configuration error?  Can anybody help me out here?

Thanks.

Upload index.html file to => /home/.servername/blakeyrat/domain.com/forum/files/

Thanks Frank H!

I'm from Viet Nam. i speak english vey bad! Sorry.

395

Re: Attachment Mod 2.0.1 by Frank H

9. Installation trouble can be caused by php running in safe mode, turning it off will make it work. (if you're getting an error on .htaccess beeing copied, but the chmod seems to be correct)

Do you have safe_mode on (PHP setting)?

Re: Attachment Mod 2.0.1 by Frank H

Hello,
I am trying to install and configure Attachment Mod for my PunBB board.
The thing is that I have the same problem than FredrikK, which is the "Unable to move file from: /tmp/phpbTaHmT to /forum/attachments/5b965acd05257c60857c7d24937ead5a/198a17057604be15a9ff95aa6a0a9991.attach." error.

I have given 777 chmod to /forum/attachments folder, so as for the /forum/attachments/5b965acd05257c60857c7d24937ead5a one, and now I don't really know what to do sad

Please, help me smile

397

Re: Attachment Mod 2.0.1 by Frank H

Eskimobleu- you might want to try editing the CHMOD value in install_mod.php to be 0777. That's what I had to do to get the installation to complete properly.


Everyone- On another note-I got the mod installed fine. I can configure it and the form to upload a file appears, but it never uploads the file. It says "posting, please wait" but when the final post appears, no attachment is present.

Please help! Thanks.

398

Re: Attachment Mod 2.0.1 by Frank H

Just a notion... check to see how php is set for file size limits on your server php configuration file (php.ini), or ask your host.  Typical default limit is 2MB.  Symptoms when uploading a larger file than allowed are as you describe.
Google: php file size limit  ...should give you a good lead.
Cheers,

TwoHawks
Love is the Function
No Form is the Tool

399

Re: Attachment Mod 2.0.1 by Frank H

Eskimobleu wrote:

Hello,
I am trying to install and configure Attachment Mod for my PunBB board.
The thing is that I have the same problem than FredrikK, which is the "Unable to move file from: /tmp/phpbTaHmT to /forum/attachments/5b965acd05257c60857c7d24937ead5a/198a17057604be15a9ff95aa6a0a9991.attach." error.

I have given 777 chmod to /forum/attachments folder, so as for the /forum/attachments/5b965acd05257c60857c7d24937ead5a one, and now I don't really know what to do sad

Please, help me smile

Is the server running with safemode on?

400

Re: Attachment Mod 2.0.1 by Frank H

clariden wrote:

Eskimobleu- you might want to try editing the CHMOD value in install_mod.php to be 0777. That's what I had to do to get the installation to complete properly.


Everyone- On another note-I got the mod installed fine. I can configure it and the form to upload a file appears, but it never uploads the file. It says "posting, please wait" but when the final post appears, no attachment is present.

Please help! Thanks.

Sounds like you need to setup the mod. Have you followed the installation guide I made? (Especially the parts about "Testing the mod", and "Setup the mod")