x
 
Create New Page

Revision: Comment Expiration Notice

Revision from: 21:41, 18 Aug 2006

To be able to add “Commenting has expired” in other places on the template than just the form (it appears where the form should be if the ability to comment has expired). Since there isn’t a tag to do this, Caitlinn wrote a query to display “Commenting has expired” on other areas of a single entry template.

Mind, this is working off a URL displaying the entry title as segment 3 and with a PHP enabled template:

{exp:query sql="
SELECT entry_id,
unix_timestamp(current_date) as today,
url_title,
comment_expiration_date as comms
FROM exp_weblog_titles
where url_title='{segment_3}'
"
}
<?php
if ({today} > {comms}) echo "Commenting has expired.";?>
{
/exp:query}

Original Post

Category:Tricks

Categories: