'."\n"; $sname = $_SERVER['SERVER_NAME']; $sname = str_replace('www.', '', $sname); $self = 'http://www.'.$sname.$_SERVER['PHP_SELF']; $self = str_replace($adminDir.'/images.php', '', $self); $output .= ''; if (!ISSET($_GET['gid'])){ $q = "SELECT * FROM $atbl WHERE active = 1 ORDER BY displayOrder"; $r = mysql_query($q); } else { $gid = $_GET['gid']; $q = "SELECT $atbl.id, $atbl.name, $atbl.description, $atbl.tn, $atbl.target, $atbl.startHere, $atbl.audioFile, $atbl.aTn, $atbl.path, $atbl.audioCap FROM $atbl, $dltbl WHERE $dltbl.aid = $atbl.id and $dltbl.did = $gid ORDER BY $dltbl.display"; $r = mysql_query($q); } while ($rw = mysql_fetch_array($r)) { $id = $rw['id']; $n = ent2ncr(htmlentities($rw['name'])); $des = $rw['description']; $des = str_replace("\n", '', $des); $d = ent2ncr(htmlentities($des)); $tn = $rw['tn']; $tgt = $rw['target']; $s = $rw['startHere']; $p = $self.$adminDir.'/albums/'.$rw['path'].'/lg/'; $aMp3 = $self.$adminDir.'/album-audio/'.$rw['audioFile']; $ac = $rw['audioCap']; $ac = nl2br($ac); $ac = str_replace("\n", '', $ac); $ac = str_replace("\r", '', $ac); $aCap = ent2ncr(htmlentities($ac)); $atn = $rw['aTn']; $cArr = explode('http://', $atn); if (count($cArr) == 1){ $atn = $self.$atn; } if ($tn == 1) { $tn = $self.$adminDir.'/albums/'.$rw['path'].'/tn/'; } else { $tn = ''; } if ($tgt == 1) $t_str = ' target="_self"'; else $t_str = ''; if ($s == 1) $s = 'true'; else $s = ''; if (!empty($rw['audioFile'])) $audioStr = 'audio="'.$aMp3.'"'; else $audioStr = ''; if (!empty($rw['audioFile']) && !empty($aCap)) $audioStr .= ' audioCaption="'.$aCap.'"'; $output .= "\n\t".''; $iq = "SELECT * FROM $itbl WHERE active = 1 AND aid = $id ORDER BY seq"; $ir = mysql_query($iq); while ($irw = mysql_fetch_array($ir)) { $sc = $irw['src']; $cap = $irw['caption']; $cap = nl2br($cap); $cap = str_replace("\n", '', $cap); $cap = str_replace("\r", '', $cap); $output .= "\n\t\t".''; } $output .= "\n\t".''; } $output .= "\n".''; echo $output; /* Many Thanks to Kaf Oseio ent2ncr function from Entity2NCR Wordpress Plugin http://guff.szub.net/2005/03/02/entity2ncr/ */ function ent2ncr($text) { $to_ncr = array( '"' => '"', '&' => '&', '⁄' => '/', '<' => '<', '>' => '>', ' ' => ' ', '¡' => '¡', '¢' => '¢', '£' => '£', '¤' => '¤', '¥' => '¥', '\|' => '¦', '¦' => '¦', '&brkbar;' => '¦', '§' => '§', '¨' => '¨', '¨' => '¨', '©' => '©', 'ª' => 'ª', '«' => '«', '¬' => '¬', '­' => '­', '®' => '®', '¯' => '¯', '&hibar;' => '¯', '°' => '°', '±' => '±', '²' => '²', '³' => '³', '´' => '´', 'µ' => 'µ', '¶' => '¶', '·' => '·', '¸' => '¸', '¹' => '¹', 'º' => 'º', '»' => '»', '¼' => '¼', '½' => '½', '¾' => '¾', '¿' => '¿', 'À' => 'À', 'Á' => 'Á', 'Â' => 'Â', 'Ã' => 'Ã', 'Ä' => 'Ä', 'Å' => 'Å', 'Æ' => 'Æ', 'Ç' => 'Ç', 'È' => 'È', 'É' => 'É', 'Ê' => 'Ê', 'Ë' => 'Ë', 'Ì' => 'Ì', 'Í' => 'Í', 'Î' => 'Î', 'Ï' => 'Ï', 'Ð' => 'Ð', 'Ñ' => 'Ñ', 'Ò' => 'Ò', 'Ó' => 'Ó', 'Ô' => 'Ô', 'Õ' => 'Õ', 'Ö' => 'Ö', '×' => '×', 'Ø' => 'Ø', 'Ù' => 'Ù', 'Ú' => 'Ú', 'Û' => 'Û', 'Ü' => 'Ü', 'Ý' => 'Ý', 'Þ' => 'Þ', 'ß' => 'ß', 'à' => 'à', 'á' => 'á', 'â' => 'â', 'ã' => 'ã', 'ä' => 'ä', 'å' => 'å', 'æ' => 'æ', 'ç' => 'ç', 'è' => 'è', 'é' => 'é', 'ê' => 'ê', 'ë' => 'ë', 'ì' => 'ì', 'í' => 'í', 'î' => 'î', 'ï' => 'ï', 'ð' => 'ð', 'ñ' => 'ñ', 'ò' => 'ò', 'ó' => 'ó', 'ô' => 'ô', 'õ' => 'õ', 'ö' => 'ö', '÷' => '÷', 'ø' => 'ø', 'ù' => 'ù', 'ú' => 'ú', 'û' => 'û', 'ü' => 'ü', 'ý' => 'ý', 'þ' => 'þ', 'ÿ' => 'ÿ', 'Œ' => 'Œ', 'œ' => 'œ', 'Š' => 'Š', 'š' => 'š', 'Ÿ' => 'Ÿ', 'ƒ' => 'ƒ', 'ˆ' => 'ˆ', '˜' => '˜', 'Α' => 'Α', 'Β' => 'Β', 'Γ' => 'Γ', 'Δ' => 'Δ', 'Ε' => 'Ε', 'Ζ' => 'Ζ', 'Η' => 'Η', 'Θ' => 'Θ', 'Ι' => 'Ι', 'Κ' => 'Κ', 'Λ' => 'Λ', 'Μ' => 'Μ', 'Ν' => 'Ν', 'Ξ' => 'Ξ', 'Ο' => 'Ο', 'Π' => 'Π', 'Ρ' => 'Ρ', 'Σ' => 'Σ', 'Τ' => 'Τ', 'Υ' => 'Υ', 'Φ' => 'Φ', 'Χ' => 'Χ', 'Ψ' => 'Ψ', 'Ω' => 'Ω', 'α' => 'α', 'β' => 'β', 'γ' => 'γ', 'δ' => 'δ', 'ε' => 'ε', 'ζ' => 'ζ', 'η' => 'η', 'θ' => 'θ', 'ι' => 'ι', 'κ' => 'κ', 'λ' => 'λ', 'μ' => 'μ', 'ν' => 'ν', 'ξ' => 'ξ', 'ο' => 'ο', 'π' => 'π', 'ρ' => 'ρ', 'ς' => 'ς', 'σ' => 'σ', 'τ' => 'τ', 'υ' => 'υ', 'φ' => 'φ', 'χ' => 'χ', 'ψ' => 'ψ', 'ω' => 'ω', 'ϑ' => 'ϑ', 'ϒ' => 'ϒ', 'ϖ' => 'ϖ', ' ' => ' ', ' ' => ' ', ' ' => ' ', '‌' => '‌', '‍' => '‍', '‎' => '‎', '‏' => '‏', '–' => '–', '—' => '—', '‘' => '‘', '’' => '’', '‚' => '‚', '“' => '“', '”' => '”', '„' => '„', '†' => '†', '‡' => '‡', '•' => '•', '…' => '…', '‰' => '‰', '′' => '′', '″' => '″', '‹' => '‹', '›' => '›', '‾' => '‾', '⁄' => '⁄', '€' => '€', 'ℑ' => 'ℑ', '℘' => '℘', 'ℜ' => 'ℜ', '™' => '™', 'ℵ' => 'ℵ', '↵' => '↵', '⇐' => '⇐', '⇑' => '⇑', '⇒' => '⇒', '⇓' => '⇓', '⇔' => '⇔', '∀' => '∀', '∂' => '∂', '∃' => '∃', '∅' => '∅', '∇' => '∇', '∈' => '∈', '∉' => '∉', '∋' => '∋', '∏' => '∏', '∑' => '∑', '−' => '−', '∗' => '∗', '√' => '√', '∝' => '∝', '∞' => '∞', '∠' => '∠', '∧' => '∧', '∨' => '∨', '∩' => '∩', '∪' => '∪', '∫' => '∫', '∴' => '∴', '∼' => '∼', '≅' => '≅', '≈' => '≈', '≠' => '≠', '≡' => '≡', '≤' => '≤', '≥' => '≥', '⊂' => '⊂', '⊃' => '⊃', '⊄' => '⊄', '⊆' => '⊆', '⊇' => '⊇', '⊕' => '⊕', '⊗' => '⊗', '⊥' => '⊥', '⋅' => '⋅', '⌈' => '⌈', '⌉' => '⌉', '⌊' => '⌊', '⌋' => '⌋', '⟨' => '〈', '⟩' => '〉', '←' => '←', '↑' => '↑', '→' => '→', '↓' => '↓', '↔' => '↔', '◊' => '◊', '♠' => '♠', '♣' => '♣', '♥' => '♥', '♦' => '♦' ); foreach ($to_ncr as $entity => $ncr) { $text = preg_replace("/$entity/Us", $ncr, $text); } return $text; } ?>