Plugin: Commented Entries
Posted: 19 June 2010 04:49 AM   [ Ignore ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1135
Joined  02-02-2007

The attached add-on files may be out of date.  Please visit Devot-ee for the latest versions.

This plugin allows you to display list of commented entries. Supports both usual pagination and loading pages via AJAX.

I. PARAMETERS
 
  1) site - Optional. Allows you to specify site id number.
You can stack site id numbers using pipe character to get entries
from any of those sites, e.g. site=“1|3”. Or use “not”
(with a space after it) to exclude sites, e.g. site=“not 1|2”.
 
  2) weblog - Optional. Allows you to specify weblog name.
You can use the pipe character to get entries from any of those
weblogs, e.g. weblog=“weblog1|weblog2|weblog3”.
Or you can add the word “not” (with a space after it) to exclude weblogs,
e.g. weblog=“not weblog1|weblog2|weblog3”. You also can use weblog ids
instead of weblog names as the values of this parameter; you can even
mix weblog names and weblog ids, e.g. weblog=“weblog1|10|weblog2|15|weblog3”.
 
  3) category - Optional. Allows you to specify category id number
(the id number of each category is displayed in the Control Panel).
You can stack categories using pipe character to get entries
with any of those categories, e.g. category=“3|6|8”. Or use “not”
(with a space after it) to exclude categories, e.g. category=“not 4|5|7”.
 
  4) status - Optional. Allows you to specify status of entries. You can choose multiple
statuses using a pipe status=“draft|reviewed|published” or exclude statuses using “not”
status=“not submitted|processing|closed”.
 
  5) entry_id - Optional. Allows you to specify entry_id of entries. You can specify multiple
  entry_ids using pipe, e.g. entry_id=“101|109|12|136” or exclude entry_ids using “not”,
  e.g. entry_id=“not 101|109|12|136”.
 
  6) orderby - Optional. This parameter sets the display order of the entries.
Possible values are “date”, “title”, “edit_date”, “comment_total”, “recent_comment_date”,
“screen_name”. Default is “date”.
 
  7) sort - Optional. Allows you to specify sort order.
Sort order can be ascending (sort=“asc”) or descending (sort=“desc”).
Default is descending.

NOTE: The orderby=”” and sort=”” parameters can accept multiple values using the pipe character.
This allows you to have multiple levels of ordering and then specify the sort rules for those levels.
For example, if you wish to order by screen_name alphabetically and then have the most recent entries first, you would use the following parameters:
orderby=“screen_name|date” sort=“asc|desc”
 
  8) expired_entries - Optional. Allows you to specify if expired entries should be displayed.
  Possible values are “yes” and “no”. Default is “no”.
 
  9) expired_comments - Optional. Allows you to specify if expired comments should be counted.
  Possible values are “yes” and “no”. Default is “no”.
 
  10) limit - Optional. Allows you to specify number of entries to be displayed. Default value is “10”.
  To display all commented entries set the value of this parameter to “none”.
 
  11) per_page - Optional. Allows you to specify how many
items should be displayed on one page. Default value is “10”. This parameter should net be confused with
“limit” parameter.
 
  12) date_format - Optional. Allows you to specify how date should be formatted.
Use ExpressionEngine’s date formatting code.
 
  13) date_localize - Optional. Allows you to specify if the date should be localized.
Possible values are “yes” and “no”. Default is “no”.

  14) time_span_entries - Optional. Allows you to specify number of days from now.
  E.g. time_span_entries=“14” means that plugin will display commented entries posted
  during the last 14 days.
 
  15) time_span_comments - Optional. Allows you to specify number of days from now.
  E.g. time_span_comments=“21” means that plugin will display commented entries which have comments submitted
  during the last 21 days.
 
  Continued in the next post

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 19 June 2010 04:50 AM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1135
Joined  02-02-2007

16) max_pagination_links - Optional. Allows you to specify how many pagination links should be
displayed. Default value is “2”.

  17) ajax_pagination - Optional. Allows you to specify if using pagination the pages
  should be loaded via ajax. Possible values are “yes” and “no”. Default is “no”.
 
  18) ajax_namespace - Optional. Used in case you add several exp:commentries tag on one teplate
  each having parameter ajax_pagination=“yes”. In such case each exp:commentries tag *must* have
  parameter “ajax_namespace” with unique string as its value.
 
  19) ajax_post_vars - Optional. Allows you to specify pipe delimited list of POST variable names which will be
  sent by AJAX. E.g. ajax_post_vars=“my_var_1|my_var_2”.
 
  20) ajax_post_values - Optional. Allows you to specify pipe delimited list of POST variable values which will be
  sent by AJAX. E.g. ajax_post_values=“my_value_1|my_value_2”. On the template which will be used by AJAX those POST
  variables can be outputted by some other add-on, e.g. by “GET/POST Parameters” plugin available at http://devot-ee.com/add-ons/get-post-parameters/.
 
  21) ajax_template_url - Optional. Allows you to specify template group name and template name
  (those names shoul be separated by slash) of the template which will be used by AJAX.
 
  22) ajax_container_id - Optional. Allows you to specify CSS id parameter of the HTML element
inside which AJAX should output commented entries list.
 
  23) progress_indicator_id - Optional. Allows you to specify CSS id parameter of the HTML element
which will act as the indicator of commented entries list being loaded via AJAX.
 
  24) progress_indicator_class - Optional. Allows you to specify CSS class parameter of the HTML element
which will act as the indicator of commented entries list being loaded via AJAX.
 
  25) error_message_container_id - Optional. Allows you to specify CSS id parameter of the HTML element
inside which an error message will be outputted in case pulling list of commented entries by AJAX fails.
 
  26) error_message_container_class - Optional. Allows you to specify CSS class parameter of the HTML element
inside which an error message will be outputted in case pulling list of commented entries by AJAX fails.

  27) ajax_add_callback - Optional. Allows you to specify name of javascript function which
will be executed when AJAX response will be outputted into container after clicking of some pagination link.
This parameters supports pipe character, i.e. you can add several callback functions.

  28) any name of javascript function which is used inside the value of “ajax_add_callback” parameter
  can be used as the name of a new parameter. The value of this parameter will
be used as argument of the relevant javascript function. E.g. if you have parameter ajax_add_callback=“my_callback”,
then you can add parameter my_callback=“5”; the number “5” will be used as the argument for “my_calback” function.
In case you need to call a function with several arguments, use javascript object.  E.g. if you have parameter
ajax_add_callback=“new_callback”, then you can add parameter new_callback=’{“value1”: null, “value2”: “some_string”}’.
 
  29) invalid_input - Optional. Accepts two values: “alert” and “silence”.
Default value is “silence”. If the value is “alert”, then in cases when some
parameter’s value is invalid plugin exits and PHP alert is being shown;
if the value is “silence”, then in cases when some parameter’s value
is invalid plugin finishes its work without any alert being shown.
Set this parameter to “alert” for development, and to “silence” - for deployment.

Continued in the next post

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 19 June 2010 04:51 AM   [ Ignore ]   [ # 2 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1135
Joined  02-02-2007

II. SINGLE VARIABLES
 
  1) commentries_title - outputs title of the entry.
 
  2) commentries_entry_id - outputs ID number of the entry.
 
  3) commentries_url_title - outputs url title of the entry.
 
  4) commentries_status - outputs status of the entry.
 
  5) commentries_entry_date - outputs date when the entry was submitted.
 
  6) commentries_weblog_id - outputs ID number of the weblog into which an entry was
posted.
 
  7) commentries_weblog_name - outputs short name of the weblog into which an entry was
posted.
 
  8) commentries_weblog_title - outputs title of the weblog into which an entry was
posted.
 
  9) commentries_author_name - outputs screen name of the entry’s author.
 
  10) commentries_comments_number - outputs number of comments posted in relevant entry.
 
  11) commentries_total - outputs number of commented entries displayed on current page.
 
  12) commentries_absolute_total - outputs number of commented entries displayed on all
  pages (if pagination is being used).
 
  13) commentries_count - outputs count number of commented entry on current page.
 
  14) commentries_absolute_count - outputs absolute count number of the entries being
displayed by the tag, including those entries on previous pages (if using pagination).

III. VARIABLE PAIRS
 
  1) {commentries_no_results}{/commentries_no_results} - contents of this variable pair
  will be outputted in case no commented entries were found by exp:commentries tag.
 
  2) {commentries_pagination_top}{/commentries_pagination_top}
 
  3) {commentries_pagination_bottom}{/commentries_pagination_bottom}
 
  Variables available for use within these last two variable pairs are:
 
  1) {commentries_current_page}
 
  2) {commentries_total_pages}
 
  3) {commentries_pagination_links}

Continued in the next post

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 19 June 2010 04:53 AM   [ Ignore ]   [ # 3 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1135
Joined  02-02-2007

IV. EXAMPLE (NOT USING AJAX)
 

{exp:commentries weblog="my_blog_1|my_blog_2" category="5|8|11" orderby="most_recent_comment" sort="desc" limit="50" per_page="10" parse="inward"}

  {commentries_entry_id}
{commentries_title}{commentries_url_title}{commentries_status}{commentries_entry_date}{commentries_weblog_id}{commentries_weblog_name}{commentries_weblog_title}{commentries_author_name}{commentries_comments_number}<br><br>
  
  
{commentries_pagination_bottom}<pPage {commentries_current_page} of {commentries_total_pages} {commentries_pagination_links}{/commentries_pagination_bottom}
  
  {
/exp:commentries} 

 
  V. EXAMPLE (USING AJAX)
 
  a) Code in the main template:
 

<div id="latest_comments_progress_indicator" style="display: none">
  <
h2>Loading comments...</h2>
  </
div>
  
  <
div id="latest_comments_error_message" style="display: none">
  <
h2>Error occurred:</h2>
  </
div>
  
  <
h2>Latest comments</h2>
  
  
{embed="my_template_group/embed_latestComments" category_id="{segment_3}" ajax_post_vars="category_id" ajax_post_values="{segment_3}"

 
  b) Code in the embedded template:
 

<div id="comments_latest">
  
{exp:parameters parse="inward"}
  {exp
:commentries weblog="my_weblog" category="{embed:category_id}{post_category_id}" orderby="most_recent_comment" sort="desc" limit="none" per_page="15" ajax_pagination="yes" ajax_namespace="LatestComments" ajax_post_vars="{embed:ajax_post_vars}" ajax_post_values="{embed:ajax_post_values}" ajax_template_url="my_template_group/embed_latestComments" ajax_container_id="comments_latest" progress_indicator_id="latest_comments_progress_indicator" progress_indicator_class="progress_indicator" error_message_container_id="latest_comments_error_message" error_message_container_class="ajax_error" ajax_add_callback="my_callback" invalid_input="alert" parse="inward"}
  
  {commentries_entry_id}
{commentries_title}{commentries_url_title}{commentries_status}{commentries_entry_date}{commentries_weblog_id}{commentries_weblog_name}{commentries_weblog_title}{commentries_author_name}{commentries_comments_number}<br><br>
  
  
{commentries_pagination_bottom}<pPage {commentries_current_page} of {commentries_total_pages} {commentries_pagination_links}{/commentries_pagination_bottom}
  
  {
/exp:commentries}
  {
/exp:parameters}
  
</div

End of the description of plugin

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 21 June 2010 06:27 AM   [ Ignore ]   [ # 4 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1135
Joined  02-02-2007

Hi,

I released version 1.0.1 of Commented Entries plugin.

In this release a bug - javascript error being triggered when parameter ““ajax_add_callback” is undefined - was fixed.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 21 June 2010 08:28 AM   [ Ignore ]   [ # 5 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1135
Joined  02-02-2007

Hi,

I released version 1.1 of Commented Entries plugin.

In this release a new variable pair - {commentries_no_results}{/commentries_no_results} - were added. The contents of this variable pair will be outputted in case no commented entries were found by exp:commentries tag.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 23 June 2010 10:40 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  272
Joined  11-06-2007

Laisvunas,

Looks great.  Would it be possible to add an author_id parameter so you can display comments only by selected authors?

Profile
 
 
Posted: 23 June 2010 10:52 AM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1135
Joined  02-02-2007

Hi Joe,

I plan to develop functionality of displaying list of entries commented by certain authors. Such functionality will be included either in this plugin or in an entirely new plugin.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 23 June 2010 10:54 AM   [ Ignore ]   [ # 8 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  272
Joined  11-06-2007

Ok great.  I’m currently doing a bunch of custom queries to get this functionality but would love to have a plugin to do this.  Please post an update here if/when you have something ready.

Profile
 
 
   
 
 
‹‹ Magpie RSS Issue      Plugin: Reverse These! ››