ID:913012
 
Resolved
Applies to:Website
Status: Resolved

This issue has been resolved.
This should be fairly simple and quick to do. Automatically load more games as you scroll down the BYOND.com games listings. Most modern websites nowadays do it and it makes content much more accessible.

Little things like this will bring life to the site and make it feel more professional.
+1 simple to implement shouldn't take long at all..
I went ahead and added this feature to the mockup I was working on awhile back to show how it might work. And hopefully convince you to do it.

http://iccusion.com/byond/games/

I noticed you guys use jQuery, so I went ahead and used it. I don't have access to the database, so I just made it load the same games over and over.

Using a noscript tag around the page HTML stuff would allow people without Javascript enabled to still change pages manually.

Basically what I did was use a PHP function to print the search_results_table table and a div called load_end with an id that represents the number of loaded elements (carrying it over with AJAX to increase the number of the next one). The search_results_table div isn't included in the function, it's used to append the new content (gave it the id of load_games_div).

Then I used this script.
var loading = false;

$(window).scroll(function() {
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
newInfo();
}
});

function newInfo() {
if (loading) return;
loading = true;
$.ajax({url:'ajax.php?func=loadMoreGames&count=' + $('.load_end:last').attr('id'), success:function(result) {
$('#load_games_div').append(result);
loading = false;
}});
}


I don't know much about jQuery, I normally do everything myself, so there might be a better way.

But that's the general idea.
Just chipping in to say, nicely done and solid suggestion IMO.
+1 gets annoying clicking to the next page.
I support this! (:
Can anything fit in the right side of the screen when scrolled down far? The games list only takes 2/3 of the width, of course. Maybe something that follows your scrolling down?
I'd enjoy this- if it were optional.
Correct me if I am wrong, but doesn't BYOND get paid based on both pageviews and clicks of ads, and if they get paid based on pageviews then wouldnt a system which dramatically reduces page refreshes be something they would avoid on purpose? Not saying your suggestion isnt awesome, but there is probably a reason for the constantly refreshing pages.
We don't make any money on page views. The main reason not to do this (aside from dev testing etc) is just that we make extensive use of caching so it would be more involved than just throwing in some javascript.
In response to Tom
I wasn't trying to imply that it was just a script and you're done. The code used to display the games list table is moved into its own file, which can still be cached. I don't recall what language you guys use for the website, but I prefer PHP, so I used it for my example.

http://iccusion.com/byond/games/ ajax.php?func=loadMoreGames&count=20

//include needed files for database, caching, whatever

function loadGames($pCount) {
if($pCount) echo('<div style="height: 10px;"></div>');
//code to display the proper search_results_table and set $addCount
echo('<div class="load_end" id="' . $pCount + $addCount . '"></div>');
}

if (isset($_GET['func'])) {
if ($_GET['func'] == 'loadMoreGames') {
if (isset($_GET['count'])) {
$count = (int)$_GET['count'];
loadGames($count);
}
}
}


And then the index file would include this to call the first group.

//include other file somewhere

echo('<div class="search_results_table" id="load_games_div">' . loadGames(0) . '</div>');


Of course what I did was the basics of it. You'd still need other stuff to make it a little more user-friendly like a return to top link or a footer that scrolls with you, or whatever.

Normally I would have just left this alone after you denied it, but it just seemed you sort of implied that I was ignorant on the subject (maybe unintentionally), so I just wanted to defend myself a bit.
Oh, it wasn't meant as a criticism. I just wanted to point out that we have a lot of design around the an existing per-page caching mechanism, so it'd require some reworking. I think it's a cool idea and do like this on other sites. I wouldn't call any web stuff a real priority at the moment though.
In response to Aaiko
I believe it as C C# C++ one of those.
The site is written in perl.
In response to A.T.H.K
A.T.H.K wrote:
I believe it as C C# C++ one of those.

I think it's Perl now that I look at it.

In response to Tom
Tom wrote:
The site is written in perl.

Way off .. lol, Perhaps you could write a GreaseMonkey script in the mean time as Tom said Web stuff is not a real priority.
Fugsnarf resolved issue