Dynamic filter and search with CGUserDirectory?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
stefhoesli
Forum Members
Forum Members
Posts: 56
Joined: Mon Sep 19, 2011 1:06 pm
Location: Zurich, Switzerland

Dynamic filter and search with CGUserDirectory?

Post by stefhoesli »

I would like to get your opinion on the following: I want to implement "dynamic" filter/search/sort options for a CGUserDirectory listing. E.g. a drop down, with different sort options. I thought about doing the filtering/searching/sorting with JQuery client-side. Accordingly I first would have to get the user data myself out of the DB. I found this page that explains how to do DB queries in CMSMS: http://www.denisvlasov.net/157/database ... de-simple/

So I would actually not use the CGUserDirectory functions.

Does this make sense to you? Is there a better way? Is there a module that facilitates access to the DB, instead of working with $gCms? Could this be achieved with CGUserDirectory directly?

Any input welcome!
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1967
Joined: Mon Jan 29, 2007 4:47 pm

Re: Dynamic filter and search with CGUserDirectory?

Post by Jo Morg »

a) If you remove the global $gCms; and replace it with $gCms = cmsms(); that bit of code should work fine or even just ditch it and use $db = cmsms()->GetDb(); instead of $db =& $gCms->GetDB();...

b) Usually CG modules have a sort of API that can be used, however the documentation for it it's mostly the code itself;

I, personally, would check if I could get somewhere with b before going the a route... but that is me.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Post Reply

Return to “Modules/Add-Ons”