Function to retrieve the forums a user can access
This is something I once wrote for someone (think it was merk?), and kept it in a file, and finally got around to clean it up and wrap it in a function.
Very useful for some hacks, hope this helps at least some of you. Here is the full function, along with some basic instructions: PHP Code:
|
Great function, very usefull indeed. Thanks.
|
Wow...very useful I agree. Thank you!
|
I should mention that the function only issues 3 queries, one of which VERY fast. :)
|
I seem to be having some problems with this.
I've added the entire function to functions.php. I added it as the second-to-last function, above doshutdown. I tried to use the function from global.php (the forums, not the admin). Right above the part of global.php that parses the css (headinclude), header, and footer. I've tried $jjr512=get_allowed_forums();. I've tried $jjr512=get_allowed_forums('canview',-1,',');. I've tried a lot of things. But whenever I try to use the function, I get this error: "Warning: Bad arguments to implode() in /home/jjr512/public_html/testvb/admin/functions.php on line 2289" Now as I have it in my functions.php, Line 2289 is: Code:
SELECT forumid, '.iif(is_array($checkfor), implode(', ', $checkfor), $checkfor)." |
Try the new version.
|
great, thank you!
|
This is a great function, and i'm using it right now for some custom statistics.
Thing is though, Guests and normal members and stuff get permissions returned that they don't have "canview" permissions to. Any thoughts? |
I think what is happening, is if a forum is using permissions from it's parent forum, then it doesn't get taken into account.
If you know what I mean? |
very usefull, as lesane said before. thanks for posting it.
|
All times are GMT. The time now is 02:41 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|