[Plugin: Author Avatars List] Wrong Parameter Count (9 posts)

  1. gregfielding
    Posted 6 years ago #

    I just installed this plugin and I added the widget to my sidebar. Now, on the site, I get this error message:

    Warning: Wrong parameter count for array_slice() in /home/housings/public_html/wp-content/plugins/author-avatars/lib/UserList.class.php on line 250

    No users found.

    Any ideas? This looks like a great plugin and I'd love to get it working.


  2. Paul Bearne
    Posted 6 years ago #

    This is new error

    Can check that it not the theme or other plug-in cause the problem by removing them all for a quick test?

    Can I have the URL of the site to look at?

    Ping me Monday and I will look at the code

    Paul Bearne

  3. gregfielding
    Posted 6 years ago #

    Playing around, I learned something new. The error only shows up when I hit set a maximum number of authors to show. If I leave that field blank, then it works great.

    The site is http://housingstorm.com

    The theme I'm using is solostream's wp-mediamag. However, I tried using the widget with the default kubric theme sample2.housingstorm.com and got the same error when I set a limit.

    I was hoping to use the widget across my entire network, as a way to showcase random authors and drive traffic from site to site. I will need a limit as I launch and start to grow the site.

    Any thoughts? Also, will the avatars display as a mosaic?


  4. Paul Bearne
    Posted 6 years ago #


    Ok I will have look at the code

    Yes the avatars will display as a mosaic I have a MU site that has over a 1000 users and we display then all on a page (using a short code) and there just flow to fill the space (float:left) you may need to tweek the CSS to get the effect you need.

  5. Paul Bearne
    Posted 6 years ago #


    I have looked at this and problem is that we use an array_slice to truncate the list of users but we are getting different shape arrays

    on my MU install I am getting


    so if I change ln 250 from

    $users = array_slice($users, 0, intval($this->limit), true);


    $users[1] = array_slice($users[1], 0, intval($this->limit), true);

    the truncate works

    I need to a load of testing in the single user etc. before I patch this and what to talk to Ben (the main coder) as well

    You can try make this change to see if it fixes it

    if it doesn't put print_r($users); on ln 149 and have a look at the shape of the array and send it to me / adjust the array _slice

    Thanks for you help here


  6. gregfielding
    Posted 6 years ago #


    I made the change on line 250, and there is some improvement. The same error message is there, but the images do show up beneath it.

    Also, any thoughts on how to show the tiles as mosaic within a sidebar widget? Above, you mentioned using shortcode...is there a specific code that will create a mosaic?

  7. Paul Bearne
    Posted 6 years ago #

    What version of PHP are you running and wordpress version?

    You will need to add some CSS to your theme to override the default CSS

    try adding this css to you style sheet
    this is for the Featured Bloggers

    #author_avatars-5 .author-list .user {
    add then reduce the size of the avatars in the widget

  8. gregfielding
    Posted 6 years ago #

    I'm not sure which version...where does it say?


    I add that code to my themes style.css file, right? does it matter where in the code it goes?


  9. Paul Bearne
    Posted 6 years ago #

    no anywhere in the file will do

    Have search for phpinfo() and create a temp php file on your site to run it lots of example out on web.

Topic Closed

This topic has been closed to new replies.

About this Topic