From 7218d47f6486bf65e9a772fc3c52b256634d00fc Mon Sep 17 00:00:00 2001
From: Verena Lyding <verena.lyding@eurac.edu>
Date: Tue, 14 Jul 2015 15:21:25 +0000
Subject: [PATCH] update of server addresses from tuebingen to EURAC direct
 link to index_help.php page

git-svn-id: https://sdcsvn01.eurac.edu/svn/commul/MERLIN/merlin-webpage@3800 71ad02bc-cbdd-11db-a10a-ee346e295fe1
---
 php/A_forms.php          |  2 +-
 php/F_openannis_wide.php |  9 +++++----
 php/F_showdocuments.php  |  8 +++++---
 php/F_showkwic.php       |  7 ++++---
 php/F_showstatistics.php | 11 ++++++-----
 php/_includes/head.php   |  8 ++++++++
 6 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/php/A_forms.php b/php/A_forms.php
index 34b7c9a..98b2420 100644
--- a/php/A_forms.php
+++ b/php/A_forms.php
@@ -2,7 +2,7 @@
 <form name="about" action="../php/index.php" method="post"><input type="hidden" name="curscr" value="about.php"></form>
 <form name="team" action="../php/index.php" method="post"><input type="hidden" name="curscr" value="team.php"></form>
 <form name="contact" action="../php/index.php" method="post"><input type="hidden" name="curscr" value="contact.php"></form>
-<form name="help_up" action="../php/index.php" method="post"><input type="hidden" name="curscr" value="help.php"></form>
+<form name="help_up" action="../php/index_help.php" method="post"><input type="hidden" name="curscr" value="help.php"></form>
 <form name="disclaimer" action="../php/index.php" method="post"><input type="hidden" name="curscr" value="disclaimer.php"></form>
 <form name="language-en" action="#" method="post"><input type="hidden" name="language" value="en"></form>
 <form name="language-de" action="#" method="post"><input type="hidden" name="language" value="de"></form>
diff --git a/php/F_openannis_wide.php b/php/F_openannis_wide.php
index 7fe5f00..79582c0 100644
--- a/php/F_openannis_wide.php
+++ b/php/F_openannis_wide.php
@@ -471,7 +471,7 @@ function get_corp(){
 	
 	
 <?php
-function openANNIS($qu, $corp){
+function openANNIS($qu, $cor, $a_server){
 	$q = base64_encode($qu);
 	if($corp == "all"){
 		// all corpora: 2014-07-29-italian-gold-pilot,2014-07-29-german-gold-pilot,2014-07-29-czech-gold-pilot
@@ -485,7 +485,8 @@ function openANNIS($qu, $corp){
 		$c = base64_encode($corp);
 	}
 
-	$link = "<script>previewUrl('http://samos.sfs.uni-tuebingen.de:8080/annis/#_q=".$q."&_c=".$c."&cl=5&cr=5&s=0&l=10&_seg=bGVhcm5lcg','div1')</script>";
+	//http://samos.sfs.uni-tuebingen.de:8080/annis/
+	$link = "<script>previewUrl('".$a_server."#_q=".$q."&_c=".$c."&cl=5&cr=5&s=0&l=10&_seg=bGVhcm5lcg','div1')</script>";
 	echo $link;
 }
 	// button: modify previous query
@@ -515,12 +516,12 @@ function openANNIS($qu, $corp){
 // 3. - ANNIS-Anzeige im MERLIN Fenster (_self) (erweitert, ohne linke Taskleiste)
 
 if(!empty($_POST["featq"])){
-	openANNIS($_POST["featq"], "all");
+	openANNIS($_POST["featq"], "all", $annis_server);
 }
 else{
 	$aql = process_post();
 	$corpus = get_corp();
-	openANNIS($aql, $corpus);
+	openANNIS($aql, $corpus, $annis_server);
 }
 ?>
 
diff --git a/php/F_showdocuments.php b/php/F_showdocuments.php
index 6ce2925..283247d 100644
--- a/php/F_showdocuments.php
+++ b/php/F_showdocuments.php
@@ -293,13 +293,15 @@ function create_table($data, $json_results, $trans) {
 
 
 // makes SOLR call and returns json array with all (or selected) data
-function runMyFunction($q) {
+function runMyFunction($q, $s_server) {
 
 	// jSON URL which should be requested
 	// this works: $json_url = 'http://samos.sfs.uni-tuebingen.de:8080/solr/texts/select?q=_test_level_cefr%3AC1&wt=json';
 	// this works too: $json_url = 'http://samos.sfs.uni-tuebingen.de:8080/solr/texts/select?q=text%3AWohnung+AND+_test_language%3AGerman&wt=json';
 
-	$json_url = 'http://samos.sfs.uni-tuebingen.de:8080/solr/final/select?q='.$q.'&rows=3000&fl=id%2C+_test_language%2C+_rating_fair_cefr%2C+_author_L1%2C+_author_id%2C+th1%2C+th2%2C+text%2C+_test_level_cefr%2C+_task_id%2C+_author_age%2C+_author_gender%2C+_rating_grammatical_accuracy%2C+_rating_vocabulary_range%2C+_rating_coherence%2C+_rating_sociolinguistic_appropriateness%2C+_rating_orthography%2C+_rating_vocabulary_control%2C+_rating_fair_cefr_rough%2C+_rating_general_linguistic_range&wt=json';
+	$json_url = $s_server.'/select?q='.$q.'&rows=3000&fl=id%2C+_test_language%2C+_rating_fair_cefr%2C+_author_L1%2C+_author_id%2C+th1%2C+th2%2C+text%2C+_test_level_cefr%2C+_task_id%2C+_author_age%2C+_author_gender%2C+_rating_grammatical_accuracy%2C+_rating_vocabulary_range%2C+_rating_coherence%2C+_rating_sociolinguistic_appropriateness%2C+_rating_orthography%2C+_rating_vocabulary_control%2C+_rating_fair_cefr_rough%2C+_rating_general_linguistic_range&wt=json';
+
+	//$json_url = 'http://samos.sfs.uni-tuebingen.de:8080/solr/final/select?q='.$q.'&rows=3000&fl=id%2C+_test_language%2C+_rating_fair_cefr%2C+_author_L1%2C+_author_id%2C+th1%2C+th2%2C+text%2C+_test_level_cefr%2C+_task_id%2C+_author_age%2C+_author_gender%2C+_rating_grammatical_accuracy%2C+_rating_vocabulary_range%2C+_rating_coherence%2C+_rating_sociolinguistic_appropriateness%2C+_rating_orthography%2C+_rating_vocabulary_control%2C+_rating_fair_cefr_rough%2C+_rating_general_linguistic_range&wt=json';
 
 	$username = 'merlin';  // authentication
 	$password = 'merlin23';  // authentication
@@ -355,7 +357,7 @@ function createsubcorpus($ids){
 
 $querytest=process_post();
 //echo "QUERY:".$querytest;
-$json_results = runmyfunction($querytest); //check!
+$json_results = runmyfunction($querytest,$solr_server); //check!
 
 
 if($json_results['response']['numFound']==0){
diff --git a/php/F_showkwic.php b/php/F_showkwic.php
index 169d968..430ece9 100644
--- a/php/F_showkwic.php
+++ b/php/F_showkwic.php
@@ -38,10 +38,11 @@ function process_post(){
 	return $q;
 }
 
-function runMyFunction($querystring) {
+function runMyFunction($querystring, $s_server) {
 
 	// jSON URL which should be requested
-	$json_url = 'http://samos.sfs.uni-tuebingen.de:8080/solr/final/select?q='.$querystring.'&rows=500&wt=json';
+	$json_url = $s_server.'select?q='.$querystring.'&rows=500&wt=json';
+	//$json_url = 'http://samos.sfs.uni-tuebingen.de:8080/solr/final/select?q='.$querystring.'&rows=500&wt=json';
 	//pilot: $json_url = 'http://samos.sfs.uni-tuebingen.de:8080/solr/pilot/select?q='.$querystring.'&rows=500&wt=json';
 	//$json_url = 'http://samos.sfs.uni-tuebingen.de:8080/solr/texts/select?q=meta_test_level_cefr%3AC1&fl=text_de&wt=json';
 
@@ -71,7 +72,7 @@ function runMyFunction($querystring) {
 //$q_tmp = process_post();
 //echo "QUERY:".$q_tmp;
 
-$json_results = runMyFunction(process_post());
+$json_results = runMyFunction(process_post(),$solr_server);
 //echo $json_results['response']['docs'][1]['text'][0];
 
 // the json result will always have (docs array) -- 
diff --git a/php/F_showstatistics.php b/php/F_showstatistics.php
index 60122e6..b49f80e 100644
--- a/php/F_showstatistics.php
+++ b/php/F_showstatistics.php
@@ -67,12 +67,13 @@ function process_post(){
 }
 
 
-function runMyFunction($querystring) {
+function runMyFunction($querystring,$s_server) {
 	$jtest;
 	foreach($querystring as $ind => $que){
 	// jSON URL which should be requested
 	// pilot $json_url = 'http://samos.sfs.uni-tuebingen.de:8080/solr/pilot/select?q='.$que.'&rows=3000&wt=json';
-	$json_url = 'http://samos.sfs.uni-tuebingen.de:8080/solr/final/select?q='.$que.'&rows=500&wt=json';
+	$json_url = $s_server.'/select?q='.$que.'&rows=500&wt=json';
+	//$json_url = 'http://samos.sfs.uni-tuebingen.de:8080/solr/final/select?q='.$que.'&rows=500&wt=json';
 	
 	$username = 'merlin';  // authentication
 	$password = 'merlin23';  // authentication
@@ -226,7 +227,7 @@ function create_corp_features($q_results, $f_names, $solrTOannis, $trans, $abbre
 				$res .= '<tr class="border_bottom_blue"><td class="stats" colspan="2">'.$trans['select_llf'][$_SESSION['lang']].'</td></tr>';
 				$select_llf = 1;
 				
-				switch($d){
+				/*switch($d){
 					case (preg_match("/^l_feat_g/", $d) ? true : false) :
 						$res .= '<tr class="border_bottom_blue"><td class="stats" colspan="2">'.$trans['grammar'][$_SESSION['lang']].'</td></tr>';
 					case (preg_match("/^l_feat_o/", $d) ? true : false) :
@@ -241,7 +242,7 @@ function create_corp_features($q_results, $f_names, $solrTOannis, $trans, $abbre
 						$res .= '<tr class="border_bottom_blue"><td class="stats" colspan="2">'.$trans['socioling'][$_SESSION['lang']].'</td></tr>';
 					case (preg_match("/^l_feat_p/", $d) ? true : false) :
 						$res .= '<tr class="border_bottom_blue"><td class="stats" colspan="2">'.$trans['pragmatics'][$_SESSION['lang']].'</td></tr>';
-				}
+				}*/
 
 			}
 			else if(preg_match("/^rel_l_feat/", $d) & !($select_rel_llf)){
@@ -472,7 +473,7 @@ function create_single_doc_features($q_results, $f_names, $solrTOannis, $trans){
 
 }
 
-$json_results = runMyFunction(process_post());
+$json_results = runMyFunction(process_post(),$solr_server);
 
 
 ?>
diff --git a/php/_includes/head.php b/php/_includes/head.php
index b0eb1cb..e1973dd 100644
--- a/php/_includes/head.php
+++ b/php/_includes/head.php
@@ -2,6 +2,14 @@
    session_set_cookie_params(86400);
    session_start();
    header('Cache-Control: private, max-age=300');
+   // server adresses
+   
+   // ANNIS installation -- called from script 'F_openannis_wide.php'
+   $annis_server = "http://sdcsfe03.eurac.edu/annis/";
+   
+   // SOLR installation -- called from scripts 'F_showkwic.php', 'F_showdocuments.php' and 'F_showstatistics.php'.
+   $solr_server = "http://sdcsfe03.eurac.edu/solr/final/";
+   
    
    // available languages
    $language_glosses = array('cz' => 'czech', 'de' => 'german', 'en' => 'english', 'it' => 'italian');
-- 
GitLab