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

Dizkus

Bottom
Showing total comments on the home page for Add Article Module
  • Posted: 19.01.2008, 08:10
     
    rkilmabi
    rank:
    Softmore Softmore
    registered:
     December 2007
    Status:
    offline
    last visit:
    24.02.08
    Posts:
    67
    New articles are currently being posted on the home page of my web site, I also allow users to post comments, Is there a way where I can display the number of comments posted for each article (below the article), this way it will be easy for users to see which article has how many comments.

    Thanks
  • Posted: 19.01.2008, 09:44
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    2975

    Code

    <!--[$preformat.comment]-->


    If you are using a Xanthia theme, edit the themes/yourtheme/templates/news-idex.htm to include this.


    --
    David Pahl
    Zikula Support Team
  • Posted: 19.01.2008, 23:59
     
    rkilmabi
    rank:
    Softmore Softmore
    registered:
     December 2007
    Status:
    offline
    last visit:
    24.02.08
    Posts:
    67
    Thanks, the total comments and the option to post comments show up, however, they appear only if I log in, how can I ensure that even without logging, a person should be able to see the number of comments and click on them to read it.
  • Posted: 20.01.2008, 02:25
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    2975

    Code

    <!--[$info.comments]-->


    --
    David Pahl
    Zikula Support Team
  • Posted: 20.01.2008, 17:36
     
    reuhkala
    rank:
    Freshman Freshman
    registered:
     August 2005
    Status:
    offline
    last visit:
    07.09.08
    Posts:
    43
    How to do this with much edited ExtraLite theme? Friend of mine edited ExtraLite and I do not know how to do it.

    ExtraLite does not include news-idex.htm file.

    Timo

    www.asia-lutheran.org
  • Posted: 20.01.2008, 17:51
     
    rank:
    Freshman Freshman
    registered:
     April 2006
    Status:
    offline
    last visit:
    11.10.08
    Posts:
    48
    Download this Theme:http://www.markwest.…-getit-lid-50.phtml

    --
    regards from germany

    postnuke-themes.de My Testsite for Zikula
  • Posted: 20.01.2008, 20:23
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    2975
    Hmmm... that is modified, eh?!

    I have not modified a legacy theme since .726...

    So here is the comments function:

    Code

    // Work out how to say 'comment(s)(?)' correctly
        $comment = '';
        $postcomment = '';
        if (pnModAvailable('Comments')) {
            if ($info['withcomm'] == 0) {
                if ($info['comments'] == 0) {
                    $comment = _COMMENTSQ;
                } else if ($info['comments'] == 1) {
                    $comment = '1 ' . _COMMENT;
                } else {
                    $comment = "$info[comments] "._COMMENTS;
                }
            }

            // Allowed to comment?
            if (pnSecAuthAction(0, $component, $instance, ACCESS_COMMENT)) {
                $comment = "<a href=\"$links[comment]\">$comment</a>";
                $postcomment = "<a href=\"$links[postcomment]\">"._COMMENTSQ.'</a>';
            } else {
                $comment = '';
                $postcomment = '';
            }
        } else if (pnModAvailable('EZComments') && pnModIsHooked('EZComments', 'News')) {
            $commentcount = pnModAPIFunc('EZComments', 'user', 'countitems', array('mod' => 'News', 'objectid' => $info['sid'], 'status' => 0));
            if ($commentcount == 0) {
                $comment = _COMMENTSQ;
            } else if ($commentcount == 1) {
                $comment = '1 ' . _COMMENT;
            } else {
                $comment = "$commentcount "._COMMENTS;
            }
            if (pnSecAuthAction(0, 'EZComments::', "News::$info[sid]", ACCESS_COMMENT)) {
                $comment = "<a href=\"$links[comment]\">$comment</a>";
                $postcomment = "<a href=\"$links[postcomment]\">"._COMMENTSQ.'</a>';
            } else {
                $comment = '';
                $postcomment = '';
            }
        }


    Extract what you need.

    HTH



    --
    David Pahl
    Zikula Support Team
  • Posted: 21.01.2008, 00:34
     
    rkilmabi
    rank:
    Softmore Softmore
    registered:
     December 2007
    Status:
    offline
    last visit:
    24.02.08
    Posts:
    67
    David,

    Thanks so much, I have it working in Seabreeze, I noticed that after I added , the homepage just showed the number of comments without any prefix or suffix and it was not very intutive. Added this piece of code: : and now the users see something like Comments: 2.

    The only draw back being I don't know how to make this a hyperlink so that users can directly click on it and read the comments. Any suggestioins?

    Further, is there a way I can have user assign ratings to the AddArticle when they submit the article and also for users reading it, rate it? I saw some forum postings on a module EZComments, I hope their is a simpler way of achieving it.

    Thanks

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula