Forums

Turnig off Display Error (4 posts)

  1. ricland
    Member
    Posted 3 years ago #

    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

  2. t31os
    Member
    Posted 3 years ago #

    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.

  3. ricland
    Member
    Posted 3 years ago #

    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

  4. ricland
    Member
    Posted 3 years ago #

    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("http://www.youtube.com/rss/tag/".$tag.".rss");
    $items = @ array_slice($feed->items, 0, $maxitems);
    foreach ($items as $item) {
    $item['link'] = str_replace("http://youtube.com/?v=", "", $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

Topic Closed

This topic has been closed to new replies.

About this Topic