<?php if (function_exists('snap_my_roll')){snap_my_roll();} ?>. Version: 0.7 Author: Denis Balencourt Author URI: http://www.balencourt.com/blog/snap-my-roll */ function imagecompare($img1, $img2) { if (imagesx($img1)!=imagesx($img2) || imagesy($img1)!=imagesy($img2)){ return false; } for( $x=0; $xget_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"; //determine upload directory $directory = get_option('home') .'/'. get_option('upload_path'); $exceeded = imagecreatefrompng ("exceeded.png"); //lets print the list of images echo '\n
  • "; } function widget_snap_my_roll_init() { if (!function_exists('register_sidebar_widget')) { return; } function widget_snap_my_roll($args) { extract($args); echo $before_widget . $before_title . $after_title; if(!$options = get_option('snap_my_roll')) $options = array('title'=>'Snap My Roll', 'size'=>'s', 'key'=>'Enter your key'); snap_my_roll($options['title'], $options['size'], $options['key']); echo $after_widget; } function widget_snap_my_roll_options() { if(!$options = get_option('snap_my_roll')) $options = array('title'=>'Snap My Roll', 'size'=>'s', 'key'=>'Enter your key'); if($_POST['snap_my_roll-submit']) { $options = array('title' => $_POST['snap_my_roll-title'], 'size' => $_POST['snap_my_roll-size'], 'key' => $_POST['snap_my_roll-key']); update_option('snap_my_roll', $options); } echo '

    Widget Title:

    '; echo '

    Websnapr Key:

    '; echo 'No Key ? Get One !

    '; echo '

    Select a snapshot size
    '; echo ' Tiny [92x70 pixels]
    '; echo ' Small [202x152 pixels]
    '; echo ' Medium [400x300 pixels]

    '; echo ''; } register_sidebar_widget('Snap My Roll','widget_snap_my_roll'); register_widget_control('Snap My Roll','widget_snap_my_roll_options', 200, 200); } add_action('plugins_loaded', 'widget_snap_my_roll_init'); ?>