oh my! I have no idea how common.php got into my release archive. Removed it. I'm really sorry if it caused problems.

Now, on that "can't upload" error. The problem is that for me it doesn't cause any problems. Script works ok both on localhost and web site (here is example), so it is hard for me to catch possible bug. Perhaps it is something with server/php configuration... not sure. The error itself happens when executing following code (line 168)

@copy($file, './uploaded/'.$file_name) or error('Could not copy file to server', __FILE__, __LINE__, $db->error());

I can't say what's wrong with it yet, it just was copied from punUpload module as is and for me caused no errors. I will look more colsely on copy command tomorrow... too sleepy now.

P.S. does anyone else has this "can't upload" error?

ooops... fixed it. Thanks Smartys smile

Smartys wrote:

Yup, I got that too: and I couldn't upload (but that's unrelated) smile

Change
<?php echo $lang_uploads['Uploader']; ?>
to
<?php echo 'Uploader'; ?>

Heh, yeah that will work, but no multilanguage support then tongue

One more thing. Upload.php requires /include/common.php file where you can find

if (!defined('PUN_ROOT'))
    exit('The constant PUN_ROOT must be defined and point to a valid PunBB installation root directory.');

So you have to define PUN_ROOT constant. This can be done either in common.php file (so you won't need to define it again for other modules) or in uploads.php before you include common.php

Edit:

To close matter with PUN_UPLOAD constant i just added to uploads.php

if (!defined('PUN_ROOT')) define('PUN_ROOT','./');

Updated archive.

erissiva wrote:

Loiso - That's not what's wrong...
I have the same problem. It has to do with the way that variables are being called.

I've gotten the page to load with the following code.
What I did was replace "$pun_root" with "PUN_ROOT", and "$language" with "$pun_user['language']".
Past that, I don't know what else to change.
Paste this as the "uploads.php" file. It should work...


Also, it won't let me upload. It keeps saying that I need to select something to upload, even when I have...

Yep, you are right. There were couple variables which i forgot to port from punUpload. I fixed $pun_user['language'], but left $pun_root as is. For some reason on my local windows machine PUN_ROOT definition doesn't works, however using $pun_root on linux web server seems ok, just tested it.

About  "No file selected". For me it works fine, however the way variables were passed wasn't "clean". I added some code in uploads.php, hope it will work for you.

Also there was a little bug in lang file for UploadMoD. That's why ppl were getting that undefined index message (uploads.php on line 45).

I re-uploaded fixed release, please download it again. Hope this time it will work smooth smile

Ultime, snapsolutions: thank you smile



Ataxy wrote:

what is there to change to make it work with 1.2.2 since its made for 1.2.1
ok found it just mod the installer script to accept v1.2.2

UploadMoD should work on any 1.2.x punnBB version. Mod doesn't affects code it just adds several files, same thing with db - it need 2 tables to be created. So, it won't work with new punbb versions only if data structure will be changed (i.e. new variable names, or certain data will be stored in other db table etc.). However i tested it only on 1.2.1 yet smile

Ataxy wrote:

ok i got it iinstalled but now how do one upload when you do your post there is no attachement option or anything
basicly where should i find that user section

www.yoursite.com/pun_folder/uploads.php

Also you can add link to uploader in nav menu. Go Administration/options. Find there "Additional menu items" and use something like

5 = <a href="uploads.php">Uploads</a>
Smartmonkey wrote:

hrm..

The constant PUN_ROOT must be defined and point to a valid PunBB installation root directory.

$pun_root is defined as

$pun_root = './';

and it is in the root..


I get this when i launch uploads.php.. ? anyone know what im doing wrong?

Hmm... the only thing comes in mind is that $pun_root points on wrong folder. This means you uploaded files in wrong folder. In archive you will find folder named upload. You should upload uploads.php, /lang, /plugins. Not upload folder itself.

##        Mod title:  UploadMoD
##
##      Mod version:  1.0
##   Works on PunBB:  1.2.1
##     Release date:  2005-02-23
##           Author:  Yevgen Zinchenko aka Loiso (loiso@ukrtop.com)
##
##      Description:  Mod allows to site users upload their files to the
##                    site. Also Mod has simple permission system for upload 
##                    managing. AM plugin is included in this release to  
##                    set permissions for usergroups.
##
##   Affected files:  none
##
##       Affects DB:  Yes
##
##            Notes:  This mod was originally based on punUpload 1.1.1 by 
##                    ultime (Pierre-Luc Lacroix - ultime@omgultime.com).  
##                                         
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

Download here

Sorry, there is no demo for this module so far. However, here is some screenshots:

User section:

http://www.utopia-ru.net/pun/user.gif

Administration:

http://www.utopia-ru.net/pun/admin1.gif

http://www.utopia-ru.net/pun/admin2.gif

hcblue wrote:
boneheade wrote:
TheBaker wrote:

It's all working fine, but when I edit a post without a poll, I get these errors:

Notice: Undefined index: question in /xxxxx/include/punpoll/edit_save.php on line 6

Notice: Undefined index: answers in /xxxxx/include/punpoll/edit_save.php on line 9

It doesn't stop anything working, it's just annoying. Any ideas how I could stop them from appearing?

I get the same errors yet everything works fine. I just put an @ in the edit.php to stop seeing the errors. Like so: @require PUN_ROOT.'include/punpoll/edit_form.php';

I was getting similar error in other script. Should be because some assosiative array have no values. This can be fixed with something like

 if (!isset($_POST['question']]))  $_POST['question']='';

should work...

Well, atm i'm reworking code of PunUpload mod. New version will also be extended with basic permissions system. Should be ready within next few days, need add a bit of code in mod itself and write an admin plugin to edit upload settings.

Thanks, Gizzmo! Very very nice mod smile

And i let myself to create .pun installation file for PunMod 0.9.5b2. It makes needed changes to punBB source and db, but you have upload contents of mod archive manually. You can get .pun file here

11

(1 replies, posted in PunBB 1.2 discussion)

I searched around and didn't find much info about PunBB plugins system. Is there documantaion other than example plugin and some short notes in documantation/Developer info?

Does it works only for Admins/Moders or plugins may be used to change general PunBB functionality?