Has anybody a working example of this?
I found out that there are two instances of the code need to be replaced for PHP5. At least when I only replace the first, there are more errors. When only replacing the second instance, no errors, but it doesn't work, same as replacing both.
Main problem seems to be that the blogger's settings are not saved. A publisher ID can be entered and the rest can be changed. After saving changes, it is still there when clicking again on the adsense widget. But when doing anything else (for example going to Themes tab and then back to widgets), the user code has disappeared. Other widgets, like the text one, do keep their info.
Any thoughts? Thanks
ps: WPMU 1.2.3
-----
Some extra info from the widget code:
// Save changes
update_option('widget_adsense', $options);
}
I am not sure how other widgets do this, but I cannot see how this line can save anything anywhere? What is missing?
-----
and some more info:
this is the last part of the code that should register/save?
foreach($options as $key => $value): ?>
<p style="text-align:left"><label for="adsense-<?=$key?>"><?=$key?>: <input style="width: 200px;" id="adsense-<?=$key?>" name="adsense-<?=$key?>" type="text" value="<?=htmlspecialchars($value, ENT_QUOTES)?>" /></label></p>
<? endforeach;
echo '<input type="hidden" id="adsense-submit" name="adsense-submit" value="1" />';
}
// This registers our widget so it appears with the other available
// widgets and can be dragged and dropped into any active sidebars.
register_sidebar_widget('Google AdSense', 'widget_adsense');
// This registers our optional widget control form. Because of this
// our widget will have a button that reveals a 300x100 pixel form.
register_widget_control('Google AdSense', 'widget_adsense_control', 220, 50 * count(widget_adsense_options()));
}
'