|
|
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.
|
|
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|