• I’m using Daikos Youtube Widget and it’s working fine except that the sidebar above the widget is displaying the errors below.

    Since the plugin is working fine, all I want to do is stop these errors from displaying in the sidebar. How do I do that?

    —->

    Warning: array_slice() expects parameter 1 to be array, null given in /home/.lembu/ricland/backdoorstuff.net/wp-content/plugins/daikos-youtube-widget/daikosyoutubewidget.php on line 120

    Warning: Invalid argument supplied for foreach() in /home/.lembu/ricland/backdoorstuff.net/wp-content/plugins/daikos-youtube-widget/daikosyoutubewidget.php on line 121

    Warning: array_slice() expects parameter 1 to be array, null given in /home/.lembu/ricland/backdoorstuff.net/wp-content/plugins/daikos-youtube-widget/daikosyoutubewidget.php on line 138

    Warning: Invalid argument supplied for foreach() in /home/.lembu/ricland/backdoorstuff.net/wp-content/plugins/daikos-youtube-widget/daikosyoutubewidget.php on line 139

Viewing 3 replies - 1 through 3 (of 3 total)
  • Speak to the author or report the bug to him.

    To stop PHP errors being displayed, assuming you want to just want to ignore them you’ll need to put @ infront of the problem commands/functions/calls….

    Example php with function errors surpressed…

    <?php $myvar = @some_function(); ?>

    The @ simply surpresses any errors generated by some_function();

    It’s not an advisable thing to do, ideally you should get those errors fixed not surpressed.

    Thread Starter ricland

    (@ricland)

    The author is not responding.

    I was hoping there was a switch I could turn off.

    I have no idea where the function command is.

    Is there a plugin that might help

    Thread Starter ricland

    (@ricland)

    Oh, I see what you’re talking about. Well, I got it to work for one command, but couldn’t figure where to put the @ for the other

    if (!empty($tags)) {
    foreach ($tags as $tag) {
    $feed = fetch_rss(“https://www.youtube.com/rss/tag/&#8221;.$tag.”.rss”);
    $items = @ array_slice($feed->items, 0, $maxitems);
    foreach ($items as $item) {
    $item[‘link’] = str_replace(“https://youtube.com/?v=&#8221;, “”, $item[‘link’]);
    if ($videos =”) {
    $videofeed = $videofeed.$item[‘link’].”@”.$item[‘title’];
    $videos = $videos.$videofeed;
    }
    else {
    $videofeed = $videofeed.”\n”.$item[‘link’].”@”.$item[‘title’];
    $videos = $videos.$videofeed;
    }

    the error line begins at “foreach”

    Where do I put the @ i that function?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Turnig off Display Error’ is closed to new replies.