"; } function widget_recentLastFmTracks($args) { extract($args); $options = get_option("widget_recentLastFmTracks"); if (!is_array( $options )) { $options = array( 'title' => 'Recent LastFM Tracks', 'username' => '', 'limit'=>'10' ); } echo $before_widget; echo $before_title; // echo $options['title']; echo $after_title; //Our Widget Content recentLastFmTracks_action($options['username'], $options['limit']); echo $after_widget; } // Backend options function recentLastFmTracks_control() { $options = get_option("widget_recentLastFmTracks"); if (!is_array( $options )) // Pruefe ob variable KEIN array ist { $options = array( 'title' => 'Recent LastFM Tracks', 'username' => '', 'limit'=>'10' ); } if ($_POST['recentLastFmTracks-Submit']) { $options['username'] = htmlspecialchars($_POST['recentLastFmTracks-username']); // variable $options['limit'] = htmlspecialchars($_POST['recentLastFmTracks-limit']); // variable update_option("widget_recentLastFmTracks", $options); // in option } ?>
Insert your LastFm username
Insert the limit of songs to show