Hi!
I have a solution for infinite scrolling items. This is for "modern" theme, but you can use on your own too...
1. step
Download this jquery plugin from here:
http://www.fieg.nl/wp-content/themes/fieg-b/js/jquery.ias.min.jsAnd upload into your theme js folder ( oc-content/themes/modern/js/ )
2. step
Open your search.php
Insert into <head> section:
<script type="text/javascript" src="<?php echo osc_current_web_theme_js_url('jquery.ias.min.js') ; ?>"></script>
And put this code at the and of the search.php, BEFORE the </body> tag:
<script type="text/javascript">
jQuery.ias({
container : '.ad_list',
item: '.myitem',
pagination: '#main .paginate',
next: '.searchPaginationNext',
loader: '<?php echo osc_current_web_theme_url('images/loader.gif'); ?>'
loaderDelay: 100,
triggerPageTreshold: 3,
trigger: 'More items',
tresholdMargin: 0,
history : true
});
</script>
Here is the options for jQuery.ias what you can modify in:
https://github.com/webcreate/infinite-ajax-scrollThis is modifying your PAGINATION, so it must be use the pagination funcion in search.php!
Create your own ajax loader.gif if you want:
http://www.ajaxload.info/
and put into the theme image folder.
Now, the last step is to give your items a class (in this example .myitem)
modify search_list.php ( like this, important the div and class="myitem" )
<?php while(osc_has_items()) { ?>
<div class="myitem" onclick="location.href='<?php echo osc_item_url() ; ?>'" style="cursor:pointer;">
<table border="0" cellspacing="0">
<tbody>
<?php $class = "even" ; ?>
<tr class="<?php echo $class; ?>">
<?php if( osc_images_enabled_at_items() ) { ?>
<td class="photo">
<?php if(osc_count_item_resources()) { ?>
<img src="<?php echo osc_resource_thumbnail_url() ; ?>" width="100" height="80" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" />
<?php } else { ?>
<img src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" title="" alt="" />
<?php } ?>
</td>
<?php } ?>
<td class="text">
<strong style="font-size:11pt;text-transform: lowercase;margin-bottom:8px; background-color:#9CAF1E;-webkit-border-radius: 3px;border-radius: 3px;-moz-border-radius: 3px;padding: 1px 3px 2px;color:#fff;"><?php if( osc_price_enabled_at_items() ) { echo osc_item_formated_price() ; ?></strong>
<h3>
<span style="float:left;margin-top:4px;"><?php echo osc_highlight( strip_tags( osc_item_title() ) ); ?></span><span style="float:right;"><?php echo osc_item_category() ; ?></span>
</h3><br />
<p style="clear: left;">
<strong><?php } echo osc_item_city(); ?> (<?php echo osc_item_region(); ?>) - <?php echo osc_format_date(osc_item_pub_date()); ?></strong>
</p>
<p><?php echo osc_highlight( strip_tags( osc_item_description()),180 ) ; ?></p>
</td>
</tr>
<?php $class = ($class == 'even') ? 'odd' : 'even' ; ?>
</tbody>
</table>
</div>
<?php } ?>
In your admin, set a number to show in Settings > General
Search page shows 5 listings at most.
And finally, edit your style.css, put into this:
.ias_loader, .ias_trigger {
text-align:center;
margin: 30px 0 40px;
}
.ias_trigger a:link,
.ias_trigger a:visited {
padding: 4px 50px;
background-color: #f9f9f9;
border: solid 1px #ddd;
border-radius: 2px;
font: bold 12px Arial, sans-serif;
color: #555;
text-decoration: none;
}
.ias_trigger a:hover,
.ias_trigger a:active {
border-color: #ccc;
}
Save, upload, refresh.
Done.