• I’ve just posted Samsarin PHP Widget v0.2.

    Features:

    – Works almost identically to the default text widget.
    – Allows entry of PHP, HTML, or text for both the title and the body.
    – Empty title removes the $before_title and after $after_title text. This leaves the body floating without a title – good for ad blocks and the like.

    https://samsarin.com/2006/08/06/samsarin-php-widget/

Viewing 15 replies - 1 through 15 (of 15 total)
  • I tried your widget and it worked with html, but Php Code didn’t get parsed.

    It did show up in the source code. I’m running WP 2.0.4.

    Will it work with javascript? My plan is to display different google-ads depending on the category being displayed.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    The ExecPHP widget does the exact same thing, and has for the last 4 months.
    https://widgets.wordpress.com/2006/04/10/execphp/

    Not to discourage widget development, because widget development is good, but why reinvent the wheel? Always look through https://widgets.wordpress.com before writing a new widget. Might save you some time in the future. ??

    Thread Starter samsarin

    (@samsarin)

    Otto:

    Thanks for the heads up about your widget. There are at least three widgets that have similar functionality out there (include both of ours). However, none addressed my specific needs (and I was not aware of yours, nor can I now find the features), so I was locked into writing it anyway.

    A capatalistic way to look at this is that everyone has at least three choices now and they can choose whichever one has the features they need.

    Edit: I looked the ExecPHP plugin, but it did not satisfy all of my requirements. Thanks tho for bringing it to my attention.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    I was not aware of yours

    I understand that. All I’m saying is that looking through https://widgets.wordpress.com might have saved you some time.

    As for features, it really doesn’t need a list or anything. I mean, it’s a Text Widget that will run PHP code. How much more feature rich can you get? ??

    – Allows entry of PHP, HTML, or text for both the title and the body.
    – Empty title removes the $before_title and after $after_title text. This leaves the body floating without a title – good for ad blocks and the like.

    Thread Starter samsarin

    (@samsarin)

    Bruno, please make sure to put the PHP code between <?php and ?> as you would when editing the .php files directly. Javascript will work in the widget.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Yosemite: ExecPHP does all of those except allowing PHP in the title, as it seems a bit pointless.. However, calling those “features” seems pretty thin anyway, as the default Text widget does exactly the same things, except for actually executing PHP code.

    Anyway, this is pointless. I was really just wanting to point people to https://widgets.wordpress.com , not draw attention to my own widget. I mean, ExecPHP took all of 5 minutes to write anyway, as it’s just a copy of the Text Widget with an added eval in it. Anybody could do it. ??

    Can someone post the actual code for this widget? The webpage that had it located on there was remove and I’m not sure how to change my archives to use this one! Thanks!

    Thread Starter samsarin

    (@samsarin)

    It is back up: https://samsarin.com/samsarin-php-widget

    Sorry for the inconvenience.

    Looks as if WP 2.2 may have broken this widget, if I have multiple copies of the widget running they all display the code of #1.

    Agreed, 2.2 has broken both ExecPHP and Samsarin PHP. Only the code in the first widget works (it repeats in every other widget you try to add).

    Looks like Erik’s Widgetize Anything php widget also is broken in WP 2.2.

    Sidebar Modules by Nybble Labs breaks with WP 2.2 as well, which totally irks me. It’s the only sidebar plugin that allows you to select what widget appears on each individual page, and I relied on that heavily.

    I’ve de-activated the built-in WordPress Widget feature with *another* widget, reinstalled Side Bar Modules, and it’s working for now.

    Also, my site is now slower than molasses rolling uphill in the winter.

    !@#$%. >:(

    I tweaked widgets.php as described in this ticket and EXECphp is back in business.

    Thread Starter samsarin

    (@samsarin)

    FYI, I have modified Samsarin PHP Widget 1.1 to support WordPress 2.2 (without the modified widgets.php). Fortunately, it looks like this issue should be resolved in the next release of WordPress.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Samsarin PHP Widget v0.2’ is closed to new replies.