parent::__construct(false, false);
}
-
+
public function fancybox_scripts(){
-
+
}
/*
* Perform Model Action
wp_enqueue_style('fancyStyle', GLM_MEMBERS_PLUGIN_URL . 'fancybox/source/jquery.fancybox.css?v=2.1.5');
wp_enqueue_style('fancyStyleButtons', GLM_MEMBERS_PLUGIN_URL . 'fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5');
wp_enqueue_style('fancyStyleThumbs', GLM_MEMBERS_PLUGIN_URL . 'fancybox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7');
-
+
wp_enqueue_script('fancyScript', GLM_MEMBERS_PLUGIN_URL . 'fancybox/source/jquery.fancybox.pack.js?v=2.1.5', array('jquery'), '', true );
wp_enqueue_script('fancyMouse', GLM_MEMBERS_PLUGIN_URL . 'fancybox/lib/jquery.mousewheel-3.0.6.pack.js', array('jquery'), '', true );
wp_enqueue_script('fancyThumbs', GLM_MEMBERS_PLUGIN_URL . 'fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7', array('jquery'), '', true );
$haveMember = false;
$haveImageGallery = false;
$imageGallery = false;
+ $featuredImage = false;
+ $featuredImageCaption = false;
// Find the active member info record and get it with main member data
$memberData = $this->getActiveInfoForMember($id);
require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataImages.php');
$Images = new GlmDataImages($this->wpdb, $this->config);
$imageGallery = $Images->getGallery($this->config['ref_type_numb']['MemberInfo'], $memberData['id']);
- $haveImageGallery = ($imageGallery != false);
+ // If we have a gallery
+ if ($imageGallery != false) {
+
+ $haveImageGallery = true;
+
+ // Check for a featured image
+ foreach ($imageGallery as $image) {
+ if ($image['featured']['value']) {
+ $featuredImage = $image['file_name'];
+ $featuredImageCaption = $image['caption'];
+
+ }
+ }
+ }
}
// Since the ID we recieved with the member data is the pointer to the member info record, replace it with member ID
'haveMember' => $haveMember,
'member' => $memberData,
'haveImageGallery' => $haveImageGallery,
- 'imageGallery' => $imageGallery
-
+ 'imageGallery' => $imageGallery,
+ 'featuredImage' => $featuredImage,
+ 'featuredImageCaption' => $featuredImageCaption
);
// Return status, suggested view, and data to controller