WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: PHP Code Widget] Executable PHP widget – Not Working

[Resolved] [Plugin: PHP Code Widget] Executable PHP widget – Not Working

  • Uploaded executed the plugin

    I have a custom widgetized sidebar on a template page.

    Put in a query post call – showed nothing

    Put in text – it’s there

    Put in the <?php echo ‘testing!’; ?> and that didn’t show either…

    Hu?

    I have used this plugin before and it worked beautifully and unsure what I am doing wrong. Any help greatly appreciated.

    Thanks

    **Ann

    http://wordpress.org/extend/plugins/php-code-widget/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    Dunno. Works fine for me.

    Do you have any sort of caching plugins like super-cache or similar? Maybe you’re only seeing the cached version of the page. Clear the cache in that case.

    Hi,
    I try to put only a include:
    <?php include("http://url_smf/SSI.php?ssi_function=recentTopics"; ?>
    And didn’t work:
    Parse error: syntax error, unexpected ‘;’ in /path_to_wordpress/wp-content/plugins/php-code-widget/execphp.php(44) : eval()’d code on line 1

    function widget( $args, $instance ) {
    		extract($args);
    		$title = apply_filters( 'widget_title', empty($instance['title']) ? '' : $instance['title'], $instance );
    		$text = apply_filters( 'widget_execphp', $instance['text'], $instance );
    		echo $before_widget;
    		if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }
    			ob_start();
    /*Line 44*/		eval('?>'.$text);
    			$text = ob_get_contents();
    			ob_end_clean();
    			?>
    			<div class="execphpwidget"><?php echo $instance['filter'] ? wpautop($text) : $text; ?></div>
    		<?php
    		echo $after_widget;
    	}

    I didn’t known the problem (it’s not the problem for use ” or ‘).
    I try to put a simple echo “Hello World”, and it works, but not with an a include…
    Thanks

    Plugin Author Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    Well, this:
    <?php include("http://url_smf/SSI.php?ssi_function=recentTopics"; ?>

    Isn’t valid PHP code.

    For one thing, you’re missing the closing parenth.

    For another, you’re trying to include an HTTP URL as PHP code, which is incorrect.

    Sorry, I typed incorrectly the php code in the message, but it was right in the widget:
    <?php include("http://url_smf/SSI.php?ssi_function=recentTopics"); ?>
    I wrote this because it was only to simplify the php code and it would be more easily understood.

    Finally, if I include the php file, it works, but not with include(“…”)

    The final code:

    <ul>
    <?php
    require("/path_to_smf/SSI.php");
    $Lista = ssi_recentPosts($num_recent = 10, $exclude_boards = null, $include_boards = null, $output_method = 'array');
    foreach ($Lista as $Post) {
    
    echo '<li><a target="_blank" href=', $Post['href'], '>', $Post['subject'], '</a></li>';
    
    }
    unset($Lista);
    ?>
    </ul>

    Thanks

    Hello there!
    It just can’t execute shortcodes?? Very useful, miss this functionallity in this plugin.
    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] [Plugin: PHP Code Widget] Executable PHP widget – Not Working’ is closed to new replies.