Fork me on GitHub

EZComments Block suggestions?  Bottom

  • So I am pretty new to this whole PostNuke thing. I've written a pretty basic block for the EZComments module. It pulls the x number of newest comments and displays them in the block.

    You can choose whether you want to display the time, username, and if you want the username to link to the user's profile. All heavily inspired by the latest comments block, and the v4bJournal latest comments block.

    I don't really know much about how security works in crazy ol' postnuke, so if you are crazy about security maybe this isn't for you. Also it will display *all* comments in the table regardless if the user has permissions to that topic/category/poll whatever. I guess that is a feature request.

    The other wacky thing is for some reason the EZComments table doesn't show up when i do a pnDBGetTables(); so if your EZComments table isn't nuke_ezcomments and your users table isn't nuke_users then you may be out of luck.

    Basically I am looking for some thoughts, and suggestions. Especially if I committed a major no-no somewhere.

    Here is the link if you want to check it out.
    Thanks!
  • Thank you for your contribution. I will have a look at it how you have done things.

    May I include it in the EZComments distribution?


    Jörg
  • Hi jn - there is one for PagEd also if you are interested.
    Download URL http://canvas.anubix.net/modules.php?op=modload&name=Downloads&file=index&req=viewsdownload&sid=4
    Demo at the canvas site, bottom centre block.
  • Yeah dude, go ahead you can do what ever you want with it. Like I said though, I really just want to learn how to do it "correctly." As I just kind of hacked that together.
  • The reason that the tables aren't in the pntables array is because the information for that module has not been loaded. This happens automatically when you load an API for a module. You can also load the DB information with pnModDBInfoLoad('[modname]'). That may help you refine that code a bit.
  • Leason:

    Should I unload the DB info after I am done with it? The array is already pretty huge. What is standard operating procedure?
  • I don't think that is necessary since the array is naturally destroyed at the end of every server call. So when the server is done processing the page request that uses that array it gets recycled automatically. If you wanted to make sure of that through your code you could simply set your $pntables array to "" or use a function that does something equivalent, but I don't think it is needed.
  • It's not working on my site, the block doesn't show up at all... When you said that the table needs to be nuke_ezcomments, is that case sensitive? Mine's nuke_EZComments... If this is the problem, is there a way to fix it? If this isn't the problem, is there anything else that could be wrong?

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