Changeset 9813


Ignore:
Timestamp:
03/21/11 20:51:25 (9 years ago)
Author:
rvelices
Message:

2.2.b avoid google bot retrieving ajax pages used by rv_tscroller

Location:
extensions/rv_tscroller
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_tscroller/main.inc.php

    r8935 r9813  
    11<?php /* 
    22Plugin Name: RV Thumb Scroller 
    3 Version: 2.2.a 
     3Version: 2.2.b 
    44Plugin URI: http://piwigo.org/ext/extension_view.php?eid=493 
    55Description: Loads async using ajax thumbnails on index page as you scroll down the page 
     
    77Author URI: http://www.modusoptimus.com 
    88*/ 
    9 define('RVTS_VERSION', '2.2.a'); 
     9define('RVTS_VERSION', '2.2.b'); 
    1010 
    1111class RVTS 
     
    6565        $per_page = $page['nb_image_page']; 
    6666        $url_model = str_replace('123456789', '%start%', duplicate_index_url( array('start'=>123456789) ) ); 
    67         $ajax_url_model = add_url_params($url_model, array( 'rvts'=>'' ) ); 
     67        $ajax_url_model = add_url_params($url_model, array( 'rvts'=>'%per%' ) ); 
    6868 
    6969        $url_model = str_replace('&amp;', '&', $url_model); 
     
    9191        } 
    9292        $repeat=false; 
     93        // the String.fromCharCode comes from google bot which somehow manage to get these urls 
    9394        $template->block_footer_script(null, 
    9495                "var RVTS = { 
    95 ajaxUrlModel: '$ajax_url_model'+'%per%', 
     96ajaxUrlModel: String.fromCharCode(".ord($ajax_url_model[0]).")+'".substr($ajax_url_model,1)."', 
    9697start: $per_page, 
    9798total: $total, 
    9899perPage: $per_page, 
    99 urlModel: '$url_model', 
     100moreUrlModel: String.fromCharCode(".ord($url_model[0]).")+'".substr($url_model,1)."', 
    100101moreMsg: '$moreMsg', 
    101102ajaxLoaderImage: '$ajax_loader_image' 
  • extensions/rv_tscroller/rv_tscroller.js

    r8900 r9813  
    2424                                RVTS.$thumbs.after( 
    2525                                        '<div style="text-align:center;font-size:180%;margin:0 0 20px"><a href="' 
    26                                         +RVTS.urlModel.replace('%start%', RVTS.start)+'">' 
     26                                        +RVTS.moreUrlModel.replace('%start%', RVTS.start)+'">' 
    2727                                        +RVTS.moreMsg.replace('%d', RVTS.total-RVTS.start) 
    2828                                        +'</a></div>'); 
     
    4040        var tBot=RVTS.$thumbs.position().top+RVTS.$thumbs.outerHeight() 
    4141                ,wBot=$(window).scrollTop()+$(window).height(); 
    42         tBot -= !evt ? 0:40; //begin 40 pixels before end 
     42        tBot -= !evt ? 0:90; //begin 90 pixels before end 
    4343        return tBot <= wBot ? (RVTS.doAutoScroll(),1) : 0; 
    4444}, 
  • extensions/rv_tscroller/rv_tscroller.min.js

    r8900 r9813  
    1 window.jQuery&&window.RVTS&&function(a){a(".navigationBar").hide();RVTS=a.fn.extend(RVTS,{loading:0,adjust:0,doAutoScroll:function(){if(!(RVTS.loading||RVTS.start>=RVTS.total)){var b=RVTS.ajaxUrlModel.replace("%start%",RVTS.start).replace("%per%",RVTS.perPage);if(RVTS.adjust){b+="&adj="+RVTS.adjust;RVTS.adjust=0}a("#ajaxLoader").show();RVTS.loading=1;a.ajax({type:"GET",dataType:"html",url:b,success:function(c){RVTS.start+=RVTS.perPage;RVTS.$thumbs.append(c);if(RVTS.start>500&&RVTS.total>550){RVTS.$thumbs.after('<div style="text-align:center;font-size:180%;margin:0 0 20px"><a href="'+ RVTS.urlModel.replace("%start%",RVTS.start)+'">'+RVTS.moreMsg.replace("%d",RVTS.total-RVTS.start)+"</a></div>");RVTS.total=0}},complete:function(){RVTS.loading=0;a("#ajaxLoader").hide()}})}},checkAutoScroll:function(b){var c=RVTS.$thumbs.position().top+RVTS.$thumbs.outerHeight(),d=a(window).scrollTop()+a(window).height();c-=!b?0:40;return c<=d?(RVTS.doAutoScroll(),1):0},engage:function(){var b=a(window);RVTS.$thumbs=a("#thumbnails");RVTS.$thumbs.append('<div id="ajaxLoader" style="display:none;position:fixed;bottom:32px;right:1%;z-index:999"><img src="'+ RVTS.ajaxLoaderImage+'" width="128" height="15" alt="~"></div>');b.scrollTop(0);if(RVTS.$thumbs.outerHeight()<b.height())RVTS.adjust=1;else if(RVTS.$thumbs.height()>2*b.height())RVTS.adjust=-1;b.bind("scroll resize",RVTS.checkAutoScroll);RVTS.checkAutoScroll()&&window.setTimeout(RVTS.checkAutoScroll,1500)}});a(document).ready(function(){window.setTimeout(RVTS.engage,250)})}(jQuery); 
     1window.jQuery&&window.RVTS&&function(a){a(".navigationBar").hide();RVTS=a.fn.extend(RVTS,{loading:0,adjust:0,doAutoScroll:function(){if(!(RVTS.loading||RVTS.start>=RVTS.total)){var b=RVTS.ajaxUrlModel.replace("%start%",RVTS.start).replace("%per%",RVTS.perPage);if(RVTS.adjust){b+="&adj="+RVTS.adjust;RVTS.adjust=0}a("#ajaxLoader").show();RVTS.loading=1;a.ajax({type:"GET",dataType:"html",url:b,success:function(c){RVTS.start+=RVTS.perPage;RVTS.$thumbs.append(c);if(RVTS.start>500&&RVTS.total>550){RVTS.$thumbs.after('<div style="text-align:center;font-size:180%;margin:0 0 20px"><a href="'+ 
     2RVTS.moreUrlModel.replace("%start%",RVTS.start)+'">'+RVTS.moreMsg.replace("%d",RVTS.total-RVTS.start)+"</a></div>");RVTS.total=0}},complete:function(){RVTS.loading=0;a("#ajaxLoader").hide()}})}},checkAutoScroll:function(b){var c=RVTS.$thumbs.position().top+RVTS.$thumbs.outerHeight(),d=a(window).scrollTop()+a(window).height();c-=!b?0:90;return c<=d?(RVTS.doAutoScroll(),1):0},engage:function(){var b=a(window);RVTS.$thumbs=a("#thumbnails");RVTS.$thumbs.append('<div id="ajaxLoader" style="display:none;position:fixed;bottom:32px;right:1%;z-index:999"><img src="'+ 
     3RVTS.ajaxLoaderImage+'" width="128" height="15" alt="~"></div>');b.scrollTop(0);if(RVTS.$thumbs.outerHeight()<b.height())RVTS.adjust=1;else if(RVTS.$thumbs.height()>2*b.height())RVTS.adjust=-1;b.bind("scroll resize",RVTS.checkAutoScroll);RVTS.checkAutoScroll()&&window.setTimeout(RVTS.checkAutoScroll,1500)}});a(document).ready(function(){window.setTimeout(RVTS.engage,250)})}(jQuery); 
Note: See TracChangeset for help on using the changeset viewer.