The MU forums have moved to WordPress.org

Friend List Plugin - how to limit (5 posts)

  1. pug
    Member
    Posted 17 years ago #

    I was wandering if there's any chance to limit the number of friends to show in the friends array. Would be cool to limit the number of friends to show in the domain.com/blog page while showing all friends in something like domain.com/blog/friends page.

  2. kmaz
    Member
    Posted 16 years ago #

    Hi,
    To limitate the number of friends in the array I just limited the number of friends you can add by not showing the add Friends buttons when the array reach 5 values.
    In friend_list.php first write :

    <?php $sizearray=sizeof($aFriendList);?>

    And then :

    <?php if ($sizearray < '5'){?>
    				<div class="submitsearch">
    <input name="addfriend" id="addfriend" type="submit" value="Add Friends &raquo;" /></div>
    <?php } else { ?><br />
    <br />
    You have Reach the maximum of your Entourage.Delete one Entourage to add a new one<?php } ?>

    Simple but it works ;)

  3. kmaz
    Member
    Posted 16 years ago #

    Obviously here 5 is the maximum number of friends in the array.So put the value you want to match your needs (<?php if ($sizearray < '10'){?> for 10 friends etc.)

  4. Ovidiu
    Member
    Posted 16 years ago #

    what plugin are you exactly refering to?

  5. kmaz
    Member
    Posted 16 years ago #

    I am speaking about the friend-list plugin here : http://wpmudevorg.wordpress.com/project/Friend-List

About this Topic