The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
List available pages for a user - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28) +--- Forum: Modifications and Hackery (https://userspice.com/forums/forumdisplay.php?fid=29) +--- Thread: List available pages for a user (/showthread.php?tid=1166) |
List available pages for a user - jtullett - 10-09-2018 This is a pretty ugly piece of hackery, so I'm hoping there's some sort of award. I had a request from a user for a page to list other pages he was authorized to use. So I came up with this: Code: if ($user->data()->id) { Each page title already has a project prefix, so basically I'm just asking for a list of pages with that title, and matching uid->permission. There's no sorting, which may or may not be a problem at some stage. I'm sure there's a much more elegant way, so suggestions are welcome! RE: List available pages for a user - mudmin - 10-09-2018 I love it. I think that's a great idea! |