JB Comment

Developer

Joel Bradbury

3rd Party (Free)


EE Version Support

  • ExpressionEngine 1.x

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.

  • Updater
  • Multi Site Manager
  • Stand Alone Entry Form
  • Low Variables
  • Content Elements
  • Better Workflow
  • Matrix
  • Grid
  • Webservice
  • Publisher

Requirements

  • jQuery for the Control Panel

Add-On Type(s)

Plugin

Tags

A few helper functions to handle various cases with comments.

Usage

This plugin is used with the following tag pair:

{exp:jb_comment}
{if comments_state=='open'} THE COMMENTS ARE OPEN{/if}
{/exp:jb_comment}

The plugin has two conditional for your logic :

1) comments_open - A bool, _true_ if the comments are open, _false_ if not

2)comments_state - The specific state of the comments. Will return either _open_, _expired_, or _closed_.

The plugin follows the same logic as the standard comment module in Expression Engine, to determine the current entry id. If you find this not getting the correct entry_id (_as will happen occasionaly if you’re using an non-standard url structure_) you can optionally supply the entry_id manually:

{exp:jb_comment entry_id="{entry_id}}..

Example

I created this plugin to allow differing handling of the comments block depending on the specific circumstances. My specific usage would be as follows:

 

        {exp:jb_comment entry_id="{entry_id}"}
            {if comment_total>0 OR comments_state=='open'}
    <div id="comments">
      <h2>Comments</h2>
      {exp:comment:entries sort="asc" entry_id="{entry_id}"}
        <div class="comment">
          <div class="meta">
            <img src="/assets/images/gravatar.png" alt="" class="avatar"/>
            <h3>{name}</h3>
            <p class="date">on {comment_date format="%l %j%S %F, %Y"}</p>
          </div>
          <div class="comment_message">
            {comment}
          </div>
        </div>
      {/exp:comment:entries}
    </div>
            {if comments_state=='open'}
                {exp:comment:form preview="weblog/preview" entry_id="{entry_id}"}
              <h2>Have your say</h2>
              {if logged_out}
              <p class="note">Got something to say? Well excellent, share it with us by filling in this form!</p>
              <fieldset class="your_details">
                <h3>Your details</h3>
                <label for="comment_name">
                  <span>Name:</span>
                  <input type="text" id="comment_name" name="name" value="{name}" />
                </label>
                <label for="comment_email">
                  <span>Email:</span>
                  <input type="text" id="comment_email" name="email" value="{email}" />
                </label>
                <label for="comment_url">
                  <span>URL:</span>
                  <input type="text" id="comment_url" name="url" value="{url}" size="50" />
                </label>
              </fieldset>
              {/if}
              <fieldset class="your_message">
                <h3>Your message</h3>
                <label for="comment_comment">
                  <span>Your message</span>
                  <textarea name="comment" id="comment_comment" cols="70" rows="10">{comment}</textarea>
                </label>
                <label for="save_info" class="boolean">
                  <input type="checkbox" name="save_info" id="save_info" value="yes" {save_info} /> <span>Remember my personal information</span>
                </label>
                <label for="notify_me" class="boolean">
                  <input type="checkbox" id="notify_me" name="notify_me" value="yes" {notify_me} /> <span>Notify me of follow-up comments?</span>
                </label>

                <input type="submit" name="submit" value="Submit" />
              </fieldset>
            {/exp:comment:form}
            {/if}
            {/if}
        {/exp:jb_comment}

JB Comment Links

This entry was created March 14, 2011, 11:46 am.
This entry was last updated March 14, 2011, 4:45 am.

Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

Returns: devot:ee has a 30-day return policy on all commercial add-ons sold through devot-ee.com. If you need to return an add-on, do not go to the developer or the developer's site, but rather visit our returns page at https://devot-ee.com/returns to initiate your return. If you have questions, email support@devot-ee.com.

There are no reviews for this add-on yet.

What are you waiting for? Rate it and review it!