Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Custom module, hooks and EZComments
  • Posted: 16.01.2006, 17:23
     
    Hunkpapa
    rank:
    Freshman Freshman
    registered:
     January 2006
    Status:
    offline
    last visit:
    30.03.06
    Posts:
    18
    Hey folks

    I am going to develop a custom module and I want to have comments on several pages. I have a few questions which I were not able to find any information about by searching..

    1. Can someone point me to some docs to help me write my module to support hooks?

    2. Is EZComments the recommended comment module? I've seen at least one other (dpComments or something)

    3. How do I actually put comments on a specific page? I call a hook function?

    Thanks in advance for helping!
  • Posted: 16.01.2006, 17:35
     
    ainigma32
    rank:
    Professional Professional
    registered:
     January 2004
    Status:
    offline
    last visit:
    22.03.06
    Posts:
    958
    Hi,


    1. [*:1883429e6b]The latest addition to docs.postnuke.com is about the example module. That module also shows the usage of hooks calls. I'm not sure if the hooks code is commented on but you can always ask specific questions here.

    2. [*:1883429e6b]I think it depends on who you ask whether EZComments is the *recommended* comment module but I like it a lot. But then again I also like EZForumComments... icon_smile

    3. [*:1883429e6b]Yes, at least if you use EZComments or EZForumComments you call a display hook and that makes sure the comments belonging to the item from your module are displayed together with the links/buttons to add comments.


    HTH and Happy Coding!
  • Posted: 16.01.2006, 18:13
     
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    26.08.08
    Posts:
    7720
    In answer to 2 as ainigma32 has covered 1 and 3 well..... EZComments will replace all commenting code shipped with PostNuke.8x and beyond. IMO it's the best commenting module for PostNuke

    -Mark
  • Posted: 17.01.2006, 21:08
     
    jbirchett
    rank:
    Helper Helper
    registered:
     November 2002
    Status:
    offline
    last visit:
    29.05.07
    Posts:
    203
    I looked through my document and noticed I had somehow skipped over the example_user_display.htm template, which is where EZ Comments would be called via hooks. I updated the document to detail this template and also updated the example_user_view template because I actually understand hooks a little better now. I had some questions about the last two lines of the template in the original version of the doc.

    The new section is 2.4.1.6 Displaying an item in detail – example_user_display.htm

    Link
  • Posted: 17.01.2006, 21:12
     
    ainigma32
    rank:
    Professional Professional
    registered:
     January 2004
    Status:
    offline
    last visit:
    22.03.06
    Posts:
    958
    See Hunkpapa: it can be that easy icon_smile

    Nice going jbirchett!
  • Posted: 18.01.2006, 09:36
     
    Shelby
    rank:
    Helper Helper
    registered:
     February 2004
    Status:
    offline
    last visit:
    16.06.06
    Posts:
    108
    EZForumComments is my preferred comment module.
  • Posted: 16.02.2006, 00:36
     
    Hunkpapa
    rank:
    Freshman Freshman
    registered:
     January 2006
    Status:
    offline
    last visit:
    30.03.06
    Posts:
    18
    Thanks for the answers everyone, I have EZComments working on .761.

    My problem now is that I also need a commenting module for a .750 installation (it's not my decision to upgrade or not although I am of course saying that it should be done :) ).

    Is it at all possible to get EZComments on a .750 installation, and if so, can you give me a few hints how it's different from .761?

    Thanks in advance.

    (if it's not possible, can you suggest an alternative that is rather good?)
  • Posted: 16.02.2006, 01:55
     
    Simon
    rank:
    Steering Committee Steering Committee
    registered:
     December 2002
    Status:
    offline
    last visit:
    23.11.08
    Posts:
    13415
    Hooks are pretty much identical in .750 as in .760 - the only difference is that some of the core modules don't take to hooks as readily.

    --
    Regards,
    Simon

    itbegins.co.uk - Zikula Consulting

    Please read the Support Guide
  • Posted: 16.02.2006, 01:58
     
    Hunkpapa
    rank:
    Freshman Freshman
    registered:
     January 2006
    Status:
    offline
    last visit:
    30.03.06
    Posts:
    18
    How do you enable a module to use hooks from a certain other module using .750?

    In .761 you can enable it in the administration->module using the "hooks" link next to each module
  • Posted: 16.02.2006, 03:20
     
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    26.08.08
    Posts:
    7720
    Under .750 hooks can be found under the 'edit' option in the modules admin panel. Under .76x hooks gained thier own menu option.

    -Mark
  • Posted: 16.02.2006, 15:22
     
    Hunkpapa
    rank:
    Freshman Freshman
    registered:
     January 2006
    Status:
    offline
    last visit:
    30.03.06
    Posts:
    18
    Thanks all

    I have EZComments working under .750 also, although I read several places that it was not possible :)

    I only have one issue: returnurl

    For some reason, returnurl is always sending the user back to the index page after having submitted a comment (happens in .761 also). I know I'm passing a correct URL to returnurl, and I've tried writing it straight in like below also.

    Code

    <!--[pnmodcallhooks hookobject="item" hookaction="display"
    hookid="$id" module="myModule" returnurl="http://www.postnuke.com/"]-->


    This is located in a template. The $id is unique and things are working except the returnurl.. any ideas?

    Code

    <input type="hidden" name="EZComments_redirect" id="EZComments_redirect" value="" />

    No value there.. the rest of the form is correct

    I tried reading the source of EZComments but I couldn't find where the EZComments_redirect is being set
  • Posted: 16.02.2006, 15:34
     
    ainigma32
    rank:
    Professional Professional
    registered:
     January 2004
    Status:
    offline
    last visit:
    22.03.06
    Posts:
    958
    /modules/EZComments/pnuser.php line 120

    Code

    if (!is_array($args['extrainfo'])) {
            $pnRender->assign('redirect',   $args['extrainfo']);
        } else {
            $pnRender->assign('redirect',   $args['extrainfo']['returnurl']);
        }


    Maybe you could try a print_r($args) to see what's being passed to EZComments?

    HTH
  • Posted: 16.02.2006, 16:09
     
    Hunkpapa
    rank:
    Freshman Freshman
    registered:
     January 2006
    Status:
    offline
    last visit:
    30.03.06
    Posts:
    18
    I was using this version of EZComments:
    http://lottasophie.sourceforge.net/index.php?name=Downloads&req=viewdownload&cid=3
    EZComments 0.2 preview

    I will try EZComments_1_3_RC1 now, and I'm guessing that's where I will get trouble installing for .750 :|
  • Posted: 16.02.2006, 16:27
     
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    26.08.08
    Posts:
    7720
    Don't..... EZComments 1.3RC1 will only work on .76x+

    -Mark

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula