Plugin Name: CommentLuv Plugin Description: CommentLuv rewards your readers and helps you discover new and interesting posts by automatically adding a titled link to the comment authors last blog post when they comment. Plugin URL: http://comluv.com Author: CommentLuv Author URL: http://intensedebate.com/people/CommentLuv Date Added: November 9th, 2009 Code: var id_commentluv_plugin = {}; id_commentluv_plugin.id_post_luv_comment = function (){ } // load jQuery if it doesn't exist id_commentluv_plugin.id_luvload_jquery = function (){ /* load jQuery if it isn't already loaded */ if (typeof jQuery == 'undefined') { s = document.createElement('script'); s.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'; document.getElementsByTagName('head')[0].appendChild(s); } } // end id_add_luvlink_field // full document ready action id_commentluv_plugin.id_loaded_luv_full = function (){ var commentluvDiv = document.createElement("DIV"); commentluvDiv.id = "luv_field_reply"; commentluvDiv.style.width = "400px"; commentluvDiv.style.clear = "both"; commentluvDiv.style.marginBottom = "5px"; jQuery("#IDCommentReplyForm1").append(commentluvDiv); // add div to new thread text area var new_thread_div = document.createElement("DIV"); new_thread_div.id = "luv_field_new"; new_thread_div.style.width = "400px"; new_thread_div.style.clear = "both"; new_thread_div.style.marginBottom = "5px"; jQuery("#IDCommentNewThreadForm1").append(new_thread_div); // array to use for global settings and values var cl_settings = new Array(); // lod the external script id_commentluv_plugin.id_load_commentluv_script(); } // add link to comment on submit filter id_commentluv_plugin.id_add_luv_to_comment_text = function(text){ var id_luv_add_it = ''; if(cl_settings['request_id'] > 1){ // there was a successful return of a post or posts so add it to comment id_luv_add_it = "\nMy recent post " + cl_settings['cl_post']; // tell comluv what post got added confirm_comluv(); } return text + id_luv_add_it; } // load commentluv js function id_commentluv_plugin.id_load_commentluv_script = function(){ var commentluvScript = document.createElement("SCRIPT"); commentluvScript.src = "http://comluv.s3.amazonaws.com/scripts/commentluvid-s3.js"; commentluvScript.type = "text/javascript"; document.getElementsByTagName("HEAD")[0].appendChild(commentluvScript); } id_add_action('comment_post',id_commentluv_plugin.id_post_luv_comment); id_add_action('idcomments_func_load',id_commentluv_plugin.id_loaded_luv_full); id_add_action('idcomments_init',id_commentluv_plugin.id_luvload_jquery); id_add_filter('pre_comment_text',id_commentluv_plugin.id_add_luv_to_comment_text); CSS: #lastposts{ width:375px; padding-left:5px; padding-bottom:5px; background-color:#fee; font-size:13px; border:1px solid #ddd; } .choosepost{ background-color:#fff; line-height:1.4em; display:block; width:372px; border-bottom:1px dashed #bbb; cursor:pointer; } .cl_type_icon{ margin-right:3px; border:none; } #IDCColumnURL{ display: none !important; } #IDCColumnURLReply{ display: none !important; } #IDCColumnURLLabel{ display: none !important; } #IDCColumnURLReplyLabel { display: none !important; }