SM-Finder-Logo        
herz Karte Kalender Suche Bookmarks Experte FAQ

Module

Download

SMFinder_Admin_addCategories

Wird verwendet von:
SMFinder_Admin_addCategories

Die Datei SMFinder_Elementdefinitions enth¨lt Listen der Kathegorien und Attribute zu den Elementen. Diese Funktion dient, um diese Listen zu erweiter.

Zum Datenabgleich der verschiedenen Server sollten diese Listen synchron gehalten werden! Sofern du also nicht dein eigenes Süppchen kochen willst, spreche Erweiterungen bitte mit dem AK-SM-Finder ab.

<?php
function SMFinder_Admin_addCategories(){
  include("SMFinder_Config.php");
  switch($_POST['change']){
  case "POST":
    /* Aenderung nur durch Admin */
    if (!$_SESSION['IamGod']){
      echo "<p><b>Du hat keine Adminrechte!</b></p>";
      break;
    }
    /* modify data base */
    list($firstPart,$CatsAtrs,$AliasLines) = readElementdefinitions();
    $dblink=mysql_connect($GLOBALS['dbserver'],$GLOBALS['dbuser'],$GLOBALS['dbpasswd']);
    mysql_select_db($GLOBALS['dbname'],$dblink);
    $catsOld=$_POST['catsOld'];
    $atrsOld=$_POST['atrsOld'];
    $catsAliasOld=$_POST['catsAliasOld'];
    $atrsAliasOld=$_POST['atrsAliasOld'];
    $which=$_POST['which']; #aliasCat/aliasAtr
    $NoOfAlias=$_POST['NoOfAlias'];
    $ID=$_POST['ID'];
    $addCat=$_POST['addCat'];
    $addAtr=$_POST['addAtr'];
    if($GLOBALS['debug']){
      echo "<b>SMFinder_Admin_addCategories.php</b><br>";
      echo "which ".$which."<br>";
      echo "addCat ".$addCat."<br>";
      echo "addAtr ".$addAtr."<br>";
      echo "NoOfAlias ".$NoOfAlias."<br>";
    }
    /* add category */
    $cats=explode(",",$catsOld);
    if (strlen($addCat)>1){
      array_push($cats,$addCat);
      $anfrage =" ALTER TABLE  `".$GLOBALS['DBTaddress']."` CHANGE  `cats`  `cats` ENUM("; 
      $catsString ="\$cats_address=array("; 
      $anfrage.=" '".$cats[0]."'";
      $catsString.="'".$cats[0]."'";
      for ($c=1;$c<count($cats);$c++){  
	$anfrage.=", '".$cats[$c]."'"; 
	$catsString.=",'".$cats[$c]."'";
      } #c
      $anfrage.=" ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL";
      $catsString.=");";
      if ($GLOBALS['sitename']=="Bizarre-Medien"){
	$anfrage = "ALTER TABLE  `categories` ADD `".$addCat."` BOOL NOT NULL";
      }
      if($GLOBALS['debug']){echo "<b>SMFinder_Admin_addCategories.php</b> ".$anfrage."<br>";}
      if ($ergebnis=mysql_query($anfrage)){
	echo "<p><aj>DB angepasst</aj></p>";
	$CatsAtrs[0]=$catsString;
	echo "Schreibe in Elementdefinitions:<br>".$catsString."<br>";
	$error = writeElementdefinitions($firstPart,$CatsAtrs,$AliasLines);
      }else{
	echo $ergebnis;
      }
    }
    /* add atribute */
    $atrs=explode(",",$atrsOld);
    if (strlen($addAtr)>1){
      array_push($atrs,$addAtr);
      $anfrage =" ALTER TABLE  `".$GLOBALS['DBTaddress']."` CHANGE  `atrs`  `atrs` ENUM("; 
      $atrsString ="\$atrs_address=array(";  
      $anfrage.=" '".$atrs[0]."'";
      $atrsString.="'".$atrs[0]."'";
      for ($a=1;$a<count($atrs);$a++){  
	$anfrage.=", '".$atrs[$a]."'";
	$atrsString.=",'".$atrs[$a]."'";
      } #c
      $anfrage.=" ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL";
      $atrsString.=");";
      if ($GLOBALS['sitename']=="Bizarre-Medien"){
	$anfrage = "ALTER TABLE `attributes` ADD `".$addAtr."` BOOL NOT NULL";
      }
      if($GLOBALS['debug']){echo "<b>SMFinder_Admin_addCategories.php</b> ".$anfrage."<br>";}
      if ($ergebnis=mysql_query($anfrage)){
	echo "<p><aj>DB angepasst</aj></p>";
	$CatsAtrs[1]=$atrsString;
	echo "Schreibe in Elementdefinitions:<br>".$atrsString."<br>";
	$error = writeElementdefinitions($firstPart,$CatsAtrs,$AliasLines);
      }else{
	echo $ergebnis;
      }
    }
    /* modify aliases */
    if ($which=="aliasCat" OR $which=="aliasAtr"){
      $aliases = parseAliases($AliasLines,$cats,$atrs);
    }
    if ($which=="aliasCat"){
      $aliases["catsAddress"][$cats[$NoOfAlias]]=array();
      $NoOfKeywords=count($aliases["catsAddress"][$cats[$NoOfAlias]])+1;
      for ($kw=0;$kw<=$NoOfKeywords;$kw++){
	$ID=sprintf("aliasCat_%02d_%02d",$NoOfAlias,$kw);
	$thisAlias=$_POST[$ID];
	if (strlen($thisAlias)>1){
	  array_push($aliases["catsAddress"][$cats[$NoOfAlias]],$thisAlias);
	}
      } #kw

      $aliasExists=false;
      $thisCat=$cats[$NoOfAlias];
      for ($l=0;$l<count($AliasLines);$l++){
	$tmp1=strpos($AliasLines[$l],"aliasCats_address");
	$tmp2=strpos($AliasLines[$l],"['".$cats[$NoOfAlias]."']");
	if ($tmp1>0 AND $tmp2>0){
	  $AliasLines[$l] ="\$aliasCats_address['".$thisCat."']=array(";
	  $AliasLines[$l].="'".$aliases["catsAddress"][$thisCat][0]."'";
	  for ($al=1;$al<count($aliases["catsAddress"][$thisCat]);$al++){
	    $AliasLines[$l].=",'".$aliases["catsAddress"][$thisCat][$al]."'";
	  } #al
	  $AliasLines[$l].=");";
	  $aliasExists=true;
	  break;
	}
      } #l
      if (!$aliasExists){
	$AliasLines[$l] ="\$aliasCats_address['".$thisCat."']=array(";
	$AliasLines[$l].="'".$aliases["catsAddress"][$thisCat][0]."'";
	for ($al=1;$al<count($aliases["catsAddress"][$thisCat]);$al++){
	  $AliasLines[$l].=",'".$aliases["catsAddress"][$thisCat][$al]."'";
	} #al
	$AliasLines[$l].=");";
      }
    }
    if ($which=="aliasAtr"){
      $aliases["atrsAddress"][$atrs[$NoOfAlias]]=array();
      $NoOfKeywords=count($aliases["atrsAddress"][$atrs[$NoOfAlias]])+1;
      for ($kw=0;$kw<=$NoOfKeywords;$kw++){
	$ID=sprintf("aliasAtr_%02d_%02d",$NoOfAlias,$kw);
	$thisAlias=$_POST[$ID];
	if (strlen($thisAlias)>1){
	  array_push($aliases["atrsAddress"][$atrs[$NoOfAlias]],$thisAlias);
	}
      } #kw
      $aliasExists=false;
      $thisAtr=$atrs[$NoOfAlias];
      for ($l=0;$l<count($AliasLines);$l++){
	$tmp1=strpos($AliasLines[$l],"aliasAtrs_address");
	$tmp2=strpos($AliasLines[$l],"['".$atrs[$NoOfAlias]."']");
	if ($tmp1>0 AND $tmp2>0){
	  $AliasLines[$l] ="\$aliasAtrs_address['".$thisAtr."']=array(";
	  $AliasLines[$l].="'".$aliases["atrsAddress"][$thisAtr][0]."'";
	  for ($al=1;$al<count($aliases["atrsAddress"][$thisAtr]);$al++){
	    $AliasLines[$l].=",'".$aliases["atrsAddress"][$thisAtr][$al]."'";
	  } #al
	  $AliasLines[$l].=");";
	  $aliasExists=true;
	  break;
	}
      } #l
      if (!$aliasExists){
	$AliasLines[$l] ="\$aliasAtrs_address['".$thisAtr."']=array(";
	$AliasLines[$l].="'".$aliases["atrsAddress"][$thisAtr][0]."'";
	for ($al=1;$al<count($aliases["atrsAddress"][$thisAtr]);$al++){
	  $AliasLines[$l].=",'".$aliases["atrsAddress"][$thisAtr][$al]."'";
	} #al
	$AliasLines[$l].=");";
      }
    }
    $error = writeElementdefinitions($firstPart,$CatsAtrs,$AliasLines);
    break;
  case "ugly":
    $fname="ShowCatsAtrsNice.php";
    $ShowCatsAtrsNice = readShowCatsAtrsNice($fname);
    $NoUgly=$_POST['NoUgly'];
    $ugly=array(); $nice=array();
    for ($l=0;$l<$NoUgly;$l++){
      $ID=sprintf("ugly%02d",$l);
      $tmp=$_POST[$ID];
      if (strlen($tmp)>0){
	array_push($ugly,$tmp);
	$ID=sprintf("nice%02d",$l);
	$tmp=$_POST[$ID];
	array_push($nice,$tmp);
      }
    } #l
    $uglyString="\$ugly=array('".$ugly[0]."'";
    $niceString="\$nice=array('".$nice[0]."'";
    for ($l=1;$l<count($ugly);$l++){
      $uglyString.=",'".$ugly[$l]."'";
      $niceString.=",'".$nice[$l]."'";
    } #l
    $uglyString.=");\n";
    $niceString.=");\n";

    for ($l=0;$l<count($ShowCatsAtrsNice);$l++){
      $pos=strpos($ShowCatsAtrsNice[$l],"ugly=array");
      if ($pos>0){
	$ShowCatsAtrsNice[$l]=$uglyString;
      }
      $pos=strpos($ShowCatsAtrsNice[$l],"nice=array");
      if ($pos>0){
	$ShowCatsAtrsNice[$l]=$niceString;
      }
      $tmp=str_replace("<","",$ShowCatsAtrsNice[$l]);
      $tmp=str_replace(">","",$ShowCatsAtrsNice[$l]);
    } #l
    $fname="ShowCatsAtrsNice";
    exec("cp ".$fname.".php ".$fname.".arne");
    $fid=fopen($fname.".php","w");
    for ($l=0;$l<count($ShowCatsAtrsNice);$l++){
      fputs($fid,$ShowCatsAtrsNice[$l]);
    } #l
    fclose($fid);
    echo "<p><aj>ShowCatsAtrsNice angepasst.</aj></p>";
    break;

  default:
    /* read existing categories, attributes from DB */
    if ($GLOBALS['sitename']=="Bizarre-Medien"){
    $fieldNames = SQL_getFieldNamesOfTable('categories');
    for ($f=2;$f<count($fieldNames);$f++){$catsSQL[$f-2]=$fieldNames[$f];}
    $fieldNames = SQL_getFieldNamesOfTable('attributes');
    for ($f=2;$f<count($fieldNames);$f++){$atrsSQL[$f-2]=$fieldNames[$f];}
    #exit(1); //arne
    }else{
    $catsSQL = SQL_getMembersOfSet($GLOBALS['DBTaddress'],"cats");
    $atrsSQL = SQL_getMembersOfSet($GLOBALS['DBTaddress'],"atrs");
    }
    $NoOfCats = count($catsSQL);
    $NoOfAtrs = count($atrsSQL);
    $keywords=array();
    for ($c=0;$c<$NoOfCats;$c++){
      array_push($keywords,$catsSQL[$c]);
    } #c
    for ($a=0;$a<$NoOfAtrs;$a++){
      array_push($keywords,$atrsSQL[$a]);
    } #a
    /* read existing aliases from Elementdefinitions */
    list($firstPart,$CatsAtrs,$AliasLines) = readElementdefinitions();
    $aliases = parseAliases($AliasLines,$catsSQL,$atrsSQL);

    /* form to add some */
    $catsOld=implode(",",$catsSQL);
    $atrsOld=implode(",",$atrsSQL);
    echo "<h1>Modifikation des Stichworteverzeichnisses</h1>\n";
    echo "Bitte vermeide deutsche Umlaute!<br>Diese werden mittels showCatsAtrsNice für die Anzeige optimiert.<br><a href='#ShowCatsAtrsNice'>(siehe unten)</a></p>\n";
    echo "<h2>Kategorien & Attribute</h2>\n";
    echo "<p>Es können nur Begriffe hinzugefügt, nicht gelöscht werden, da es sonst zu Inkonsistenzen mit alten Daten kommt.</p>\n";
    echo "<form method='POST' action='".$GLOBALS['PHP_SELF']."?what2do=addCategories' align='center'>";
    echo "<input type='hidden' name='catsOld' value='".$catsOld."'>
        <input type='hidden' name='atrsOld' value='".$atrsOld."'>";
    echo "<input type='hidden' name='change' value='POST'>";
    echo "<table>";
    echo "<tr><th>Kategorien</th><th>Attribute</th></tr>";
    for ($ca=0;$ca<max($NoOfCats,$NoOfAtrs);$ca++){
      echo "<tr><td>".$catsSQL[$ca]."</td><td>".$atrsSQL[$ca]."</td></tr>\n";
    } #ca
    echo "<tr><td><input name='addCat' value='' type='text' size='40'></td>
        <td><input name='addAtr' value='' type='text' size='40'></td></tr>\n";
    echo "</table><input type='submit' value='hinzufügen'></form>\n";
    /* ------------------- */
    echo "<h2>Synonyme</h2>\n";
    echo "<p>Die Aliase für die Suchmaschine können hingegen frei umdefiniert werden.</p>\n";
    for ($c=0;$c<$NoOfCats;$c++){
      echo "<p><strong>".$catsSQL[$c]."</strong><br>
          <form method='POST' action='".$GLOBALS['PHP_SELF']."?what2do=addCategories'>\n";
      echo "<input type='hidden' name='change' value='POST'>";
      echo "<input type='hidden' name='which' value='aliasCat'>";
      echo "<input type='hidden' name='NoOfAlias' value='".$c."'>";
      echo "<input type='hidden' name='catsOld' value='".$catsOld."'>
          <input type='hidden' name='atrsOld' value='".$atrsOld."'>";
      for ($kw=0;$kw<count($aliases["catsAddress"][$catsSQL[$c]]);$kw++){
	$ID=sprintf("aliasCat_%02d_%02d",$c,$kw);
	echo "<input name='".$ID."' value='".$aliases["catsAddress"][$catsSQL[$c]][$kw]."' type='text' size='40'><br>\n";
      } #kw
      $ID=sprintf("aliasCat_%02d_%02d",$c,$kw);
      echo "<input name='".$ID."' value='' type='text' size='40'><br>\n";
      echo "<input type='submit' value='ok'></form></p>";
    } #c
    for ($a=0;$a<$NoOfAtrs;$a++){
      echo "<p><strong>".$atrsSQL[$a]."</strong><br>
          <form method='POST' action='".$GLOBALS['PHP_SELF']."?what2do=addCategories'>\n";
      echo "<input type='hidden' name='change' value='POST'>";
      echo "<input type='hidden' name='which' value='aliasAtr'>";
      echo "<input type='hidden' name='NoOfAlias' value='".$a."'>";
      echo "<input type='hidden' name='catsOld' value='".$catsOld."'>
          <input type='hidden' name='atrsOld' value='".$atrsOld."'>";
      for ($kw=0;$kw<count($aliases["atrsAddress"][$atrsSQL[$a]]);$kw++){
	$ID=sprintf("aliasAtr_%02d_%02d",$a,$kw);
	echo "<input name='".$ID."' value='".$aliases["atrsAddress"][$atrsSQL[$a]][$kw]."' type='text' size='40'><br>\n";
      } #kw
      $ID=sprintf("aliasAtr_%02d_%02d",$a,$kw);
      echo "<input name='".$ID."' value='' type='text' size='40'><br>\n";
      echo "<input type='submit' value='ok'></form></p>";
    } #a
    /* ------------------- */
    echo "<h2>Sonderzeichen</h2>\n
          <p>Sonderzeichen bereiten generell Progleme, da sowohl jeder Server damit zuverlaessig arbeiten muss (GET, POST), als auch die Anzeige gut aussehen soll.</p>
          <p>Deswegen sollen die Kategorien und Attribute <strong>keine Sonder- oder Leerzeichen</strong> enthalten!</p>
          <p>Für die Anzeige werden hier Ersatzstrings definiert, dabei ist es eine gute Idee, html-Notierungen für die Deutschen Umlaute zu verwenden (ä=<tt>&auml;</tt> ö=<tt>&ouml;</tt> ü=<tt>&uuml;</tt> ß=<tt>&szlig;</tt>):</p>";
    $fname="ShowCatsAtrsNice.php";
    $ShowCatsAtrsNice = readShowCatsAtrsNice($fname);
    for ($c=0;$c<count($ShowCatsAtrsNice);$c++){
      $pos=strpos($ShowCatsAtrsNice[$c],"ugly=array");
      if ($pos>0){
	$tmp=substr($ShowCatsAtrsNice[$c],$pos+11);
	$tmp=substr($tmp,0,strpos($tmp,");"));
	$ugly=explode("','",$tmp);
	for ($l=0;$l<count($ugly);$l++){
	  $ugly[$l] = str_replace("'","",$ugly[$l]);
	  $ugly[$l] = str_replace("&","&",$ugly[$l]);
	} #l
      }
      $pos=strpos($ShowCatsAtrsNice[$c],"nice=array");
      if ($pos>0){
	$tmp=substr($ShowCatsAtrsNice[$c],$pos+11);
	$tmp=substr($tmp,0,strpos($tmp,");"));
	$nice=explode("','",$tmp);
	for ($l=0;$l<count($nice);$l++){
	  $nice[$l] = str_replace("'","",$nice[$l]);
	  $nice[$l] = str_replace("&","&",$nice[$l]);
	} #l
      }
    } #c
    echo "<a name='ShowCatsAtrsNice'></a>";
    echo "<form method='POST' action='".$GLOBALS['PHP_SELF']."?what2do=addCategories'>\n
          <table><tr><th>Intern</th><th>Anzeige</th></tr>\n";
    echo "<input type='hidden' name='change' value='ugly'>";
    for ($l=0;$l<=count($ugly);$l++){
      $ID=sprintf("ugly%02d",$l);
      echo "<tr><td><input type='text' name='".$ID."' value='".$ugly[$l]."' size='40'></td>";
      $ID=sprintf("nice%02d",$l);
      echo "<td><input type='text' name='".$ID."' value='".$nice[$l]."' size='40'></td></tr>\n";
    } #l
    echo "<input type='hidden' name='NoUgly' value='".$l."'>";
    echo "</table>\n<input type='submit' value='ok'>\n</from>\n";
  } #switch
}

function readElementdefinitions(){
  $fname="SMFinder_Elementdefinitions.php";
  if (file_exists($fname)) {
    $fid = fopen($fname, "r");
    $line = fgets( $fid, 2048 );
    while(!feof($fid)){
      $Elementdefinitions.= $line;
      $line = fgets( $fid, 2048 );
    }
    fclose($fid);
  }else{
    printf("FILE ".$fname." DOES NOT EXIST!\n");
  }
  $startPos = strpos($Elementdefinitions,"\$cats");
  $firstPart = substr($Elementdefinitions,0,$startPos-1);
  $residual = substr($Elementdefinitions,$startPos-1);
  $lines = explode(");",$residual);
  $CatsAtrs=array();
  $Aliases=array();  
  for ($l=0;$l<count($lines);$l++){
    if (strpos($lines[$l],"cats")>0 OR strpos($lines[$l],"atrs")>0){
      array_push($CatsAtrs,$lines[$l].");");
    }elseif(strpos($lines[$l],"alias")>0){
      array_push($Aliases,$lines[$l].");");
    }
  } #l
  for ($l=0;$l<count($CatsAtrs);$l++){
    $CatsAtrs[$l] = substr($CatsAtrs[$l],strpos($CatsAtrs[$l],"$"));
  } #l
  for ($l=0;$l<count($Aliases);$l++){
    $Aliases[$l] = substr($Aliases[$l],strpos($Aliases[$l],"$"));
  } #l
 
  #$tmp=str_replace("<","<",$firstPart);
  #$tmp=str_replace(">",">",$tmp);
  #echo "<pre>".$tmp."</pre>";
  #print_r($Aliases);#exit(1);
  return array($firstPart,$CatsAtrs,$Aliases);
}

function writeElementdefinitions($firstPart,$CatsAtrs,$Aliases){
  exec("cp SMFinder_Elementdefinitions.php SMFinder_Elementdefinitions.arne");
  $fid = fopen("SMFinder_Elementdefinitions.php","w");
  $string = $firstPart."\n";
  for ($c=0;$c<count($CatsAtrs);$c++){
    $string.=$CatsAtrs[$c]."\n";
  } #c
  $string.="\n/* fuer die Suchmaschine */\n\n";
  for ($a=0;$a<count($Aliases);$a++){
    $string.=$Aliases[$a]."\n";
  } #a
  $string.="\n?>\n";
  fputs($fid,$string);
  fclose($fid);
  $string=str_replace(">",">",$string);
  $string=str_replace("<","<",$string);
 # echo "<pre>".$string."</pre>";
  return false;
}

function readShowCatsAtrsNice($fname){
  if (file_exists($fname)) {
    $fid = fopen($fname, "r");
    $line = fgets( $fid, 2048 );
    $l=-1;
    while(!feof($fid)){
      $l++;
      $ShowCatsAtrsNice[$l]=$line;
      $line = fgets( $fid, 2048 );
    }
    fclose($fid);
  }else{
    printf("FILE ".$fname." DOES NOT EXIST!\n");
  }
/*
  if (strpos($ShowCatsAtrsNice[$l],"\>")>0){}else{
    #  $ShowCatsAtrsNice[$l+1]="?>";
  }
  #$tmp=str_replace("<?","?",$ShowCatsAtrsNice);
  #$tmp=str_replace("?>","?",$tmp);
  #print_r($tmp);
*/
  return $ShowCatsAtrsNice;
}

function parseAliases($AliasLines,$cats,$atrs){
  $NoOfCats=count($cats);
  for ($c=0;$c<$NoOfCats;$c++){
    for ($l=0;$l<count($AliasLines);$l++){
      $tmp1=strpos($AliasLines[$l],"aliasCats_address");
      $tmp2=strpos($AliasLines[$l],"['".$cats[$c]."']");
      if ($tmp1>0 AND $tmp2>0){
	$thisAliases = substr($AliasLines[$l],strpos($AliasLines[$l],"(")+1);
	$thisAliases = substr($thisAliases,0,strpos($thisAliases,")")-1);
	$thisAliases = str_replace("\"","",$thisAliases);
	$thisAliases = str_replace("'","",$thisAliases);
	$aliases["catsAddress"][$cats[$c]]= explode(",",$thisAliases);
	break;
      }
    } #l
  } #c
  $NoOfAtrs=count($atrs);
  for ($a=0;$a<$NoOfAtrs;$a++){
    for ($l=0;$l<count($AliasLines);$l++){
      $tmp1=strpos($AliasLines[$l],"aliasAtrs_address");
      $tmp2=strpos($AliasLines[$l],"['".$atrs[$a]."']");
      if ($tmp1>0 AND $tmp2>0){
	$thisAliases = substr($AliasLines[$l],strpos($AliasLines[$l],"(")+1);
	$thisAliases = substr($thisAliases,0,strpos($thisAliases,")")-1);
	$thisAliases = str_replace("\"","",$thisAliases);
	$thisAliases = str_replace("'","",$thisAliases);
	$aliases["atrsAddress"][$atrs[$a]]= explode(",",$thisAliases);
	break;
      }
    } #l
  } #c
  return $aliases;
}

function SQL_getFieldNamesOfTable($table){
  include("SMFinder_Config.php");
  $dblink=mysql_connect($GLOBALS['dbserver'],$GLOBALS['dbuser'],$GLOBALS['dbpasswd']);
  mysql_select_db($GLOBALS['dbname'],$dblink);
  $anfrage = "DESCRIBE `".$table."`";
  if($GLOBALS['debug']){echo "<p><b>SQL_getMembersOfSet</b> ".$anfrage."</p>";}
  if ($ergebnis=mysql_query($anfrage)){
    $f=-1;
    while($fieldInfo=mysql_fetch_row($ergebnis)){
      $f++;
      $fieldNames[$f]=$fieldInfo[0];
    }
  }
  #print_r($fieldNames);
  return $fieldNames;
}

function SQL_getMembersOfSet($table,$field){
  include("SMFinder_Config.php");
  $dblink=mysql_connect($GLOBALS['dbserver'],$GLOBALS['dbuser'],$GLOBALS['dbpasswd']);
  mysql_select_db($GLOBALS['dbname'],$dblink);
  $anfrage = "DESCRIBE `".$table."` `".$field."`";
  if($GLOBALS['debug']){echo "<p><b>SQL_getMembersOfSet</b> ".$anfrage."</p>";}
  if ($ergebnis=mysql_query($anfrage)){
    $setInfo=mysql_fetch_row($ergebnis);
    $setMembers=$setInfo[1];
    $setMembers = substr($setMembers,4);
    $setMembers = substr($setMembers,0,strlen($setMembers)-1);
    $setMembersArray = explode(",",$setMembers);
    for ($m=0;$m<count($setMembersArray);$m++){
      $setMembersArray[$m]=str_replace("'","",$setMembersArray[$m]);
    } #m
    return $setMembersArray;
  }
}
?>

Index

Für die Funktionalität des SM-Finders sind viele kleine Tools notwendig. Alle Funktionen beginnen mit SMFinder_ um deren Ursprung zu kennzeichnen. Dem schließt sich die Funktionsgruppe, z.B. Geo_ an, gefolgt vom eigentlichen Namen, der die Aufgabe der Funktion widerspiegeln soll, z.B. PLZ2DB.

Der gesamte Sourcecode darf gemäß GNU General Public License weiterverbreitet werden.

1Makefile
2SMFinder_Admin
3SMFinder_Admin_addCategories
4SMFinder_Admin_checkAllLinks
5SMFinder_Admin_clean
6SMFinder_Admin_exportXML
7SMFinder_Admin_genMap
8SMFinder_Admin_getTimefInt
9SMFinder_Admin_importGeo
10SMFinder_Admin_sendXML2user
11SMFinder_Admin_uploadXML
12SMFinder_Config
13SMFinder_DTD
14SMFinder_Datenbanken
15SMFinder_Edit
16SMFinder_Edit_AddressFields
17SMFinder_Edit_AdrFields
18SMFinder_Edit_CatsAtrs
19SMFinder_Edit_EventFields
20SMFinder_Edit_LinkFields
21SMFinder_Edit_Modus
22SMFinder_Edit_POST
23SMFinder_Edit_PersFields
24SMFinder_Edit_genUID
25SMFinder_Elementdefinitions
26SMFinder_Geo
27SMFinder_Geo_PLZ2DB
28SMFinder_Geo_Umkreis
29SMFinder_Geo_getGeo
30SMFinder_Help
31SMFinder_Help_Download
32SMFinder_Help_FAQ
33SMFinder_Help_KategorienInfo
34SMFinder_Help_editAddress
35SMFinder_Help_editEvent
36SMFinder_Main
37SMFinder_MapDACH
38SMFinder_Menu
39SMFinder_Modules
40SMFinder_ModulesIndex
41SMFinder_Pagelayout
42SMFinder_Query_ABC
43SMFinder_Query_Calendar
44SMFinder_Query_CheckCatsAtrs
45SMFinder_Query_Map
46SMFinder_Query_Mask
47SMFinder_Query_SearchEngine
48SMFinder_Query_analyzeSearch
49SMFinder_Query_composeDates4UIDs
50SMFinder_Query_dateFormat
51SMFinder_Query_dmoz
52SMFinder_Query_expandSeries
53SMFinder_Query_find
54SMFinder_Query_getAllUID
55SMFinder_Query_getUID4CatsAtrsGeo
56SMFinder_Query_getUID4Geo
57SMFinder_Query_getUID4adr
58SMFinder_Query_getUID4fn
59SMFinder_Query_readAddress
60SMFinder_Query_readAdr
61SMFinder_Query_readBookmark
62SMFinder_Query_readEvent
63SMFinder_Query_readLink
64SMFinder_Query_readPers
65SMFinder_Query_showAddress
66SMFinder_Query_showAdr
67SMFinder_Query_showCalendar
68SMFinder_Query_showCalendarDynamic
69SMFinder_Query_showEvent
70SMFinder_Query_showEventList
71SMFinder_Query_showEventsChronological
72SMFinder_Query_showLink
73SMFinder_Query_showPers
74SMFinder_Query_showResult
75SMFinder_Query_validDate
76SMFinder_Style
77SMFinder_Write_Address
78SMFinder_Write_Adr
79SMFinder_Write_Event
80SMFinder_Write_Link
81SMFinder_Write_Pers
82SMFinder_Write_deleteEntry
83SMFinder_XML_checkType
84SMFinder_XML_export
85SMFinder_XML_extractAttribute
86SMFinder_XML_extractTag
87SMFinder_XML_findAllElements
88SMFinder_XML_import
89SMFinder_XML_importParseAddress
90SMFinder_XML_importParseAdr
91SMFinder_XML_importParseCatsAtrs
92SMFinder_XML_importParseEvent
93SMFinder_XML_importParseLink
94SMFinder_XML_importParsePerson
95SMFinder_XML_readFile
96SMallGiessen_SMFinder
97ShowCatsAtrsNice
98index
99php2txt.pl
100sm-finder-02.dtd
101testGeo
102sm-finder-02.dtd
103

Datenbanken

 

SM-Finder-Logo

Die hier zur Verfügung gestellten Informationen basieren auf dem Austauschnetzwerk des SM-Finders.
Änderungen an eurem Datensatz könnt ihr z.B. beim Arbeitskreis SM-Finder vornehmen.
Bei Fragen und Problemen schreibt bitte an: sm-finderATki-co.org
Der AK-SM-Finder ist korporatives Mitglied der BVSM e.V.

Für Aktualität und Richtigkeit der dargebotenen Infomationen kann keine Gewähr übernommen werden!

blank

blank