Connorhd wrote:

you can add this to the install_mod.php
<snip>
that will delete the cache files

I use this in the attachment mod installer (as Rickard used it in his scripts wink) (dunno if it also creates a new one?)

    require_once PUN_ROOT.'include/cache.php';
    generate_config_cache();

well, download the modified files, and replace (but keep a backup of your modified) post.php ... and test if the same happens ... if it works we know it's in the modifications, if it doesn't we need to further narrow it down...

and make sure you're usign a really small file when testing, I suggest you make a textfile with the word test or something within ... that makes a 6 byte file or such ...  wink

now, everything works again...

Sorry for that, but the network has dropped the routing to my machines at home (well, 3/4 machines, but totally out of my control) ... support is contacted ... and we will see when they fix it ... (I'm guessing the newly changed switch has dropped the ip's to route, dns still has them, but it's impossible to connect to anything outside of my apartment...)

send a mail to frank_n05pam [at] hotmail [dot] com and I'll mail the zip to you... but I hope the network will be up soon...

Edit: this was sent by using VNC onto a slooow windows server, in 640x480 256 colors ... and the ooold pci card really struggles big_smile ... but I'll be able to email the stuff from this one for those who want the mod ... hmmm... but I suppose it'll be on punres later ... just gotta register (yet another place roll (lol I couldn't login to my gmail, as I forgot the pass to that place big_smile)) ...

New version released!
*****************************************************************************************************************'
But don't worry, it's just a small bug update, and really easy to update from 2.0 to 2.0.1 (3 files replaced (attachment mod files) and run a script)

read more about it here and download

To update, just read the "update_2.0_to_2.0.1_readme.txt" ...
Fixed a ruleset check that I thought were there, but obv. not, and that I added Dexus header for that annoying 5-7s delay for downloading attachments.
(hopefully no more "users can upload, but not admins", as it's most likely partly due to this little bug I had done. Where usergroups could have a larger allowed size, than the max allowed size for the mod (that the admins used as limit))

Ok, a small bug has surfaced...

The rule editing should go to max allowed size if a larger value is entered, but somehow that 'trick' was only in my head ... and not in the code. Due to this I'll add a couple of lines in two of the files (both the admin plugin and in attach_func.php), so that the max allowed isn't ovverridden by anyone. (there will be a check in the allow upload, and when editing/creating rules it'll set max upload instead of leaving a larger number)

So, I'll update the first post with links to the two slightly altered files, and update the zip (I'm just not sure if I'll increase the version or not, but I don't think it's such a big thing... well see) wink

507

(12 replies, posted in PunBB 1.2 discussion)

one problem that you should consider is also PHP versions etc. They're as critical as the phpscripts themselves ...

(and I must say that I've seen a few phpBB boards getting '0wn3d' ... so the frequency of 'critical' bug updates isn't always the best thing to look at wink)


But if I would do such a critical thing that you seems to need, I'd use SSL/https, with login (not relying on the forum login only) ... as that will hopefully only let 'allowed' people to even reach the scripts ... and then ... sit down and look through all the code of each script, looking out for any vurnabilities, like how info is garthered and handled from the user. But things like PHP bugs should also be under consideration, I know of a vBulletin board that has problems due to PHP versions and bugs ... resulting in the only PHP version is possible to run due to security reasons is a beta, and that one locks up once in a while instead...

ted: Gardell has also added the Calender mod (+ some other mods, but both of you have that and have problems, and his worked 'clean' so the attachment mod itself works, jsut some interferrence) ... might be that one that's interferring ...

I suppose it's just a matter of finding out what gets affected, and how to solve it ... I'll keep you all updated when the problem is figured out...

Edit: I looked at Calender 2.0.5(or 4), and at a first glance I dont' think that one is the one interfering ... as it doesn't alter any files used in attachment mod, and only adds a column in the users table, that I don't think should affect any queries in either PunBB or my mod ... so Calender is probably not the reason why it stopped working ... going to go through all other of Gardells mods...
Edit2: and now I've looked through Easy BBCode, dont think that one interfers either, 2 more mods to look through ...

Edit3: Ok, Gardell has a working mod now, turned out to be some stuff that hadn't been added into a file (easily done, I've done it a few times myself big_smile).
(so this mod will work with easy bb code, pm mod, calender, and easy poll) smile

ted: sounds like you've altered something, try to check what each modification has done, it's probably one of your modifications that has altered either my mod (doubt it, but not impossible), or that other mod alters used information (I'm guessing this, and it's a harder thing to find, so start with the first wink) ... $pun_user['g_id'] is used for identity checks, so make sure that that information is intact.

ultravibe: From the Edit rules page

Here you can increase the allowed number of attachments per post. (To add more attachments to a post the user needs to edit the message.)

So, have you edited the message to add more attachments?
(reason why it's like this is because I don't want to add a shitload of code for temporary storage, and handling that when people don't post (but send up files), and don't want to add javascripts, as not all people have them enabled)

smile

(perhaps a consequense that I nowadays never read all forums ... but yep you were first big_smile)

hmm... I had CET in my profile, and now at 01:22 it showed I had posted at 00:22 ... so I suppose the server hasn't changed time to DST? wink

(did a temporary fix to set my time to +02, just not to get fooled by all posts big_smile)

hmm... I think I'll email, and try to structure the error searching wink
(and I can do it in Swedish big_smile)

ted: someone had a similar issue, but haven't heard any updates on his problems, if he solved it or not, this was the suggestion I gave to him on previous page

Administrators override security checks, so make sure all the code is in place, and that your administratorgroup has the right group id. (should be 1) ... you can also check so that you haven't set max upload size to something that php cannot handle. (Documentation chapter 1.6)

and if you change php.ini, you probably need to restart the webserver to put the changes in effect

well, then why not just use some simple script? (I made this for me, and I need the security stuff ... thus this is why I've made it this way) ...

about fpasthru, yep I know, and the reason why other scripts use that is due to fpassthru is rumored to be a memory hog (probably reads most of the file into memory), but I had planned to rewrite the attachment.php file, and used that as I knew it worked, but it's on the todo list to be changed ... (and isn't it even commented in attachment.php that I use it only temporary? so what's the need to point it out more?)


but wasn't there another image upload mod? I think it'll fit better to those only needing a small "unsafe" mod for images in threads ... as I've said before, I made this mod to fulfill my needs, and shared it if anyone else wants it.
(note, that I'm not saying the other mod was unsafe, I never tried it or looked at how it worked, but IIRC it was simpler than mine)

that looks imho very unclean/cluttrered, how does it look with say ... 20 groups?
But I'm glad you've made soemthing you're happy with, that suits your needs smile

well, there's a reason why I go through php script, to limit all possibility for direct linking. Letting apache or similar handle downloads, then one can just as well show all the files... and it's pretty unsecure to have files with correct names in public locations...  (sure, some people might have the attachments in a 'public' place, but direct linking is only possible if they bruteforce, as the filenames are random, or that they can fetch info from the database ...)

Dexus wrote:

it's very annoying thing, to edit rules of many groups and many forums.... sad
is there any way to set "default" rules? or to multiset them???

Default is to allow nothing ... I might add 'base rules upon' in future version, similar to what punbb already has...

iku wrote:

Frank: Yep I know that but I don't want it to work that way.

Well, I'm not forcing anyone to use it, I could add a zillion features, but then it would be very far from the idea of PunBB, right? ... and I wanted to keep this mod as simple as possible, othervise I would have done a temporary storage, javascripts doing this and that etc. But I made this mod for myself, and released it in public for anyone else that want to have attachments... feel free to write another mod that suits your needs (wasn't there another image upload mod? Perhaps that better suites to your needs?)

treffynnon wrote:

When I am logged in as an administrator no attachments get uploaded.  But if I log in as a standard user then I can upload.  Basically in both modes it actually attempts to upload the file (can tell by the length of time it takes) but in admin mode the file does not seem to be added to the database or to the base of the admins posts.

Administrators override security checks, so make sure all the code is in place, and that your administratorgroup has the right group id. (should be 1) ... you can also check so that you haven't set max upload size to something that php cannot handle. (Documentation chapter 1.6)

Dexus wrote:

I was trying to implement "resume" of broken downloads of attachments, but faced some problems... and decided that it's nearly impossible due to "Range" parameter parsed by http server (apache).

Ouch, ah well one cannot have everything in the world wink
And this isn't just a config issue/lack of info sent to apache? (seeing that you seem to have all the neccessary headers), as there seems to be people in the php documentation that has managed to send resumes ...

if you want to show an image in the post, just copy paste the download url into an [ img ] tag   (it's the same url as for viewing it, but with the added &download=1)

This mod is made for all type of files, not just images

jerryg wrote:

Frank H
For needs of my users I was made a translation for the file attach.php to spanish, if somebody think this it can be useful can ask for it to gerardogomezvargas@gmail.com or if somebody can tell me where to upload it, thanks a lot

Great Work  Frank


Jerryg

Nice to hear you got it working smile
If you want to, you can mail it to me (frank [dot} hagstrom [at} gmail [dot} com) and I'll put it up for download on my server.


@iku: ok, I'll edit the first message to say so wink
Edit: I coulnd't edit it as the thread is locked(by my request, as it's outdated) ... but the link goes to my page, where it clearly is visible there's a newer version, so I dont' htink it should be a problem...

Dexus wrote:

Request for:
* Time of uploading of attachment (i.e. some later message was edited, attachment was deleted and re-uploaded.)

Nice one, never had thought of that, defenetly a good thing smile

Buzz wrote:

Has anyone been able to make the attachment mod work with sqlite? I get the following error message when I run the install_mod.php:

An error was encountered
File: /share/hdd/conf/opt/share/apache2/htdocs/forum/install_mod.php
Line: 40

PunBB reported: Unable to add table "attach_2_files" to database

Database reported: SQL logic error or missing database (Errno: 1)

Thanks in adavance for any help.

Hmm, no, totally untested.

Anyone with good knowledge how sqlite works, that want to give it a try?

no problems, always nice to be able to help smile

thanks flx smile

about plox issue, the $cur_post['id'] has gone missing, we're trying to figure out why ... so if it's a bug I'll defenetly post about it in the first post smile
Edit: with my viewtopic.php from the 'debug-zip' it seemed to work

Well, even if there is a problem with the attach dir, that doesn't explain that error, that error only comes from the database query that looks into the attach_2_files table ... can you enable debug and show queries (in common.php), and tell the output for that query? (you can also mail to frank [dot} hagstrom [at} gmail [dot} com if you don't want to show stuff in open wink)

pl0x wrote:

They are there ! ... I checked ...
Can U advise me anything ?

I'm trying...

In the documentation (chapter 2.1.1), there's info on what columns the attach_2_files database should have, do your table have all those columns?

pl0x wrote:

After updating got this when tried to open topics
" Unable to fetch if there were any attachments to the post. "

Checked veiwtopic and attachment folder - no result

Sounds like you might have got an error during mod_install.php, what tables do you have in the database (make sure the attach_2_files and attach_2_rules tables are there)


Smartmonkey wrote:

I rebooted the server and the attachment mod now works awesome..

big_smile good to hear it works now though smile

jerryg wrote:

I install the mod.   All appear to work fine, but the files are not writed in the HD, there are not any error.

Do you have a folder with a bunch of random letters and numbers in your attachment folder, if so, do that folder contain two files, an index.html and an .htaccess?
Also, make sure the php settings are correct, so it allows fileuploads. (and you probably need to restart Apache (or whatever your websoftware is) to get PHP to alter it's settings, as Smartmonkey noticed wink)

flx wrote:

is there a german lang file?

No, not yet, only English as of now. But if you translate it, I'd love to have it as my german isn't so good wink