function display_metadata($alias, $item, $conf) { dmGetCollectionFullResInfo($alias, $enabled, $public, $volprefix, $volsize, $displaysize, $archivesize); $fullres = ""; $std_fields = array(); for ($i = 0; $i < count($conf); $i++) { $tag = strtoupper($conf[$i]["nick"]); if ($conf[$i]["type"] != "FTS" && array_key_exists($tag, $item['index']) && array_key_exists("value", $item['structure'][$item['index'][$tag][0]])) { $value = ''; if ($conf[$i]["type"] == "DATE") { $value = linkDate($item['structure'][$item['index'][$tag][0]]["value"], $alias, $conf[$i]["nick"]); } else { if ($conf[$i]["search"] == "1" && $conf[$i]["vocab"] == "1") { $value = vocabLink(charReplace($item['structure'][$item['index'][$tag][0]]["value"]), $alias, $conf[$i]["nick"]); } elseif ($conf[$i]["search"] == "1" && $conf[$i]["vocab"] == "0") { $value = makeLinks(isHyperlink(charReplace($item['structure'][$item['index'][$tag][0]]["value"]), $conf[$i]["type"], $conf[$i]["nick"], $alias)); } else { $value = makeLinks(charReplace($item['structure'][$item['index'][$tag][0]]["value"])); } } $std_fields[] = array('field' => $conf[$i]["name"], 'value' => $value); } } include 'meta_scr_template.php'; }
function altText($text) { if (strlen($text) > 100) { $text = truncate($text, 100); } return str_replace("<br />", "\n", str_replace("'", "'", str_replace("\"", """, charReplace($text)))); }
function seo($s, $id) { /* ************************************************ ** ** Neden bilmiyorum, regex'ten hiç hazzetmiyorum... ** ** ************************************************ */ $tr = array('ş', 'Ş', 'ı', 'İ', 'ğ', 'Ğ', 'ü', 'Ü', 'ö', 'Ö', 'ç', 'Ç'); $en = array('s', 's', 'i', 'i', 'g', 'g', 'u', 'u', 'o', 'o', 'c', 'c'); $s = str_replace($tr, $en, $s); $s = strtolower($s); $s = charReplace($s); $s = lCase($s); $s = str_replace("--", "-", $s); $s = trim($s, '-'); /* Belirlenen URL kullanımda mı? */ global $db; $kntr = 0; while ($hoy = current($db->query("SELECT id FROM makaleler WHERE url = '" . $s . ($kntr ? '-' . $kntr : '') . "' AND id <> {$id}")->fetch_row())) { $kntr++; } // Ürkütücü return $s . ($kntr ? '-' . $kntr : ''); }