function readwofields() { # readtype is ignored here $linesstrold="# Info header1|Required information|Påkrevet informasjon|NA|header|noinclude name|Map name|Kartets navn|required|text|tabfield owner|Owner/Club|Eier/Klubb|required|text|tabfield country|Country|Land|required|select|tabfield header2|Optional information|Ikke påkrevet informasjon - fyll ut det som passer|NA|header|noinclude year|Year|År|optional|text|tabfield scale|Scale|Målestokk|optional|text|tabfield contours|Contours (meters)|Ekvidistanse|optional|text|tabfield area|Area (sqkm.)|Areal (km^2)|optional|text|tabfield place|Nearest place or city|Nærmeste by/tettsted|optional|text|include region|Region|Krets|optional|text|include email|Email address for ordering|E-postadresse for bestilling|optional|text|tabfield ownerurl|Owner webpage (url)|Webadresse for eier/klubb|optional|text|include access|Accessability (free access or need permission?)|Fritt tilgjengelig eller krever tillatelse?|optional|text|include maptype|Map type|Kart type|optional|select|include|Regular map;Sprint map;Instructional/School map;MTB-O map;Ski-O map;Pre-O map;Karttapullautin mapmaker|Map makers (fieldwork, drawing, etc.)|Kart produsent (synfarer, rentegner, etc.)|optional|text|include price|Price per map (euro)|Pris per kart (inklusiv valuta)|optional|text|include address|Contact details for ordering/questions|Kontaktadresse for kartets eier|optional|textarea|include terdescription|Terrain description|Terrengbeskrivelse|optional|textarea|include comments|Comments about the map|Kommentarer|optional|textarea|include header2b|Geographical position of map|Geografisk posisjon for kartet|NA|header|noinclude map|map|map|NA|NA|noinclude header3|Optional map images at other webpage (jpg/gif/png)|Kartbilde på andre websteder (jpg/png/gif)|NA|header|noinclude imageurl|Image at other webpage (url to jpg/gif/png)|Kartbilde på andre websteder (url til jpg/gif/png)|optional|text|include header3|Optional upload of images. Max 200 Kb. Will be scaled down to max 400x400 px.|Frivillig opplasting av bilder. Max 200 Kb. Vil bli skalert ned til 400x400 px.|NA|header|noinclude map1|Upload map sample, jpg|Last opp kart bilde, jpg|optional|file|noinclude map2|Second map sample, jpg|Last opp kart bilde 2, jpg|optional|file|noinclude map3|Third map sample, jpg|Last opp kart bilde 3, jpg|optional|file|noinclude mapimagelist|Previous map samples|Tidligere bilder|prev|hidden|include terr1|Upload image of terrain/scenery, jpg|Last opp terreng bilde, jpg|optional|file|noinclude terr2|Second terrain/scenery image, jpg|Last opp terreng bilde 2, jpg|optional|file|noinclude terr3|Third terrain/scenery image, jpg|Last opp terreng bilde 3, jpg|optional|file|noinclude terrimagelist|Previous terrain images|Tidligere terreng bilder|prev|hidden|include header4|Information about you is required for reference (will not be displayed)|Informasjon om deg er påkrevet for referanse- vil ikke bli vist.|NA|header|noinclude postcomment|Please provide a comment if you have changed an entry!|Legg inn en kommentar hvis du har gjort endringer med informasjon om endringen|optional|textarea|include postname|Your name|Ditt navn|required|text|include postemail|Your email address|Din e-postadresse|requiredemail|text|include lat|lat|lat|NA|hidden|tabfield lng|lng|lng|NA|hidden|tabfield oldid|oldid|oldid|NA|hidden|tabfield sourceid|sourceid|sourceid|NA|hidden|tabfield sourceurl|sourceurl|sourceurl|NA|hidden|tabfield outline|outline|outline|NA|hidden|tabfield source|source|source|NA|hidden|tabfield # End "; $linesstr="# Info header1|Required information|Påkrevet informasjon|Benötigte Informationen|NA|header|noinclude name|Map name|Kartets navn|Kartenname|required|text|tabfield owner|Owner/Club|Eier/Klubb|Eigentümer/Verein|required|text|tabfield country|Country|Land|Land|required|select|tabfield header2|Optional information|Ikke påkrevet informasjon - fyll ut det som passer|Optionale Informationen|NA|header|noinclude year|Year|År|Jahr|optional|text|tabfield scale|Scale|Målestokk|Maßstab|optional|text|tabfield contours|Contours (meters)|Ekvidistanse|Äquidistanz|optional|text|tabfield area|Area (sqkm.)|Areal (km^2)|Fläche|optional|text|tabfield place|Nearest place or city|Nærmeste by/tettsted|Stadt in der Nähe|optional|text|include region|Region|Krets|Bundesland|optional|text|include email|Email address for ordering|E-postadresse for bestilling|E-Mail Adresse für Bestellung|optional|text|tabfield ownerurl|Owner webpage (url)|Webadresse for eier/klubb|Webseite Eigentümer|optional|text|include access|Accessability (free access or need permission?)|Fritt tilgjengelig eller krever tillatelse?|Nutzbarkeit (frei Nutzbar oder mit Genehmigung?)|optional|text|include maptype|Map type|Kart type|Kartenart|optional|select|include|Regular map;Sprint map;Instructional/School map;MTB-O map;Ski-O map;Pre-O map;Karttapullautin mapmaker|Map makers (fieldwork, drawing, etc.)|Kart produsent (synfarer, rentegner, etc.)|Kartenersteller|optional|text|include price|Price per map (euro)|Pris per kart (inklusiv valuta)|Preis pro Karte (Euro)|optional|text|include address|Contact details for ordering/questions|Kontaktadresse for kartets eier|Kontaktadresse für Bestellung oder Fragen|optional|textarea|include terdescription|Terrain description|Terrengbeskrivelse|Geländebeschreibung|optional|textarea|include comments|Comments about the map|Kommentarer|Kommentare zur Karte|optional|textarea|include header2b|Geographical position of map|Geografisk posisjon for kartet|Geografische Position der Karte|NA|header|noinclude map|map|map|Karte|NA|NA|noinclude header3|Optional map images at other webpage (jpg/gif/png)|Kartbilde på andre websteder (jpg/png/gif)|Optionales Bild der Karte von einer anderen Webseite (jpg/png/gif)|NA|header|noinclude imageurl|Image at other webpage (url to jpg/gif/png)|Kartbilde på andre websteder (url til jpg/gif/png)|Bild von einer anderen Webseite (Link zur jpg/gif/png)|optional|text|include header3|Optional upload of images. Max 200 Kb. Will be scaled down to max 400x400 px.|Frivillig opplasting av bilder. Max 200 Kb. Vil bli skalert ned til 400x400 px.|Optionales Hochladen von Bildern. Max 200 Kb, wird skaliert zur Maximalgröße 400x400 px.|NA|header|noinclude map1|Upload map sample, jpg|Last opp kart bilde, jpg|Hochladen vom Kartenbeispiel, jpg|optional|file|noinclude map2|Second map sample, jpg|Last opp kart bilde 2, jpg|Zweites Kartenbeispiel, jpg|optional|file|noinclude map3|Third map sample, jpg|Last opp kart bilde 3, jpg|Drittes Kartenbeispiel, jpg|optional|file|noinclude mapimagelist|Previous map samples|Tidligere bilder|zeitigere Kartenbeispiele|prev|hidden|include terr1|Upload image of terrain/scenery, jpg|Last opp terreng bilde, jpg|Hochladen eines Bildes vom Gelände|optional|file|noinclude terr2|Second terrain/scenery image, jpg|Last opp terreng bilde 2, jpg|Hochladen zweites Bild vom Gelände|optional|file|noinclude terr3|Third terrain/scenery image, jpg|Last opp terreng bilde 3, jpg|Hochladen drittes Bild vom Gelände|optional|file|noinclude terrimagelist|Previous terrain images|Tidligere terreng bilder|zeitigere Geländebeispiele|prev|hidden|include header4|Information about you is required for reference (will not be displayed)|Informasjon om deg er påkrevet for referanse- vil ikke bli vist.|die Informationen über Dich werden fürs Referenzieren benötigt (werden aber nicht angezeigt)|NA|header|noinclude postcomment|Please provide a comment if you have changed an entry!|Legg inn en kommentar hvis du har gjort endringer med informasjon om endringen|bitte hinterlasse einen Kommentar falls etwas geändert wurde|optional|textarea|include postname|Your name|Ditt navn|Dein Name|required|text|include postemail|Your email address|Din e-postadresse|Deine E-Mail Adresse|requiredemail|text|include lat|lat|lat|lat|NA|hidden|tabfield lng|lng|lng|lng|NA|hidden|tabfield oldid|oldid|oldid|oldid|NA|hidden|tabfield sourceid|sourceid|sourceid|sourceid|NA|hidden|tabfield sourceurl|sourceurl|sourceurl|sourceurl|NA|hidden|tabfield outline|outline|outline|outline|NA|hidden|tabfield source|source|source|source|NA|hidden|tabfield # End "; $lang=mysql_real_escape_string($_GET["lang"]); $lines=explode("\n",$linesstr); $line=true; $count=0; while ($line) { $line=$lines[$count]; $line=chop($line); if ($line && substr($line,0,1) != "#") { $fields=explode("|",$line); $fieldinfo[$count]["name"]=$fields[0]; if ($lang=="N") { $fieldinfo[$count]["explain"]=$fields[2];} elseif ($lang=="D") { $fieldinfo[$count]["explain"]=htmlentities($fields[3]);} else { $fieldinfo[$count]["explain"]=$fields[1];} $fieldinfo[$count]["req"]=$fields[4]; $fieldinfo[$count]["type"]=$fields[5]; $fieldinfo[$count]["dbinfo"]=$fields[6]; $fieldinfo[$count]["selectvals"]=$fields[7]; } $count++; } return $fieldinfo; } ?> include("basis/rating/includes/rating_config.php"); /* Dynamic Star Rating Redux Developed by Jordan Boesch www.boedesign.com Licensed under Creative Commons - http://creativecommons.org/licenses/by-nc-nd/2.5/ca/ Used CSS from komodomedia.com. */ function getRating($id){ $total = 0; $rows = 0; $sel = mysql_query("SELECT rating_num FROM ratings WHERE rating_id = '$id'"); if(mysql_num_rows($sel) > 0){ while($data = mysql_fetch_assoc($sel)){ $total = $total + $data['rating_num']; $rows++; } $perc = ($total/$rows) * 20; //$newPerc = round($perc/5)*5; //return $newPerc.'%'; $newPerc = round($perc,2); return $newPerc.'%'; } else { return '0%'; } } function outOfFive($id){ $total = 0; $rows = 0; $sel = mysql_query("SELECT rating_num FROM ratings WHERE rating_id = '$id'"); if(mysql_num_rows($sel) > 0){ while($data = mysql_fetch_assoc($sel)){ $total = $total + $data['rating_num']; $rows++; } $perc = ($total/$rows); return round($perc,2); //return round(($perc*2), 0)/2; // 3.5 } else { return '0'; } } function getVotes($id){ $sel = mysql_query("SELECT rating_num FROM ratings WHERE rating_id = '$id'"); $rows = mysql_num_rows($sel); if($rows == 0){ $votes = '0 Votes'; } else if($rows == 1){ $votes = '1 Vote'; } else { $votes = $rows.' Votes'; } return $votes; } function pullRating($id,$show5 = false, $showPerc = false, $showVotes = false, $static = NULL){ // Check if they have already voted... $sel = mysql_query("SELECT id FROM ratings WHERE IP = '".$_SERVER['REMOTE_ADDR']."' AND rating_id = '$id'"); if(mysql_num_rows($sel) > 0 || $static == 'novote' || $_COOKIE['has_voted_'.$id]){ $text = ''; if($show5 || $showPerc || $showVotes){ $text .= '