Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: May 2002
Posts: 41
User
User
Offline
Joined: May 2002
Posts: 41
Mod Name / Version: Per-Forum Attachments - Version 1.0

Description: A modification that allows admins the option of allowing file attachments on posts in specific forums only.

Working Under: UBB.Threads 6.3-6.4

Mod Status: Finished

Any pre-requisites: None

Author(s): Sheallaidh

Date: 05/11/04

Credits: Me and a half a pack of Embassy Number 1

Files Altered:
./ubbthreads/addpost.php
./ubbthreads/modifypost.php
./ubbthreads/newpost.php
./ubbthreads/newreply.php
./ubbthreads/admin/createboard.php
./ubbthreads/admin/docreate.php
./ubbthreads/admin/viewboard.php
./ubbthreads/admin/doeditboard.php
./ubbthreads/languages/english/default/admin/createboard.php
./ubbthreads/languages/english/default/admin/Viewboard.php

New Files: None.

Database Altered: w3t_Boards (column added)

Info/Instructions:
1. Follow the modification instructions attached.
2. Go to your admin area and choose edit config settings.
3. Turn on file attachments by specifying a writeable folder, and the URL.
4. Set the maximum allowed size of attachments.
5. Set what file types to allow.
6. Click the update config.inc.php button.
7. Using the edit forum tool, allow file attachments to any or all forums.

NOTE: Allowing file attachments is set to OFF by default on any existing forums.

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
Attachments
113052-attachment forum choice.txt (0 Bytes, 41 downloads)

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Don't have time to test this right now, but thanks, looks like a good modification


- Allen wavey
- What Drives You?
Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
Great idea thanks for the mod.. I can't get to testing this one for awhile either.

Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
Great mod!

Would it be possible for the different forums to use separate file catalogs?

What I mean is this:

I would like some forums to have theis own catalogs for attachements. These should only be accesseble by users who have access to the certain forum, and not open to everyone, like the default catalog.

Would be cool to have when I later on will by the PayPal-mod.

Joined: May 2002
Posts: 41
User
User
Offline
Joined: May 2002
Posts: 41
Yes, but I as it is outwith the scope of what I want to do with the website I am working on at the moment, I wont be create the modifcation.

Perhaps you could ask someone for hire?

Sponsored Links
Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
Wondering if it would be a simple add in or edit to this mod to only allow certain groups to post the attachments, on any given forum?

To basicly only allow groups 5 to 8 the permission to post attachments for instance? (Didnt see a mod like this when searching, hope i didnt miss it)

Looks like the first edit mentions group 4... would it just be adding the other groups to that (and taking the 4 out?) what would be the code exactly? (Im real green at programming)


Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
This section in adduser.php seems to be where it decides permissions to post attachments? Yes? No?

// -------------------------------------------------------------------------
// If we are allowing file attachments and we are dealing with a Mozilla 4+
// browser then we let them attach files. Also we need to make sure they
// are not posting as Anon.
if( ($Attach == "On") && ($Reged == "y")) {
$attachfile = "<br /><br />{$ubbt_lang['YES_FILE2']}";
$fileinput ="<input type="file" name="userfile" accept="*" class="formboxes" size="60" />";
}


This line:
if( ($Attach == "On") && ($Reged == "y"))


Im not sure how to do it, but adding more arguements to it will do it right?

Like if it said "if attach is on, and reged is yes, AND group is 5 OR 6 OR 7 OR 8" then it is allowed???

Can someone who knows php more than me make/modify that line of code so I can try it?

Will it work the way I think it will, only allowing users in those groups to post attachments?

It looks like the same if/then line I am asking for help on might need to be added/edited to other parts of this mod too, whereever it says the if reg'd and attach=on?

This would be great for you guys out there like myself who run donation/supporter software for supporting members.

Deej

Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
I made this real easy for what I wanted.

Since i was allowing attachments to any forums, I only needed to change who was allowed to.. I only wanted certain groups to have the ability to upload...

SO I only changed the strings which checked the user, in the post modifying scripts, and it now locks out any user who isnt in my supporting groups, from adding attachments.

Deej

Last edited by Deejay; 06/02/2004 10:40 PM.
Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
Deej is this the one you just posted or additional steps? 6.4.2

Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
I just modified this mod... Only had to modify the scripts that add or modify posts. (addpost, modifypost etc)

Just changed the lines in the scripts that figure out what users are allowed to post attachments. I added in the groups I wanted, and took out the ones I didnt.

This mod the way its posted is a lot more in depth than what I just did... This mod is made to restrict them per forum... and also there is selections available through the admin panel. What I did stripped out all that stuff.

Deej

Sponsored Links
Joined: May 2002
Posts: 41
User
User
Offline
Joined: May 2002
Posts: 41
I am glad SOMEONE actually used it

It's the first real "hack" that I've not been able to find anywhere online, and had to resort to writing myself.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)