<?php include_once 'client/facebook.php'; include_once 'lib.php'; include_once 'config.php'; $fb = FB::get($api_key, $secret); $friends = $fb->api_client->friends_get(); $user = $_POST['fb_sig_user']; $friends = explode(",", $_POST['fb_sig_friends']); $shared_items = get_shared_items($user); echo render_menu("my_listings", $user, $friends); echo render_tabs(1); /* <fb:editor-custom label="Photo"> <input type="hidden" name="MAX_FILE_SIZE" value="300000" /> <input type="file" id="photo" name="photo"/> </fb:editor-custom> */ ?> <div style="background-color: #EEEEEE;padding:10px 0 0 0"> <fb:editor action="<?php echo $canvas_url; ?> /my_listings.php" labelwidth="175" width="300" align="left"> <fb:editor-text label="Item to share (required)" name="what" value=""/> <fb:editor-textarea label="Description (required)" name="description" value=""/> <fb:editor-text label="Estimated value (required for use with privacy settings)" name="value" value=""/> <fb:editor-custom label="Availability"> <select name="available"> <option value="true" selected="selected">Available</option>
$user = $_POST['fb_sig_user']; $friends = explode(",", $_POST['fb_sig_friends']); if (isset($_POST['what'])) { $who = $user; $what = $_POST['what']; $description = $_POST['description']; $value = $_POST['value']; $available = (bool) false; if ($_POST['available'] == 1) { $available = (bool) true; } add_shared_item($who, $what, $description, $value, $available); $render_msg = (bool) true; } echo render_menu("my_listings", $user, $friends); echo render_tabs(0); if ($render_msg) { ?> <fb:success> <fb:message>Your shared item has been added.</fb:message> </fb:success> <?php } ?> <div style="background-color: white; border: 1px solid black; margin: 10px"> <table style="width: 100%"> <tr><td style="vertical-align: top; width: 0%" rowspan="5"> <fb:profile-pic uid="<?php echo $user; ?>
<?php include_once '../client/facebook.php'; include_once 'lib.php'; include_once 'config.php'; // can't use 0 for "no items" because $friend_limits[$friend_uid] // returns nul=0 if $friend_uid does not exist; when friend doesn't // exist, we want drop-down set to default value; use escape-value=-1 // to work-around nul=0. $SHARE_NONE = -1; $limit2text = array("{$SHARE_NONE}" => "no items", "20" => "items under \$20", "50" => "items under \$50", "100" => "items under \$100", "200" => "items under \$200", "500" => "items under \$500", "1000" => "items under \$1000", "{$SHARE_ALL}" => "all items"); global $SHARE_LIMIT_DEFAULT; $user = $_REQUEST['fb_sig_user']; $fb = FB::get($api_key, $secret); echo render_menu("my_listings", $user); echo render_tabs(2); $checked = ""; 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." />'; } }