function openthesaurus_searchSynonyms($query)
{
    $start = getmicrotime();
    $items = array();
    $query_str = sprintf("\n\t\tSELECT words.id AS word_id, word, meaning_id\n\t\tFROM words, word_meanings, meanings\n\t\tWHERE \n\t\t\tword = '%s' AND\n\t\t\twords.id = word_meanings.word_id AND\n\t\t\tword_meanings.meaning_id = meanings.id AND\n\t\t\tmeanings.hidden = 0\n\t\n\t\tUNION\n\n\t\tSELECT words.id AS word_id, word, meaning_id\n\t\tFROM words, word_meanings, meanings\n\t\tWHERE \n\t\t\tlookup = '%s' AND\n\t\t\twords.id = word_meanings.word_id AND\n\t\t\tword_meanings.meaning_id = meanings.id AND\n\t\t\tmeanings.hidden = 0\n\n\t\tORDER BY word", myaddslashes($query), myaddslashes($query), myaddslashes($query), myaddslashes($query));
    $db = new DB_Thesaurus();
    $db->query($query_str);
    $synmatches = 1;
    if ($db->nf() == 0) {
        $item['words'] = array();
        $items[] = $item;
    }
    while ($db->next_record()) {
        $mid = $db->f('meaning_id');
        $item['words'] = getSynsetWithUsage($db->f('meaning_id'), 1);
        $items[] = $item;
    }
    $_GET['search'] = 1;
    # otherwise logSearch ignores the search
    logSearch($db, $query, $db->nf(), 0, getEndTimer(), 1);
    XMLRPC_response(XMLRPC_prepare($items), KD_XMLRPC_USERAGENT);
}
include "../include/substring_matches.php";
?>

<?php 
if (uservar('word') && trim(uservar('word')) != "") {
    ?>
	<p><a href="add.php?word=<?php 
    print urlencode($_GET['word']);
    ?>
"><?php 
    print sprintf(_("Add '%s' and synonyms to the thesaurus"), escape($_GET['word']));
    ?>
</a></p>
<?php 
}
?>

<script type="text/javascript">
<!--
	document.f.word.focus();
	document.f.word.select();
// -->
</script>

<?php 
if ($queryterm != "") {
    externalSearchLinks($_GET['word']);
}
logSearch($db, $_GET['word'], 0, 0, getEndTimer());
include "../include/bottom.php";
page_close();
        ?>
		<a href="add.php?id=<?php 
        print $word_id;
        ?>
"><?php 
        print sprintf(_("Add another meaning of '%s' to the thesaurus"), escape($words[$i]));
        ?>
</a><br />
		<?php 
        $i++;
    }
    if (!in_array($word, $words)) {
        ?>
		<a href="add.php?word=<?php 
        print urlencode($_GET['word']);
        ?>
"><?php 
        print sprintf(_("Add '%s' and synonyms to the thesaurus"), escape($_GET['word']));
        ?>
</a>
	<?php 
    }
}
?>

<br />
<?php 
include "../include/external_searches.php";
logSearch($db, $word, $db->nf(), 0, getEndTimer());
include "../include/bottom.php";
page_close();
Example #4
0
<?php

/* ========================================================================
 * Music v1.2.7
 * https://github.com/alashow/music
 * ======================================================================== */
include 'helper.php';
logSearch($_GET['q']);
$apiUrl = "https://api.vk.com/method/audio.search?";
$params = $_GET;
$params['access_token'] = $config["token"];
//for private access token. if public, comment this line so access token from js will be used
$fullUrl = $apiUrl . http_build_query($params);
$response = file_get_contents($fullUrl);
//hehe https://datmusic.xyz/stream/YGexC:AEYtr
die($response);
					</td>
			</tr>
		<?php 
		} 
		?>
		</table>
	</td>
</tr>

<tr><td></td></tr>

<?php if( array_key_exists('word', $_GET) ) { ?>
	<tr>
		<td></td>
		<td colspan="3"><a href="add.php?word=<?php print $_GET['word']; ?>"><?php print sprintf(T_("Add another meaning of '%s' to the thesaurus"), escape($_GET['word'])) ?></a></td>
	</tr>
<?php } ?>

</table>

</form>

<?php
if( isset($_GET['word']) ) {
	logSearch($db, $_GET['word'], $matches_for_log, 0, getEndTimer());
}

include("include/bottom.php");
page_close();
?>
Example #6
0
<?php

/* ========================================================================
 * Music v1.4.5
 * https://github.com/alashow/music
 * ======================================================================== */
include 'helper.php';
logSearch($_GET["q"]);
$apiUrl = "https://api.vk.com/method/audio.search?";
$params = $_GET;
$params["access_token"] = $config["token"];
//for private access token. if public, comment this line so access token from js will be used
//doing some magic here. read about Jquery.Ajax callback here http://stackoverflow.com/questions/12864096/
//web app client sends unique callback string for each call. it's not good for our json caching (because it's based on md5 of url)
//solution: save original callback string, replace with unique string in url, replace saved one with original in response.
if (isset($params["callback"])) {
    $originalJsonCallback = $params["callback"];
    $params["callback"] = "63kfn61Ikx90Nw";
    //just a unique random string
}
$fullUrl = $apiUrl . http_build_query($params);
if ($config["isNoCache"]) {
    removeCacheForUrl($fullUrl);
}
$result = file_get_contents_with_cache($fullUrl, true);
if (isset($originalJsonCallback)) {
    $resultJson = json_decode(preg_replace('/.+?({.+}).+/', "\$1", $result), true);
} else {
    $resultJson = json_decode($result, true);
}
//if response has errors or has no response
Example #7
0
    challangePage($dbh, $array);
}
if ($type == 'challangeimg') {
    challangeImage($dbh, $array);
}
if ($type == 'challangeCom') {
    challangeCom($dbh, $array);
}
if ($type == 'myChall') {
    challangeSearch($dbh, $array);
}
if ($type == 'popChall') {
    popularChallangeSearch($dbh, $array);
}
if ($type == 'logSearch') {
    logSearch($dbh, $array);
}
if ($type == 'comments') {
    comments($dbh, $array);
}
if ($type == 'locationSearch') {
    location($dbh, $array, "", $data);
}
if ($type == 'topLocation') {
    location($dbh, $array, "order by likes desc limit 20", $data);
}
if ($type == 'recentAddLocation') {
    location($dbh, $array, "order by id desc limit 20", $data);
}
if ($type == 'allLocation') {
    location($dbh, $array, "", "");
if ($queryterm != "") {
    include "../include/external_searches.php";
}
?>
	</td>
	<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
	<td class="compact" width="65%" valign="top">
		<?php 
if (uservar('word') && $queryterm != "") {
    ?>
			<p class="compact"><strong>Aktionen:</strong></p>
			<ul class="compact">
				<li><a href="add.php?word=<?php 
    print urlencode($_GET['word']);
    ?>
"><?php 
    print sprintf(_("Add '%s' and synonyms to OpenThesaurus"), escape($_GET['word']));
    ?>
</a></li>
			</ul>
		<?php 
}
?>
	</td>
</tr>
</table>

<?php 
logSearch($db, $_GET['word'], $synmatches, 0, getEndTimer());
include "../include/bottom.php";
page_close();
}
?>

<?php 
if (uservar('word')) {
    ?>
	<a href="add.php?word=<?php 
    print urlencode($_GET['word']);
    ?>
"><?php 
    print sprintf(T_("Add '%s' to the thesaurus"), escape($_GET['word']));
    ?>
</a>
<?php 
}
?>

<script type="text/javascript">
<!--
	if( document.f && document.f.word ) {
		document.f.word.focus();
		document.f.word.select();
	}
// -->
</script>

<?php 
externalSearchLinks($_GET['word']);
logSearch($db, $_GET['word'], sizeof($results), 1, getEndTimer());
include "include/bottom.php";
page_close();