Page 1 of 1

Dynamic filter and search with CGUserDirectory?

Posted: Wed Feb 04, 2015 2:49 pm
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!

Re: Dynamic filter and search with CGUserDirectory?

Posted: Wed Feb 04, 2015 2:59 pm
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.