<?php if (function_exists('snap_my_roll')){snap_my_roll();} ?>.
Version: 0.6
Author: Denis Balencourt
Author URI: http://www.balencourt.com/blog/snap-my-roll
*/
function snap_my_roll($title,$size,$key){
global $wpdb;
$js_url = get_option('siteurl') . '/wp-content/plugins/snap-my-roll/' . 'js/';
//store links in an array
$my_query = "SELECT link_name, link_url FROM wp_links WHERE link_visible = 'Y'";
$links = $wpdb->get_results($my_query, OBJECT);
//rand the the array and slice it to 20 elements
shuffle($links);
if (count($links)>20){
$links = array_slice($links,0,20);
}
//build the javascript
echo "
\n\t
".$title."
\n";
echo ''."\n";
echo ''."\n";
echo '\n";
//lets print the list of images
echo '