'notfound')); verb_register_hook("vae_permalink", array('callback' => 'permalink')); function notfound() { header("location: 404.php"); } function permalink($url) { return "/".$url; } function URLBreak($u) { $u = str_replace("http://","",$u); $u_explode = explode("/",$u); $u = stripslashes($u_explode[1]); return $u; } function smart_quotes($string) { $search = array(chr(145), chr(146), chr(147), chr(148), chr(151)); $replace = array('‘', '’', '“', '”', '—'); return str_replace($search, $replace, $string); } function articleCallouts() { $id = $_REQUEST["id"]; $i = 1; $string = ""; foreach(vae($id) as $p) { foreach($p->callouts as $c) { $class = $c->position->class; $img_class = $c->image_uses_drop_shadow == '1' ? " dropshadowed" : ""; $img_class2 = $c->piece == '1' ? " piece" : ""; $img = '
'; $title = '
'.$c->title."
"; //$link = isset($c->link) ? ''.$c->link_text.'' : $c->link_text; $caption = strlen($c->caption) > 0 ? '
'.$c->caption.'
' : ''; $style = ""; $top = $c->top_perct; $left = $c->left_perct; $right = $c->right_perct; if ($top != "" || $left != "" || $right != "") { $styleTop = ($top != "") ? 'margin-top: 0; top: '.$top.'%;' : ''; if ($left != "") { $styleHorz = 'left: '.$left.'%; right: auto;'; } else if ($right != "") { $styleHorz = 'right: '.$right.'%; left: auto;'; } else { $styleHorz = ""; } $style = ' style="'.$styleTop.$styleHorz.'"'; } if (strlen($c->link) > 0) { $link = '
'.$c->link_text."
"; $string .= ''.$img.$title.$link.$caption.''; } else { $string .= '
'.$img.$title.$caption.'
'; } $i++; } } return $string; } function makeNav($n) { $sn = $n->short_name; $navID = ""; if ($sn != "") { $navID = " id='nav-".$sn."'"; } if (URLBreak($n->url) == URLBreak($_SERVER['PHP_SELF'])) { $class = "active"; } $link = ''.$n->label.''; return $link; } function nav() { $out = ""; $nav = vae("/nav"); foreach($nav as $n) { $out .= makeNav($n); } $out = ''; return $out; } function siteMapLinks() { //collections $links = ''; foreach("/9s" as $p) { $links .= vae_permalink($p->id); } foreach("/journal_categories" as $p) { $links .= vae_permalink($p->id); } return $links; } function videoEmbedCode() { $id = $_REQUEST["id"]; if (isset($id)) { foreach(vae($id) as $p) { return $p->video_embed_code; } } else { $options = array("limit" => 1); foreach(vae("/craftsmanship/headers", $options) as $p) { return $p->video_embed_code; } } } /* function collection() { //$id = $_REQUEST["id"]; $string = ""; foreach(vae("/collection/collections") as $c) { $string .= '
'; $string .= '
'; $pieces = ""; foreach($c->pieces as $p) { $thumb_class = $p->thumb_size->class; //$thumb_class = ""; switch ($thumb_class) { case "thumb-small": $thumb = vae_image($p->image, 164, 176); break; case "thumb-medium": $thumb = vae_image($p->image, 264, 292); break; case "thumb-large": $thumb = vae_image($p->image, 330, 400); break; } $thumb = vae_data_url().$thumb; $class_position = $p->position->class; $class_vertical = $p->vertical_movement->class; $info = '
'.$p->name.'
'; $pieces .= '
'.$info.'
'; } $string .= '
'.$pieces.'
'; $string .= '
The
'.$c->title.'
Collection
'; if (isset($c->landing_polygon)) { $string .= '
'; } if (isset($c->callouts)) { foreach($c->callouts as $co) { $callout = '
'.$co->text.'
'; $string .= ''.$callout.''; break; // allow only one } } $string .= '
'; $string .= '
'; } return $string; } */ function collection() { //$id = $_REQUEST["id"]; $string = ""; $w = 1280; foreach(vae("/collection/collections") as $c) { if ($c->hide_from_landing != '1') { $h = isset($c->landing_height) ? $c->landing_height : 1000; if (isset($c->callouts)) { $callouts = array(); foreach($c->callouts as $co) { $callout = '
'.$co->text.'
'; //$string .= ''.$callout.''; $callouts[] = ''.$callout.''; //break; // allow only one } } if (isset($c->polygons)) { $polygons = array(); foreach($c->polygons as $poly) { $polygons[] = '
'; } } $string .= '
'; $string .= '
'; $pieces = ""; $piece_c = 0; $three = 0; foreach($c->pieces as $p) { $piece_c++; $three++; if ($three == 5) { $three = 1; } $pw = ($p->landing_width) ? $p->landing_width : 300; $thumb = vae_image($p->image, $pw, 1000); $thumb = vae_data_url().$thumb; $x1 = isset($p->landing_x) ? $p->landing_x : 0; $y1 = isset($p->landing_y) ? $p->landing_y : 0; $w = isset($p->landing_width) ? $p->landing_width: 100; if ((string)$w < 180) { $smallClass = " small"; } else { $smallClass = ""; } $rollover_class = ""; if ($p->rollover_left == '1') { $rollover_class = " callout-piece-info-left"; } //$class_position = $p->position->class; //$class_vertical = $p->vertical_movement->class; $info = '
'.$p->name.'
'; $pieces .= '
'.$info.'
'; if ($three == 4) { $pieces .= array_shift($callouts); $pieces .= array_shift($polygons); } } if (sizeof($callouts) > 0) { for ($i=0; $i'; if (strlen($c->title_link) > 0) { $string .= ''; } else { $string .= '
The
'.$c->title.'
Collection
'; } /* if (isset($c->landing_polygon)) { $string .= '
'; } */ $string .= '
'; $string .= '
'; } } return $string; } function zoomImage() { $url = $_REQUEST["i"]; return $url; } ?> Munnu The Gem Palace | Handcrafted jewelry from Jaipur's Kasliwal family