Last active
July 21, 2016 07:00
-
-
Save vineeth030/755585d569f40eb7cd7dbac5ad7512f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// *Check to see if someone has clicked on a word out of the description text on the video page.* | |
// *If they have then do a search for that term.* | |
if(isset($_GET["term"])) | |
{ | |
$termid = $_GET["term"]; | |
if(is_numeric($termid)) | |
{ | |
zpConnectDB('zanesitecontent'); | |
$sql = "SELECT g.id, g.term, t.name as topic, g.description FROM glossary AS g | |
INNER JOIN Topics AS t ON (t.productid = g.topic) | |
WHERE g.id = " . mysql_real_escape_string($termid) . " | |
" . ($subject == 0?"":"AND t.subject = " . mysql_real_escape_string($subject)) . " | |
" . ($category == 0?"":"AND t.category = " . mysql_real_escape_string($category)) . " | |
" . ($topic == 0?"":"AND t.productid = " . mysql_real_escape_string($topic)) . " | |
ORDER BY t.name, g.term"; | |
$result = mysql_query($sql) OR $debugContent .= debugMysql(mysql_error(),$sql); | |
$rowCount = mysql_num_rows($result); | |
while($row = mysql_fetch_array($result)) | |
{ | |
array_push($results, array("topic" => $row["topic"], "term"=>$row["term"], "id" => $row["id"], "description" => $row["description"])); | |
} | |
$smarty->assign('rowCount', $rowCount); | |
$smarty->assign('searchResults', $results); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment