Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Now I swear I've seen this before, but all my searching didn't bring up what I was looking for...

Is there a mod to allow uploads/attachment on a forum by forum basis?

I would like to allow my members to be able to attach/upload some items to my site, but only in a single forum, not all...

Am I just too tired and not searching right? Or has this not been done yet?

Sponsored Links
Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Ok, so the answer is a no...

Is this possible to be done? Anyone interested?

Not sure if I'm up to attempting this one. hehe

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Zackary - don't have alot of time to look at this, but basically in addpost.php you're looking for this:


if(($config['files']) && ($Reged == "y")) {
$attachfile = "<br /><br />{$ubbt_lang['YES_FILE2']}";
$fileinput ="<input type="file" name="userfile" accept="*" class="formboxes" size="60" />";
}



Above it add -

if ($Board == "keyword") {



and below it add:


}


That'll remove the box if they aren't in the board(s) that you want.

Hope that gets you going in the right direction.

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Hmm interesting Josh. Thanks.

Perhaps I can turn this into a control panel hack. Would be handy to choose on a per forum basis.

And now that you've shown this to me, I think it wouldn't be too bad.

Gonna go play with it.

Joined: Jul 2001
Posts: 1,157
Likes: 82
coffee and code
coffee and code
Joined: Jul 2001
Posts: 1,157
Likes: 82
In 6.23, To allow Admins to to attach any NON-HARMFULL file type of ANY SIZE...

In addpost.php

Replace...
Code
<br />// --------------------------------------<br />// Let's see if we want this type of file<br />   if (isset($HTTP_POST_FILES['userfile'])) {<br />      if ( ($HTTP_POST_FILES['userfile']['name'] != "none") && ($HTTP_POST_FILES['userfile']['name']) ){<br />         if (preg_match("/\.(php|php3|php4|cgi|pl|exe|bat|reg)$/i",$HTTP_POST_FILES['userfile']['name'])) {<br />	         $html -> not_right("{$ubbt_lang['FILESALLOWED']}: {$config['allowfiles']}",$Cat);<br />         }<br />         $checkfile = str_replace(",","|",$config['allowfiles']);<br />         if (!preg_match("/($checkfile)$/i",$HTTP_POST_FILES['userfile']['name'])) {<br />            $html -> not_right("{$ubbt_lang['FILESALLOWED']}: {$config['allowfiles']}",$Cat);<br />         }<br />      }<br />      if ( ($HTTP_POST_FILES['userfile']['size'] > $config['filesize']) ) {<br />         $html -> not_right($ubbt_lang['FILE_TOO_BIG'],$Cat);<br />      }<br />   }<br />


With...
Code
<br />// --------------------------------------<br />// Let's see if we want this type of file<br />   if (isset($HTTP_POST_FILES['userfile'])) {<br />      if ( ($HTTP_POST_FILES['userfile']['name'] != "none") && ($HTTP_POST_FILES['userfile']['name']) ){<br />         if (preg_match("/\.(php|php3|php4|cgi|pl|exe|bat|reg)$/i",$HTTP_POST_FILES['userfile']['name'])) {<br />	         $html -> not_right("{$ubbt_lang['FILESALLOWED']}: {$config['allowfiles']}",$Cat);<br />         }<br /><br />   if ($user['U_Status'] != "Administrator") {<br />         $checkfile = str_replace(",","|",$config['allowfiles']);<br />         if (!preg_match("/($checkfile)$/i",$HTTP_POST_FILES['userfile']['name'])) {<br />            $html -> not_right("{$ubbt_lang['FILESALLOWED']}: {$config['allowfiles']}",$Cat);<br />         }<br />   }<br />      }<br />   if ($user['U_Status'] != "Administrator") {<br />      if ( ($HTTP_POST_FILES['userfile']['size'] > $config['filesize']) ) {<br />         $html -> not_right($ubbt_lang['FILE_TOO_BIG'],$Cat);<br />      }<br />   }<br />   }<br />



you can get creative and switch around U_status tags for board tags and Administrator for name of board (its a little more tricky than just this, but atleast now you get the general idea of how it could be done)


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Sponsored Links

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
Posts: 70
Joined: January 2007
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)