From: <sk...@us...> - 2008-08-28 06:02:08
|
Revision: 1134 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1134&view=rev Author: sknappe Date: 2008-08-28 06:02:05 +0000 (Thu, 28 Aug 2008) Log Message: ----------- deleted all unneccessary files and made mysql server configurable in settings.php Modified Paths: -------------- trunk/src/dbpedia-navigator/Settings.php trunk/src/dbpedia-navigator/ajax_get_class.php trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php trunk/src/dbpedia-navigator/ajax_learn_concepts.php trunk/src/dbpedia-navigator/ajax_search.php trunk/src/dbpedia-navigator/ajax_set_positives_and_negatives.php trunk/src/dbpedia-navigator/helper_functions.php Removed Paths: ------------- trunk/src/dbpedia-navigator/processTreeMenu.php trunk/src/dbpedia-navigator/treemenu/ trunk/src/dbpedia-navigator/xajax/ Modified: trunk/src/dbpedia-navigator/Settings.php =================================================================== --- trunk/src/dbpedia-navigator/Settings.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/Settings.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -47,6 +47,13 @@ //public $googleMapsKey="ABQIAAAAWwHG9WuZ8hxFSPjRX2-D-hRHWRcfpxRnIG10qrJMLnZO-_MKjRRpu2rZj8etMweqJES04ZL_eht1iQ"; public $useCache=true; + + //the server, where the mysql databank is located + public $mysqlServer='localhost'; + //the user, that has rights to access the navigator databank + public $mysqlUser='navigator'; + //the password of that user + public $mysqlPass='dbpedia'; } ?> \ No newline at end of file Modified: trunk/src/dbpedia-navigator/ajax_get_class.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_class.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/ajax_get_class.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -1,5 +1,6 @@ <?php include('helper_functions.php'); + include('Settings.php'); $class=$_POST['class']; $fromCache=$_POST['cache']; @@ -34,7 +35,7 @@ if ($fromCache<0) { //if there are errors see catch block try{ - mysql_connect('localhost','navigator','dbpedia'); + mysql_connect($mysqlServer,$mysqlUser,$mysqlPass); mysql_select_db("navigator_db"); //build Select box with Child Classes Modified: trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -14,7 +14,7 @@ $content=""; $bestsearches=""; - mysql_connect('localhost','navigator','dbpedia'); + mysql_connect($mysqlServer,$mysqlUser,$mysqlPass); mysql_select_db("navigator_db"); //get label of the category Modified: trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -11,17 +11,20 @@ setRunning($id,"true"); $concept=html_entity_decode($concept); + + $test=preg_match("/^http://dbpedia.org/class/yago/[^/]+$/",$concept); + $content=""; - try{ + /*try{ require_once("DLLearnerConnection.php"); $sc=new DLLearnerConnection($id,$ksID); $subjects=$sc->getSubjectsFromConcept($concept); $content.=getResultsTable($subjects); } catch (Exception $e){ $content=$e->getMessage(); - } + }*/ - print $content; + print $test."ho"; print '$$'; print "Instances for Concept ".$concept; ?> \ No newline at end of file Modified: trunk/src/dbpedia-navigator/ajax_learn_concepts.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_learn_concepts.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/ajax_learn_concepts.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -29,7 +29,7 @@ $concept.="<table border=0>\n"; $concept.="<tr><td>You could also be interested in articles matching these descriptions:</td></tr>"; foreach ($concepts as $con){ - $concept.="<tr><td><a href=\"\" onclick=\"getSubjectsFromConcept('concept=".$con['descriptionManchesterSyntax']."');return false;\" />".$con['NaturalLanguage']."</a> (Accuracy: ".(floatVal($con['accuracy'])*100)."%)</td></tr>"; + $concept.="<tr><td><a href=\"\" onclick=\"getSubjectsFromConcept('concept=".htmlentities($con['descriptionManchesterSyntax'])."');return false;\" />".$con['NaturalLanguage']."</a> (Accuracy: ".(floatVal($con['accuracy'])*100)."%)</td></tr>"; } $concept.="</table>"; } Modified: trunk/src/dbpedia-navigator/ajax_search.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_search.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/ajax_search.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -12,7 +12,7 @@ //initialise content $content=""; - mysql_connect('localhost','navigator','dbpedia'); + mysql_connect($mysqlServer,$mysqlUser,$mysqlPass); mysql_select_db("navigator_db"); $query="SELECT name, label FROM rank WHERE MATCH (label) AGAINST ('$label') ORDER BY number DESC LIMIT ".$number; $res=mysql_query($query); Modified: trunk/src/dbpedia-navigator/ajax_set_positives_and_negatives.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_set_positives_and_negatives.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/ajax_set_positives_and_negatives.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -9,7 +9,7 @@ if (strlen($negatives)>0) $negatives=explode('][',substr($negatives,1,strlen($negatives)-2)); else $negatives=array(); - mysql_connect('localhost','navigator','dbpedia'); + mysql_connect($mysqlServer,$mysqlUser,$mysqlPass); mysql_select_db("navigator_db"); $ptemp=array(); Modified: trunk/src/dbpedia-navigator/helper_functions.php =================================================================== --- trunk/src/dbpedia-navigator/helper_functions.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -235,7 +235,7 @@ } function formatClassArray($ar) { - mysql_connect('localhost','navigator','dbpedia'); + mysql_connect($mysqlServer,$mysqlUser,$mysqlPass); mysql_select_db("navigator_db"); $string="<ul>"; for($i=0; $i<count($ar); $i++) { Deleted: trunk/src/dbpedia-navigator/processTreeMenu.php =================================================================== --- trunk/src/dbpedia-navigator/processTreeMenu.php 2008-08-25 16:46:15 UTC (rev 1133) +++ trunk/src/dbpedia-navigator/processTreeMenu.php 2008-08-28 06:02:05 UTC (rev 1134) @@ -1,33 +0,0 @@ -<?php header("Content-type:text/xml"); print("<?xml version=\"1.0\"?>"); -if (isset($_GET["id"])) - $url_var=$_GET["id"]; -else - $url_var=0; - - - -print("<tree id='".$url_var."'>"); - if (!$url_var) print("<item child=\"1\" id=\"http://dbpedia.org/class/yago/Entity100001740\" text=\"Entity\"><userdata name='ud_block'>ud_data</userdata></item>"); - else{ - /*require_once("DLLearnerConnection.php"); - $sc=new DLLearnerConnection(); - $ids=$sc->getIDs(); - $sc=new DLLearnerConnection($ids[0],$ids[1]); - $categories=$sc->getYagoSubCategories($url_var);*/ - mysql_connect('localhost','navigator','dbpedia'); - mysql_select_db("navigator_db"); - $query="SELECT name FROM articlecategories WHERE category='$url_var' AND name LIKE 'http://dbpedia.org/class/yago/%' LIMIT 100"; - $res=mysql_query($query); - while ($result=mysql_fetch_array($res)){ - $query="SELECT name FROM articlecategories WHERE category='".$result['name']."' AND name LIKE 'http://dbpedia.org/class/yago/%' LIMIT 1"; - $res2=mysql_query($query); - if (mysql_num_rows($res2)>0) $child=1; - else $child=0; - $query="SELECT label FROM categories WHERE category='".$result['name']."' LIMIT 1"; - $res2=mysql_query($query); - $result2=mysql_fetch_array($res2); - print("<item child=\"".$child."\" id=\"".$result['name']."\" text=\"".$result2['label']."\"><userdata name=\"myurl\">".$result['name']."</userdata><userdata name=\"mylabel\">".$result2['label']."</userdata></item>"); - } - } -print("</tree>"); -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |