Nuer Website



Click ">here to start William's Story 1

Click ">here to start William's Story 2

"; $id=$_GET['id']; $current_xml_file = simplexml_load_file($text_file); $story_title=$current_xml_file->xpath("/story/story_title"); $story_title_audio=$current_xml_file->xpath("/story/story_title_audio"); $story_audio=$current_xml_file->xpath("/story/story_audio"); $title=$current_xml_file->xpath("/story/paragraph[@id=$id]/title"); $image=$current_xml_file->xpath("/story/paragraph[@id=$id]/image"); $thumb_image="Thumb".$image[0]; $dinka_text=$current_xml_file->xpath("/story/paragraph[@id=$id]/nuer_text"); $english_text=$current_xml_file->xpath("/story/paragraph[@id=$id]/english_text"); print "

".$story_title[0]; print "

"; print "

".$title[0]."

"; print "
"; $dinka_text_string = $dinka_text[0]->asXML(); //find word enclosed within and replace with hyper link $pattern='/(.+?)<\/w>/i'; $replacement="$2"; $dinka_text_string = preg_replace($pattern, $replacement, $dinka_text_string); print ""; print ""; print ""; /* print "
"; print "Nuer Text:".$dinka_text_string; //The audio file for the whole paragraph print "


"; print "English Translation:".$english_text[0]; print "



"; print "Story Description:"; print "Please click here"; print "
"; //following line is used to display an image for each paragraph //print ""; print "

"; $temp_ids=$current_xml_file->xpath("/story/paragraph/@id"); $total_paragraphs=count($temp_ids); $id_back=$id-1; $id_forward=$id+1; $id_back=$id_back<1?1:$id_back; $id_forward=$id_forward>$total_paragraphs?$total_paragraphs:$id_forward; print ""; */ /* enable a thumbnail image for each paragraph of the story by using following code foreach($temp_ids as $temp_id) { $thumb_image_name = "Thumb".$temp_id.".jpg"; print ""; } */ //print ""; print ""; } if(isset($_GET['id'])) { print "
Home
"; } ?>