From 847d7638a0de40cf3c910c52b5cb5000a2ff9244 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 26 Jul 2012 17:33:26 +0000 Subject: [PATCH] =?UTF-8?q?Ticket=20#933=20->=20Control=20de=20comentarios?= =?UTF-8?q?=20muy=20largos=20en=20la=20p=C3=A1gina=20de=20inicio=20Ticket?= =?UTF-8?q?=20#932=20->=20Comportamiento=20de=20los=20comentarios=20en=20l?= =?UTF-8?q?a=20p=C3=A1gina=20de=20inicio=20Ticket=20#927=20->=20Cambiar=20?= =?UTF-8?q?los=20nombres=20de=20los=20usuarios=20por=20sus=20alias=20Ticke?= =?UTF-8?q?t=20#935=20->=20Escribir=20comentarios=20sin=20recargar=20p?= =?UTF-8?q?=C3=A1gina=20Ticket=20#934=20->=20Paginaci=C3=B3n=20de=20coment?= =?UTF-8?q?arios=20sin=20recargar=20p=C3=A1gina?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@37 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6 --- wp-content/plugins/wp-comment-master/admin.js | 12 + .../plugins/wp-comment-master/ajax-loader.gif | Bin 0 -> 422 bytes .../autoresize.jquery.min.js | 7 + wp-content/plugins/wp-comment-master/cm.css | 23 ++ wp-content/plugins/wp-comment-master/cm.js | 177 +++++++++++++++ .../plugins/wp-comment-master/readme.txt | 103 +++++++++ .../wp-comment-master/wp-comment-master.php | 182 ++++++++++++++++ wp-content/themes/score/comments.bak.php | 205 ++++++++++++++++++ wp-content/themes/score/comments.php | 179 +++++---------- wp-content/themes/score/header.php | 4 +- wp-content/themes/score/home-comments.php | 40 +++- wp-content/themes/score/index.php | 19 +- .../themes/score/loop-dedication-data.php | 1 + .../members/single/small-member-header.php | 2 +- .../themes/score/single-image-gallery.php | 25 --- wp-content/themes/score/single-review.php | 127 ----------- wp-content/themes/score/single.php | 12 +- wp-content/themes/score/style-asong2u.css | 31 ++- wp-content/themes/score/video-slider.php | 66 +++--- 19 files changed, 890 insertions(+), 325 deletions(-) create mode 100644 wp-content/plugins/wp-comment-master/admin.js create mode 100644 wp-content/plugins/wp-comment-master/ajax-loader.gif create mode 100644 wp-content/plugins/wp-comment-master/autoresize.jquery.min.js create mode 100644 wp-content/plugins/wp-comment-master/cm.css create mode 100644 wp-content/plugins/wp-comment-master/cm.js create mode 100644 wp-content/plugins/wp-comment-master/readme.txt create mode 100644 wp-content/plugins/wp-comment-master/wp-comment-master.php create mode 100644 wp-content/themes/score/comments.bak.php delete mode 100644 wp-content/themes/score/single-image-gallery.php delete mode 100644 wp-content/themes/score/single-review.php diff --git a/wp-content/plugins/wp-comment-master/admin.js b/wp-content/plugins/wp-comment-master/admin.js new file mode 100644 index 0000000..a554d24 --- /dev/null +++ b/wp-content/plugins/wp-comment-master/admin.js @@ -0,0 +1,12 @@ +jQuery(document).ready(function($){ + $('input[name="com_paging"]').eq(0).click(function(){ + $('input[name="com_per_page"]').attr('disabled', false); + $('select[name="num_per_page"]').attr('disabled', false); + $('input[name="pager_pos"]').attr('disabled', false); + }); + $('input[name="com_paging"]').eq(1).click(function(){ + $('input[name="com_per_page"]').attr('disabled', true); + $('select[name="num_per_page"]').attr('disabled', true); + $('input[name="pager_pos"]').attr('disabled', true); + }); +}); \ No newline at end of file diff --git a/wp-content/plugins/wp-comment-master/ajax-loader.gif b/wp-content/plugins/wp-comment-master/ajax-loader.gif new file mode 100644 index 0000000000000000000000000000000000000000..3ea7e442765638b023c88c2960c5feb0cd4d5507 GIT binary patch literal 422 zcmZ?wbhEHb6krfwSj52a|NsAM*RGv8b7t?}z17v##l^*GX=(o$nH2wX`?-b$J39ur z8tEA@GcqtRDE?$&WoKY#&;hc6ngtjbm~A+AIf`hXO7fX_hBfPUcg(}wt6N(VBzspc z+aO`EsL&%>vFG4H1BaRCog74#=uBLcuq^3^hiv#-Np2=(PGkew7}yv%fCdUz7+?Q% z=-@Jm+?ESTKACgeQ{9=6)iJ@TCL{R-s06Oi<$CNfk@5vL$y-WW#ILXi-JFP|kc$Ckvq*)@ z_0(k+8n?54^fb1LpJg|@jj9mg6|W`X$3$3{CTH=e?+Um#J=Y7#iEIp9aGO`TtUfxU T=$J)em#&|6%=d`%Km)A-2GDqH literal 0 HcmV?d00001 diff --git a/wp-content/plugins/wp-comment-master/autoresize.jquery.min.js b/wp-content/plugins/wp-comment-master/autoresize.jquery.min.js new file mode 100644 index 0000000..4b8d315 --- /dev/null +++ b/wp-content/plugins/wp-comment-master/autoresize.jquery.min.js @@ -0,0 +1,7 @@ +/* + * jQuery autoResize (textarea auto-resizer) + * @copyright James Padolsey http://james.padolsey.com + * @version 1.04 + */ + +(function(a){a.fn.autoResize=function(j){var b=a.extend({onResize:function(){},animate:true,animateDuration:150,animateCallback:function(){},extraSpace:20,limit:1000},j);this.filter('textarea').each(function(){var c=a(this).css({resize:'none','overflow-y':'hidden'}),k=c.height(),f=(function(){var l=['height','width','lineHeight','textDecoration','letterSpacing'],h={};a.each(l,function(d,e){h[e]=c.css(e)});return c.clone().removeAttr('id').removeAttr('name').css({position:'absolute',top:0,left:-9999}).css(h).attr('tabIndex','-1').insertBefore(c)})(),i=null,g=function(){f.height(0).val(a(this).val()).scrollTop(10000);var d=Math.max(f.scrollTop(),k)+b.extraSpace,e=a(this).add(f);if(i===d){return}i=d;if(d>=b.limit){a(this).css('overflow-y','');return}b.onResize.call(this);b.animate&&c.css('display')==='block'?e.stop().animate({height:d},b.animateDuration,b.animateCallback):e.height(d)};c.unbind('.dynSiz').bind('keyup.dynSiz',g).bind('keydown.dynSiz',g).bind('change.dynSiz',g)});return this}})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/wp-comment-master/cm.css b/wp-content/plugins/wp-comment-master/cm.css new file mode 100644 index 0000000..472bd30 --- /dev/null +++ b/wp-content/plugins/wp-comment-master/cm.css @@ -0,0 +1,23 @@ +.yjl-pager{ + margin:0px 0 10px; +} +span.page-number,span.yjl-more,span.yjl-prev,span.yjl-next,.gray{ + margin:0 4px 0 4px; + padding:3px 5px 3px 5px; + border:1px solid #dedede; +} +span.page-number:hover,span.yjl-more:hover,span.yjl-prev:hover,span.yjl-next:hover{ + cursor:pointer; + border:1px solid #666; +} +.currentPager{ + background:blue; + color:white; +} +.gray{ + color:#aaa; +} +.yjl-mes{ + color:#c22; + font-size:14px; +} \ No newline at end of file diff --git a/wp-content/plugins/wp-comment-master/cm.js b/wp-content/plugins/wp-comment-master/cm.js new file mode 100644 index 0000000..512c87b --- /dev/null +++ b/wp-content/plugins/wp-comment-master/cm.js @@ -0,0 +1,177 @@ + var $pager=jQuery('
'); + var $cPager=jQuery('
'); + var $prev=jQuery(''+ (yjlSettings.prev==''? 'Prev':yjlSettings.prev) +''); + var $next=jQuery(''+ (yjlSettings.next==''? 'Next':yjlSettings.next) +''); + var $moreFront=jQuery(''); + var $moreEnd=jQuery(''); + var $commentlist=jQuery('.commentlist'); + var $respond=jQuery('#respond'); + var $message=jQuery('').appendTo("#commentform");; + var $list=$commentlist.children(); + var totalCom=$list.length; + var $textarea=$respond.find('#comment').attr('rows','4'); + var comPerPage=parseInt((yjlSettings.comPerpage==''? '5':yjlSettings.comPerpage),10); + + var currentPage=0,$number,numPerPage,totalPage,$reply; + + //repostion comment form if enabled + if(yjlSettings.repForm!='disable'){ + $respond.insertBefore($commentlist.prev()); + } + + function getTotal($comlist){ + $list=$comlist.children(); + totalCom=$list.length; + totalPage=Math.ceil(totalCom/comPerPage); + } + + if(yjlSettings.pagination!='disable')pagination(); + function pagination(){ + getTotal($commentlist); + numPerPage=parseInt((yjlSettings.numPerpage==''? '5':yjlSettings.numPerpage),10); + if(totalPage').text(i+1) + .bind('click',{newPage:i}, function(event){ + currentPage=event.data['newPage']; + $number.eq(currentPage).addClass('currentPager').siblings().removeClass('currentPager'); + rePagCom(); + rePager(); + }).appendTo($pager); + } + //select a set of page-numbers for later uses + $number=$pager.find('span.page-number'); + + //if there are more page-numbers front + jQuery('').appendTo($moreFront) + .text('1').click(function(){$number.eq(0).trigger('click');}); + $moreFront.append(' ... ').prependTo($pager); + $prev.prependTo($pager).click(function(){ + if(currentPage>0)$number.eq(currentPage).prev().trigger('click'); + }); + + $moreEnd.append(' ... ').appendTo($pager); + jQuery('').appendTo($moreEnd) + .text(totalPage+'').click(function(){$number.eq(totalPage-1).trigger('click');}); + $next.appendTo($pager).click(function(){ + if(currentPagetotalPage-(numPerPage+1)/2){ + $number.hide().slice(totalPage-numPerPage,totalPage+1).show(); + } + else{ + $number.hide().slice(currentPage-(numPerPage-1)/2 ,currentPage+(numPerPage-1)/2+1).show(); + } + if(currentPage==0)$prev.removeClass('yjl-prev').addClass('gray'); + else $prev.addClass('yjl-prev').removeClass('gray'); + + if(currentPage==totalPage-1)$next.removeClass('yjl-next').addClass('gray'); + else $next.addClass('yjl-next').removeClass('gray'); + + if(currentPage+(numPerPage-1)/20 && numPerPage!=totalPage) + $moreFront.show();else $moreFront.hide(); + if(yjlSettings.pagerPos=='both') + $cPager.insertAfter($commentlist).empty().append($pager.children().clone(true)); + } + + //track a reply comment + jQuery('.comment-reply-link').live('click',function(){ + $reply=true; + }); + var $cancel=jQuery('#cancel-comment-reply-link').click(function(){ + $reply=false; + }); + + /* + *if Ajax comment posting is eanbled + */ + jQuery('#commentform').submit(function(){ + jQuery.ajax({ + beforeSend:function(xhr){ + xhr.setRequestHeader("If-Modified-Since","0"); + $message.empty().append('processing...'); + }, + type:'post', + url:jQuery(this).attr('action'), + data:jQuery(this).serialize(), + dataType:'html', + error:function(xhr){ + if(xhr.status==500){ + $message.empty().append(xhr.responseText.split('

')[1].split('

')[0]); + } + else if(xhr.status=='timeout'){ + $message.empty().append((yjlSettings.timeOut!=''?yjlSettings.timeOut:'Error:Server time out,try again!')); + } + else{ + $message.empty().append((yjlSettings.fast!=''?yjlSettings.fast:'Please slow down,you are posting to fast!')); + } + }, + success:function(data){ + $message.empty().append((yjlSettings.thank!=''?yjlSettings.thank:'Thank you for your comment!')); + $newComList=jQuery(data).find('.commentlist'); + if(totalCom>0){ + if($reply)$cancel.trigger('click'); + else { + if(yjlSettings.order=='desc')currentPage=0; + else { getTotal($newComList);currentPage=totalPage-1;} + } + if(yjlSettings.pagination=='disable' || yjlSettings.pagerPos=='after') + $commentlist.prev().replaceWith($newComList.prev()); + else $commentlist.prev().prev().replaceWith($newComList.prev()); + $commentlist.replaceWith($newComList); + }else{ + if(yjlSettings.repForm=='disable')$newComList.prev().andSelf().insertBefore($respond); + else $newComList.prev().andSelf().insertAfter($respond); + } + $commentlist=$newComList; + if(yjlSettings.pagination!='disable')pagination(); + $textarea.val(''); + } + });//end of ajax + return false; + });//end of submit function + + if(yjlSettings.autoGrow!='disable'){ + $textarea.autoResize({ + // On resize: + onResize : function() { + jQuery(this).css({opacity:0.8}); + }, + // After resize: + animateCallback : function() { + jQuery(this).css({opacity:1}); + }, + // Quite slow animation: + animateDuration : 300, + // More extra space: + extraSpace : 20 + }); + } \ No newline at end of file diff --git a/wp-content/plugins/wp-comment-master/readme.txt b/wp-content/plugins/wp-comment-master/readme.txt new file mode 100644 index 0000000..1d4ac57 --- /dev/null +++ b/wp-content/plugins/wp-comment-master/readme.txt @@ -0,0 +1,103 @@ +=== Plugin Name === +Contributors: bingjie2680 +Donate link: http://example.com/ +Tags: wordpress Comments, ajax comment, ajax comment posting,comment pager,comment pagination,ajax commenting,AjAX comment paging,comment paging,paged comments,paginated comments,AJAX comment page,AJAX comments +Requires at least: 2.8 +Tested up to: 3.1.3 +Stable tag: 1.7 + +== Description == +Are you looking for a real AJAX comment posting plugin? +Are you seeking for a better solution to present the long-list comments to your site visitors? +Then this plugin is for you. + +WP-comment-master is developed mainly in jQuery to enhance the experience of commenting for your site visitors. it has two main features:AJAX comment posting and comment pagination. the AJAX comment posting enables the commenters to post and view the comment instantly without refreshing the page, while the comment pagination paginates all comments into pages with a well presented and structured navigation. if you does not need either of these two features, you can simply disable it. + += Something to note: = +* SEO:pagination still enables your comment to be indexed by Search Engine Crawler +* Minimize Dom traversal to optimize the performance(this is crucial when you use many plugins) +* Compatible up to the newest verson +* Tested with many themes and in all major browsers +* Custom settings eanbled + +Please note that this plugin should work with most wordpress themes, but may not work with some themes due to your different theme css construct, in this case, you can leave a comment to me and I will help you get it to work. + +See it in action [here](http://yjlblog.com/?p=11#comments) + +== Installation == +1. Go to your site admin->plugins->add new, and search for wp-comment-master. +1. Install it directly and activate it + += or = + +1. Download the 'wp-comment-master' plugin from [plugin site](http://yjlblog.com/?p=11) +1. Upload `wp-comment-master` to the `/wp-content/plugins/` directory +1. Activate the plugin through the 'Plugins' menu in WordPress + +In order for the comment pagination to work in a best outcome, it is suggested to do the following settings: +go to site admin panel->settings->discussion, and check that the option below is not ticked: + +* Break comments into pages with top level comments per page and the last first page displayed by default +Comments should be displayed with the oldernewer comments at the top of each page + +and now you are ready to go... + +== Screenshots == + +Screenshot and Demo see [here](http://yjlblog.com/?p=11#comments) + +== Changelog == += 1.7 = +* correct depreciated api + += 1.6 = +* removed settings for dysfuncational AJAX comment +* javascript code remain beautified, so you can make any changes + += 1.5 = +*Small adjustment of css pager number, should be a bit better user-friendly now + += 1.4 = +* comment form textarea auto grow function added(this feature is based on [James Padolsey's](http://james.padolsey.com) plugin +* fiexed the bug that it didn't work with Atahualpa theme +* corrected some spelling errors + += 1.3 = +* code optimized(less code) and absolutly even better performance +* enabled the comment form position back to the top or bottom of comment list after a reply +* enabled custom output text +* attempt to recover dysfunction AJAX posting added for some themes that have a diffrent css construct +* the option to enable or disable AJAX posting is removed +* After AJAX posting, pagination will always locate where the new comment is + += 1.2 = +* Solved the problem that 'unlogged' in user can not view post instantly in IE, now very visitor can experience the AJAX commenting. +* Fixed the bug that comment from disappeared after posting when page-number is positioned after commentlist +* load the script in footer instead of head to decrease your site loading time. +* 'Thank you' message displyed after successful submission of comment. + + += 1.1 = +* Fixed the bug that comment form disappeared after posting a reply when pagination is disabled +* Fixed some logic to be compatible with more themes. +* fnables page-number to be positioned both before and after commentlist +* Animation effect is enabled during AJAX loading +* Fixed the bug that after a reply, the page-number jump back to the first page. + + +== Upgrade Notice == += 1.4 = +textarea auto grow featured added + += 1.3 = +less code, custom text output enabled, please notice some changes to Css construce and setting panel. + += 1.2 = +Sloved the problem of compatiable issue with IE, decrease your site loading time, AJAx commenting more friendly. + += 1.1 = +Compatiable with more themes, correct some confusions + + +== Frequently Asked Questions == +none diff --git a/wp-content/plugins/wp-comment-master/wp-comment-master.php b/wp-content/plugins/wp-comment-master/wp-comment-master.php new file mode 100644 index 0000000..2c25971 --- /dev/null +++ b/wp-content/plugins/wp-comment-master/wp-comment-master.php @@ -0,0 +1,182 @@ +get_option('com_paging'), + 'comPerpage'=>get_option('com_per_page'), + 'numPerpage'=>get_option('num_per_page'), + 'pagerPos'=>get_option('pager_pos'), + 'repForm'=>get_option('rep_form'), + 'gifUrl'=>WP_PLUGIN_URL.'/wp-comment-master/ajax-loader.gif', + 'prev'=>get_option('yjlprev'), + 'next'=>get_option('yjlnext'), + 'timeOut'=>get_option('yjltimeout'), + 'fast'=>get_option('yjlfast'), + 'thank'=>get_option('yjlthank'), + 'order'=>get_option('comment_order'), + 'autoGrow'=>get_option('autogrow') + )); + } +} + +add_action('admin_init', 'wpcm_admin_init'); +function wpcm_admin_init(){ + wp_enqueue_script('admin_js', WP_PLUGIN_URL.'/wp-comment-master/admin.js',array('jquery'),'',true); +} + +add_action('admin_menu', 'mt_add_pages'); +// action function for above hook +function mt_add_pages() { + add_options_page('WP-comment-master','WP-comment-master', 'level_4', 'WP-comment-master', 'YJL_options'); + add_action( 'admin_init', 'register_mysettings' ); +} + +function register_mysettings() { + //register our settings + register_setting( 'YJL-settings-group', 'com_paging' ); + register_setting( 'YJL-settings-group', 'com_per_page' ); + register_setting( 'YJL-settings-group', 'num_per_page' ); + register_setting( 'YJL-settings-group', 'pager_pos' ); + register_setting( 'YJL-settings-group', 'rep_form' ); + register_setting( 'YJL-settings-group', 'yjlprev' ); + register_setting( 'YJL-settings-group', 'yjlnext' ); + register_setting( 'YJL-settings-group', 'yjltimeout' ); + register_setting( 'YJL-settings-group', 'yjlfast' ); + register_setting( 'YJL-settings-group', 'yjlthank' ); + register_setting( 'YJL-settings-group', 'autogrow' ); +} + +function YJL_options() { ?> +
+

WP-Comment-Master Settings:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Reposition the comment form before all comments + + >Enable + >Disable +
Textarea autogrow + + >Enable + >Disable +
+
Pagination settings:
Comment Pagination + + >Enable + >Disable +
Comments per page
(If you enable threaded comments,threaded comments does not count towards this number.)
Number of page-number to show (default 5) +
Page-number position + + >Before comments
+ >After comments
+ >Both before and after comments +
Custom output Text:
Default Text:Custom Text:
'Prev'
'Next'
'Error:Server time out,try again!'
'Please slow down,you are posting to fast!'
'Thank you for your comment!'
+

+ +

+
+

Thank you for using wp-comment-master, if you have any suggestion,you are very welcom to visit me

+
+ \ No newline at end of file diff --git a/wp-content/themes/score/comments.bak.php b/wp-content/themes/score/comments.bak.php new file mode 100644 index 0000000..b8254eb --- /dev/null +++ b/wp-content/themes/score/comments.bak.php @@ -0,0 +1,205 @@ + + + + + $post->ID, 'user_id' => $current_user->ID); +$usercomment = get_comments($args); + +function comment_template($comment, $args, $depth) { +$GLOBALS['comment'] = $comment; +global $post, $gp_settings; + +require(ghostpool_inc . 'options.php'); + +?> + +
  • id="li-comment-"> + +
    + +
    + +
    + +
    + + + + + + + +
    + +
    + , +
    + + + +
    + + +
    + +
    + + +
    + +
    + + comment_approved == '0') { ?> +
    + +
    + +
    + + + + + + + +
    + + + + +comment_status OR have_comments()) { ?> + +
    + +

    + + + + + +
      + +
    + + 1) { ?> +
    + + + comment_status) { // If comments are open, but there are no comments yet ?> + + + + + + + + + + + + comment_status) { ?> + + +
    = $comment_number) { ?> class="hidden"> + + +
    + +

    + + + +

    + + + +
    + + +
    +
    +
    + +
    +
    + + + + +

    />

    + +

    />

    + +

    + + + +

    + + + + + + ID); ?> + +
    + + + +
    + + +
    + + + + + = $comment_number) { ?> + +
    + + + + +comment_status OR have_comments()) { ?> +
    + + \ No newline at end of file diff --git a/wp-content/themes/score/comments.php b/wp-content/themes/score/comments.php index b8254eb..a78e3a0 100644 --- a/wp-content/themes/score/comments.php +++ b/wp-content/themes/score/comments.php @@ -64,12 +64,6 @@ require(ghostpool_inc . 'options.php'); - -
    - -
    - -
    @@ -81,125 +75,70 @@ require(ghostpool_inc . 'options.php');
    - - - - - - - - - -comment_status OR have_comments()) { ?> - -
    - -

    - +
    + comment_status OR have_comments()) : ?> - - -
      - -
    - - 1) { ?> -
    - +

    + +
      + +
    - comment_status) { // If comments are open, but there are no comments yet ?> - - - - - - - - - - - - comment_status) { ?> - - -
    = $comment_number) { ?> class="hidden"> - - -
    - -

    + - - -

    - - - -
    + + - -
    -
    -
    - -
    -
    - - - - -

    />

    - -

    />

    - -

    - - - -

    - - - - - - ID); ?> - -
    - - - -
    - - -
    - - - + + +

    - = $comment_number) { ?> - -
    - - - - -comment_status OR have_comments()) { ?> -
    - - \ No newline at end of file + + +
    + + + +
    +

    +
    + +
    + +

    + +
    + + +

    %2$s.'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity); ?>

    + + + +

    /> +

    + +

    /> +

    + +

    +

    + + + + + +

    + +

    + +

    + ID); ?> +
    +
    + +
    + + diff --git a/wp-content/themes/score/header.php b/wp-content/themes/score/header.php index 60772ab..0296c12 100644 --- a/wp-content/themes/score/header.php +++ b/wp-content/themes/score/header.php @@ -55,7 +55,7 @@