$vote = $_REQUEST['vote']; // Using a null type, type allows you to put things in buckets // For instance, type could equal a bookmark. But, ratings are app // specific, so since we only have 1 type we can leave it null. $rest->ratings_set($iid, $vote, null); showSuggestions($rest, $userid); } else { error_log("Rating error, missing param!"); } } else { showSuggestions($rest, $userid); } } } } else { showSuggestions($rest, $userid); } /** * 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'];
?> Script <select id='qa-script-select' onchange="changeDefaultQuranScript()"> <option value='simple' selected>Simple</option> <option value='uthmani'>Uthmani</option> </select> <?php } ?> </div> <?php // SHOW SUGGESTIONS showSuggestions($postResultSuggestionArr); ?> <div id="result-verses-area" > <?php if ($isQuestion) { ?> <div id='question-answering-area' <?php echo returnDirectionStyle($lang); ?> >
// Using a null type, type allows you to put things in buckets // For instance, type could equal a bookmark. But, ratings are app // specific, so since we only have 1 type we can leave it null. $rest->ratings_set($iid, $vote, null); showSuggestions(); } else { error_log("Rating error, bad params!"); } } else { error_log("Unknown Action: {$action}"); showSuggestions(); } } } } else { showSuggestions(); } /** * 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) {
function handleEmptyResults($scoringTable, $extendedQueryWordsArr, $query, $originalQuery, $isColumnSearch, $searchType, $lang) { // NOT RESULTS FOUND if (empty($scoringTable)) { // GET SIMILAR WORDS BY MIN-EDIT-DISTANCE $suggestionsArr = getSimilarWords($lang, array_keys($extendedQueryWordsArr)); $searchedForText = $query; if ($isColumnSearch) { $searchedForText = " this verse \"{$originalQuery}\" "; } else { $searchedForText = "\"{$searchedForText}\""; } ?> <div class='search-error-message'> No results found for <?php echo $searchedForText; ?> <script> trackEvent('SEARCH',$searchType,'FAILED',''); </script> </div> <?php showSuggestions($suggestionsArr); exit; } }