function init_share_limits($sharer, $borrowers) { global $default_limit; $share_limits = get_share_limits($sharer); if (count($share_limits) == 0) { foreach ($borrowers as $borrower) { add_share_limit($sharer, $borrower, $SHARE_LIMIT_DEFAULT); } } }
if (isset($_GET['check']) && $_GET['check'] == "all") { $checked = "checked"; } if (isset($_POST['share_limit'])) { if (isset($_POST['selected_friends'])) { $friends = $_POST['selected_friends']; $share_limit = $_POST['share_limit']; foreach ($friends as $friend) { add_share_limit($user, $friend, $share_limit); } } else { echo '<fb:error message="Must select at least one friend." />'; } } $friends = $fb->api_client->friends_get(); $share_limits = get_share_limits($user); ?> <div style="background-color: #EEEEEE;float:center;padding:10px 10px 10px 10px"> Control which of your shared items will be visible to specific friends by setting a dollar limit on what items they can borrow from you. You can even share nothing with friends you don't know very well. <br/><br/> By default friends are limited to items under $<?php echo $SHARE_LIMIT_DEFAULT; ?> . <hr size=1 noshade /> <form action="<?php echo $canvas_url;