minibb®
Fight the automated spam - protect your miniBB-forums,
getting the Captcha addon! Click here to read more.
Captcha Addon for miniBB
Community Forum
 | Forums | File Bank | Sign Up | Reply | Search | Statistics | Manual |
Bugs miniBB Community Forum / Bugs /

activity field may be not properly updated if it's called not like by default

 
Anonymous
Guest
#1 | Posted: 16 Jan 2008 11:25
Reply 
bb_func_usernfo.php

line 17,

update fails if the value of $dbUserAct (setup_options.php) is not 'activity'
tom322
Forums Member
#2 | Posted: 16 Jan 2008 18:37
Reply 
Why would you want to change that in the first place? :}
Paul
CEO
#3 | Posted: 17 Jan 2008 04:01 | Edited by: Paul
Reply 
Why would you want to change that in the first place?

- I think it is because he uses external users table where this field may be called differently...

Ok I agree such bug exists and for fixing it you will need to put:

$$dbUserAct=$_GET['activity'];
updateArray(array($dbUserAct),$Tu,$dbUserId,$user);


Will be fixed in the next miniBB release.

Thanks!
Anonymous
Guest
#4 | Posted: 17 Jan 2008 05:52
Reply 
Same thing on line 76: (bb_func_usernfo.php)

call_user_func('parseUserInfo_'.$ix,$row[$i])

$ix has value of user defined field. The functions above line 76 are defined by the keys of $dbUserSheme.
Paul
CEO
#5 | Posted: 17 Jan 2008 08:38
Reply 
Regarding your last post: that's absolutely right because we can't create the function which in its name uses the dynamic variable.

You would need to redefine such function yourself in bb_plugins.php, for example

if($action=='userinfo'){
function parseUserInfo_customActivityField($val){
/* code here */
}
}

However I am in doubt why would you need the function for activity field? It's displayed only for admin/moderator and there can't be anything custom to display.

For other fields follow my advice.
Anonymous
Guest
#6 | Posted: 17 Jan 2008 09:29
Reply 
I was wondering why you do not use the keys of $dbUserSheme instead of the user defined values to create the function names.

Anyway, I will refine the functions,
Thanks.
Paul
CEO
#7 | Posted: 17 Jan 2008 10:28
Reply 
If you know the way how the function can be defined using a dynamic variable in it's name, I would be happy to know ;-)
Anonymous
Guest
#8 | Posted: 17 Jan 2008 11:36
Reply 
I ment the function name you define in the

call_user_func('parseUserInfo_'.$ix,$row[$i])

part.

If you use the key of $dbUserSheme instead of $ix, you don't need to redefine the function itself.
But maybe I'm missing something here.

I added the redefined function to bb_plugins and all works well!
Thanks again
Paul
CEO
#9 | Posted: 17 Jan 2008 12:30 | Edited by: Paul
Reply 
I think if it works with re-defining, it's good :-) I don't remember already why I have programmed it that way (with the value of $dbUserSheme not the key), but probably there was some reason which I am not supposed to remember ;-)

[and usually if I can't remember the reason it flows up in the future bringing new bug, so let's leave it for a while... it anyway should work in all aspects and is universal approach like now]
tom322
Forums Member
#10 | Posted: 18 Jan 2008 22:48
Reply 
usually if I can't remember the reason it flows up in the future bringing new bug

I find this statement true almost every day so I learned not to change too much if not needed ;).
 
Your reply
Bold Style  Italic Style  Image Link  URL Link 


» Username  » Password 
You are welcome to post anonymously by entering a nickname with no password (if that nickname has not been taken by another member) or by leaving both fields empty. If you have a forums membership account, you can also sign in from this page without posting a message, or sign in and post at once.

Before posting, be sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.

 
Online now: Guests - 32
Members - 0
Most users ever online: 191 [24 Dec 2007 14:33]
Guests - 191 / Members - 0

Forums are powered by miniBB®