'view_only' => true,
'use' => 'a'
),
+ 'old_id' => array (
+ 'field' => 'old_id',
+ 'type' => 'integer',
+ 'use' => 'a'
+ ),
'topic' => array (
'field' => 'topic',
'type' => 'list',
'type' => 'checkbox',
'use' => 'a'
),
- 'post' => array (
- 'field' => 'post',
- 'type' => 'text',
- 'use' => 'a'
- ),
'location' => array (
'field' => 'location',
'type' => 'text',
item_expiration[90] = '90 Days'
item_expiration[120] = '120 Days'
-topics[1] = 'Buy'
-topics[2] = 'For Sale'
\ No newline at end of file
+topics[1] = 'For Sale'
+topics[2] = 'Buy'
\ No newline at end of file
-#glm-admin-content-container .admin-item-label,#glm-admin-content-container .admin-item-input,#glm-admin-content-container .admin-item-list{padding:0}.itemTitle-record{float:left}.admin-new-item{margin-bottom:15px}.admin-new-item .admin-new-item-link{padding:5px;background:#3D84D0;color:white;text-decoration:none;border-radius:4px}.no-padding{padding:0}.no-margin{margin:0}#glm-admin-content-container .admin-item-list-header{margin-bottom:20px;padding-bottom:2px;border-bottom:1px solid lightgray}.admin-item-list-row{padding-bottom:5px}.item-company-list-header,.item-date-list-header,.item-title-list-header{font-weight:bold;font-size:16px}.admin-item-list-row:nth-child(odd){background:#e3e3e5}.item-image{display:block;max-width:200px}.item-image-row{border-bottom:1px solid lightgray;padding-bottom:10px}
+#glm-admin-content-container .admin-item-label,#glm-admin-content-container .admin-item-input,#glm-admin-content-container .admin-item-list{padding:0}.admin-list-edit-item{padding:5px}.admin-list-edit-items{max-width:100px;float:right}@media (max-width: 641px){.admin-list-edit-items{margin:0 auto;float:none}}.itemTitle-record{float:left}.admin-new-item{margin-bottom:15px}.admin-new-item .admin-new-item-link{padding:5px;background:#3D84D0;color:white;text-decoration:none;border-radius:4px}.no-padding{padding:0}.no-margin{margin:0}#glm-admin-content-container .admin-item-list-header{margin-bottom:20px;padding-bottom:2px;border-bottom:1px solid lightgray}.admin-item-list-row{padding-bottom:5px}.item-company-list-header,.item-date-list-header,.item-title-list-header{font-weight:bold;font-size:16px}.admin-item-list-row:nth-child(odd){background:#e3e3e5}.item-image{display:block;max-width:200px}.item-image-row{border-bottom:1px solid lightgray;padding-bottom:10px}
/*# sourceMappingURL=admin.css.map */
-{"version":3,"file":"admin.css","sources":["admin.scss"],"sourcesContent":["#glm-admin-content-container .admin-item-label,\n#glm-admin-content-container .admin-item-input,\n#glm-admin-content-container .admin-item-list{\n padding: 0;\n}\n.itemTitle-record{\n float: left;\n}\n.admin-item-input textarea{\n \n}\n.admin-new-item{\n margin-bottom: 15px;\n}\n.admin-new-item .admin-new-item-link{\n padding: 5px;\n background: #3D84D0;\n color: white;\n text-decoration: none;\n border-radius: 4px;\n}\n.no-padding{\n padding: 0;\n}\n.no-margin{\n margin: 0;\n}\n#glm-admin-content-container .admin-item-list-header{\n margin-bottom: 20px;\n padding-bottom: 2px;\n border-bottom: 1px solid lightgray;\n}\n.admin-item-list-row{\n padding-bottom: 5px;\n/* border-bottom: 1px solid lightgray;*/\n}\n.item-company-list-header,.item-date-list-header, .item-title-list-header{\n font-weight: bold;\n font-size: 16px;\n}\n.admin-item-list-row:nth-child(odd){\n background: #e3e3e5;\n}\n.item-image{\n display: block;\n max-width: 200px;\n}\n.item-image-row{\n border-bottom: 1px solid lightgray;\n padding-bottom: 10px;\n}\n"],"names":[],"mappings":"AAAA,AAA6B,4BAAD,CAAC,iBAAiB,CAC9C,AAA6B,4BAAD,CAAC,iBAAiB,CAC9C,AAA6B,4BAAD,CAAC,gBAAgB,AAAA,CACzC,OAAO,CAAE,CAAC,CACb,AACD,AAAA,iBAAiB,AAAA,CACb,KAAK,CAAE,IAAI,CACd,AAID,AAAA,eAAe,AAAA,CACX,aAAa,CAAE,IAAI,CACtB,AACD,AAAgB,eAAD,CAAC,oBAAoB,AAAA,CAChC,OAAO,CAAE,GAAG,CACZ,UAAU,CAAE,OAAO,CACnB,KAAK,CAAE,KAAK,CACZ,eAAe,CAAE,IAAI,CACrB,aAAa,CAAE,GAAG,CACrB,AACD,AAAA,WAAW,AAAA,CACP,OAAO,CAAE,CAAC,CACb,AACD,AAAA,UAAU,AAAA,CACN,MAAM,CAAE,CAAC,CACZ,AACD,AAA6B,4BAAD,CAAC,uBAAuB,AAAA,CAChD,aAAa,CAAE,IAAI,CACnB,cAAc,CAAE,GAAG,CACnB,aAAa,CAAE,mBAAmB,CACrC,AACD,AAAA,oBAAoB,AAAA,CAChB,cAAc,CAAE,GAAG,CAEtB,AACD,AAAA,yBAAyB,CAAC,AAAA,sBAAsB,CAAE,AAAA,uBAAuB,AAAA,CACrE,WAAW,CAAE,IAAI,CACjB,SAAS,CAAE,IAAI,CAClB,AACD,AAAA,oBAAoB,AAAA,UAAW,CAAA,AAAA,GAAG,CAAC,CAC/B,UAAU,CAAE,OAAO,CACtB,AACD,AAAA,WAAW,AAAA,CACP,OAAO,CAAE,KAAK,CACd,SAAS,CAAE,KAAK,CACnB,AACD,AAAA,eAAe,AAAA,CACX,aAAa,CAAE,mBAAmB,CAClC,cAAc,CAAE,IAAI,CACvB"}
\ No newline at end of file
+{"version":3,"file":"admin.css","sources":["admin.scss"],"sourcesContent":["#glm-admin-content-container .admin-item-label,\n#glm-admin-content-container .admin-item-input,\n#glm-admin-content-container .admin-item-list{\n padding: 0;\n}\n.admin-list-edit-item{\n // float: right;\n padding: 5px;\n}\n.admin-list-edit-items{\n max-width: 100px;\n float: right;\n @media(max-width: 641px){\n margin: 0 auto;\n float: none;\n }\n}\n.itemTitle-record{\n float: left;\n}\n.admin-item-input textarea{\n \n}\n.admin-new-item{\n margin-bottom: 15px;\n}\n.admin-new-item .admin-new-item-link{\n padding: 5px;\n background: #3D84D0;\n color: white;\n text-decoration: none;\n border-radius: 4px;\n}\n.no-padding{\n padding: 0;\n}\n.no-margin{\n margin: 0;\n}\n#glm-admin-content-container .admin-item-list-header{\n margin-bottom: 20px;\n padding-bottom: 2px;\n border-bottom: 1px solid lightgray;\n}\n.admin-item-list-row{\n padding-bottom: 5px;\n/* border-bottom: 1px solid lightgray;*/\n}\n.item-company-list-header,.item-date-list-header, .item-title-list-header{\n font-weight: bold;\n font-size: 16px;\n}\n.admin-item-list-row:nth-child(odd){\n background: #e3e3e5;\n}\n.item-image{\n display: block;\n max-width: 200px;\n}\n.item-image-row{\n border-bottom: 1px solid lightgray;\n padding-bottom: 10px;\n}\n"],"names":[],"mappings":"AAAA,AAA6B,4BAAD,CAAC,iBAAiB,CAC9C,AAA6B,4BAAD,CAAC,iBAAiB,CAC9C,AAA6B,4BAAD,CAAC,gBAAgB,AAAA,CACzC,OAAO,CAAE,CAAC,CACb,AACD,AAAA,qBAAqB,AAAA,CAEjB,OAAO,CAAE,GAAG,CACf,AACD,AAAA,sBAAsB,AAAA,CAClB,SAAS,CAAE,KAAK,CAChB,KAAK,CAAE,KAAK,CAKf,AAJG,MAAM,EAAC,SAAS,EAAE,KAAK,EAH3B,AAAA,sBAAsB,AAAA,CAId,MAAM,CAAE,MAAM,CACd,KAAK,CAAE,IAAI,CAElB,CACD,AAAA,iBAAiB,AAAA,CACb,KAAK,CAAE,IAAI,CACd,AAID,AAAA,eAAe,AAAA,CACX,aAAa,CAAE,IAAI,CACtB,AACD,AAAgB,eAAD,CAAC,oBAAoB,AAAA,CAChC,OAAO,CAAE,GAAG,CACZ,UAAU,CAAE,OAAO,CACnB,KAAK,CAAE,KAAK,CACZ,eAAe,CAAE,IAAI,CACrB,aAAa,CAAE,GAAG,CACrB,AACD,AAAA,WAAW,AAAA,CACP,OAAO,CAAE,CAAC,CACb,AACD,AAAA,UAAU,AAAA,CACN,MAAM,CAAE,CAAC,CACZ,AACD,AAA6B,4BAAD,CAAC,uBAAuB,AAAA,CAChD,aAAa,CAAE,IAAI,CACnB,cAAc,CAAE,GAAG,CACnB,aAAa,CAAE,mBAAmB,CACrC,AACD,AAAA,oBAAoB,AAAA,CAChB,cAAc,CAAE,GAAG,CAEtB,AACD,AAAA,yBAAyB,CAAC,AAAA,sBAAsB,CAAE,AAAA,uBAAuB,AAAA,CACrE,WAAW,CAAE,IAAI,CACjB,SAAS,CAAE,IAAI,CAClB,AACD,AAAA,oBAAoB,AAAA,UAAW,CAAA,AAAA,GAAG,CAAC,CAC/B,UAAU,CAAE,OAAO,CACtB,AACD,AAAA,WAAW,AAAA,CACP,OAAO,CAAE,KAAK,CACd,SAAS,CAAE,KAAK,CACnB,AACD,AAAA,eAAe,AAAA,CACX,aAAa,CAAE,mBAAmB,CAClC,cAAc,CAAE,IAAI,CACvB"}
\ No newline at end of file
// echo '<pre>', print_r($this->getList()), '</pre>';
// Compile template data
$templateData = array(
- 'itemData' => $item_data,
- 'memberList' => $member_list,
- 'lockedToMember' => $lockedToMember,
- 'haveMember' => $haveMember,
- 'memberID' => $memberID,
- 'itemID' => $this->item_id,
- 'haveItem' => $haveItem,
- 'itemUpdated' => $itemUpdated,
- 'itemUpdateError' => $itemUpdateError,
- 'itemAdded' => $itemAdded,
- 'itemAddError' => $itemAddError,
- 'option' => $option,
- 'item' => $item,
- 'assetsUrl' => GLM_MEMBERS_FOR_SALE_PLUGIN_URL . 'assets/',
+ 'itemData' => $item_data,
+ 'memberList' => $member_list,
+ 'lockedToMember' => $lockedToMember,
+ 'haveMember' => $haveMember,
+ 'memberID' => $memberID,
+ 'itemID' => $this->item_id,
+ 'haveItem' => $haveItem,
+ 'itemUpdated' => $itemUpdated,
+ 'itemUpdateError' => $itemUpdateError,
+ 'itemAdded' => $itemAdded,
+ 'itemAddError' => $itemAddError,
+ 'option' => $option,
+ 'item' => $item,
+ 'assetsUrl' => GLM_MEMBERS_FOR_SALE_PLUGIN_URL . 'assets/',
);
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * Admin Development
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @version 0.1
+ */
+
+/**
+ * This class performs the work for the default action of the "Members" menu
+ * option, which is to display the members dashboard.
+ *
+ */
+class GlmMembersAdmin_management_itemsImport
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+
+ /**
+ * Constructor
+ *
+ * This contractor sets up this model. At this time that only includes
+ * storing away the WordPress data object.
+ *
+ * @return object Class object
+ *
+ */
+ public function __construct ($wpdb, $config)
+ {
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ }
+
+ public function addScheme($url, $scheme = 'http://')
+ {
+ return parse_url($url, PHP_URL_SCHEME) === null ?
+ $scheme . $url : $url;
+ }
+
+ /**
+ * Perform Model Action
+ *
+ * This method does the work for this model and returns any resulting data
+ *
+ * @return array Status and data array
+ *
+ * 'status'
+ *
+ * True if successful and false if there was a fatal failure.
+ *
+ * 'menuItemRedirect'
+ *
+ * If not false, provides a menu item the controller should
+ * execute after this one. Normally if this is used, there would also be a
+ * modelRedirect value supplied as well.
+ *
+ * 'modelRedirect'
+ *
+ * If not false, provides an action the controller should execute after
+ * this one.
+ *
+ * 'view'
+ *
+ * A suggested view name that the controller should use instead of the
+ * default view for this model or false to indicate that the default view
+ * should be used.
+ *
+ * 'data'
+ *
+ * Data that the model is returning for use in merging with the view to
+ * produce output.
+ *
+ */
+ public function modelAction ($actionData = false)
+ {
+
+
+ $resultMessage = '';
+ $success = false;
+ $haveMembers = false;
+ $import = false;
+ $importNotice = '';
+ $option = '';
+
+ if (isset($_REQUEST['option']) && $_REQUEST['option'] != '') {
+ $option = $_REQUEST['option'];
+ }
+
+ switch($option) {
+ case 'upload_file':
+ // We're given a CSV file.
+ // We need to parse it out. File must have header line.
+ // $file_data = $file_headers = $data = $members = array();
+
+ // if ( isset( $_FILES ) && isset( $_FILES['file_upload'] ) && ( $fh = fopen( $_FILES['file_upload']['tmp_name'], 'r' ) ) !== false ) {
+ // $row = 0;
+ // while( ( $data = fgetcsv( $fh, 1000, ',' ) ) !== false ) {
+ // if ( $row === 0 ) {
+ // // First row grab as headers.
+ // $file_headers = $data;
+ // } else {
+ // // All other rows are data.
+ // $file_data[] = array_combine( $file_headers, $data );
+ // }
+ // $row++;
+ // }
+ // fclose( $fh );
+ // }
+ // $resultMessage .= $this->importMemberData( $file_data );
+ //$resultMessage .= '<pre>$file_data: ' . print_r( $file_data, true ) . '</pre>';
+ break;
+
+ case 'importItems':
+ $table = GLM_MEMBERS_FOR_SALE_PLUGIN_DB_PREFIX . 'items';
+ require_once GLM_MEMBERS_PLUGIN_PATH.'/models/admin/ajax/imageUpload.php';
+ $ImageUpload = new GlmMembersAdmin_ajax_imageUpload($this->wpdb, $this->config);
+
+ $img_src = "http://is0.gaslightmedia.com/migcsa/CKImage/";
+
+ define('BASE_URL', 'http://www.migcsa.org');
+ define('PG_DSN', 'pgsql: host=ds4 dbname=migcsa2_update user=postgres');
+
+ try {
+ $dsn = PG_DSN;
+ $driverOptions = array(
+ PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
+ );
+ $dbh = new PDO($dsn, null, null, $driverOptions);
+ $dbh->setAttribute(
+ PDO::ATTR_ERRMODE,
+ PDO::ERRMODE_EXCEPTION
+ );
+
+ // FOR SALE
+ $forsale_sql = "SELECT * FROM forsale;";
+ $stmt = $dbh->query($forsale_sql);
+ $forsale = $stmt->fetchAll(PDO::FETCH_ASSOC);
+ // $count = 0;
+ foreach($forsale as $key=>$value){
+
+ // process the expiration values
+ if( $value['post'] == "30days" ){
+ $post_exp = 30;
+ } else if( $value['post'] == "60days" ){
+ $post_exp = 60;
+ } else if( $value['post'] == "120days" ){
+ $post_exp = 120;
+ }
+
+ // check for images
+ if($value['img']){
+ $res = $img_src . $value['img'];
+ $parts = pathinfo($value['img']);
+ if($parts['extension']){
+ $image_1 = $ImageUpload->storeImage($res);
+ }
+
+ }
+ if($value['img2']){
+ $res = $img_src . $value['img2'];
+ $parts = pathinfo($value['img2']);
+ if($parts['extension']){
+ $image_2 = $ImageUpload->storeImage($res);
+ }
+ }
+ if($value['img3']){
+ $res = $img_src . $value['img3'];
+ $parts = pathinfo($value['img3']);
+ if($parts['extension']){
+ $image_3 = $ImageUpload->storeImage($res);
+ }
+ }
+
+ $this->wpdb->insert( $table,
+ array(
+ 'old_id' =>$value['id'],
+ 'title' =>$value['title'],
+ 'topic' =>$value['topicid'],
+ 'descr' =>$value['descr'],
+ 'item_expiration' =>$post_exp,
+ 'location' =>$value['location'],
+ 'contact_email' =>$value['contactemail'],
+ 'contact_name' =>$value['contactname'],
+ 'contact_phone' =>$value['contactphone'],
+ 'visible' =>$value['visable'],
+ 'company' =>$value['company'],
+ 'terms' =>$value['terms'],
+ 'post_date' =>$value['ds'],
+ 'member' =>$value['member'],
+ 'image_1' => $image_1['newFileName'],
+ 'image_2' =>$image_2['newFileName'],
+ 'image_3' =>$image_3['newFileName'],
+ ),
+ array(
+ '%d',
+ '%s',
+ '%d',
+ '%s',
+ '%s',
+ '%s',
+ '%s',
+ '%s',
+ '%s',
+ '%s',
+ '%s',
+ '%s',
+ '%s',
+ '%d',
+ '%s',
+ '%s',
+ '%s',
+ )
+ );
+ // $count++;
+ }
+
+ // $forsale_topic_sql = "SELECT * FROM forsale_topic;";
+ // $stmt = $dbh->query($forsale_topic_sql);
+ // $forsale_topic = $stmt->fetchAll(PDO::FETCH_ASSOC);
+ // foreach($forsale_topic as $key=>$value){
+
+ // }
+
+ } catch(PDOException $e) {
+ echo '<pre>'.print_r($e, true).'</pre>';
+ }
+
+ if ( isset( $_REQUEST['start'] ) ) {
+ $start = filter_var( $_REQUEST['start'], FILTER_VALIDATE_INT );
+ } else {
+ $start = 0;
+ }
+ // global $wpdb;
+
+
+ $url = get_site_url() . '/wp-admin/admin.php?page=glm-members-admin-menu-management&glm_action=itemImport&option=importItems';
+ $limit = 200;
+
+ // $sql = "SELECT name,mother_name,misc_info, courier_date FROM chxctyitem LIMIT $limit OFFSET $start";
+ // $items = $wpdb->get_results( $sql, ARRAY_A );
+
+ $count = 0;
+ // foreach($items as $column=>$data ){
+ // $count++;
+ // // $insert = array();
+
+ // }
+// echo '<pre>', print_r($insert), '</pre>';
+ // $wpdb->insert($table, $insert);
+
+ $resultMessage = "<pre>Start: $start</pre>";
+ $start += $limit;
+ $resultMessage .= "<p><a class='next-import-btn' href=\"". $url . "&limit=$limit&start=$start\">Next</a></p>";
+
+ break;
+
+ default:
+ break;
+ }
+
+ $templateData = array(
+ 'success' => $success,
+ 'option' => $option,
+ 'resultMessage' => $resultMessage
+ );
+
+ // Return status, suggested view, and data to controller
+ return array(
+ 'status' => true,
+ 'menuItemRedirect' => false,
+ 'modelRedirect' => false,
+ 'view' => 'admin/management/itemsImport.html',
+ 'data' => $templateData
+ );
+ }
+}
#glm-admin-content-container .admin-item-list{
padding: 0;
}
+.admin-list-edit-item{
+ // float: right;
+ padding: 5px;
+}
+.admin-list-edit-items{
+ max-width: 100px;
+ float: right;
+ @media(max-width: 641px){
+ margin: 0 auto;
+ float: none;
+ }
+}
.itemTitle-record{
float: left;
}
* );
*
-} */
\ No newline at end of file
+} */
+if (apply_filters('glm_members_permit_admin_members_management_tab', true)) {
+
+ add_filter('glm-member-db-add-tab-for-management',
+ function($addOnTabs) {
+ $newTabs = array(
+ array(
+ 'text' => 'For Sale Import',
+ 'menu' => 'management',
+ 'action' => 'itemsImport'
+ ),
+ );
+ $addOnTabs = array_merge($addOnTabs, $newTabs);
+ return $addOnTabs;
+ }
+ );
+}
\ No newline at end of file
-- Conditions Table
CREATE TABLE {prefix}items (
id INT NOT NULL AUTO_INCREMENT,
+ old_id int NULL ,
topic int NULL ,
title TEXT NULL ,
company TINYTEXT NULL ,
-- default entries in table
INSERT INTO {prefix}items (
-id,title,descr,topic,contact_email,contact_name,contact_phone,post_date,visible,
+id,old_id,title,descr,topic,contact_email,contact_name,contact_phone,post_date,visible,
terms,location,item_expiration,image_3,post,image_1,
company,member,image_2
-) VALUES ( 1, "TITLE", "DESCR", 1, "CONTACT_EMAIL", "CONTACT_NAME", "CONTACT_PHONE", NOW(), true, "TERMS", "LOCATION", 60, "IMAGE_3.jpg", "POST",
+) VALUES ( 1, 1,"TITLE", "DESCR", 1, "CONTACT_EMAIL", "CONTACT_NAME", "CONTACT_PHONE", NOW(), true, "TERMS", "LOCATION", 60, "IMAGE_3.jpg", "POST",
"IMAGE_1.jpg", "COMPANY", 1, "IMAGE_2.jpg"
);
\ No newline at end of file
'forSale' => array(
'index' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG,
),
+ 'management' => array(
+ 'itemsImport' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG, // General Options
+ ),
),
'frontActions' => array(
'forSale' => array(
<div class="item-date-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.item_expiration.name}</div>
</div>
</div>
- <div class="glm-small-12 glm-columns admin-item-list">
- <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=edit&item={$data.id}">Edit</a>
- <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=delete&item={$data.id}">Delete</a>
+ <div class="glm-small-12 glm-columns admin-item-list admin-list-edit-items">
+ <a class="admin-list-edit-item" href="{$thisUrl}?page={$thisPage}&glm_action=index&option=edit&item={$data.id}">Edit</a>
+ <a class="admin-list-edit-item" href="{$thisUrl}?page={$thisPage}&glm_action=index&option=delete&item={$data.id}">Delete</a>
</div>
</div>
{/foreach}
--- /dev/null
+{include file='admin/management/header.html'}
+
+<h2>For Sale Importer</h2>
+
+{if $option == ''}
+<form action="{$thisUrl}?page={$thisPage}&glm_action=obitImport&option=upload_file" method="post" enctype="multipart/form-data">
+ <!-- <input type="submit" class="button"> -->
+</form>
+<p><a href="{$thisUrl}?page={$thisPage}&glm_action=itemsImport&option=importItems">Import For Sale Items</a></p>
+{/if}
+
+{if $resultMessage}
+ {$resultMessage}
+{/if}
+
+{include file='admin/footer.html'}
</div>
<div class="glm-row item-detail-images">
<div class="glm-small-12 glm-medium-4 glm-columns image-1-detail">
- <a class="item-detail-image" data-fancybox data-src="{$glmPluginMediaUrl}/images/large/{$itemData.image_1}">
+ <a data-fancybox="images" rel="detail-gallery" class="item-detail-image fancybox" data-fancybox data-src="{$glmPluginMediaUrl}/images/large/{$itemData.image_1}" href="{$glmPluginMediaUrl}/images/large/{$itemData.image_1}">
<img class="detail-image" src="{$glmPluginMediaUrl}/images/medium/{$itemData.image_1}" alt="">
</a>
</div>
<div class="glm-small-12 glm-medium-4 glm-columns image-2-detail">
- <a class="item-detail-image" data-fancybox data-src="{$glmPluginMediaUrl}/images/large/{$itemData.image_2}">
+ <a data-fancybox="images" rel="detail-gallery" class="item-detail-image fancybox" data-fancybox data-src="{$glmPluginMediaUrl}/images/large/{$itemData.image_2}" href="{$glmPluginMediaUrl}/images/large/{$itemData.image_2}">
<img class="detail-image" src="{$glmPluginMediaUrl}/images/medium/{$itemData.image_2}" alt="">
</a>
</div>
<div class="glm-small-12 glm-medium-4 glm-columns image-3-detail">
- <a class="item-detail-image" data-fancybox data-src="{$glmPluginMediaUrl}/images/large/{$itemData.image_3}">
+ <a data-fancybox="images" rel="detail-gallery" class="item-detail-image fancybox" data-fancybox data-src="{$glmPluginMediaUrl}/images/large/{$itemData.image_3}" href="{$glmPluginMediaUrl}/images/large/{$itemData.image_3}">
<img class="detail-image" src="{$glmPluginMediaUrl}/images/medium/{$itemData.image_3}" alt="">
</a>
</div>
</div>
<script>
jQuery(function($){
- $('.item-detail-image').fancybox({
- fitToView: true
- });
+ $('a.item-detail-image').fancybox();
});
</script>