Re: Attachment Mod 2.0.1 by Frank H
the install_mod.php haven't run successfully ... it should have given an error when you ran it ...
in the attachments directory, do you find any randomly lettered subdirectories?
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → Attachment Mod 2.0.1 by Frank H
the install_mod.php haven't run successfully ... it should have given an error when you ran it ...
in the attachments directory, do you find any randomly lettered subdirectories?
I've read through this thread and sussed out a few issues and i've got it working but not fully.
Basically, Attachments are only visable for Admins along with the ability to attach files in posts.
Originally it would only display the attachments for Admins after the post was edited, i missed a part of the mod edit thou for that.
After going through all the changes again and making sure they were all correct, Admins were able to post attachments without needing to edit the post for them to show.
I really want members, mods and admins to be able to post attachments and for Guests not to be able to post or view them.
Is there anything you can suggest?
Thanks
Have you set the rules for normal users? (administrators override all rulechecks, except max size that's defined in "Alter Settings")
in the Admin plugin for the attachment mod, click "List Rules", and then add rules for guests, moderators and members (and any other groups you have)
also while you're in there, also look in "Alter Settings" to see that you don't have the default 2000 bytes limit on attachments ... (better do this before settting the rules, as the rules cannot have larger values than this max allowed size ... it's described how to know this value in the Documentation chapter 1.6)
Since the master php.ini is defaulted at 2mb, is there any way to have a 2nd php.ini file to override it? My website is hosted and I don't have access to the php.ini and I'd like to have up to 6mb for attachment size.
Since the master php.ini is defaulted at 2mb, is there any way to have a 2nd php.ini file to override it? My website is hosted and I don't have access to the php.ini and I'd like to have up to 6mb for attachment size.
Create a file named .htaccess in your forum root directory.
Add the following to it, save & upload:
php_value post_max_size 6M
php_value upload_max_filesize 6M
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!
Worked like a charm CodeXP.
Thank you!!!!!
savas: have you copied the .htaccess and index.html file into the "attachments" directory?
easier to find problems through email aswell, so mail me at the adress shown below in my signature (or use the mailform) if you still have trouble (that is, if you have those files there, or it still doesn't work)
I've now created a small installation guide. To help people getting started and shows how you need to setup the forum ... you can find it here http://frankh.shacknet.nu/index.php?section=15 ... the layout on that CMS is still default ... but I'm populating it with more and more stuff, and thought I'd tell that I've written the Installation Guide ... (looks like I'm going to stay with this CMS, tried nucleus, but hadn't the features I wanted, looked at mambo, didn't like it, xoops had an awful admin interface ... but this one is simple to use, and has the stuff I need)
I'm having major problems with this mod. It doesn't upload any files. The problem lies in that $_FILES['attached_file'] is empty. I've never had any problems uploading files with this php setup in the past and I have not pasted the mod wrong since I've done that 3 times and tried with your modified post.php.
Edit: Nvm, seems like there was just max_file_size that were missconfigured.
that's why I made the installation guide
"You are running a version of PunBB (1.2.6) that this mod does not support. This mod supports PunBB versions: 1.2, 1.2.1, 1.2.3, 1.2.4, 1.2.5"
Will there be an update soon or can this still be used?
"You are running a version of PunBB (1.2.6) that this mod does not support. This mod supports PunBB versions: 1.2, 1.2.1, 1.2.3, 1.2.4, 1.2.5"
Will there be an update soon or can this still be used?
Follow the Installation guide linked to from the first post in this forum.
I've followed all the instructions. The mod is installed correctly. However, when I click on any forum posts now, I get this:
An error was encountered
Error: Unable to fetch if there were any attachments to the post.
I'm running 1.2.6 (I edited it to allow that.. however, I don't understand where I'm supposed to change "True" to false. Could you paste the line I need to change? Perhaps paste exactly what I need to put in there and I can just copy/paste?
Thanks!
please email me the viewtopic.php file and I'll see what's wrong with it (my email adress is in the signature)
how to make error msg to inform user that the extension is not allowed when submitting or when the file size is > max limit?
I didn't find a good method for that, as I didn't want to interfer with the normal post/editing. So I didn't feel like adding an error() page, and the only option would then be to make some kind of message transfer to pop up on the redirect page or something, and that just felt too complex to be simple ... and javascript is an option, that I don't like, so I ended up not adding that functionality ...
But you could probably add error messages in the attach.php file (in the include folder), I might even have the ifstatements ready for that (was a while since I peaked in my code), so you just need to add
error("some text");
(Edit: I think the browser is supposed to tell if you're trying to upload larger files than allowed in the MAXSIZE hidden variable, that normal member gets)
Frank, its in the post.php
// Attachment Mod Block Start
if (isset($_FILES['attached_file'])&&$_FILES['attached_file']['size']!=0&&is_uploaded_file($_FILES['attached_file']['tmp_name'])){
//fetch the rules for this forum for this group
$attach_result = $db->query('SELECT rules,size,file_ext FROM '.$db->prefix.'attach_2_rules WHERE group_id=\''.$pun_user['g_id'].'\' AND forum_id=\''.$cur_posting['id'].'\' LIMIT 1')or error('Unable to fetch attachment rules',__FILE__,__LINE__,$db->error());
if($db->num_rows($attach_result)!=0||$pun_user['g_id']==PUN_ADMIN){
$attach_rules=0; $attach_size=0; $attach_file_ext=''; // just some defaults to get the parser to stop nagging me if it's an admin :D
if($db->num_rows($attach_result)!=0)
list($attach_rules,$attach_size,$attach_file_ext)=$db->fetch_row($attach_result);
//check so that the user is allowed to upload
if(attach_allow_upload($attach_rules,$attach_size,$attach_file_ext,$_FILES['attached_file']['size'],$_FILES['attached_file']['name'])){
// ok we're allowed to post ... time to fix everything...
if(!attach_create_attachment($_FILES['attached_file']['name'],$_FILES['attached_file']['type'],$_FILES['attached_file']['size'],$_FILES['attached_file']['tmp_name'],$new_pid,count_chars($message))){
error('Error creating attachment, inform the owner of this bulletin board of this problem. (Most likely something to do with rights on the filesystem)',__FILE__,__LINE__);
}
}
else
{
// no output ... but if you want, enable this error (you really shouldn't need to as this will only happen if someone try to go around the restrictions
// error($lang_attach['Not allowed to post attachments']);
}
}
else {
// no output ... but if you want, enable this error (you really shouldn't need to as this will only happen if someone try to go around the restrictions
// error($lang_attach['Error_Message']);
}
}
// Attachment Mod Block End
ah, it was in that file
uncommenting the error() part does NOT work, lang reference is available.
no error msg is shown :-(
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'
yea i upgraded to 1.2.7 an it worked
Thanks for the info.
Frank, in the readme.txt file, you have the following line:
index.htm to attachment-directory (read the preparations above!)
no index.htm file exists, index.html does, however. Is this the file its referring to?
rgds
Si
yep, I believe that should be correct
remember that you still have the quirks of 1.2.6 mentioned in this installation guide aswell
http://frankh.shacknet.nu/index.php?section=15
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → Attachment Mod 2.0.1 by Frank H
Powered by PunBB, supported by Informer Technologies, Inc.