Topic: level of useage

okej, installed punbb and all works very well, at one level

say that i have three Categories

1: Intern
2: intern2
3: everyone

well you get the point

now i would like to make some users to be able to read all 3, some users to read 2 and 3 and some users to read only 3

well, number 3 is regular useres but how can i make the other 2 Categories to work the way i want, this is pretty importent for me to contiue use the forum, and i dont wanna use the moderator choice cause this aint what om looking for
i dont want to have 500 moderators in my forums

Im Jacks Broken Heart

2 (edited by Netfeed 2004-04-15 14:56)

Re: level of useage

okey, found this: http://punbb.org/forums/viewtopic.php?id=3537
the onlye problem is that im using PostgreSql and wonder how shall the table be altred then?

i wonder because i get this error:

File: /home/sexet/html/new/forum/install_mod.php
Line: 30

PunBB reported: Unable to alter table structure
Database reported: ERROR: parser: parse error at or near "," at character 64 (Errno: -1)

Im Jacks Broken Heart

Re: level of useage

Try replacing that row with these two:

$db->query('ALTER TABLE '.$db->prefix.'forums ADD locked SMALLINT NOT NULL DEFAULT 0') or error('Unable to alter table structure', __FILE__, __LINE__, $db->error());
$db->query('ALTER TABLE '.$db->prefix.'forums ADD locked_users TEXT') or error('Unable to alter table structure', __FILE__, __LINE__, $db->error());

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: level of useage

File: /home/sexet/html/new/forum/install_mod.php
Line: 29

PunBB reported: Unable to alter table structure
Database reported: ERROR: Adding columns with defaults is not implemented. Add the column, then use ALTER TABLE SET DEFAULT. (Errno: -1)

Im Jacks Broken Heart

Re: level of useage

it would be really nice if someone could help me with this...

Im Jacks Broken Heart

Re: level of useage

Ok, try these three rows instead:

$db->query('ALTER TABLE '.$db->prefix.'forums ADD locked SMALLINT NOT NULL') or error('Unable to alter table structure', __FILE__, __LINE__, $db->error());
$db->query('ALTER TABLE '.$db->prefix.'forums ALTER COLUMN locked SET DEFAULT 0') or error('Unable to alter table structure', __FILE__, __LINE__, $db->error());
$db->query('ALTER TABLE '.$db->prefix.'forums ADD locked_users TEXT') or error('Unable to alter table structure', __FILE__, __LINE__, $db->error());

"Programming is like sex: one mistake and you have to support it for the rest of your life."

7 (edited by Netfeed 2004-04-16 22:31)

Re: level of useage

that didnt work, but this seems to make it

$db->query('ALTER TABLE '.$db->prefix.'forums ADD locked SMALLINT') or error('Unable to alter table structure', __FILE__, __LINE__, $db->error());
$db->query('ALTER TABLE '.$db->prefix.'forums ALTER COLUMN locked SET DEFAULT 0') or error('Unable to alter table structure', __FILE__, __LINE__, $db->error());
$db->query('ALTER TABLE '.$db->prefix.'forums ADD locked_users TEXT') or error('Unable to alter table structure', __FILE__, __LINE__, $db->error());

Im Jacks Broken Heart

Re: level of useage

that worked splendid, thank you

Im Jacks Broken Heart

Re: level of useage

So, you got an error when trying to add a new column when specifying NOT NULL?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: level of useage

yes precisly
it said something like that you couldnt set null to it
but it was solved when i get rid of it and its seems to works as it shall now

Im Jacks Broken Heart

Re: level of useage

Ok, cool. Jansson, could you perhaps update the mod with the above SQL statements for PostgreSQL?

"Programming is like sex: one mistake and you have to support it for the rest of your life."