RE: dynamicdata getitems function
[email protected] (mikespub) Mon, 08 Sep 2003 18:30:16 GMT
| Newsgroups | gmane.comp.cms.xaraya.knowledge-base |
|---|---|
| Organization | not much |
| Message-ID | <[email protected]> |
In article <mailman.255.1063044028.9998.xaraya_knowledge-base-n5IRV0TL0hwRxVAL8JNkPw@public.gmane.org>, Xaraya Knowledge Base <[email protected]> wrote: >Not a problem. In reality I have been trying to duplicate the functionality >of the top items and featured items block from the articles in the >dyn_example module when I noticed that calls to this function were not >working when the hook field was added. Blocks seemed to be the only thing >lacking in this module and I wanted to prove to myself that dynamicdata >could do everything the articles module could do. I was successful in >duplicating the simple block from the "example" module and merging the >functionality and BL(xarTplBlock) like the article's blocks. For the most >part everything has gone fine until the getitems function wouldn't perform >by returning the "counter" field as part of the array. Everything else works >though. I need to get those pesky hook fields though. Any suggestions? > >Paul > I'm afraid that hook integration is one thing where articles still beats DD, mainly because I cheated to get it working there. :-) For DD, I was hoping to use a more generic approach, so that you could retrieve the hitcount, ratings, number of comments etc. related to a particular item - still based on the enabled hooks for that item, but without needing to "hard-code" the look-ups in hooked tables like I did for articles. The hooked property types were one experiment in that direction, but didn't provide what I wanted. Next step would be to use an articles-like approach, but better... And I'm still stuck on the "better" part there, because in some cases you can do a join and retrieve 1 or 2 values, in another case you need to count items, and in still another you actually need a separate SQL statement to get what you want. Plus it should all fit in with the concept of relations within an object and between objects as well, so if you have any ideas on how to tackle that, let me know :-) So for your block experiment, you *could* use the respective getitems() APIs of hitcount and ratings, and the get_countlist() API for comments, etc. after retrieving the items from DD. Or work the other way around and call the respective topitems() APIs first and then retrieve those items from DD. But that would be cheating just as much... :-) Mike. P.S.: I'm glad to see that I'm not the only one who sees the potential of replacing the whole articles code with generic DD stuff - it's my secret dream for DD too (at least one of them) :-)