Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Acmlmboard support?.
Acmlm's Board - I2 Archive - Acmlmboard support? - Run into a problem (Help needed) | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
Xeolord

- B l u e s -
Power Metal > All
Level: 81

Posts: 1733/3418
EXP: 4884196
For next: 108653

Since: 03-15-04
From: Yeah

Since last post: 15 hours
Last activity: 15 hours
Posted on 05-10-05 09:03 PM Link | Quote
Well I recently edited my profile.php page and basically inserted "User Comments". (Assuming you've heard of them on other boards or something) and yadda yadda ...

It's all working fine, but I decided maybe everyone doesn't want to have people commenting on them in their profile? So, I've attempted making it optional to turn off and on.

I created a variable, and this quite possibly may be the thing that's not right:
usercomm, tinyint 1, not null, default 1
0 = off
1 = on

The problem is, once this option is turned off by any user, it's turned off globally for everyone on the board. Thus, Comments are not shown for anyone. (They get "This user has disabled user comments" obviously, since I made it say that. Check my board if you need to actually see it or something)

I didn't exactly want it to go that way.
I just wanted the option, to turn layouts off for that person alone.

So, in profile.php here is what I have basically:
[What I have added]

if ($loguser[usercomm]==0) $ucom=0;
if ($loguser[usercomm]==1) $ucom=1;
if ($ucom==1) {
[insert all the basic code here]
}
if ($ucom==0) {
$addcomment = "This user has disabled user comments.";
}

That's basically all I've added at attempting to do this.

If needed, the $addcomment variable appears towards the end of the User comments code in:

if ($logpwenc and $loguser[powerlevel]>=0)
$addcomment = "

<input type=hidden name=action value=addcomment>$inpt=usercom SIZE=60> &nbsp; <input type=submit value='Add Comment'></form>";<br> else $addcomment = "You must be logged in to add a comment for this user";

If that means anything, or something.

Well, hopefully someone can tell me what the problem is. My guess, is the variable itself might just need to simply be changed to something else. But, my php / MySQL knowledge is pretty low, so who knows ...



(edited by Darth Xeodious on 05-10-05 04:05 AM)
(edited by Darth Xeodious on 05-10-05 04:06 AM)
(edited by Darth Xeodious on 05-10-05 04:07 AM)
Narf
Hi Tuvai!
(reregistering while banned)
Level: 16

Posts: 69/100
EXP: 17634
For next: 2622

Since: 12-26-04

Since last post: 22 hours
Last activity: 14 hours
Posted on 05-10-05 10:36 PM Link | Quote
What MySQL query are you using to update the field which determines a user has it turned on/off? Most likely you're forgetting to include a 'WHERE clause' in the query.

IE

UPDATE users SET iwantcomments=1
sets 'iwantcomments' to 1 for everyone

UPDATE users SET iwantcomments=1 WHERE i$id
sets 'iwantcomments' to 1 just for the user which has ID $id.
Xeolord

- B l u e s -
Power Metal > All
Level: 81

Posts: 1745/3418
EXP: 4884196
For next: 108653

Since: 03-15-04
From: Yeah

Since last post: 15 hours
Last activity: 15 hours
Posted on 05-10-05 10:45 PM Link | Quote
Hmm, that's probably right then.

What I have in editprofile.php is pretty simple:
$checked8[$loguser[usercomm]]='checked=1';

$usercom="
$radio=usercomm value=0 $checked8[0]> Disabled   
$radio=usercomm value=1 $checked8[1]> Enabled";

Then in the main update field with all the user stuff, and I have usercomm=$usercomm in that.

So, I should probably just put a WHERE clause after that?
tuna
...
Level: 3

Posts: 315/2
EXP: 51
For next: 77

Since: 12-02-04

Since last post: 1 day
Last activity: 1 day
Posted on 05-10-05 11:30 PM Link | Quote
Originally posted by Darth Xeodious
if ($loguser[usercomm]==0) $ucom=0;
if ($loguser[usercomm]==1) $ucom=1;
if ($ucom==1) {
[insert all the basic code here]
}
if ($ucom==0) {
$addcomment = "This user has disabled user comments.";
}

No, no, that's wrong (and so is the "INSERT WHERE CLAUSE HERE" thing, it's perfectly fine as-is)

However, your first fatal error is right here -- loguser stores the logged in user's variables, not that certain profile's variables. Chances are not that it's off for everyone, but for just you.

You need to change it to whatever variable contains the user's variable for that.
Xeolord

- B l u e s -
Power Metal > All
Level: 81

Posts: 1746/3418
EXP: 4884196
For next: 108653

Since: 03-15-04
From: Yeah

Since last post: 15 hours
Last activity: 15 hours
Posted on 05-11-05 12:03 AM Link | Quote
Originally posted by Alexa
Originally posted by Darth Xeodious
if ($loguser[usercomm]==0) $ucom=0;
if ($loguser[usercomm]==1) $ucom=1;
if ($ucom==1) {
[insert all the basic code here]
}
if ($ucom==0) {
$addcomment = "This user has disabled user comments.";
}

No, no, that's wrong (and so is the "INSERT WHERE CLAUSE HERE" thing, it's perfectly fine as-is)

However, your first fatal error is right here -- loguser stores the logged in user's variables, not that certain profile's variables. Chances are not that it's off for everyone, but for just you.

You need to change it to whatever variable contains the user's variable for that.


Well I did suspect it was only affecting me, but then I was logged out it was still turned off for everyone. Maybe cookies?

Regardless, Xk you were right. Changed $loguser to $user, and it now works perfectly fine.

Thanks guys, the help is appreciated.


(edited by Darth Xeodious on 05-10-05 07:05 AM)
DarkSlaya
POOOOOOOOOOOORN!
Level: 88

Posts: 3647/4249
EXP: 6409254
For next: 241410

Since: 05-16-04
From: Montreal, Quebec, Canada

Since last post: 8 hours
Last activity: 5 hours
Posted on 05-11-05 12:46 AM Link | Quote
I am an idiot. Yay.

I never even thought about $loguser while messing around.

Gotta hate using wrong variables
Xkeeper
The required libraries have not been defined.
Level: NAN

Posts: -1812/-863
EXP: NAN
For next: 0

Since: 03-15-04

Since last post: 2 hours
Last activity: -753366 sec.
Posted on 05-15-05 02:17 PM Link | Quote
Originally posted by Darth Xeodious
Well I did suspect it was only affecting me, but then I was logged out it was still turned off for everyone. Maybe cookies?

Regardless, Xk you were right. Changed $loguser to $user, and it now works perfectly fine.

Thanks guys, the help is appreciated.
Of course it'll be off when logged out. Since $loguser doesn't exist, any value you request will return 0, and since 0 is "off", it'll make it appear it was disabled for everyone.

Had you logged in as another user that had them on, you would've found them to be all enabled.
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Acmlmboard support? - Run into a problem (Help needed) | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.017 seconds.