Ignore:
Timestamp:
Feb 16, 2012, 8:51:48 PM (12 years ago)
Author:
rvelices
Message:

rv_tscroller can load thumbnail up (if page[start]>0)

File:
1 edited

Legend:

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

    r12735 r13194  
    11<?php /*
    22Plugin Name: RV Thumb Scroller
    3 Version: 2.3.d
     3Version: 2.4.a
    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.3.d');
     9define('RVTS_VERSION', '24a');
    1010
    1111class RVTS
     
    1414{
    1515        global $page;
    16         if (!@$page['start'])
     16        $page['nb_image_page'] *= pwg_get_session_var('rvts_mult', 1);
     17        if (count($page['items'])<$page['nb_image_page']+3)
    1718        {
    18                 if (script_basename()!='picture')
    19                         $page['nb_image_page'] *= pwg_get_session_var('rvts_mult', 1);
    20                 if (count($page['items'])<$page['nb_image_page']+3)
     19                if (!@$page['start'] || script_basename()=='picture')
    2120                        $page['nb_image_page'] = max($page['nb_image_page'], count($page['items']));
    2221        }
     
    3029        if (!$is_ajax)
    3130        {
    32                 if (empty($page['items']) || @$page['start']>0)
     31                if (empty($page['items']))
    3332                        add_event_handler('loc_end_index', array('RVTS','on_end_index'));
    3433                else
     
    6362                return $thumbs;
    6463        }
    65         $per_page = $page['nb_image_page'];
    6664        $url_model = str_replace('123456789', '%start%', duplicate_index_url( array('start'=>123456789) ) );
    6765        $ajax_url_model = add_url_params($url_model, array( 'rvts'=>'%per%' ) );
     
    8482                        'version' => RVTS_VERSION,
    8583                ), $template->smarty);
     84  $start = (int)$page['start'];
     85        $per_page = $page['nb_image_page'];
    8686        $moreMsg = 'See the remaining %d photos';
    8787        if ('en' != $GLOBALS['lang_info']['code'])
     
    9595                "var RVTS = {
    9696ajaxUrlModel: String.fromCharCode(".ord($ajax_url_model[0]).")+'".substr($ajax_url_model,1)."',
    97 start: $per_page,
     97start: $start,
     98perPage: $per_page,
     99next: ".($start+$per_page).",
    98100total: $total,
    99 perPage: $per_page,
    100101moreUrlModel: String.fromCharCode(".ord($url_model[0]).")+'".substr($url_model,1)."',
    101102moreMsg: '$moreMsg',
     103prevMsg: '".l10n("Previous")."',
    102104ajaxLoaderImage: '$ajax_loader_image'
    103105};",
     
    140142
    141143add_event_handler('loc_end_section_init', array('RVTS','on_end_section_init'));
    142 
    143144?>
Note: See TracChangeset for help on using the changeset viewer.