It really depends on how your backend is created, there is no "plug and play" solution. But a good start would be to first read the section "Defining "settingsvar" dynamically" on the supplimentary page. The general idea is to dynamically write out the "settings" portion of the script based on info from your backend, for example:
PHP Code:
<?php
echo "<script type='text/javascript'>\n"; //Dynamically output JavaScript opening tag
echo "var mysettings={}\n"; //Dynamically output javascript variable
$commentids=mysql_query("select id from comments order by date limit 5"); //get IDs to last 5 comment pages
$idarray=array();
while ($theid=mysql_fetch_array($commentids)){
array_push($idarray, "'http://www.mysite.com/comments.php?id=" . $theid[id] . "'");
}
echo "mysettings.page=[" . implode(",", $idarray) . "]\n";
echo "mysettings.selectedpage=0\n";
echo "</script>\n"; //Dynamically output JavaScript closing tag
?>
Bookmarks