Hi there,
I've been hitting nothing but brick walls trying to implement the use of infinite scroll on one of my sites.
Most of the examples I have found online are done by loading static html pages...
In this style:
The closest to what I believe might work for Couch is something like the following:
I'm pretty sure I should be using the <cms:gpc 'my_parameter' /> tag, but can't seem to wrap my head around it...
my question is can this be done with a dynamic cms like Couch? If so, Any pointers would totally be appreciated. Thanks!
p.s. am patiently waiting the new Couch release with possible easier to use member support. That's going to be a game changer!
I've been hitting nothing but brick walls trying to implement the use of infinite scroll on one of my sites.
Most of the examples I have found online are done by loading static html pages...
In this style:
- Code: Select all
<script>
$(document).ready(function () {
$('#marker-end')
.on('lazyshow', function () {
$.ajax({
url: 'infinite.htm',
dataType: "html"
})
.done(function (responseText) {
// add new elements
$('#infinite').append(
$('<div>')
.append($.parseHTML(responseText))
.find('#infinite')
.children()
);
// process added elements
$(window).lazyLoadXT();
$('#marker-end').lazyLoadXT({visibleOnly: false, checkDuplicates: false});
});
})
.lazyLoadXT({visibleOnly: false});
});
</script>
The closest to what I believe might work for Couch is something like the following:
- Code: Select all
<?php
include('config.php');
$page = (int) (!isset($_GET['p'])) ? 1 : $_GET['p'];
# sql query
$sql = "SELECT * FROM actor_info ORDER BY id DESC";
# find out query stat point
$start = ($page * $limit) - $limit;
# query for page navigation
if( mysql_num_rows(mysql_query($sql)) > ($page * $limit) ){
$next = ++$page;
}
$query = mysql_query( $sql . " LIMIT {$start}, {$limit}");
if (mysql_num_rows($query) < 1) {
header('HTTP/1.0 404 Not Found');
echo 'Page not found!';
exit();
}
?>
I'm pretty sure I should be using the <cms:gpc 'my_parameter' /> tag, but can't seem to wrap my head around it...
my question is can this be done with a dynamic cms like Couch? If so, Any pointers would totally be appreciated. Thanks!
p.s. am patiently waiting the new Couch release with possible easier to use member support. That's going to be a game changer!