Hallo,
kann mir vielleich jemand sagen, wie man den Timestamp von diesem Widget entfernt? Vielen Dank im Voraus!
Code
function widget_Twidget_init() {
if ( !function_exists('register_sidebar_widget') )
return;
function widget_Twidget($args) {
// "$args is an array of strings that help widgets to conform to
// the active theme: before_widget, before_title, after_widget,
// and after_title are the array keys." - These are set up by the theme
extract($args);
// These are our own options
$options = get_option('widget_Twidget');
$account = $options['account']; // Your Twitter account name
$title = $options['title']; // Title in sidebar for widget
$show = $options['show']; // # of Updates to show
$follow = $options['follow']; // # of Updates to show
// Output
echo $before_widget ;
// start
echo '<div id="twitter">';
echo '<h3><span>'.$title.'</span></h3>';
echo '<ul id="twitter_update_list"><li></li></ul>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>';
echo '<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/'.$account.'.json?callback=twitterCallback2&count='.$show.'"></script>';
echo '<p class="website"><a href="http://www.twitter.com/'.$account.'/" title="'.$follow.'">'.$follow.'</a></p></div>';
// echo widget closing tag
echo $after_widget;
}
// Settings form
function widget_Twidget_control() {
// Get options
$options = get_option('widget_Twidget');
// options exist? if not set defaults
if ( !is_array($options) )
$options = array('account'=>'Google', 'title'=>'Twitter Updates', 'show'=>'3', 'follow'=>'Follow us on Twitter');
// form posted?
if ( $_POST['Twitter-submit'] ) {
// Remember to sanitize and format use input appropriately.
$options['account'] = strip_tags(stripslashes($_POST['Twitter-account']));
$options['title'] = strip_tags(stripslashes($_POST['Twitter-title']));
$options['show'] = strip_tags(stripslashes($_POST['Twitter-show']));
$options['follow'] = strip_tags(stripslashes($_POST['Twitter-follow']));
update_option('widget_Twidget', $options);
}
// Get options for form fields to show
$account = htmlspecialchars($options['account'], ENT_QUOTES);
$title = htmlspecialchars($options['title'], ENT_QUOTES);
$show = htmlspecialchars($options['show'], ENT_QUOTES);
$follow = htmlspecialchars($options['follow'], ENT_QUOTES);
// The form fields
echo '<p style="text-align:right;">
<label for="Twitter-account">' . __('Account:') . '
<input style="width: 200px;" id="Twitter-account" name="Twitter-account" type="text" value="'.$account.'" />
</label></p>';
echo '<p style="text-align:right;">
<label for="Twitter-title">' . __('Title:') . '
<input style="width: 200px;" id="Twitter-title" name="Twitter-title" type="text" value="'.$title.'" />
</label></p>';
echo '<p style="text-align:right;">
<label for="Twitter-show">' . __('Show:') . '
<input style="width: 200px;" id="Twitter-show" name="Twitter-show" type="text" value="'.$show.'" />
</label></p>';
echo '<p style="text-align:right;">
<label for="Twitter-follow">' . __('Follow us:') . '
<input style="width: 200px;" id="Twitter-follow" name="Twitter-follow" type="text" value="'.$follow.'" />
</label></p>';
echo '<input type="hidden" id="Twitter-submit" name="Twitter-submit" value="1" />';
}
// Register widget for use
register_sidebar_widget(array('Bizz → Twitter', 'widgets'), 'widget_Twidget');
// Register settings for use, 300x200 pixel form
register_widget_control(array('Bizz → Twitter', 'widgets'), 'widget_Twidget_control', 300, 200);
}
// Run code and init
add_action('widgets_init', 'widget_Twidget_init');
?>
Alles anzeigen