Fork me on GitHub

Multiple tables and hooks?  Bottom

Go to page [-1] 1 - 2:

  • Gotta agree with you there, jbirchett. Hooks in general are way cool, but they could be even more useful as you describe.

    I guess that, knowing this limitation, we could work on designing modules based around the fact. Split my project module into three different kinds of modules would help, because then I could have "people," "organizations," and "projects." But since it's already put together, this would involve a lot of work that probably wouldn't pay off enough to justify it.
  • Same here. My module has guilds, guild halls, and matches, and I want users to be able to comment on all three object types. Writing three modules to maintain this data would be extreme overkill. It seems to me that this is a popular request, but since it's a core function, the only immediate workaround is the unique id solution, which I don't even want to look at. I'd rather restrict comments to matches only until the hooks module can be improved.
  • I'm trying to do something similar with Pagesetter and EZComments. I want comments for specific publications within publication types i.e. tid_pid but all I'm seeing in the DB is tid_ e.g. 2_

    Can someone point me to where I need to make any modifications to make it work? Is it in Pagesetter or EZComments?
  • Code

    <!--[pnmodurl modname=db type=artist func=display id=$id display=comments assign=returnurl]-->
    <!--[ pnmodcallhooks hookobject=item hookaction=display hookid=ar-$id module=db returnurl=$returnurl implode=false]-->
    <!--[ $hooks.EZComments ]-->



    all u need is a prefix for the id to get unique comments. for example in a module i made, artists are "ar-$id
    ", albums are "al-$id" etc etc.



    edited by: cannibus, Mar 05, 2007 - 08:39 PM
  • FYI - I ended up doing the same thing in my module. Any time I call hooks, I prefix an "object type" string before the objectid. It works fine. The hook doesn't get the real object ID, but as long as you call hooks this way all the time, you're safe. In the DB, the objects are still auto incrementing integers, but hooks sees matches as m#, guild halls as gh#, etc.

Go to page [-1] 1 - 2:

This list is based on users active over the last 60 minutes.