function useSess(){
session_start();
$_SESSION['sitename']="CRUMB";
//$_SESSION['isadmin']=0;
$_SESSION['debug']=1;
}
function insertHead($thisTitle){
$t=$thisTitle;
?>
}
function getPopSearches(){
global $link_id;
$scount=0;
?>
Popular Searches:
selectDatabase("coredatabase");
//echo("trying");
$sql = mysql_query("SELECT * FROM popularsearches ORDER BY frequency DESC", $link_id);
while ($row = mysql_fetch_row($sql)) {
if (trim($row[1])<>""){
if ($scount<24){
echo "$row[1] ";
}
$scount++;
}
}
}
function insertTopBlock($topLine, $subLine){
?>
search
}
function gatherInfo(){
if(1==0){
//do logging
selectDatabase("TrackingDatabase");
if($_GET[nolog]==$nothing){
//first deal with basic hit tracking
$sql="CREATE TABLE BAHits (id INT AUTO_INCREMENT PRIMARY KEY, yr TEXT, month TEXT, hits INT)";
$result = mysql_query($sql);
mysql_query("ALTER TABLE BAHits ADD dy TEXT");
$sql="CREATE TABLE BAHitDetail (id INT AUTO_INCREMENT PRIMARY KEY, yr TEXT, month TEXT, URL TEXT, hits INT)";
$result = mysql_query($sql);
$m=date("m");
$y=date("y");
$d=date("d");
$result = mysql_query("SELECT * FROM BAHits WHERE yr='$y' AND month='$m' AND dy='$d'");
$num_rows = mysql_num_rows($result);
//echo("rows=".$num_rows);
if($num_rows==0){
$sql="INSERT INTO BAHits (yr,month,hits,dy) VALUES('$y','$m',1,'$d')";
$result2 = mysql_query($sql);
}else{
$result = mysql_query("SELECT * FROM BAHits WHERE yr='$y' AND month='$m' AND dy='$d'");
$row=mysql_fetch_row($result);
$curval=$row[3];
$curval=($curval+1);
//echo("incremented is ".$curval);
$query="UPDATE BAHits set yr='$y', month='$m', hits=$curval, dy='$d' WHERE id='$row[0]'";
$result=mysql_query($query);
}
//now deal with USER AGENT TRACKING
$sql="CREATE TABLE AGENTHits (id INT AUTO_INCREMENT PRIMARY KEY, yr TEXT, month TEXT, hits INT)";
$result = mysql_query($sql);
mysql_query("ALTER TABLE AGENTHits ADD dy TEXT");
mysql_query("ALTER TABLE AGENTHits ADD AGENT TEXT");
$m=date("m");
$y=date("y");
$d=date("d");
$ag=$_SERVER['HTTP_USER_AGENT'];
$result = mysql_query("SELECT * FROM AGENTHits WHERE yr='$y' AND month='$m' AND dy='$d' AND AGENT='$ag'");
$num_rows = mysql_num_rows($result);
if($num_rows==0){
$sql="INSERT INTO AGENTHits (yr,month,hits,dy,AGENT ) VALUES('$y','$m',1,'$d','$ag')";
$result2 = mysql_query($sql);
}else{
$result = mysql_query("SELECT * FROM AGENTHits WHERE yr='$y' AND month='$m' AND dy='$d' AND AGENT='$ag'");
$row=mysql_fetch_row($result);
$curval=$row[3];
$curval=($curval+1);
//echo("incremented is ".$curval);
$query="UPDATE AGENTHits set yr='$y', month='$m', hits=$curval, dy='$d', AGENT='$ag' WHERE id='$row[0]'";
$result=mysql_query($query);
}
//now deal with individual page hit tracking
//now deal with USER AGENT TRACKING -- THIS NEEDS TS REMOVAL
$sql="CREATE TABLE PAGEHits (id INT AUTO_INCREMENT PRIMARY KEY, yr TEXT, month TEXT, hits INT)";
$result = mysql_query($sql);
mysql_query("ALTER TABLE PAGEHits ADD dy TEXT");
mysql_query("ALTER TABLE PAGEHits ADD PAGE TEXT");
$m=date("m");
$y=date("y");
$d=date("d");
$pg=$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
$raw=$pg;
$stpos=strpos($raw,"&ts=");
$enpos=strpos($raw,'&',$stpos+1);
if($enpos<=stpos){
$enpos=1000;
}
if($stpos>0){
//echo("start=$stpos ");
//echo("end=$enpos ");
//echo("raw=".substr($raw,$stpos,$enpos-$stpos)." ");
$raw=substr($raw,$stpos,$enpos-$stpos);
//echo("raw=$raw ");
}
$temp=$pg;
//$temp=str_replace($raw,"",$temp);
//echo("temp=$temp ");
$temp2=str_replace($raw,"",$temp);
//echo("temp2=$temp2 ");
if($temp2==""){
$temp2=$row2[5];
}
$result = mysql_query("SELECT * FROM PAGEHits WHERE yr='$y' AND month='$m' AND dy='$d' AND PAGE='$temp2'");
$num_rows = mysql_num_rows($result);
if($num_rows==0){
$sql="INSERT INTO PAGEHits (yr,month,hits,dy,PAGE ) VALUES('$y','$m',1,'$d','$temp2')";
$result2 = mysql_query($sql);
}else{
$result = mysql_query("SELECT * FROM PAGEHits WHERE yr='$y' AND month='$m' AND dy='$d' AND PAGE='$temp2'");
$row=mysql_fetch_row($result);
$curval=$row[3];
$curval=($curval+1);
//echo("incremented is ".$curval);
$query="UPDATE PAGEHits set yr='$y', month='$m', hits=$curval, dy='$d', PAGE='$temp2' WHERE id='$row[0]'";
$result=mysql_query($query);
}
//now log hosts
//now deal with USER AGENT TRACKING
$sql="CREATE TABLE HOSTHits (id INT AUTO_INCREMENT PRIMARY KEY, yr TEXT, month TEXT, hits INT)";
$result = mysql_query($sql);
mysql_query("ALTER TABLE HOSTHits ADD dy TEXT");
mysql_query("ALTER TABLE HOSTHits ADD HOST TEXT");
$m=date("m");
$y=date("y");
$d=date("d");
$pg=$_SERVER['REMOTE_ADDR'];
$result = mysql_query("SELECT * FROM HOSTHits WHERE yr='$y' AND month='$m' AND dy='$d' AND HOST='$pg'");
$num_rows = mysql_num_rows($result);
if($num_rows==0){
$sql="INSERT INTO HOSTHits (yr,month,hits,dy,HOST ) VALUES('$y','$m',1,'$d','$pg')";
$result2 = mysql_query($sql);
}else{
$result = mysql_query("SELECT * FROM HOSTHits WHERE yr='$y' AND month='$m' AND dy='$d' AND HOST='$pg'");
$row=mysql_fetch_row($result);
$curval=$row[3];
$curval=($curval+1);
//echo("incremented is ".$curval);
$query="UPDATE HOSTHits set yr='$y', month='$m', hits=$curval, dy='$d', HOST='$pg' WHERE id='$row[0]'";
$result=mysql_query($query);
}
//finally look for where linked from
$sql="CREATE TABLE REFHits (id INT AUTO_INCREMENT PRIMARY KEY, yr TEXT, month TEXT, hits INT)";
$result = mysql_query($sql);
mysql_query("ALTER TABLE REFHits ADD dy TEXT");
mysql_query("ALTER TABLE REFHits ADD REF TEXT");
$m=date("m");
$y=date("y");
$d=date("d");
$pg=$_SERVER['HTTP_REFERER'];
$stpos=strpos($pg,"crumb.sunderland.ac.uk/~admin/beta");
if($stpos==false){
//echo("$pg tracking $stpos");
$result = mysql_query("SELECT * FROM REFHits WHERE yr='$y' AND month='$m' AND dy='$d' AND REF='$pg'");
$num_rows = mysql_num_rows($result);
if($num_rows==0){
$sql="INSERT INTO REFHits (yr,month,hits,dy,REF ) VALUES('$y','$m',1,'$d','$pg')";
$result2 = mysql_query($sql);
}else{
$result = mysql_query("SELECT * FROM REFHits WHERE yr='$y' AND month='$m' AND dy='$d' AND REF='$pg'");
$row=mysql_fetch_row($result);
$curval=$row[3];
$curval=($curval+1);
//echo("incremented is ".$curval);
$query="UPDATE REFHits set yr='$y', month='$m', hits=$curval, dy='$d', REF='$pg' WHERE id='$row[0]'";
$result=mysql_query($query);
}
}
}
}
}
function insertFinalSideMenu(){
if(1==1){
gatherInfo(); //page tracking
?>
selectDatabase("CoreDatabase");
$sql="SELECT * FROM sideMenu where subLink='-1' ORDER BY ordinal";
$result=mysql_query($sql);
$mainCount=0;
while ($row=mysql_fetch_row($result)) {
//$href="crumbFramework.php?op=$row[5]&sublink=-1";
$href="framework.php?op=$row[5]&sublink=-1";
?>
if ($_SESSION['open']==$row[5]){
?>
}
if ($_SESSION['open']<>$row[5]){
?>
}
?>
//OPEN SUBMENUS
if ($_SESSION['open']==$row[5]){
?>
if ($row[2]=="" && $_GET[op]<>9){ //this is generic items insert
insertGenericMenuItems($row[5]);
}
if ($row[2]=="Interviews"){
insertInterviews();
}
if ($row[2]=="Seminars"){
insertSeminars();
}
if ($row[2]=="Links & Bibliographies"){
insertBibliographies();
}
if ($row[2]=="CRUMB Outputs"){
insertBibliographies();
}
//END OF OPEN SUBMENUS
?>
}
} //ENDS maninMenuTopicLoop
?>
}
}
?>
function insertTopBar(){
if (1==1){
?>
CRUMB :: admin | shell | face | face2
Curatorial Resource for Upstart Media Bliss
}
}
function insertMainStart(){
function insertMain(){
if (1==1){
?>
Previous Posts:
Dec 10, 2005
Oct 15, 2005
Choice Links:
for curators
for theorists
for technicians
NEW! Dec 2005: Spencer has finished the website
This is the good news that Spencer has finished the website
- and now he can go to bed.
search
About CRUMB
News
Bios, contacts, etc
Discussion List
CRUMB Interviews
CRUMB Seminars
Practical Resources
Publications
Links & Bibliographies
Advanced Search
}
}
function insertsMen(){
global $type;
//echo("type=$type");
if(1==1){
?>
selectDatabase("CoreDatabase");
$sql="SELECT * FROM sideMenu where subLink='-1' ORDER BY ordinal";
$result=mysql_query($sql);
$mainCount=0;
while ($row=mysql_fetch_row($result)) {
$href="crumbFramework.php?op=$row[5]&sublink=-1";
?>
if ($_SESSION['open']==$row[5]){
echo("
");
?>
//echo("open this");
if ($row[2]=="Interviews"){
selectDatabase("CoreDatabase");
$selItem=$_GET[id];
$sql3="SELECT * FROM interviewcontent ORDER BY date";
$result3=mysql_query($sql3);
$sublink=0;
echo("
");
while ($row3=mysql_fetch_row($result3)) {
$sublink=$sublink+1;
// if ($row3[0]==$selItem){
//if ($row3[0]==$selItem){
if ($sublink==$_GET[sublink] && $_SESSION['noarrow']<>1){
echo("
";
}
if ($row[2]=="Seminars"){
selectDatabase("CoreDatabase");
$selItem=$_GET[id];
$sql3="SELECT * FROM seminarTable ORDER BY Date";
$result3=mysql_query($sql3);
$sublink=0;
echo("
");
while ($row3=mysql_fetch_row($result3)) {
$sublink=$sublink+1;
//if ($row3[0]==$selItem){
if (($sublink==$_GET[sublink] && $_SESSION['noarrow']<>1)){
echo("
");
}
if ($row[2]==""){
$sql2="SELECT * FROM sideMenu where subLink='$row[5]' ORDER BY ordinal";
$result2=mysql_query($sql2);
$sublink=0;
while ($row2=mysql_fetch_row($result2)) {
$sublink=$sublink+1;
echo("
");
if ($sublink==$_GET[sublink] && $_SESSION['noarrow']<>1){
echo("
");
selectDatabase('CoreDatabase');
$SQL="SELECT * FROM newsDB WHERE visible='1' ORDER BY itemDate DESC";
$result=mysql_query($SQL);
$firstRef="";
while($thisRow=mysql_fetch_row($result)){
if ($firstRef==""){
$firstRef=$thisRow[3];
}
$authID=$row[1];
$title=$thisRow[2];
$date=$thisRow[3];
$y=substr($date,0,4);
$m=substr($date,4,2);
$d=substr($date,6,2);
$m=$months[$m-1];
$abstract=$thisRow[4];
$detail=$thisRow[5];
echo("");
if ($thisRow[0]==$_GET[id]){
echo(">");
}else{
echo(" ");
}
echo(" $m $d, $y ");
}
}
if($type=="isNews"){
echo("
");
}
if($type=="isPresentation"){
global $firstId;
echo(" Other presentations from this seminar: ");
selectDatabase("CoreDatabase");
$query2="SELECT * FROM presentationCollectionTable WHERE presentationCollectionIDs LIKE '%/".$_GET[presID]."/%'";
//echo($query2);
$result2= mysql_query($query2);
while($row2 = mysql_fetch_row($result2)) {
$firstId=$row2[0];
}
$query="SELECT * FROM SeminarPresentationLinks WHERE presentationCollection='$firstId'";
//echo($query);
$result = mysql_query($query);
while($row = mysql_fetch_row($result)) {
$semId=$row[1];
}
global $link_id;
selectDatabase("CoreDatabase");
$query="SELECT * FROM SeminarPresentationLinks WHERE Seminar=$semId";
//echo($query);
$result = mysql_query($query, $link_id);
while($row = mysql_fetch_row($result)) {
$presColID=$row[2];
}
if ($presColID<>""){
$query="SELECT * FROM SeminarPresentationLinks WHERE Seminar=$semId";
//echo($query);
//echo("SELECT * FROM presentationCollectionTable WHERE id=$presColID");
$result = mysql_query("SELECT * FROM presentationCollectionTable WHERE id=$presColID");
while($row = mysql_fetch_row($result)) {
$datString=$row[3];
}
//echo($presLinks);
//now go through links and create SQL Statment for getting presentation list:
$SQLStr="";
$datCount=1;
//now go through datString
while(strLen($datString)>1){
$datString=subStr($datString, 1, strLen($datString));
//echo(" $datString");
$nextSlash=strPos($datString,"/");
$seekVal=subStr($datString, 0, ($nextSlash));
selectDatabase("CoreDatabase");
$result="SELECT * FROM presentationTable WHERE id='$seekVal'";
//echo($result);
$sql=mysql_query($result);
$userow=mysql_fetch_row($sql);
$userowIdRef=$userow[0];
$linkDat=$userow[1]." - ".$userow[2]." ";
if ($SQLStr<>""){
$SQLStr="$SQLStr OR ";
}
$SQLStr="$SQLStr id='$userow[0]'";
//echo("$datCount) $linkDat");
$datString=subStr($datString, $nextSlash, strLen($datString));
$datCount=$datCount+1;
}
if ($SQLStr<>""){
$SQLStr="$SQLStr ORDER BY evdate, startTime";
$SQLStr="SELECT * FROM presentationTable WHERE $SQLStr";
}
//echo("hello $SQLStr
");
//now test the query
$currentDate="NoDateSet";
$sql=mysql_query($SQLStr);
while($row = mysql_fetch_row($sql)) {
//echo($row[2]);
global $curentStartTime;
//echo("row 4 is $row[4]");
$currentStartTime=parseTime($row[4]);
//echo("cs is $currentStartTime");
$currentTitle=$row[2];
$currentPresID=$row[0];
$thisDate=parseDate($row[3]);
if ($currentDate<>$thisDate){
$months=array("January","February","March","April","May","June","July","August","September","October","November","December");
$m=substr($thisdate,3,2);
$month=$months[$m];
$yr=substr($thisDate,6,4);
$dy=substr($thisDate,0,2);
echo(" $dy $month $yr
");
// THE NEXT BLOCK ADDS A SLOT FOR THE NEW DATE (left of table)
$currentDate=$thisDate;
?>
//global $currentDate;
//echo("$currentDate");?>
//THIS ENDS THE 'CURRENT DATE IS DIFFERENT' CONDITION!
}
?>
global $currentStartTime;
$currentStartTime=parseTime($row[4]);
$currentEndTime=parseTime($row[5]);
?>
if ($currentPresID==$_GET[presID]){
echo(">");
}else{
echo(" ");
}
echo(" $currentTitle"); ?>
}
}}}
?>
}
function insertGenericMenuItems($slink){
$sql2="SELECT * FROM sideMenu where subLink='$slink' ORDER BY ordinal";
$result2=mysql_query($sql2);
$sublink=0;
while ($row2=mysql_fetch_row($result2)) {
$sublink=$sublink+1;
?>
}
function insertHeadBlock(){
if (1==1){
?>
CRUMB //
}
}
function placeForm(){
echo("");
}
function dropStyle1(){
echo("");
}
function dropStyle2(){
echo("STYLE='font-family : monospace;
font-size : 5pt'");
}
function dropStyle3(){
echo("");
}
function dropStyleSearch(){
echo("STYLE='font-family : monospace; font-size : 7pt'");
}
function setParticulars(){
useSess();
}
function testLog(){
useSess();
$s=$_SESSION['isadmin'];
if ($s!=1){
header("Location: notadmin.php?ts=".mkTime());
}
}
function redirectTo($strURL) {
//echo("$strURL");
echo "";
}
function selectDatabase($thisdbName){
global $link_id, $dbname, $debug;
$debug=1;
$site="crumbweb_crumb2";
$dbhost='5.254.160.166';
$dbusername='crumbweb'; // all privileges
$dbuserpass='k469gVF2tn';
//$dbusername='admin'; // all privileges
//$dbuserpass='management';
$dbname=$site.$thisdbName;
$task=$_POST[task];
//echo($dbhost." ".$dbname);
if($link_id) mysql_close($link_id);
$link_id=mysql_connect ($dbhost, $dbusername, $dbuserpass);
//echod (" success in database connection - $thisdbName");
// create the database.
//$dbname=$dbname;
//echo(" dbname is $dbname");
if (!mysql_query("CREATE DATABASE $dbname")){
//echo ("Didn't create this time.");
}else{
//echo "success in database creation.";
}
// select the specific database name we want to access.
//echo($dbname);
if (!mysql_select_db(strtolower($dbname), $link_id)) {
echo(" cant select db");
//die();
}
}
function newImageCount($thisC){
selectDatabase("Prefs");
$query="UPDATE imagePrefs set imageCount='$thisC' WHERE id='1'";
// echo("QUERY IS $query");
mysql_query($query);
}
function newvideoCount($thisC){
selectDatabase("Prefs");
$query="UPDATE videoPrefs set videoCount='$thisC' WHERE id='1'";
// echo("QUERY IS $query");
mysql_query($query);
}
function getPeopleDropDown($selectThis){
//selectThis is a variable to identify which item in the list to select
?>
}
function getTeamDropDown($selectThis){
//selectThis is a variable to identify which item in the list to select
?>
}
function getSpeakers($thisId){
global $link_id, $scanText;
//echo($thisId);
selectDatabase("CoreDatabase");
$sql="SELECT * FROM presentationparticipantlinks WHERE presentation=$thisId";
//echo($sql);
$result=mysql_query($sql, $link_id);
while ($row2=mysql_fetch_row($result)){
$personString=$row2[2];
}
//$sql="SELECT * FROM presentationparticipantlinks WHERE presentation=$thisId";
$result = mysql_query("SELECT * FROM peoplecollectiontable WHERE id='$personString'");
//echo($sql);
//$result=mysql_query($sql, $link_id);
while ($row3=mysql_fetch_row($result)){
$personCollectionString2=$row3[3];
//echo($personCollectionString2);
parsePersonCollection($personCollectionString2);
}
}
function getSpeakersScandata($thisId){
global $link_id, $scanText;
//echo($thisId);
selectDatabase("CoreDatabase");
$sql="SELECT * FROM presentationparticipantlinks WHERE presentation=$thisId";
//echo($sql);
$result=mysql_query($sql, $link_id);
while ($row2=mysql_fetch_row($result)){
$personString=$row2[2];
}
//$sql="SELECT * FROM presentationparticipantlinks WHERE presentation=$thisId";
$result = mysql_query("SELECT * FROM peoplecollectiontable WHERE id='$personString'");
//echo($sql);
//$result=mysql_query($sql, $link_id);
while ($row3=mysql_fetch_row($result)){
$personCollectionString2=$row3[3];
//echo($personCollectionString2);
parsePersonCollectionScandata($personCollectionString2);
}
}
function getInterviewer($thisId){
global $link_id, $embolden;
//echo("getting interviewer $thisId");
selectDatabase("CoreDatabase");
$sql="SELECT * FROM interviewInterviewerLinks WHERE interview='$thisId'";
//echo($sql);
$result=mysql_query(strtolower($sql), $link_id);
while ($row2=mysql_fetch_row($result)){
$personString=$row2[2];
}
$result = mysql_query(strtolower("SELECT * FROM peopleCollectionTable WHERE id='$personString'"), $link_id);
//echo(strtolower("SELECT * FROM peopleCollectionTable WHERE id='$personString'"));
//$result=mysql_query($sql, $link_id);
while ($row3=mysql_fetch_row($result)){
$personCollectionString2=$row3[3];
//echo("$row3[1]($row3[0])");
//echo("collection: $personCollectionString2");
parsePersonCollection($personCollectionString2);
}
}
function getInterviewee($thisId){
global $link_id;
//echo($thisId);
selectDatabase("CoreDatabase");
$sql="SELECT * FROM interviewIntervieweeLinks WHERE interview=$thisId";
//echo($sql);
$result=mysql_query(strtolower($sql), $link_id);
//echo("rsult=$result");
while ($row2=mysql_fetch_row($result)){
$personString=$row2[2];
//echo($personString);
}
//$sql="SELECT * FROM presentationParticipantLinks WHERE presentation=$thisId";
$result = mysql_query(strtolower("SELECT * FROM peopleCollectionTable WHERE id='$personString'"),$link_id);
//echo($sql);
//$result=mysql_query($sql, $link_id);
while ($row3=mysql_fetch_row($result)){
$personCollectionString=$row3[3];
//echo("PC=$personCollectionString2");
//echo($personCollectionString2);
parsePersonCollection($personCollectionString);
}
}
function getIntervieweeNoLink($thisId){
global $link_id;
//echo($thisId);
selectDatabase("coreDatabase");
$sql="SELECT * FROM interviewintervieweelinks WHERE interview=$thisId";
//echo($sql);
$result=mysql_query($sql, $link_id);
//echo("rsult=$result");
while ($row2=mysql_fetch_row($result)){
$personString=$row2[2];
//echo($personString);
}
//$sql="SELECT * FROM presentationParticipantLinks WHERE presentation=$thisId";
$result = mysql_query("SELECT * FROM peoplecollectiontable WHERE id='$personString'");
//echo($sql);
//$result=mysql_query($sql, $link_id);
while ($row3=mysql_fetch_row($result)){
$personCollectionString=$row3[3];
//echo("PC=$personCollectionString2");
//echo($personCollectionString2);
parsePersonCollectionNoLink($personCollectionString);
}
}
function getIntervieweeNoLinkNoStyle($thisId){
global $link_id;
//echo($thisId);
selectDatabase("CoreDatabase");
$sql="SELECT * FROM interviewintervieweelinks WHERE interview=$thisId";
//echo($sql);
$result=mysql_query($sql, $link_id);
//echo("rsult=$result");
while ($row2=mysql_fetch_row($result)){
$personString=$row2[2];
//echo($personString);
}
//$sql="SELECT * FROM presentationParticipantLinks WHERE presentation=$thisId";
$result = mysql_query("SELECT * FROM peoplecollectiontable WHERE id='$personString'");
//echo($sql);
//$result=mysql_query($sql, $link_id);
while ($row3=mysql_fetch_row($result)){
$personCollectionString=$row3[3];
//echo("PC=$personCollectionString2");
//echo($personCollectionString2);
parsePersonCollectionNoLinkNoStyle($personCollectionString);
}
}
function getIntervieweeNoLinkInterviewBoxes($thisId){
global $link_id;
//echo($thisId);
selectDatabase("CoreDatabase");
$sql="SELECT * FROM interviewintervieweelinks WHERE interview='$thisId'";
//echo($sql);
$result=mysql_query(strtolower($sql), $link_id);
//echo("rsult=$result");
while ($row2=mysql_fetch_row($result)){
$personString=$row2[2];
//echo("*".$personString."*");
}
//$sql="SELECT * FROM presentationParticipantLinks WHERE presentation=$thisId";
$result = mysql_query(strtolower("SELECT * FROM peoplecollectiontable WHERE id='$personString'"),$link_id);
//echo($sql);
//$result=mysql_query($sql, $link_id);
while ($row3=mysql_fetch_row($result)){
$personCollectionString=$row3[3];
//echo("PC=$personCollectionString");
//echo($personCollectionString2);
parsePersonCollectionNoLinkInterviewBoxes($personCollectionString);
}
}
function parsePersonCollection($pc){
global $interviewHref, $link_id;
//echo("got $pc ");
global $embolden, $scanText;
$embolden=array();
$datCount=1;
//now go through ipeople
?>
while(strLen($pc)>1){
$datString=subStr($pc, 1, strLen($pc));
//echo(" $datString");
$nextSlash=strPos($datString,"/");
//echo("nextSlas=$nextSlash");
$seekVal=subStr($datString, 0, ($nextSlash));
//echo("s=$seekVal");
selectDatabase("CoreDatabase");
$result="SELECT * FROM peopletable WHERE id='$seekVal'";
//echo($result);
$sql=mysql_query(strtolower($result), $link_id);
$userow=mysql_fetch_row($sql);
$scanText=" $scanText $userow[1] $userow[2] $userow[1] $userow[3] $userow[2] ";
$linkDat="".$userow[1]." ".$userow[3]." ".$userow[2]."";
$initials1=substr($userow[1],0,1);
$initials2=substr($userow[2],0,1);
$initials3=substr($userow[3],0,1);
//echo("$initials1$initials3$initials2:");
if ($userow[3]==""){
array_push($embolden, "$userow[1] $userow[2]:");
array_push($embolden, "$initials1$initials2:");
}else{
array_push($embolden, "$userow[1] $userow[3] $userow[2]:");
array_push($embolden, "$initials1$initials3$initials2:");
}
if ($datCount<>1){
echo(" & ");
}
//echo(" $linkDat");
?>
$pc=subStr($pc, $nextSlash+1, strLen($pc));
$datCount=$datCount+1;
}
?>
if ($datCount>2){
?>
}
?>
}
function parsePersonCollectionNoLink($pc){
global $interviewHref;
//echo("got $pc ");
global $embolden, $scanText;
$embolden=array();
$datCount=1;
//now go through ipeople
?>
}
function getPeopleCollectionDropDown(){
//Now get the drop down for link collections
global $link_id, $dbname, $debug;
$task=$_POST[task];
selectDatabase("CoreDatabase");
$sql = mysql_query("SELECT * FROM peopleCollectionTable ORDER BY peopleCollectionName");
echo("");
}
function getPresentationCollections(){
//Now get the drop down for presentation collections
global $link_id, $dbname, $debug;
$task=$_POST[task];
selectDatabase("CoreDatabase");
$sql = mysql_query("SELECT * FROM presentationCollectionTable");
echo("");
}
function getEveningEventCollections(){
//Now get the drop down for presentation collections
global $link_id, $dbname, $debug;
$task=$_POST[task];
selectDatabase("CoreDatabase");
$sql = mysql_query("SELECT * FROM eventCollectionTable");
echo("");
}
function getLInks(){
//Now get the drop down for link collections
global $link_id, $dbname, $debug;
$task=$_POST[task];
selectDatabase("AssetDatabase");
$sql = mysql_query("SELECT * FROM linkCollectionTable ORDER BY linkCollectionName");
echo("");
}
function getDocuments(){
//Now get the drop down for link collections
global $link_id, $dbname, $debug;
$task=$_POST[task];
selectDatabase("AssetDatabase");
$sql = mysql_query("SELECT * FROM documentTable");
echo("");
}
function getWork(){
//Now get the drop down for link collections
global $link_id, $dbname, $debug;
$task=$_POST[task];
selectDatabase("AssetDatabase");
$sql = mysql_query("SELECT * FROM workCollectionTable");
echo("");
}
function getWorks(){
//Now get the drop down for link collections
global $link_id, $dbname, $debug;
$task=$_POST[task];
selectDatabase("AssetDatabase");
$sql = mysql_query("SELECT * FROM workCollectionTable");
echo("");
}
function getMetaLInks(){
//Now get the drop down for link collections
global $link_id, $dbname, $debug;
$task=$_POST[task];
selectDatabase("AssetDatabase");
$sql = mysql_query("SELECT * FROM metaLinkCollectionTable");
echo("");
}
function getPresentationLInks(){
//Now get the drop down for images
global $link_id, $dbname, $debug;
$task=$_POST[task];
selectDatabase("CoreDatabase");
$sql = mysql_query("SELECT * FROM presentationCollectionTable");
echo("");
}
function getEveningEventLInks(){
//Now get the drop down for images
global $link_id, $dbname, $debug;
$task=$_POST[task];
selectDatabase("CoreDatabase");
$sql = mysql_query("SELECT * FROM eventCollectionTable");
echo("");
}
function getPeopleCollection(){
//Now get the drop down for images
global $link_id, $dbname, $debug;
$task=$_POST[task];
selectDatabase("CoreDatabase");
$sql = mysql_query("SELECT * FROM peopleCollectionTable ORDER BY peopleCollectionName");
echo("");
}
function getAllLInks(){
//Now get the drop down for links
global $link_id, $dbname, $debug;
$task=$_POST[task];
selectDatabase("AssetDatabase");
$sql = mysql_query("SELECT * FROM linkTable");
echo("");
}
function testQuery($thisDB, $thisQuery){
global $countVal, $link_id, $summary;
//echo($thisDB);
selectDatabase($thisDB);
$retVal="F";
//echo($thisQuery);
$result=mySql_query(($thisQuery),$link_id);
while($row9=mysql_fetch_row($result)){
$countVal=$row9[0];
if ($row9[0]!=0){
$retVal="T";
//echo($thisContentQuery);
}
}
//echo($thisQuery." ".$retVal);
return($retVal);
}
function testQuery2($thisDB, $thisQuery, $thisContentQuery, $thisType){
global $countVal, $link_id, $summary, $showFull, $firstFlag;
//echo($thisDB);
selectDatabase($thisDB);
$retVal="F";
//echo($thisQuery);
$result=mySql_query($thisQuery);
while($row9=mysql_fetch_row($result)){
$countVal=$row9[0];
if ($row9[0]!=0){
$retVal="T";
//echo($thisContentQuery);
$contentResult=mySql_query($thisContentQuery);
$contCount=0;
while($row10=mysql_fetch_row($contentResult) AND $contCount<4){
//echo($row10[0]);
//$summary="$summary $row10[1] ";
//echo("thistype=$thisType");
if ($thisType<>$lastType){
$lastType=$thisType;
if ($row9[0]>0){
if (1==1){
//$summary="$summary
";
//$summary
if ($showFull<>""){
//$summary="$summary
//echo("open this");
if ($row[2]==""){
$sql2="SELECT * FROM sideMenu where subLink='$row[5]' ORDER BY ordinal";
$result2=mysql_query($sql2);
$sublink=0;
while ($row2=mysql_fetch_row($result2)) {
$sublink=$sublink+1;
if ($sublink==$_GET[sublink] && $_SESSION['noarrow']<>1){
echo("");
}else{
echo("");
}
if($row2[2]=="http://www.jiscmail.ac.uk/lists/new-media-curating.html"){
echo("$row2[1] ");
}else{
echo("$row2[1] ");
}
}
}
if ($row[2]=="Seminars"){
selectDatabase("CoreDatabase");
$selItem=$_GET[id];
$sql3="SELECT * FROM seminarTable ORDER BY Date";
$result3=mysql_query($sql3);
$sublink=0;
while ($row3=mysql_fetch_row($result3)) {
$sublink=$sublink+1;
//if ($row3[0]==$selItem){
if (($sublink==$_GET[sublink] && $_SESSION['noarrow']<>1)){
echo("");
}else{
echo("");
}
echo("$row3[2] ");
}
}
if ($row[2]=="Interviews"){
selectDatabase("CoreDatabase");
$selItem=$_GET[id];
$sql3="SELECT * FROM interviewcontent ORDER BY date";
$result3=mysql_query($sql3);
$sublink=0;
echo("
");
while ($row3=mysql_fetch_row($result3)) {
$sublink=$sublink+1;
// if ($row3[0]==$selItem){
//if ($row3[0]==$selItem){
if ($sublink==$_GET[sublink] && $_SESSION['noarrow']<>1){
echo("
"); //added for exhibition
}
if($type=="showExhibWorks"){
echo(" All works in this exhibition:
");
global $link_id;
$eID=$_GET[showExhib];
selectDatabase('CoreDatabase');
$SQL="SELECT * FROM exhibitionWorkLinks WHERE exhibition=$eID";
// echo($SQL);
$result = mysql_query($SQL, $link_id);
$row=mysql_fetch_row($result);
$workCollection=$row[2];
// echo(" work collection=$workCollection");
$SQL="SELECT * FROM exhibitionWorkLinks WHERE exhibition=$eID";
// echo($SQL);
$result = mysql_query($SQL, $link_id);
$row=mysql_fetch_row($result);
$workCollection=$row[2];
// echo(" work collection=$workCollection");
if ($workCollection<>""){
selectDatabase("AssetDatabase");
//echo("SELECT * FROM workCollectionTable WHERE id=$theseLinks");
$sql=mysql_query("SELECT * FROM workCollectionTable WHERE id=$workCollection");
while ($row = mysql_fetch_row($sql)) {
$imString=$row[3];
}
//echo("$imString ");
$imCount=1;
//now go through imstring
while(strLen($imString)>1){
$imString=subStr($imString, 1, strLen($imString));
//echo(" $imString");
$nextSlash=strPos($imString,"/");
$seekVal=subStr($imString, 0, ($nextSlash));
selectDatabase("CoreDatabase");
$result="SELECT * FROM workTable WHERE id='$seekVal'";
//echo($result);
$sql=mysql_query($result);
$userow=mysql_fetch_row($sql);
$linkDat="";
if($_GET[exD]==$userow[0]){
$linkDat="$linkDat>";
}else{
$linkDat="$linkDat ";
}
$linkDat="$linkDat$userow[1]";
$thisWork=$userow[0];
//get artists
selectDatabase("CoreDatabase");
$imagesSoFar="";
$imcountA=1;
$getWorkNameSQLA="SELECT title from workTable where id='$thisWork'";
//echo ("semnamesql is $getWorkNameSQL");
$namresultsA=mysql_query($getWorkNameSQLA);
$rowA=mysql_fetch_row($namresultsA);
$artists="";
//echo(" Current artists links to the work '$row[0]' ");
$sqlPeop="SELECT * FROM worksArtistsLinks WHERE work='$thisWork'";
$peop=mysql_query($sqlPeop);
$rowP=mysql_fetch_row($peop);
$pid=$rowP[2];
selectDatabase("CoreDatabase");
$sqlA = mysql_query("SELECT * FROM peopleCollectionTable WHERE id=$pid");
if ($sqlA){
while ($rowA = mysql_fetch_row($sqlA)) {
$imStringA=$rowA[3];
}
//echo(" ");
$imCountA=1;
//now go through imstring
while(strLen($imStringA)>1){
$imStringA=subStr($imStringA, 1, strLen($imStringA));
//echo(" $imString");
$nextSlashA=strPos($imStringA,"/");
$seekValA=subStr($imStringA, 0, ($nextSlashA));
selectDatabase("CoreDatabase");
$resultA="SELECT * FROM PeopleTable WHERE id='$seekValA'";
//echo($result);
$sqlA=mysql_query($resultA);
$userowA=mysql_fetch_row($sqlA);
$linkDatA=$userowA[1]." ".$userowA[3]." ".$userowA[2];
$artists="$artists >$linkDatA ";
$imStringA=subStr($imStringA, $nextSlashA, strLen($imStringA));
$imCountA=$imCountA+1;
}
}
//end getartists
echo("$linkDat ");
$imString=subStr($imString, $nextSlash, strLen($imString));
$imCount=$imCount+1;
}
}
}
if($type=="showExhibs"){
global $link_id;
echo(" All exhibitions:
");
selectDatabase('CoreDatabase');
$result= mysql_query("SELECT * FROM exhibitionTable", $link_id);
while ($row = mysql_fetch_row($result)) {
echo("");
if ($_GET[id]==$row[0]){
echo(">");
}else{
echo(" ");
}
echo("$row[2] ");
}
}
if($type=="isNewsItem"){
$months=array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
echo(" Recent Postings:
");
selectDatabase('CoreDatabase');
$SQL="SELECT * FROM newsDB WHERE visible='1' ORDER BY itemDate DESC";
$result=mysql_query($SQL);
$firstRef="";
while($thisRow=mysql_fetch_row($result)){
if ($firstRef==""){
$firstRef=$thisRow[3];
}
$authID=$row[1];
$title=$thisRow[2];
$date=$thisRow[3];
$y=substr($date,0,4);
$m=substr($date,4,2);
$d=substr($date,6,2);
$m=$months[$m-1];
$abstract=$thisRow[4];
$detail=$thisRow[5];
echo("");
if ($thisRow[0]==$_GET[id]){
echo(">");
}else{
echo(" ");
}
echo(" $m $d, $y ");
}
}
if($type=="isPresentation"){
global $firstId;
echo(" Other presentations from this seminar: ");
selectDatabase("CoreDatabase");
$query2="SELECT * FROM presentationCollectionTable WHERE presentationCollectionIDs LIKE '%/".$_GET[presID]."/%'";
//echo($query2);
$result2= mysql_query($query2);
while($row2 = mysql_fetch_row($result2)) {
$firstId=$row2[0];
}
$query="SELECT * FROM SeminarPresentationLinks WHERE presentationCollection='$firstId'";
//echo($query);
$result = mysql_query($query);
while($row = mysql_fetch_row($result)) {
$semId=$row[1];
}
global $link_id;
selectDatabase("CoreDatabase");
$query="SELECT * FROM SeminarPresentationLinks WHERE Seminar=$semId";
//echo($query);
$result = mysql_query($query, $link_id);
while($row = mysql_fetch_row($result)) {
$presColID=$row[2];
}
if ($presColID<>""){
$query="SELECT * FROM SeminarPresentationLinks WHERE Seminar=$semId";
//echo($query);
//echo("SELECT * FROM presentationCollectionTable WHERE id=$presColID");
$result = mysql_query("SELECT * FROM presentationCollectionTable WHERE id=$presColID");
while($row = mysql_fetch_row($result)) {
$datString=$row[3];
}
//echo($presLinks);
//now go through links and create SQL Statment for getting presentation list:
$SQLStr="";
$datCount=1;
//now go through datString
while(strLen($datString)>1){
$datString=subStr($datString, 1, strLen($datString));
//echo(" $datString");
$nextSlash=strPos($datString,"/");
$seekVal=subStr($datString, 0, ($nextSlash));
selectDatabase("CoreDatabase");
$result="SELECT * FROM presentationTable WHERE id='$seekVal'";
//echo($result);
$sql=mysql_query($result);
$userow=mysql_fetch_row($sql);
$userowIdRef=$userow[0];
$linkDat=$userow[1]." - ".$userow[2]." ";
if ($SQLStr<>""){
$SQLStr="$SQLStr OR ";
}
$SQLStr="$SQLStr id='$userow[0]'";
//echo("$datCount) $linkDat");
$datString=subStr($datString, $nextSlash, strLen($datString));
$datCount=$datCount+1;
}
if ($SQLStr<>""){
$SQLStr="$SQLStr ORDER BY evdate, startTime";
$SQLStr="SELECT * FROM presentationTable WHERE $SQLStr";
}
//echo("hello $SQLStr
");
//now test the query
$currentDate="NoDateSet";
$sql=mysql_query($SQLStr);
while($row = mysql_fetch_row($sql)) {
//echo($row[2]);
global $curentStartTime;
//echo("row 4 is $row[4]");
$currentStartTime=parseTime($row[4]);
//echo("cs is $currentStartTime");
$currentTitle=$row[2];
$currentPresID=$row[0];
$thisDate=parseDate($row[3]);
if ($currentDate<>$thisDate){
$months=array("January","February","March","April","May","June","July","August","September","October","November","December");
$m=substr($thisdate,3,2);
$month=$months[$m];
$yr=substr($thisDate,6,4);
$dy=substr($thisDate,0,2);
echo(" $dy $month $yr
");
// THE NEXT BLOCK ADDS A SLOT FOR THE NEW DATE (left of table)
$currentDate=$thisDate;
?>
//global $currentDate;
//echo("$currentDate");?>
//THIS ENDS THE 'CURRENT DATE IS DIFFERENT' CONDITION!
}
?>
global $currentStartTime;
$currentStartTime=parseTime($row[4]);
$currentEndTime=parseTime($row[5]);
?>
if ($currentPresID==$_GET[presID]){
echo(">");
}else{
echo(" ");
}
echo(" $currentTitle"); ?>
}}
}
?>
}
?>
function massDelete(){
global $deleteArray;
$db=$deleteArray[0];
$query=$deleteArray[1];
for($lop=0; $lop
}
?>
function closeDoc(){
?>
}
}
function parseDate($thisDate){
$year=substr($thisDate, 0, 4);
$month=substr($thisDate, 4, 2);
$day=substr($thisDate, 6, 2);
return("$day/$month/$year");
}
function parseTime($thisTime){
$hour=substr($thisTime, 0, 2);
$minute=substr($thisTime, 2, 2);
return("$hour:$minute");
}
function scanforPeople($thisText){
global $nameList;
selectDatabase('CoreDatabase');
$sql="SELECT * FROM peopleTable";
$result=mysql_query($sql);
$nameList="";
while($thisrow=mysql_fetch_row($result)){
$nameSeek="$thisrow[1] $thisrow[2]";
$nameSeek2=$thisrow[1]." ".$thisrow[3]." ".$thisrow[2];
//echo("$nameSeek = ".strpos ($thisText, $nameSeek)." ".strpos ($thisText, $nameSeek2)." ");
if (strpos ($thisText, $nameSeek)>-1 ||strpos ($thisText, $nameSeek2)>-1){
$nameList="$nameList $nameSeek2";
}
}
if ($nameList<>""){
echo("
>People:$nameList");
}
}
function scanforPeopleStyled($thisText){
global $nameList, $link_id;
selectDatabase('CoreDatabase');
$sql="SELECT * FROM peopleTable";
$result=mysql_query(strtolower($sql), $link_id);
$nameList="";
while($thisrow=mysql_fetch_row($result)){
$nameSeek="$thisrow[1] $thisrow[2]";
$nameSeek2=$thisrow[1]." ".$thisrow[3]." ".$thisrow[2];
//echo("$nameSeek = ".strpos ($thisText, $nameSeek)." ".strpos ($thisText, $nameSeek2)." ");
if (strpos ($thisText, $nameSeek)>-1 ||strpos ($thisText, $nameSeek2)>-1){
$nameList="$nameList $nameSeek2 ";
}
}
if ($nameList<>""){
?>
People:
}
}
function scanforPeopleNoBreaks($thisText){
global $nameList, $scanText;
selectDatabase('CoreDatabase');
$sql="SELECT * FROM peopleTable";
$result=mysql_query($sql);
$nameList="";
while($thisrow=mysql_fetch_row($result)){
$nameSeek="$thisrow[1] $thisrow[2]";
$nameSeek2=$thisrow[1]." ".$thisrow[3]." ".$thisrow[2];
//echo("$nameSeek = ".strpos ($thisText, $nameSeek)." ".strpos ($thisText, $nameSeek2)." ");
if (strpos ($thisText, $nameSeek)>-1 ||strpos ($thisText, $nameSeek2)>-1){
$nameList="$nameList >$nameSeek2";
$scanText=" $scanText $nameSeek2 ";
}
}
if ($nameList<>""){
echo("
Related People:$nameList
");
}
}
function scanforTheory($thisText){
global $nameList, $scanText, $link_id;
selectDatabase('CoreDatabase');
$sql="SELECT * FROM lexicontable WHERE lextype<>'person'";
//echo($sql);
$result=mysql_query(strtolower($sql),$link_id);
//echo("$result");
$nameList="";
while($thisrow=mysql_fetch_row($result)){
$nameSeek="$thisrow[1]";
$nameSeek2="$thisrow[1]";
//echo($nameSeek);
//echo("$nameSeek = ".strpos ($thisText, $nameSeek)." ".strpos ($thisText, $nameSeek2)." ");
if (strpos ($thisText, $nameSeek)>-1 ||strpos ($thisText, $nameSeek2)>-1){
$nameList="$nameList $nameSeek2";
$scanText=" $scanText $nameSeek2 ";
}
}
if ($nameList<>""){
echo("
>Keywords:$nameList");
}
}
function scanforTheoryStyled($thisText){
//echo($thisText);
global $nameList, $link_id;
selectDatabase('CoreDatabase');
$sql="SELECT * FROM lexicontable WHERE lextype<>'person'";
$result=mysql_query(strtolower($sql), $link_id);
$nameList="";
while($thisrow=mysql_fetch_row($result)){
$nameSeek="$thisrow[1]";
$nameSeek2=$thisrow[1];
//echo("$nameSeek");
//echo("$nameSeek = ".strpos ($thisText, $nameSeek)." ".strpos ($thisText, $nameSeek2)." ");
if (strpos ($thisText, $nameSeek)>-1 ||strpos ($thisText, $nameSeek2)>-1){
$nameList="$nameList $nameSeek2 ";
}
}
if ($nameList<>""){
?>
Keywords:
}
}
function scanforTheoryNoBreaks($thisText){
global $nameList, $scanText;
selectDatabase('CoreDatabase');
$sql="SELECT * FROM lexicontable WHERE lextype<>'person'";
//echo($sql);
$result=mysql_query($sql);
//echo("$result");
$nameList="";
while($thisrow=mysql_fetch_row($result)){
$nameSeek="$thisrow[1]";
$nameSeek2="$thisrow[1]";
//echo($nameSeek);
//echo("$nameSeek = ".strpos ($thisText, $nameSeek)." ".strpos ($thisText, $nameSeek2)." ");
if (strpos ($thisText, $nameSeek)>-1 ||strpos ($thisText, $nameSeek2)>-1){
$nameList="$nameList >$nameSeek2";
$scanText=" $scanText $nameSeek2 ";
}
}
if ($nameList<>""){
echo("
Related Keywords:$nameList
");
}
}
function scanForSearchTerms($thisText){
global $abstract, $overviewCreds, $work, $artist;
selectDatabase("CoreDatabase");
//echo("SELECT * FROM popularSearches WHERE phrase='$nam'");
$excludes=" a b c d e f g h i j k l m n o p q r s t u v w x y z he she it they we my your the them is us test ";
$sql = mysql_query("SELECT * FROM popularSearches ORDER BY frequency");
$keywords="";
//echo("hello");
while($row=mysql_fetch_row($sql)){
//echo("seeking $row[1]");
$term=$row[1];
$term=trim($term);
str_replace("%20"," ",$term);
str_replace(" "," ",$term);
//$biography=str_replace($work,"$work",$biography);
$t1=strtoupper(substr($term,0,1)).strtolower(substr($term,1));
//echo("t1=$t1");
//$term=trim($term);
//echo("term is $term :".$work." ".$artist." ".$overviewCreds);
if ($term<>""){
if ((strpos (" ".$thisText." ", $term)>0) or (strpos (" ".$thisText." ", $t1)>0)){
if ((strpos ($excludes, $term)<1) and ($term<>"")){
//echo("found one");
$keywords="$keywords > ".strtolower($row[1])." ";
}
}
}
}
if ($keywords<>""){
echo("