Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: May 2002
Posts: 12
Newbie
Newbie
Offline
Joined: May 2002
Posts: 12
Hi,

We are running 6.2.3

Our requirements are --

(1) ALL forums shall be displayed to all but only be navigable based on 'groups'. Currently, if only GROUP A has permission to see forum A - no other group than A knows Forum A exists!!!

This is a bane. We have some 'donors only' forum, but unless one donates no one knows those forums exist! We want everyone to see them.

(2) We want the donor forum members to be able to upload more and upload different contents. Like, we want their upload size restricted to 2MB (as opposed to 100KB for general users) and we want donors to be able to upload small multimedia files, whereas general members can upload only JPEGs.

Any idea how these can be achieved.

Another concern - after upgrade to 6.2.3. the bandwidth usage has increased 2 fold! Any advice would be very welcome.

Thanks,
HB

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
The easiest way to do as you describe would be to create Teaser Forums so taht people know those hidden forums are there.
That's what I do to lure them in.

To change the filesize restrictions, you'd probably need to find the filesize variable in addpost.php and modify it from there... likewise with this list of allowed files. Using one set of variables if they are a member of a certain group.

You'd also have to adjust the same in the modify posts scripts, if people come back and edit their attachments.

As per bandwidth, is Zlib compression on? Maybe it was on and got switched off in the upgrade. Typically bandwidth is less if Zlib compression is on, as the pages sent are smaller.

Joined: May 2002
Posts: 12
Newbie
Newbie
Offline
Joined: May 2002
Posts: 12
-- No, the ZLIB compression is on. I just now double checked.

-- Hmm, the teaser forum idea is rocking cool. Will try to implement that tonight.

-- "To change the filesize restrictions, you'd probably need to find the filesize variable in addpost.php and modify it from there... likewise with this list of allowed files. Using one set of variables if they are a member of a certain group.

You'd also have to adjust the same in the modify posts scripts, if people come back and edit their attachments."

So basically, I would need to add an IF - ELSE loop to both the script. We basically want (say)

if forum # == 6
//will have 'special' attachment provisions - i.e.,
set Size = 2MB;
set type =general types + .ram + .wmv + .mpg + .avi;
end if;

Well, I am definitely not a PHP pro. Just tried to visualize it. Don't know how to code though

Thanks however,
hb



Joined: May 2002
Posts: 12
Newbie
Newbie
Offline
Joined: May 2002
Posts: 12
OK, so in my version 6.2.3 between 677 and 692 line # --

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


-- I will have to put another comparison with forum# 5 there, right?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
This is the untested theory......

It's probably best to give them different upload right based on them being a member of a particular group (your contributors).

First you'd need to look to find out what group number your contributors are in. For now, let's say group number 5.

Code
 <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 />// use different types of allowed files based on what group they are in <br />if (strstr($user['U_Groups'], '-5-')) { <br />   $checkfile = str_replace(",","|",$config['allowfilesspecial']); <br />} <br />else { <br />   $checkfile = str_replace(",","|",$config['allowfiles']); <br />} <br /> <br /> <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 />// Use different file sizes if they are members of a special group <br />if (strstr($user['U_Groups'], '-5-')) { <br />   $allowedsize = $config['filesizespecial']; <br />} <br />else { <br />   $allowedsize = $config['filesize']; <br />} <br /> <br /> <br />if ( ($HTTP_POST_FILES['userfile']['size'] > $allowedsize) ) { <br />$html -> not_right($ubbt_lang['FILE_TOO_BIG'],$Cat); <br />} <br />} <br />





Now you'd also have to edit your config file...at the very bottom there is a place for extra/unknown variables.

We'd need to add one for a list of files allowed for your special group... like this:

$config['allowfilesspecial'] = '.txt,.gif,.jpg,.png,.zip';

And one for the special files size limit:

$config['filesizespecial'] = '10000000';


I haven't tested.... but the theory is there.

To find out what group number belongs to your special group, run this SQL Query.

SELECT *
FROM w3t_Groups

Hope that helps.


Last edited by JoshPet; 04/14/2003 8:08 PM.
Sponsored Links
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Tip: strstr (or stristr when case-insensitivity is needed) is more efficient than preg_match, and is therefore preferable if you don't need regex pattern matching.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Thanks. So the line could be like this? :

if (strstr("/-5-/",$user['U_Groups'])) {


Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
if (strstr($user['U_Groups'], '-5-')) {

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Thanks.

Edited the above.

Joined: Oct 2001
Posts: 157
Member
Member
Offline
Joined: Oct 2001
Posts: 157
Thanks Joshpet...much appreciated.

However the first thing hotbabes wanted would be cool (I am a co-admin in his msgboard, btw). To display the postlist in a restricted forum to everybody, but not allow access to showflat or showthreaded only to a particular group. Otherwise, we need to double post on both the restricted forum as well as the teaser forum.


Yors Truly

Who? Me? Worry?
Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
That would be very cool. Something like that is on my list.

I think in the recent contest, I saw that the site about Bangkok did that. Maybe they will post their code. <nudge nudge>
But you could view the postlist page, but not click into them.


Joined: Oct 2001
Posts: 157
Member
Member
Offline
Joined: Oct 2001
Posts: 157
[]Something like that is on my list.[/]

ahemmm...hehehehe...any chance of ticking this item in your list soon (hate to badger you, but I guess everybody here does, so I am not th nly bad guy)


Yors Truly

Who? Me? Worry?

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
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
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 20221218)