<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>WordPress &#8250; Support Topic: Widget Logic and Samsarin PHP 1</title>
<link>http://wordpress.org/support/</link>
<description>WordPress &#8250; Support Topic: Widget Logic and Samsarin PHP 1</description>
<language>en</language>
<pubDate>Tue, 24 Nov 2009 15:06:07 +0000</pubDate>

<item>
<title>alanft on "Widget Logic and Samsarin PHP 1"</title>
<link>http://wordpress.org/support/topic/268637#post-1069509</link>
<pubDate>Sat, 09 May 2009 19:50:21 +0000</pubDate>
<dc:creator>alanft</dc:creator>
<guid isPermaLink="false">1069509@http://wordpress.org/support/</guid>
<description>&#60;p&#62;the plugin is trying to stay backwards-compatible so is using an old approach to multiple instances of a widget, and is registering the widget twice. the second time every time the widget admin interface loads just in case the number of widgets has changed, and this is AFTER widget logic has stepped in to add its controls, so this gets reset for that widget.&#60;/p&#62;
&#60;p&#62;i don't quite know how to make code like this work 100% but one workaround is to make it only do the re-register when the number of widgets changes. change&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function spw_admin_setup() {
    $options = get_option(&#38;#39;samsarin_php_widget&#38;#39;);
    if (isset($_POST[&#38;#39;samsarin_php_widget_number_submit&#38;#39;])) {
        $number = (int) $_POST[&#38;#39;samsarin_php_widget_number&#38;#39;];
        if ( $number &#38;lt; 1 ) $number = 1;
        if ($number &#38;gt; SPW_MAXWIDGETS) $number = SPW_MAXWIDGETS;
        $options[&#38;#39;number&#38;#39;] = $number;
    }

    update_option(&#38;#39;samsarin_php_widget&#38;#39;, $options);
    spw_register_plugin($options[&#38;#39;number&#38;#39;]);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;to&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function spw_admin_setup() {
    $options = get_option(&#38;#39;samsarin_php_widget&#38;#39;);
    if (isset($_POST[&#38;#39;samsarin_php_widget_number_submit&#38;#39;])) {
        $number = (int) $_POST[&#38;#39;samsarin_php_widget_number&#38;#39;];
        if ( $number &#38;lt; 1 ) $number = 1;
        if ($number &#38;gt; SPW_MAXWIDGETS) $number = SPW_MAXWIDGETS;
        $options[&#38;#39;number&#38;#39;] = $number;
        update_option(&#38;#39;samsarin_php_widget&#38;#39;, $options);
        spw_register_plugin($options[&#38;#39;number&#38;#39;]);
    }

}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;when you set the number of widgets you lose the widget logic field, but if you then reload the page it's back.
&#60;/p&#62;</description>
</item>
<item>
<title>alanft on "Widget Logic and Samsarin PHP 1"</title>
<link>http://wordpress.org/support/topic/268637#post-1069453</link>
<pubDate>Sat, 09 May 2009 18:39:04 +0000</pubDate>
<dc:creator>alanft</dc:creator>
<guid isPermaLink="false">1069453@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I see this problem too - though I don't use samsarin for PHP. i use otto's older PHP code widget &#60;a href=&#34;http://wordpress.org/extend/plugins/php-code-widget/&#34; rel=&#34;nofollow&#34;&#62;http://wordpress.org/extend/plugins/php-code-widget/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;i'll have a poke around to see why the samsarin widget does this
&#60;/p&#62;</description>
</item>
<item>
<title>cmalamed on "Widget Logic and Samsarin PHP 1"</title>
<link>http://wordpress.org/support/topic/268637#post-1067413</link>
<pubDate>Thu, 07 May 2009 13:38:05 +0000</pubDate>
<dc:creator>cmalamed</dc:creator>
<guid isPermaLink="false">1067413@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Greetings,&#60;br /&#62;
First, let me say that Widget Logic is brilliant and is allowing me to avoid having to make separate sidebars for different pages. Thanks very much.&#60;/p&#62;
&#60;p&#62;Since installing Widget Logic I installed the Samsarin PHP 1 plugin, which creates a widget that can handle PHP. The Widget Logic field does not show up in this plugin. Did I do something wrong? How can I use Widget Logic to control this php widget too? Thanks in advance.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
