function make_stimset_display($itm, $cond, $iid, $dir) { $crit = $itm['Foil']; if ($cond == "comp") { $crit = $itm['Competitor']; } else { } $im = imagecreatefromjpeg("../resource/grid.jpg"); place_image("../resource/highlight", $itm['Target'][1], $im, 0); place_image($itm['Target'][0], $itm['Target'][1], $im); place_image($crit[0], $crit[1], $im); // place_image($itm['Foil'][0], 5, $im); foreach ($itm as $k => $v) { if ($k != "Target" && $k != "Competitor" && $k != "Foil") { place_image($v[0], $v[1], $im); } else { } } imagejpeg($im, "../" . $dir . "/" . str_pad($iid, 2, "0", STR_PAD_LEFT) . ".jpg"); imagedestroy($im); }
function pdfdoc($doc, $nl = '', $large = '') { $lk = prepdlink($doc); if ($nl == 'nl') { return $doc; } $lk[0] = goodroot($lk[0]); if (is_image($lk[1])) { $im = place_image($lk[1], $media, $large, ''); } else { $im = picto('url') . ' ' . $lk[1]; } if ($_SESSION['nl']) { return lkt('', $lk[0], $im); } return lkt('', $lk[0], $im) . ' ' . lj('', 'popup_poppdf___' . ajx($lk[0]) . '_' . ajx($lk[1]), picto(txt)); }
function sconn($doc) { //artwedit list($pdoc, $xf) = split_one(':', $doc, 1); if ($xf && $pdoc != 'http') { $d = sconn_defs_r($pdoc, $xf); if ($d != $doc) { return $d; } } if ($xf) { $d = sconn_defs_app($pdoc, $xf); if ($d) { return $d; } } $xt = strtolower(strrchr($doc, ".")); if ($xt == ".mp3") { $doc = goodroot($doc); return audio($doc); } if ($xt == ".pdf") { return pdfdoc($doc, 'img/', $media); } //pdf if (is_image($doc) && strpos($doc, "§") === false && strpos($doc, "<") === false) { //images $large = currentwidth() - 20; $largb = round($large * 0.5); if (strpos($doc, "http") !== false) { return image($doc); } return place_image($doc, $media, $large, $largb); } if (strpos($doc, "§") or strpos($doc, "http") !== false or strpos($doc, "@") !== false) { //liens $lk = prepdlink($doc); if (is_image($lk[0])) { if (strpos($lk[0], "http") !== false) { return image($lk[0]); } return popim(goodroot($lk[0]), $lk[1]); } elseif (is_image($lk[1]) == true) { //link§im if (is_numeric($lk[0])) { $lk[0] = urlread($lk[0]); } if (strpos($lk[1], "http") !== false) { return lka($lk[0], $lk[1]); } return lkc("", $lk[0], place_image($lk[1], $media, $large, $largb)); } elseif (strpos($lk[0], "http") !== false) { return lka($lk[0], $lk[1]); } elseif (strpos($lk[0], "/") !== false) { return lka(goodroot($lk[0]), $lk[1]); } elseif (substr($lk[0], 0, 1) == "/") { return lka($lk[0], $lk[1]); } elseif (strpos($lk[0], "@") !== false && strpos($lk[0], ".") !== false) { return lkc("", 'mailto:' . $lk[0], $lk[1]); } elseif (strpos($doc, "@") !== false && strpos($doc, ".") !== false) { return lkc("", 'mailto:' . $doc, $doc); } elseif (is_numeric($lk[0])) { return jread('', $lk[0], $lk[1]); } } return $doc; }
/** * Calls place_image() if the $_alt variable is set for the page. * * Looks in images/photos directory. */ function place_image_if_alt($file = '', $class = 'auto') { global $_alt; if ($_alt) { return place_image($file, '', $class, '', 'photos/'); } }