improvement of comment form

vincent3569 Member, Translator
hello

the commentform allows to comment photos, albums, news or pages.

For personnal use (whith my theme herited from zpGalleriffic) I modified the function printCommentForm in commentform.php like that :

line 314 :
`

function printCommentForm($showcomments=true, $addcommenttext=NULL, $showcommentmsg=true)

`

[note] : the addcomment parameter is not described yet in the user guide

line 351
`

case 0:

if ($showcommentmsg) {echo '

'.gettext('No Comments').'

';}

`

line 355
`

default:

if ($showcommentmsg) {echo '

'.sprintf(ngettext('%u Comment','%u Comments',$num), $num).'

';}

`

line 466
`

if (!empty($addcommenttext)) {

if ($showcommentmsg) {echo '

'.$addcommenttext.'

';}

}

`

those modifications allow the user to show or not some messages of the plugin

could you take this improvement in the zenphoto's core ?
it would be cool !

Comments

  • acrylian Administrator, Developer
    Sorry, I don't exactly get what is the benefit of this. You could even put this check for comments around the function itself and have the same effect.

    Thanks for the note about the parameter.
  • vincent3569 Member, Translator
    sorry too, i don't understand your suggestion.
    In fact, with my theme, i don't want to show some messages of comment_form : number of messages (it is shown) and add message.

    first time, i've modified comment_form and commented the concerned line.
    but i want to give my theme to the community: by taking this improvement, the users don't have to hack the file and the other themes always going well (the default value of the new parameter is true)...
  • One way to do this would be to use CSS to hide that text. Anyway, feature suggestions are always welcome. However, they will get lost if just posted on this forum. The only way to track such a request is if you do it through the "Trac" system.
  • acrylian Administrator, Developer
    All right, I think I missunderstood the purpose of your change. I would have suggested zu use CSS as well next.

    Anyway, the "Trac" system is to be found on the "bugtracker" link.
  • vincent3569 Member, Translator
    in fact, i can't used css to hide the text.
    i want to hide the number of comment but i don't want to hide the message "closed to comment".
    i can't have two distinct CSS rules on those messages
    to do that, i should use some javascript...

    i will create a trac
  • Well, actually you can hide the count but not the closed to comments with CSS. Those are in different DIVs. Granted it is a little obscure how to do this since the former is in the major DIV `commentcontent` and the latter is in a sub-dif of that--`commententry`. So you want to hide H3 at the `commentcontent` level and show H3 at the `commententry` level.
  • acrylian Administrator, Developer
    Maybe we should consider to add different css classes or id to each element so it is easier to address them via CSS.
  • vincent3569 Member, Translator
    i have tried to implement those css rules.
    as far i can remember, i have tried this :
    - hide the high level div H3 commentcontent
    - show the low level div H3 commententry
    but commentcontent rule is high priority on commententry rule

    maybe, usind a id rather a class...
  • acrylian Administrator, Developer
    If a parent id prevents changes using a class you could add an `!important` to the setting to override (e.g. `border: 1px !important;`).

    You can also address sub items using `>`. Don't know the details right now but `div h3 #commententry > h3` might work. CSS can be tricky...
  • vincent3569 Member, Translator
    ok, i found my mistake : i don't had a specific rule on commententry h3 to show the text

    with those rules, it's going well

    #commentcontent h3{font-size: 100%; display: none;}
    #commententry h3{font-weight:bold; text-transform: lowercase; display: block;}

    thanks for your help
Sign In or Register to comment.