picture_block_padding_right = (isset($OBJ->hook->options['horizontal_settings']['margin'])) ? $OBJ->hook->options['horizontal_settings']['margin'] : 25; $this->bottom_margin = (isset($OBJ->hook->options['horizontal_settings']['bottom_margin'])) ? $OBJ->hook->options['horizontal_settings']['bottom_margin'] : 25; $this->text_block_height = (isset($OBJ->hook->options['horizontal_settings']['text_box_height'])) ? $OBJ->hook->options['horizontal_settings']['text_box_height'] : 18; $this->text_width = 250; $this->text_padding_right = 35; $this->final_img_container = 0; // do not adjust this one $this->valign = (isset($OBJ->hook->options['horizontal_settings']['valign'])) ? $OBJ->hook->options['horizontal_settings']['valign'] : 0; // thumbs shape == 0 and grid = true... if (isset($OBJ->hook->options['horizontal_settings']['placement'])) { $this->placement = ($OBJ->hook->options['horizontal_settings']['placement'] == 1) ? true : false; } } function createExhibit() { $OBJ =& get_instance(); global $uploads, $default; // exhibit only source $this->source = $default['filesource'][0]; // get images $this->imgs = ndxz_get_imgs(); // INTEGRATE THIS INTO THE MIX LATER! $OBJ->vars->images = $this->imgs; // if no images return our text only if (!$this->imgs) { $this->centering(); $OBJ->page->exhibit['dyn_js'][] = "$(window).resize(function() {centering(); centering_w();});"; $s = "\n
\n"; $s .= "
\n"; $s .= $OBJ->vars->exhibit['content']; $s .= "
"; $s .= "
\n"; $s .= "
\n"; $OBJ->page->exhibit['exhibit'] = $s; return $OBJ->page->exhibit['exhibit']; } $s = ''; $a = ''; $w = 0; $i = 0; $b = 0; $content = ''; //$this->final_img_container = ($OBJ->vars->exhibit['content'] != '') ? ($this->text_padding_right + $this->text_width) : 0; /////////////////// $this->x = $OBJ->vars->exhibit['thumbs']; foreach ($this->imgs as $do) { $total = count($do); $t = 1; foreach ($do as $go) { // space between images/videos // width of text space // margin $margin = $this->text_block_height; $textw = $this->bottom_margin; $separator = $this->picture_block_padding_right; $this->text_width = $textw - (2 * $margin); // height and width of thumbnail //$size = getimagesize(DIRNAME . '/files/gimgs/' . $go['media_ref_id'] . '_' . $go['media_file']); $text = $go['media_title'] . $go['media_caption']; if ($this->placement == 1) { $txt = (($OBJ->vars->exhibit['titling'] == 1) && ($text != '')) ? "\n
$text
\n" : ''; // image + separator //$width_adjust = $size[0]; //$b = "
\n"; if ($OBJ->vars->exhibit['placement'] == 0) $b.= $text; if (in_array($go['media_mime'], $uploads['video'])) { $mime = $go['media_mime']; $size[0] = $go['media_x']; $size[1] = $go['media_y']; $width_adjust = $size[0]; $b = "
\n"; $b .= "
valign($size[1]) . ">\n"; $b .= $mime($go['media_file'], $go['media_x'], $go['media_y'], $go['media_thumb']); $b .= "
\n"; } else { // height and width of thumbnail $size = getimagesize(DIRNAME . '/files/gimgs/' . $go['media_ref_id'] . '_' . $go['media_file']); $width_adjust = $size[0]; $b = "
\n"; $b .= "
valign($size[1]) . ">\n"; $b .= "$go[media_thumb_path]"; $b .= "
\n"; } if ($OBJ->vars->exhibit['placement'] == 1) $b.= $text; $b .= "
\n"; //$last = $separator; $se = "
 
"; $texty = (($OBJ->vars->exhibit['titling'] == 1) && ($txt != '')) ? $textw : 0; $this->final_img_container = $this->final_img_container + ($size[0] + $separator); $a .= ($OBJ->vars->exhibit['placement'] == 0) ? $b . $se : $b . $se; } else { $txt = (($OBJ->vars->exhibit['titling'] == 1) && ($text != '')) ? "
$text
\n" : ''; //$txt = ''; // image + separator //$width_adjust = $size[0]; //$b = "
\n"; if (in_array($go['media_mime'], $uploads['video'])) { $mime = $go['media_mime']; $size[0] = $go['media_x']; $size[1] = $go['media_y']; $width_adjust = $size[0]; $b = "
\n"; $b .= "
valign($size[1]) . ">\n"; $b .= $mime($go['media_file'], $go['media_x'], $go['media_y'], $go['media_thumb']); $b .= "
\n"; } else { // height and width of thumbnail $size = getimagesize(DIRNAME . '/files/gimgs/' . $go['media_ref_id'] . '_' . $go['media_file']); $width_adjust = $size[0]; $b = "
\n"; $b .= "
valign($size[1]) . ">\n"; $b .= "$go[media_thumb_path]"; $b .= "
\n"; } //$b .= "$go[media_thumb_path]"; $b .= "
\n"; //$last = $separator; //$se = "
 
"; $se = ($t != $total) ? "
 
" : ''; //$texty = (($OBJ->vars->exhibit['titling'] == 1) && ($txt != '')) ? $textw : 0; $texty = 0; $this->final_img_container = $this->final_img_container + ($size[0] + $texty + $separator); $a .= ($OBJ->vars->exhibit['placement'] == 1) ? $b . $txt . $se : $txt . $b . $se; } $t++; } // we need to deal with the first paragraph...if any exists... /* if ($OBJ->vars->exhibit['content'] != '') { $content = "
\n"; $content .= "
\n"; $content .= $OBJ->vars->exhibit['content']; $content .= "
\n"; $content .= "
\n"; $content .= "
 
\n"; // add the content and separator to things... $this->final_img_container = $this->final_img_container + (($this->text_width + (2 * $margin)) + $separator); } */ $content = ''; $i++; } $s .= "\n
\n"; $s .= "
\n"; $s .= $content . $a; $s .= "
"; $s .= "
\n"; $s .= "
\n"; // lazyloading? //$OBJ->page->add_jquery('jquery.lazyload.js', 20); //$OBJ->page->add_jquery_onready("$('img').lazyload({threshold : 200});", 5); $OBJ->page->exhibit['exhibit'] = $s; $OBJ->page->exhibit['dyn_css'][] = $this->defaultCSS(); $this->centering(); $OBJ->page->exhibit['dyn_js'][] = "$(window).resize(function() {centering(); centering_w();});"; return $OBJ->page->exhibit['exhibit']; } function centering() { $OBJ =& get_instance(); $centering = "function centering_w() { var d_w = $('#img-container-inner').width(); var c_w = $(window).width(); if (c_w > d_w) { var cw_tmp = (c_w - d_w); cw_tmp = (cw_tmp/2); // we need to add this width to the #img-container $('#img-container').css({'width': (cw_tmp + d_w)}); $('#img-container-inner').css({'padding-left': cw_tmp, 'padding-right': 0}); //return false; } else { //alert( (d_w + 65) ); $('#img-container').css({'width': (d_w + 280)}); $('#img-container-inner').css({'padding-left': 140, 'padding-right': 140}); //return false; } return false; }"; //$OBJ->page->add_jquery("blank", 6); $OBJ->page->add_jquery('blank.js', 28); $OBJ->page->exhibit['dyn_js'][] = $centering; $OBJ->page->add_jquery_onready("centering_w();", 6); return null; } function valign($img_height=100) { $OBJ =& get_instance(); // centered if ($this->valign == 1) { $h = round(($OBJ->vars->exhibit['images'] - $img_height) / 2); $style = " style='padding: {$h}px 0;'"; } // bottom elseif ($this->valign == 2) { $h = round(($OBJ->vars->exhibit['images'] - $img_height)); $style = " style='padding-top: {$h}px;'"; } else { // nothing $style = ''; } return $style; } function defaultCSS() { $OBJ =& get_instance(); //$grid = ($OBJ->vars->exhibit['break'] >= 1) ? 'width: ' . (($OBJ->vars->exhibit['break'] * ($this->picture_block_padding_right + $OBJ->vars->exhibit['thumbs'])) + 1) . 'px' : ''; //$title_block = ($OBJ->vars->exhibit['titling'] == 1) ? $this->text_block_height : 0; $title_block = 0; $picture_height = ($OBJ->vars->exhibit['thumbs_shape'] == 0) ? "height: " . $this->x . "px;" : ''; return "#img-container {width: " . $this->final_img_container . "px;} #img-container .text {float: left; width: " . ($this->text_width + $this->text_padding_right) . "px;} #img-container .text p, #img-container .textor p {width: " . $this->text_width . "px;} #img-container .picture {float: left;} #img-container .captioning {height: {$title_block}px; text-align: left; } #img-container .captioning .title {margin-top: 3px; text-align: left;}"; } }