/** * Queries for a list of suggestions and then includes the list page * * @param int $topic Topic ID, optional parameter. */ function showSuggestions() { global $rest; $suggestions = SuggestionUtils::getSuggestions(); if (!$suggestions || count($suggestions) < 1) { $suggestions = array(); } $iids = array(); foreach ($suggestions as $suggestion) { $iids[] = $suggestion['sid']; $rest->items_setInfo($suggestion['sid'], 'trail5', 'trail5', null); } //Now get ratings $ratings = array(); if (count($iids) > 0) { $ratings = $rest->ratings_get($iids); if (!$ratings) { $ratings = array(); } } include_once 'list.php'; }
/** * Queries for a list of suggestions and then includes the list page * * @param int $topic Topic ID, optional parameter. */ function showSuggestions(RingsideRestClient $rest, $uid) { $friends = $rest->delegate->friends_get(); $friends[] = $uid; $suggestions = SuggestionUtils::getSuggestions($friends); // Now get ratings $iids = array(); foreach ($suggestions as $suggestion) { $iids[] = $suggestion['sid']; $rest->items_setInfo($suggestion['sid'], 'trail4', 'trail4', null); } $ratings = array(); if (sizeof($iids) > 0) { $ratings = $rest->ratings_get($iids); } include_once 'list.php'; }
<br /><br /> <div class="suggest_form"> <h3>Make Suggestions</h3> <br /> <form method="post" action="display.php"> <input type="hidden" name="uid" value="<?php print $userid; ?> " /> <div class="suggest_topic_label">New Topic:</div> <div class="suggest_topic_input"><input type="text" name="newtopic" size="80" maxlength="80"/></div> <?php // Get the list of existing topics owned by the logged in user or their friends $utils = new SuggestionUtils(); $suggestions = $utils->getSuggestions($userid, $friends); $topics = array(); foreach ($suggestions as $suggestion) { // dont show the owner topics //if( !in_array( array( $suggestion['owneruid'], $suggestion['topic'] ), $topics ) ) { $topics[] = array($suggestion['owneruid'], $suggestion['topic']); //} } // Only display options if there are existing topics in the user's social network if (!empty($topics)) { ?> <br /> <div class="suggest_topic_label">Existing Topic:</div> <div class="suggest_topic_input"> <select name="existingtopic"> <option selected="true" value="none">-</option>