You should, it gives you a warm fuzzy feeling inside
Well, yeah, I should...But I write all my own PHP software and thus have little experience with other peoples'. And since more and more people are starting to charge for their PHP-based products, it gets harder still to contribute to them. Shame, I guess.
Well if you contribute code that they later charge for (which is totally bogus; it's opensource software) you can demand royalties
I think you just gave me something to do for after I finish my own personal project. Contribute to a million other projects and wait a few years...Then have my three lines removed and replaced by something else.
I think you just gave me something to do for after I finish my own personal project. Contribute to a million other projects and wait a few years...Then have my three lines removed and replaced by something else.
Hmm...Just for information, would it be possible to do this:
Code:
function is_ingroup($groups,$member='') {
global $SDK;
return ($SDK->is_ingroup($groups, $member) or is_in2group($groups, $member)) ? true : false;
}
instead of this:
Code:
function is_ingroup($groups,$member='') {
global $SDK;
if ($SDK->is_ingroup($groups, $member) or is_in2group($groups, $member)) {
return true;
}
else {
return false;
}
}
It's exactly the same thing with less lines. I don't know if it's allowed in this language.
Yep, that would work. It's used for the vBulletin plugin system alot, and it prevents an extra function call. If you know the ELSE function will just return FALSE, then there is no need to have an overhead of calling the else function. Therefore there is a method, like in C (since PHP is based on C) for returning FALSE automatically if the IF condition is false without calling ELSE.
Even though the ELSE function (if you can call it that) is obviously embedded so that it is hideously fast when used, it's still more than the parser needs to know.
Knippy, does $SDK->get_advinfo($member) generate a query? If so, it's probably a better idea for the Invision guys to incorporate all usergroups into their is_ingroup() function rather than just the first, and query it all at once (I've not used Invision for around a year - presuming the primary and secondary usergroups are stored in the same table). Well done nevertheless.
Knippy, does $SDK->get_advinfo($member) generate a query? If so, it's probably a better idea for the Invision guys to incorporate all usergroups into their is_ingroup() function rather than just the first, and query it all at once (I've not used Invision for around a year - presuming the primary and secondary usergroups are stored in the same table). Well done nevertheless.
$SDK->get_advinfo is an object calling which pulls all of $member's attributes in the database. if the param is blank, it returns the info of the currently logged in user.
the SDK is developed by a different group than IPB is.
so basically get_advinfo returns stuff like
username
displayname
warn
posts
mgroup
mgroup_others [secondary groups are stored here]
I prefer to make a list of usergroups a member is part of (primary usergroup being the first in the list) and put it into CSV format in the database, so it uses one cell. Then call it and explode() it.
This site is part of the Defy Media Gaming network
The best serving of video game culture, since 2001. Whether you're looking for news, reviews, walkthroughs, or the biggest collection of PC gaming files on the planet, Game Front has you covered. We also make no illusions about gaming: it's supposed to be fun. Browse gaming galleries, humor lists, and honest, short-form reporting. Game on!