$n) { if (strpos($navi[$i], '*')) $defpage = $i; $idnavi[$i] = $navi[$i] = split(',', preg_replace('/\s*\*\s*/','', $navi[$i])); foreach($idnavi[$i] as $I => $N) { $idnavi[$i][$I] = cleanId($N); if ($queryid == $idnavi[$i][$I]) { $curpage = $i; $lang = $I; } } } // sunniviisilised if (preg_match('/performer:/', $queryid) || in_array($queryid, array('status', 'booking', 'family_pass_booking', 'workshops', 'green_stage', 'workshops', 'green_stage', 'fairy-tale_chamber', 'concerts_in_viljandi_county', 'exhibitions', 'handicraft_yard','complete_festival_program', 'town_map'))) $lang = 1; # if ($queryid == 'blahh') $lang = 2; if (!isset($curpage)) $curpage = $defpage; $loc = array('et_EE', 'en_US', 'fi_FI'); define('LC', $loc[$lang] . '.UTF-8'); bindtextdomain('folk', getcwd() . '/data'); textdomain ('folk'); bind_textdomain_codeset('folk', 'UTF-8'); setlocale(LC_ALL, LC); # setlocale(LC_MESSAGES, LC); putenv('LANG=en_US.UTF-8'); putenv('LANGUAGE=en_US.UTF-8'); putenv('LC_ALL=en_US.UTF-8'); function linnaplaan($plaan) { global $koht, $FOO; $koht = mxpreg('@^ +- *(.*?) *(http://[^ ]*)? *(\d+)?,? *(\d+)?$@m', $plaan); // alles jääb nr, cleanid, nimi, url, x, y $koht = mxsel($abs = mxaddcol(mxaddcol($koht, '++$GLOBALS["FOO"]'), 'cleanID($0)'), array(-2, -1, 0, 1, 2, 3)); // listi jaoks: nr, nimi urliga $list = mxsel(mxupd($koht, array(2 => 'empty($3) ? $2 : "$2"')), array(0, 2)); $split = round(count($koht) / 2); for ($i = 0; $i < $split; $i++) { $list[$i][] = $list[$i+$split][0]; $list[$i][] = $list[$i+$split][1]; } $list = array_splice($list, 0, $split); $list = mxupd($list, array(0 => 'empty($0) ? "" : "$0."', 2 => 'empty($2) ? "" : "$2."')); print '' . mxout($list) . '
'; $nr = mxupd($koht, array(0 => '"\"".htmlspecialchars($2)."\""')); $nr = mxsel(mxupd($nr, array( 0 => 'empty($3) ? $0 : "$0"')), array(0)); print '
' . mxout($nr, "\n", '') . '
'; } function uencf($u) { return str_replace('%', '%%', rawurlencode($u)); } function album() { global $TITLE; $pilt = $GLOBALS['_GET']['pilt']; $album = $GLOBALS['_GET']['album']; $adir = '/(enne|N|R|L|P|peale)-(.*?)-(.*)/i'; # $adir = '/07-()(.*?)-(.*)/i'; $ab = array(); $grupp = array( 'enne' => _('Enne folki'), 'N' => paev('N'), 'R' => paev('R'), 'L' => paev('L'), 'P' => paev('P'), 'peale' => _('Peale folki') ); $fotokad = array( 'Canon PowerShot Pro1' => 'Urmas Volmer', 'Canon EOS 350D DIGITAL' => 'Naatan Haamer', ); $foottekst = ''; print "\n
\"\"\n"; $paevid = array_flip(array_keys($grupp)); // pildialbumite scannimine $d = opendir(ADIR); while (false !== ($f = readdir($d))) if (is_dir(ADIR . "/$f") && preg_match($adir, $f, $p)) $ab[] = array( strtoupper($p[1]), $paevid[$p[1]] . $p[2], $p[3], $cid = cleanID($p[1]."-".$p[3]), sprintf(''."\n", $cid, $cid == $album ? ' selected="selected"' : '', htmlspecialchars($p[3])), $cid == $album ? ($cdir = $f) : '', $f, $cid == $album ? ($TITLE = $p[3]) : '' ); closedir($d); // sorteerime pildialbumid nende numbri järgi $ab = mxsort($ab, 1); // kui albumit ei ole valitud, viimane aktiivseks if (empty($album)) { $x = &$ab[count($ab)-1]; $album = $x[3]; $x[4] = str_replace(' value="', ' selected="selected" value="', $x[4]); $cdir = $x[6]; } // väljundi tarvis gruppidesse panek $select = mxgroup($abs = mxsel($ab, array(0, 4)), '$0'); // albumi valik print '
'; // aktiivse albumi läbiratsutamine $d = opendir(ADIR . "/$cdir"); $p = array(); // pildid $P = 0; while (false !== ($f = readdir($d))) if (strtolower($laiend = substr($f,-3)) == 'jpg' && is_file(ADIR . "/$cdir/$f") && is_file(ADIR . "/$cdir/thumbs/$f")) { $pname = substr($f, 0, -4); $clpilt = cleanID($pname); $exif = @exif_read_data(ADIR . "/$cdir/$f"); $aeg = strtotime(preg_replace('/^(\d{4}):(\d\d):(\d\d) /', '\1-\2-\3 ',$exif['DateTimeOriginal'])); # 0 1 2 3 4 5 6 $p[$P++] = array($f, $clpilt, $pname, $laiend, rawurlencode($f), $aeg, $exif['Model']); } $p = mxsort($p, 5); if (!empty($pilt)) for ($P = 0; $P < count($p); $P++) if ($p[$P][1] == $pilt) { $cpilt = $P+1; break; } $thumb = sprintf('thumb'."\n", WDIR, $album, uencf($cdir)); // he pildi vaade if (!empty($pilt) && !empty($cpilt)) { // otsime 2 eelmist ja 2 jrgmist $pnavi = array(); $cur[] = &$p[$cpilt - 1]; if ($cpilt - 2 > 0) $prev[] = &$p[$cpilt - 1 - 2]; if ($cpilt - 1 > 0) $prev[] = &$p[$cpilt - 1 - 1]; if ($cpilt + 1 <= count($p)) $next[] = &$p[$cpilt - 1 + 1]; if ($cpilt + 2 <= count($p)) $next[] = &$p[$cpilt - 1 + 2]; print('
' . '' . mxsprintf($prev, $thumb) . "\n" . mxsprintf($cur, $thumb) . '' . mxsprintf($next, $thumb) . "\n" . '
'); printf('', WDIR, $album, rawurlencode($cdir), rawurlencode($p[$cpilt - 1][0])); $foottekst = _('Autor') .': ' . $fotokad[$p[$cpilt-1][6]] . ', ' . _('pildistatud') . strftime(' %A, ' . _('kell') . ' %H:%M', $p[$cpilt-1][5]); } // albumi vaade else mxprintf($p, $thumb); print "\n
$foottekst
\n"; } function get_esineja_asjad($tekst) { preg_match('/.*? +- *(.*?) *(\n|$)( +- *(.*?) *(\n|$))?/', $tekst, $asjad); if (!empty($asjad[0])) { if (substr($asjad[1], 0, 7) == 'http://') { $url = $asjad[1]; $riik = empty($asjad[3]) ? '' : $asjad[3]; } else { $riik = $asjad[1]; $url = empty($asjad[4]) ? '' : $asjad[4]; } } else { $url = ''; $riik = ''; } return array('url' => $url, 'riik' => $riik); } function parse_esineja($nimi) { $file = wikiFN($id = cleanID($nimi)); if (is_file($file)) { $tekst = get_file_contents($file); $lingi = preg_match('/^(\s*[a-z0-9]|====[^=])/im', $tekst) ? 1 : 0; $ret = array(); preg_match('/(======) *(.*?) *\1/', $tekst, $nimi); $nimi = $nimi[2]; $asjad = get_esineja_asjad($tekst); $url = $asjad['url']; $riik = $asjad['riik']; } else { $lingi = 0; $riik = 'Eesti'; $nimi = array_pop(explode(':', $nimi)); $file = ''; } return compact('id', 'file', 'nimi', 'riik', 'url', 'lingi'); } function parse_esinejad() { global $esineja, $lang; static $parsed = false; if ($parsed) return true; preg_match('/^=+ *esinejad *=+[^\|]*((\|.*\n)+)/mi', $GLOBALS['start'], $e); $eex = ' *(?:\[\[(\.(?:esineja|performer):([^\]]*))\]\]|(.*?)) *\|'; $esineja = mxsel(mxpreg($p='/^\|' . $eex.$eex.$eex. '.*(?:\n|$)/m', $e[1]), array(0,1,3,4,8)); // ainult cleanID-d $esineja = mxfilt($esineja, $lang == 1 ? '!empty($3)' : '!empty($1)'); // kus ei ole nimesid for($i = 0; $i < count($esineja); $i++) { $et = parse_esineja(cleanID($esineja[$i][0])); $en = parse_esineja(cleanID($esineja[$i][2])); if ($lang == 1 && empty($en['file'])) $en['nimi'] = empty($esineja[$i][3]) ? $et['nimi'] : $esineja[$i][3]; if ($lang == 2) $fi['nimi'] = empty($esineja[$i][4]) ? $et['nimi'] : $esineja[$i][4]; if ($lang == 0) $es = &$et; if ($lang == 1) $es = &$en; if ($lang == 2) $es = &$fi; $esineja[$i] = array($es['id'], eestist($et['riik']), esineja_weebis( $es['lingi'] ? $es['id'] : '', $es['nimi'], $es['riik']), cleanID($et['nimi']), cleanID($en['nimi'])); // ajakava jaoks if ($lang == 2) $esineja[$i][2] = preg_replace('@//(.*)//@', '\1', $esineja[$i][2]); } $esineja = mxsort($esineja, $lang == 0 ? 3 : 4); $parsed = true; } function esineja_weebis($cleanid, $nimi, $riik) { $nimi = htmlspecialchars($nimi); $nimi = empty($cleanid) ? $nimi : "$nimi"; $riigiga = empty($riik) || in_array(strtolower($riik), array('eesti', 'estonia')); return $riigiga ? $nimi : "$nimi (" . htmlspecialchars($riik) . ')'; } function eestist($riik) { $riik = strtolower($riik); return (strpos($riik, 'eesti') !== false || strpos($riik, 'estonia') !== false) ? 1 : 0; } function esinejate_nimekiri($param) { global $esineja, $lang; if (empty($esineja)) parse_esinejad(); $filter = strpos(strtolower($param), 'eesti') !== false ? '$1' : '!$1'; return "\n"; } function paev($p) { $d = array_flip(array('N', 'R', 'L', 'P')); return strftime('%A', strtotime(AASTA . '07' . ($d[$p]+ALGUS_KP))); } function paevkell($p, $k) { $d = array_flip(array('N', 'R', 'L', 'P')); return strftime('%A, %d %B', strtotime(AASTA . '07' . ($d[$p]+ALGUS_KP))) . " $k"; } function hind($h) { global $lang; if (preg_match('/^[0-9]/', $h)) return $h. ($lang == 0 ? '.-' : 'EEK'); else return htmlspecialchars(_($h)); } function ak_esineja($nimi) { global $esineja; $id = cleanID($nimi); $e = mxfilt($esineja, 'in_array("' . $id . '", array($3, $4))'); if (count($e)) $e = $e[0]; // kui peaks rohkem kui 1 olema if (count($e)) return $e[2]; else return esineja_weebis('', $nimi, ''); } function parse_kava() { global $kava; static $parsed = false; if ($parsed) return false; $tekst = get_file_contents(DDIR . '/kava.txt'); preg_match_all('/(=====) (.*?) \1\n+\^.*\n((?:\|.*(?:\n|$))+)/m', $tekst, $paev, PREG_SET_ORDER); $N = mxaddcol(mxpreg('/^' . str_repeat(WIKI_TD, 5) . '\|.*?(?:\n|$)/m', $paev[0][3]), 'N'); $R = mxaddcol(mxpreg('/^' . str_repeat(WIKI_TD, 5) . '\|.*?(?:\n|$)/m', $paev[1][3]), 'R'); $L = mxaddcol(mxpreg('/^' . str_repeat(WIKI_TD, 5) . '\|.*?(?:\n|$)/m', $paev[2][3]), 'L'); $P = mxaddcol(mxpreg('/^' . str_repeat(WIKI_TD, 5) . '\|.*?(?:\n|$)/m', $paev[3][3]), 'P'); $kava = array_merge($N, $R); $kava = array_merge($kava, $L); $kava = array_merge($kava, $P); return $parsed = true; } function ajakava($param, $sesi = null) { global $kava, $esineja, $lang; $paev = ''; $x = explode(' ', 'kell koht esineja hind grupp paeev'); $selection = array( '' => array('kell', 'koht', 'esineja', 'hind'), 'RL' => array('kell', 'esineja'), 'MT' => array('kell'), 'MK' => array('kell', 'koht', 'esineja')); if (empty($esineja)) parse_esinejad(); if (empty($kava)) parse_kava(); $param = strtoupper(trim($param)); $out = $kava; // päeva filter if (preg_match('/\b(N|R|L|P)\b/', $param, $p)) $out = mxfilt($kava, '$5 == "' . ($paev = $p[1]) . '"'); // kontserdite iseloomu filter $esi = cleanID(str_replace('"', '\"', $GLOBALS['TITLE'])); if ($lang == 1) $esi = @current(current(mxsel(mxfilt($esineja, $n = '$4 == "' . $esi . '"'), array(3)))); if ($lang == 2) $esi = @current(current(mxsel(mxfilt($esineja, $n = '$5 == "' . $esi . '"'), array(4)))); // fixme: kahtlane suva if (preg_match('/\b(ESINEJA)\b/', $param, $p)) $out = mxfilt($out, 'cleanID($2) == "'. (empty($sesi)?$esi:$sesi) .'"'); else if (preg_match('/ *(ÕT|RL|MT|MK) */', $param, $p)) $out = mxfilt($out, "in_array('$p[1]', explode(' ', $4))"); else if (!preg_match('/\bKOGU\b/', $param)) $out = mxfilt($out, 'empty($4) || substr($4, 0, 2) == "RV"'); if ($p[1] == 'MT') return preg_replace('/,([^,]*)$/', ' ' . _('ja') .' \1', mxout(mxsel($out, array(array_search('kell', $x))), ', ')); elseif ($p[1] == 'RL') { $out = mxupd(mxsel($out, array(0,2)), array(1 => 'ak_esineja($1)')); $ret = '' . "\n" . '' . "\n" . '' ."\n" . mxout($out) . '
' . join('', array(_('Kell'),_('Esineja'))) . '
'; } elseif ($p[1] == 'MK') { $out = mxupd(mxsel($out, array(0,1,2)), array(2 => 'ak_esineja($2)')); $ret = '' . "\n" . '' . "\n" . '' ."\n" . mxout($out) . '
' . join('', array(_('Kell'),_('Koht'),_('Esineja'))) . '
'; } elseif ($p[1] == 'ESINEJA') { $out = mxsel($out, array(5, 0, 1, 3, 4)); $out = mxupd($out, array( 0 => 'paev($0)', 2 => 'htmlspecialchars(_($2))', 3 => 'hind($3)', # 4 => 'substr($4,0,2) != "RV" ? "  " : "\"'"' 4 => 'substr($4,0,2) != "RV" ? "  " : _("jah")' )); $ret = '' . "\n" . '' . "\n" . '' ."\n" . mxout($out) . '
' . join('', array(_('Päev'),_('Kell'),_('Koht'),_('Hind'), 'RealVideo')) . '
'; } else { $out = mxsel($out, array(0, 1, 2, 3, 4)); $out = mxupd($out, array( 1 => 'htmlspecialchars(_($1))', 2 => 'ak_esineja($2)', 3 => 'hind($3)', # 4 => 'substr($4,0,2) != "RV" ? " " : "\"'"')); 4 => 'substr($4,0,2) != "RV" ? " " : _("jah")')); $ret = '' . "\n" . '' . "\n" . '' ."\n" . mxout( mxsel($out, array(0,1,2,3,4))) . '
' . join('', array(_('Kell'),_('Koht'),_('Esineja'),_('Hind'),'RealVideo')) . '
'; } $out = mxupd($out, array( 1 => 'htmlspecialchars(_($1))', 2 => 'ak_esineja($2)', 3 => 'hind($3)')); return $ret; } function kuulutused($param) { $ret = get_file_contents("./data/$param.txt"); $ret = preg_replace(array('/\r/', '/\n\n*/'), array("\n", "\n"), $ret); $ret = preg_split( '@[\n\s]*--- //[a-f0-9]+ *\d\d\d\d/\d\d/\d\d \d\d:\d\d//[\n\s]*@s', $ret); $ret = preg_grep ('/^\s*$/', $ret, PREG_GREP_INVERT); for ($i = 0; $i < count($ret); $i++) $ret[$i] = nl2br(trim(htmlspecialchars($ret[$i]))); if (count($ret)) return '"; else return ''; } function page() { global $CONTENT, $TITLE, $navi, $idnavi, $curpage, $lang, $queryid, $loc; ?> Viljandi pärimusmuusika festival AASTA

[VPMF 2005]

Viljandi Pärimusmuusika Festival
28. - 31. juuli 2005

'; } $BDATA = 'data/bronn.sqlite'; // broneerimine if (!empty($_POST['passe']) && !empty($_POST['tele'])) // broneerimine { // kasutame neid meilis (peavad olema escapemata) ja nii on lyhem kirjutada foreach(array('nimi', 'mail', 'tele', 'passe', 'tyyp') as $var) $$var = $_POST[$var]; switch ($tyyp) { case 1: $summa = $passe * 690; break; case 2: $summa = (2 * 690) + (345 * $passe); break; case 3: $summa = $passe * 530; break; } // lisamiseks escapeme ära mõned foreach(array('nimi', 'mail', 'tele') as $m) $_POST[$m] = sqlite_escape_string($_POST[$m]); // tekitame pika id $rndfile = fopen('/dev/urandom', 'r'); $longid = md5(fread($rndfile, 500)); fclose($rndfile); // avame andmebaasi, lisame kirje $a = sqlite_open($BDATA); sqlite_query($a, $ins = 'insert into bronn (passe, keel, tyyp, nimi, email, telefon, longid, aeg) values (' . "$_POST[passe], " . ($_POST['keel'] == 'en' ? 2 : 1) . ", $_POST[tyyp], '$_POST[nimi]', '$_POST[mail]', '$_POST[tele]'," . "'$longid', datetime('now'))"); sqlite_close($a); $m = $passe == 1 ? '' : 'i'; mail('kaiko@folk.ee' /* . ',amanda@folk.ee' */, utf2iso("Kala konksus: $nimi"), utf2iso(preg_replace('/^ +/m', '', ' Tere Pille! Teatan alandlikult, et '.date('d.m.y').' kell '.date('H:i')." täideti meie broneerimisvorm sooviga saada " . ( $tyyp == 1 || $tyyp == 3 ? // ilge spagett on see "$_POST[passe] " . ($tyyp == 3 ? 'soodus' : '') . "pass$m" : "perepass (2passi + $_POST[passe] lastepass$m)") . " Kala jättis endast teada: Nimi: $_POST[nimi] " . (empty($_POST['mail']) ? '' : "<$_POST[mail]>") . " Telefon: $_POST[tele] Tellija keel: $_POST[keel] Tema infoleheks osutus: http://www.folk.ee/2005/staatus.php?id=$longid Ilusat päeva! soovib Viljandi pärimusmuusika festivali kodulehekülg ")), 'X-Sender-Ip: '.getenv('REMOTE_ADDR')); if (!empty($_POST['mail']) && preg_match('/([\w0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)/i', $_POST['mail'])) { if ($_POST['keel'] == 'en') // TODO NB - ei tööta $parsi = current(array_slice(array('pass_mail', 'fpass-mail'), $tyyp - 1, 1)); else $parsi = current(array_slice(array('bronn-meil', 'ppbronn-meil', 'isicbronn-meil'), $tyyp - 1, 1)); ob_start(); $ID = $parsi; html_show(); $tekst = ob_get_contents(); ob_clean(); // php lehelt voetud $tekst = preg_replace( array ('@]*?>.*?@si', '@<[\/\!]*?[^<>]*?>@si', /*'@([\r\n])[\s]+@',*/ '@&(quot|#34);@i', '@&(amp|#38);@i', '@&(lt|#60);@i', '@&(gt|#62);@i', '@&(nbsp|#160);@i', '@&(iexcl|#161);@i', '@&(cent|#162);@i', '@&(pound|#163);@i', '@&(copy|#169);@i', '@&#(\d+);@e', '@\n\n@'), array ('', '', /*'\1',*/ '"', '&', '<', '>', ' ', chr(161), chr(162), chr(163), chr(169), 'chr(\1)', "\n"), $tekst); $tekst = utf2iso($tekst); // todo: lisada meilidele juurde Content-Type: text/plain; charset=iso-8859-1 $mailhead = "Content-Type: text/plain; charset=iso-8859-1\nFrom: webmaster@$SERVER_NAME\nReply-To: amanda@folk.ee"; mail($_POST['mail'], utf2iso($TITLE), $tekst, $mailhead); mail('kaiko@folk.ee', utf2iso($TITLE), $tekst, $mailhead); } $outfile = '/var/www/folk/wiki/data/passimueuek.txt'; if (file_exists($outfile)) chmod($outfile, 666); $statf = popen("echo 'select * from stat;' | sqlite " . 'data/bronn.sqlite', 'r'); $stat = "^ ^ Kokku ^ Maksmata ^ Makstud ^\n" . preg_replace(array('/\s*$/', '/^/ms', '/$/sm', '/\|/'), array('', '^','|', '| '), fread($statf, 9000)); fputs($f = fopen($outfile, 'w'), $stat); fclose($f); chmod($outfile, 444); if ($_POST['keel'] == 'en') header("Location: status.php?id=$longid"); else header("Location: staatus.php?id=$longid"); exit; } // see siin saab juhtuda vaid siis kui tullakse staatust vaatama if (!empty($_GET['id']) && preg_match('/[a-f0-9]{32}/', $_GET['id']) && $a = sqlite_open($BDATA)) { $q = sqlite_query($a, "select * from inf where longid = '$_GET[id]' and kustutatud is null limit 1"); if (sqlite_num_rows($q)) foreach(sqlite_fetch_array($q, SQLITE_ASSOC) as $k => $v) $$k = $v; $aeg = strftime('%e %B',strtotime($aeg)); // DELETEME: $mail = $email; sqlite_close($a); } // kauplemise osa if (!empty($_POST['kuulutus']) && strtolower($_POST['kuulutus']) == 'kuuluta') { $f = fopen("data/$_POST[rubriik].txt", 'a'); flock($f, LOCK_EX); fwrite($f, sprintf("\n%s\n--- //%s %s//\n", $_POST['tekst'], md5($_POST['tunnus']), date('Y/m/d H:i'))); flock($f, LOCK_UN); fclose($f); } elseif (!empty($_POST['kuulutus']) && strtolower($_POST['kuulutus']) == 'kustuta') { function delpakkumine($f) { global $_POST; $c = get_file_contents("data/$f.txt"); $res = preg_replace('@(.*)(--- //[a-f0-9]+ \d\d\d\d/\d\d/\d\d \d\d:\d\d//\n|^).*?\n--- //' . md5($_POST['tunnus']) .' \d\d\d\d/\d\d/\d\d \d\d:\d\d//\n@s', '\1\2', $c); if ($res != $c) { $f = fopen("data/$f.txt", 'w'); flock($f, LOCK_EX); fwrite($f, $res); flock($f, LOCK_UN); fclose($f); } } delpakkumine('pakun'); delpakkumine('tahan'); } ob_start(); if (preg_match('/\/(isicbronn|lehdistoe|ystaevaet|pressituba|press|festivaali|ohjelma|liput|oleellista|media_albumi|lehdisto|ystaevat|folgi_sobrad|friends|about|festival|essentials|booking|family_pass_booking|programm|elu-olu|program|piletiinfo|staatus|status|blahh|tickets|bronn|ppbronn|opitoad|muinasjututuba|roheline_lava|maakonnakontserdid|kogu_festival|kauplemine|kaesitoeoehoov|naeitused|workshops|green_stage|fairy-tale_chamber|concerts_in_viljandi_county|exhibitions|handicraft_yard|complete_festival_program|linnaplaan|town_map)(.php)?/', $_SERVER['REQUEST_URI'],$m)) $ID = getID($m[1]); elseif (preg_match('/((esineja|performer):.*)/', $_SERVER['REQUEST_URI'], $m)) { if ($m[2] == 'performer') $lang = 1; if ($m[1] == 'esineja:koos' || $m[1] == 'performer:all') { $isest = $m[1] == 'esineja:koos'; $esinejadkoos = true; parse_esinejad(); $ID = 'aasta' . AASTA . ($isest ? ':esineja:' : ':performer:'); $html = ''; foreach($esineja as $e) { if ($isest) $file = DDIR . '/esineja/' . $e[3]. '.txt'; else $file = DDIR . '/performer/' . $e[4]. '.txt'; if (!is_file($file)) continue; $E = get_file_contents($file); $asjad = get_esineja_asjad($E); $E = preg_replace('/^( +-.*)\n( +-.*)?$/mU', '', $E); $E = preg_replace('/^(=====) (.*?) \1\s*$/m', "\\1 \\2 \\1\n$asjad[riik]\\\\\\\n$asjad[url]\n\n", $E, 1); $E = preg_replace('@ *// *--- *ajakava:? *.*? --- *//@', ' // --- ekava: ' . $e[3] . ' --- //', $E); $html .= "$E\n\n"; } $html = preg_replace('/^(======) *.*? *\1$/m', '', $html) . '~~NOTOC~~'; $TITLE = _('Esinejad'); } else { $ID = getID($m[1]); $html = io_readfile(wikiFN(getID($m[1]))); $asjad = get_esineja_asjad($html); $html = preg_replace('/^( +-.*)\n( +-.*)?$/mU', '', $html); $html = preg_replace('/^(=====) (.*?) \1\s*$/m', "\\1 \\2 \\1\n$asjad[riik]\\\\\\\n$asjad[url]\n\n", $html, 1); $html .= "\n~~NOTOC~~"; } } elseif (preg_match('/\/album(\.php)/', $_SERVER['REQUEST_URI'])) { album(); $ID = 'album'; } elseif ($_SERVER['REDIRECT_STATUS'] == '404') { // TODO: wikisse see leht. inglise ja eesti keelsed versioonid. näidatakse vastavalt sellele, mida brauser aktseptib $notok = 1; $TITLE = _('Viga 404 - Lehte ei leitud'); ?>

Oled eksinud

Leia tee :)

1) $TITLE = $p[1]; } // otsime hetkelehe foreach ($idnavi as $i => $n) if (in_array($cid, $n)) { $curpage = $i; break; } $CONTENT = ob_get_contents(); ob_end_clean(); $CONTENT = preg_replace( array('/ *— *ajakava:? *(.*?) *— *<\/em>/e', '/ *— *ekava:? *(.*?) *— *<\/em>/e'), array('ajakava("$1")', 'ajakava("esineja","$1")'), $CONTENT); $CONTENT = preg_replace(array('/

\s*<(ul|ol|table)/','/<\/(ul|ol|table)>\s*<\/p>/'), array('<\1', ''), $CONTENT); if (isset($esinejadkoos)) $CONTENT = preg_replace('/