|
Joined: Mar 2001
Posts: 644
Member
|
Member
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? 
|
|
|
|
Joined: Mar 2001
Posts: 644
Member
|
Member
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
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... <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... <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)
|
|
|
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.
|
|
Posts: 808
Joined: July 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|