* PHP version 5.5
*
* @category glmWordPressPlugin
- * @package glmMembersBuySell
+ * @package glmMembersForSale
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
* @release activate.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
* Currently the only actions are to add role capability to display and modify
* prototypes.
*/
-class glmMembersBuySellPluginActivate
+class glmMembersForSalePluginActivate
{
/**
$this->config = $config;
// Set current plugin version
- update_option('glmMembersBuySellPluginVersion', GLM_MEMBERS_BUY_SELL_PLUGIN_VERSION);
+ update_option('glmMembersForSalePluginVersion', GLM_MEMBERS_FOR_SALE_PLUGIN_VERSION);
// Set Roles and Capabilities for this plugin
- require_once GLM_MEMBERS_BUY_SELL_PLUGIN_SETUP_PATH.'/rolesAndCapabilities.php';
+ require_once GLM_MEMBERS_FOR_SALE_PLUGIN_SETUP_PATH.'/rolesAndCapabilities.php';
}
/*
+++ /dev/null
-<?php
-/**
- * GLM Member-DB WordPress Add-On Plugin
- * Data Class Buy Sell Postings
- *
- * PHP version 5.3
- *
- * @category Data
- * @package GLM Member-DB
- * @author Chuck Scott <cscott@gaslightmedia.com>
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @release SVN: $Id: dataConditions.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
- */
-
-/**********************************************************************
- * NOTE: THIS IS A Buy Sell Postings FILE - DO NOT USE UNMODIFIED
- *
- * Please change all references to conditions, Conditions, or CONDITIONS to a name
- * appropriate for your new Add-On.
- *
- * Data fields in this file are conditions only.
- *
- * Remove this message before using this file in production!
- **********************************************************************/
-
-/**
- * GlmDataBuy Sells class
- *
- * PHP version 5
- *
- * @category Data
- * @package GLM Member DB
- * @author Chuck Scott <cscott@gaslightmedia.com>
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott
- * Exp $
- */
-class GlmDataBuySell extends GlmDataAbstract
-{
-
- /**
- * WordPress Database Object
- *
- * @var $wpdb
- * @access public
- */
- public $wpdb;
- /**
- * Plugin Configuration Data
- *
- * @var $config
- * @access public
- */
- public $config;
- /**
- * Data Table Name
- *
- * @var $table
- * @access public
- */
- public $table;
- /**
- * Field definitions
- *
- * 'type' is type of field as defined by the application
- * text Regular text field
- * pointer Pointer to an entry in another table
- * 'filters' is the filter name for a particular filter ID in PHP filter
- * functions
- * See PHP filter_id()
- *
- * 'use' is when to use the field
- * l = List
- * g = Get
- * n = New
- * i = Insert
- * e = Edit
- * u = Update
- * d = Delete
- * a = All
- *
- * @var $ini
- * @access public
- */
- public $fields = false;
-
- /**
- * Constructor
- *
- * @param object $d database connection
- * @param array $config Configuration array
- * @param bool $limitedEdit Flag to say indicate limited edit requested
- *
- * @return void
- * @access public
- */
- public function __construct($wpdb, $config, $limitedEdit = false)
- {
-
- // If this class is not being extended along with existing $wpdb and $config
- if (!$this->wpdb) {
-
- // Save WordPress Database object
- $this->wpdb = $wpdb;
-
- // Save plugin configuration object
- $this->config = $config;
-
- }
-
- /*
- * Table Name
- */
-
- $this->table = GLM_MEMBERS_BUY_SELL_PLUGIN_DB_PREFIX . 'items';
-
- // -- Conditions Table
- //CREATE TABLE {prefix}conditions (
- // id INT NOT NULL AUTO_INCREMENT,
- // name TEXT NOT NULL,
- // descr_short TEXT NULL,
- // descr TEXT NULL,
- // last_update DATE NULL,
- // PRIMARY KEY (id)
- //);
-
- /*
- * Table Data Fields
- */
-
- $this->fields = array (
-
- 'id' => array (
- 'field' => 'id',
- 'type' => 'integer',
- 'view_only' => true,
- 'use' => 'a'
- ),
- 'topic' => array (
- 'field' => 'topic',
- 'type' => 'list',
- 'list' => $this->config['topics'],
- 'default' => 'For Sale',
- 'force_list' => true,
- 'use' => 'a'
- ),
- 'title' => array (
- 'field' => 'title',
- 'type' => 'text',
- 'use' => 'a'
- ),
- 'descr' => array (
- 'field' => 'descr',
- 'type' => 'text',
- 'use' => 'a'
- ),
- 'terms' => array (
- 'field' => 'terms',
- 'type' => 'text',
- 'use' => 'a'
- ),
- 'contact_email' => array (
- 'field' => 'contact_email',
- 'type' => 'text',
- 'use' => 'a'
- ),
- 'contact_name' => array (
- 'field' => 'contact_name',
- 'type' => 'text',
- 'use' => 'a'
- ),
- 'contact_phone' => array (
- 'field' => 'contact_phone',
- 'type' => 'text',
- 'use' => 'a'
- ),
- 'post_date' => array (
- 'field' => 'post_date',
- 'type' => 'datetime',
- 'use' => 'lge'
- ),
- 'visible' => array (
- 'field' => 'visible',
- 'type' => 'checkbox',
- 'use' => 'a'
- ),
- 'post' => array (
- 'field' => 'post',
- 'type' => 'text',
- 'use' => 'a'
- ),
- 'location' => array (
- 'field' => 'location',
- 'type' => 'text',
- 'use' => 'a'
- ),
- 'item_expiration' => array (
- 'field' => 'item_expiration',
- 'type' => 'list',
- 'list' => $this->config['item_expiration'],
- 'default' => '120 Days',
- 'force_list' => true,
- 'use' => 'a'
- ),
- 'image_1' => array (
- 'field' => 'image_1',
- 'type' => 'image',
- 'use' => 'a'
- ),
- 'image_2' => array (
- 'field' => 'image_2',
- 'type' => 'image',
- 'use' => 'a'
- ),
- 'company' => array (
- 'field' => 'company',
- 'type' => 'text',
- 'use' => 'a'
- ),
- 'image_3' => array (
- 'field' => 'image_3',
- 'type' => 'image',
- 'use' => 'a'
- ),
- 'member' => array (
- 'field' => 'member',
- 'type' => 'pointer',
- 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'members',
- 'p_field' => 'name',
- 'p_orderby' => 'name',
- 'use' => 'a'
- ),
- );
- }
-
- /*
- * Entry Post Processing Call-Back Method
- *
- * Perform post-processing for all result entries.
- *
- * In this case we're using it to append an array of category
- * data to each row result and also sort by name.
- *
- * @param array $r Array of field result data for a single entry
- * @param string $a Action being performed (l, i, g, ...)
- *
- * @return object Class object
- *
- */
- public function entryPostProcessing($r, $a)
- {
- return $r;
- }
-
-}
-
-?>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * GLM Member-DB WordPress Add-On Plugin
+ * Data Class Buy Sell Postings
+ *
+ * PHP version 5.3
+ *
+ * @category Data
+ * @package GLM Member-DB
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release SVN: $Id: dataConditions.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ */
+
+/**********************************************************************
+ * NOTE: THIS IS A Buy Sell Postings FILE - DO NOT USE UNMODIFIED
+ *
+ * Please change all references to conditions, Conditions, or CONDITIONS to a name
+ * appropriate for your new Add-On.
+ *
+ * Data fields in this file are conditions only.
+ *
+ * Remove this message before using this file in production!
+ **********************************************************************/
+
+/**
+ * GlmDataBuy Sells class
+ *
+ * PHP version 5
+ *
+ * @category Data
+ * @package GLM Member DB
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott
+ * Exp $
+ */
+class GlmDataForSale extends GlmDataAbstract
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * Data Table Name
+ *
+ * @var $table
+ * @access public
+ */
+ public $table;
+ /**
+ * Field definitions
+ *
+ * 'type' is type of field as defined by the application
+ * text Regular text field
+ * pointer Pointer to an entry in another table
+ * 'filters' is the filter name for a particular filter ID in PHP filter
+ * functions
+ * See PHP filter_id()
+ *
+ * 'use' is when to use the field
+ * l = List
+ * g = Get
+ * n = New
+ * i = Insert
+ * e = Edit
+ * u = Update
+ * d = Delete
+ * a = All
+ *
+ * @var $ini
+ * @access public
+ */
+ public $fields = false;
+
+ /**
+ * Constructor
+ *
+ * @param object $d database connection
+ * @param array $config Configuration array
+ * @param bool $limitedEdit Flag to say indicate limited edit requested
+ *
+ * @return void
+ * @access public
+ */
+ public function __construct($wpdb, $config, $limitedEdit = false)
+ {
+
+ // If this class is not being extended along with existing $wpdb and $config
+ if (!$this->wpdb) {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ }
+
+ /*
+ * Table Name
+ */
+
+ $this->table = GLM_MEMBERS_FOR_SALE_PLUGIN_DB_PREFIX . 'items';
+
+ // -- Conditions Table
+ //CREATE TABLE {prefix}conditions (
+ // id INT NOT NULL AUTO_INCREMENT,
+ // name TEXT NOT NULL,
+ // descr_short TEXT NULL,
+ // descr TEXT NULL,
+ // last_update DATE NULL,
+ // PRIMARY KEY (id)
+ //);
+
+ /*
+ * Table Data Fields
+ */
+
+ $this->fields = array (
+
+ 'id' => array (
+ 'field' => 'id',
+ 'type' => 'integer',
+ 'view_only' => true,
+ 'use' => 'a'
+ ),
+ 'topic' => array (
+ 'field' => 'topic',
+ 'type' => 'list',
+ 'list' => $this->config['topics'],
+ 'default' => 'For Sale',
+ 'force_list' => true,
+ 'use' => 'a'
+ ),
+ 'title' => array (
+ 'field' => 'title',
+ 'type' => 'text',
+ 'use' => 'a'
+ ),
+ 'descr' => array (
+ 'field' => 'descr',
+ 'type' => 'text',
+ 'use' => 'a'
+ ),
+ 'terms' => array (
+ 'field' => 'terms',
+ 'type' => 'text',
+ 'use' => 'a'
+ ),
+ 'contact_email' => array (
+ 'field' => 'contact_email',
+ 'type' => 'text',
+ 'use' => 'a'
+ ),
+ 'contact_name' => array (
+ 'field' => 'contact_name',
+ 'type' => 'text',
+ 'use' => 'a'
+ ),
+ 'contact_phone' => array (
+ 'field' => 'contact_phone',
+ 'type' => 'text',
+ 'use' => 'a'
+ ),
+ 'post_date' => array (
+ 'field' => 'post_date',
+ 'type' => 'datetime',
+ 'use' => 'lge'
+ ),
+ 'visible' => array (
+ 'field' => 'visible',
+ 'type' => 'checkbox',
+ 'use' => 'a'
+ ),
+ 'post' => array (
+ 'field' => 'post',
+ 'type' => 'text',
+ 'use' => 'a'
+ ),
+ 'location' => array (
+ 'field' => 'location',
+ 'type' => 'text',
+ 'use' => 'a'
+ ),
+ 'item_expiration' => array (
+ 'field' => 'item_expiration',
+ 'type' => 'list',
+ 'list' => $this->config['item_expiration'],
+ 'default' => '120 Days',
+ 'force_list' => true,
+ 'use' => 'a'
+ ),
+ 'image_1' => array (
+ 'field' => 'image_1',
+ 'type' => 'image',
+ 'use' => 'a'
+ ),
+ 'image_2' => array (
+ 'field' => 'image_2',
+ 'type' => 'image',
+ 'use' => 'a'
+ ),
+ 'company' => array (
+ 'field' => 'company',
+ 'type' => 'text',
+ 'use' => 'a'
+ ),
+ 'image_3' => array (
+ 'field' => 'image_3',
+ 'type' => 'image',
+ 'use' => 'a'
+ ),
+ 'member' => array (
+ 'field' => 'member',
+ 'type' => 'pointer',
+ 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'members',
+ 'p_field' => 'name',
+ 'p_orderby' => 'name',
+ 'use' => 'a'
+ ),
+ );
+ }
+
+ /*
+ * Entry Post Processing Call-Back Method
+ *
+ * Perform post-processing for all result entries.
+ *
+ * In this case we're using it to append an array of category
+ * data to each row result and also sort by name.
+ *
+ * @param array $r Array of field result data for a single entry
+ * @param string $a Action being performed (l, i, g, ...)
+ *
+ * @return object Class object
+ *
+ */
+ public function entryPostProcessing($r, $a)
+ {
+ return $r;
+ }
+
+}
+
+?>
\ No newline at end of file
-.no-padding{padding:0}body .front-item-listings-wrapper{margin-top:20px}body .front-item-listings-wrapper .item-detail-wrapper .front-title{font-weight:bold;font-size:20px}body .front-item-listings-wrapper .item-detail-wrapper div{float:none !important;line-height:1.1;margin:8px 8px 8px 0}body .front-item-listings-wrapper span{font-weight:bold}body .front-item-listings-wrapper .front-item-list-row{margin-bottom:20px}body .front-item-listings-wrapper .front-item-list-row .item-title-list span{font-size:20px}body .front-item-listings-wrapper .item-title-search #item_title_dropdown{max-width:450px}body .front-item-listings-wrapper .item-title-search .item-title-button{height:39px}@media screen and (max-width: 641px){body .front-item-listings-wrapper .item-title-button{display:block;max-width:100px;margin:0 auto}body .front-item-listings-wrapper .front-item-search{margin-bottom:20px}}@media (min-width: 639px) and (max-width: 1025px){body .front-item-listings-wrapper .item-title-button{display:inline-block;margin:0 0 0 10px}}@media (min-width: 1023px){body .front-item-listings-wrapper .item-title-button{display:inline-block;margin:0 0 0 10px}}
+.no-padding{padding:0}.front-item-list-wrapper span{font-weight:bold}.front-item-list-wrapper .front-list-item{padding:10px 0;border-bottom:1px solid lightgray}.front-item-list-wrapper div{line-height:1.1;padding:5px}.front-item-list-wrapper .front-list-topic{padding:5px;width:100px;text-align:center;color:white;border-radius:5px;margin-bottom:10px}.front-item-list-wrapper .item-wanted{background:green}.front-item-list-wrapper .item-sale{background:red}
/*# sourceMappingURL=front.css.map */
-{"version":3,"file":"front.css","sources":["front.scss"],"sourcesContent":[".no-padding{\n padding: 0;\n}\n\nbody .front-item-listings-wrapper {\n .item-detail-wrapper{\n .front-title{\n font-weight: bold;\n font-size: 20px;\n }\n div{\n float: none !important;\n line-height: 1.1;\n margin: 8px 8px 8px 0;\n }\n }\n // .front-item-search{\n // max-width: 530px;\n // margin: 0 auto;\n // }\n margin-top: 20px;\n span{\n font-weight: bold;\n }\n \n .front-item-list-row{\n margin-bottom: 20px;\n .item-title-list{\n span{\n font-size: 20px;\n }\n }\n\n }\n .item-title-search{\n #item_title_dropdown{\n max-width: 450px;\n }\n .item-title-button{\n height: 39px;\n }\n }\n \n @media screen and (max-width: 641px){\n .item-title-button{\n display: block;\n max-width: 100px;\n margin: 0 auto;\n }\n .front-item-search{\n margin-bottom: 20px;\n }\n }\n @media (min-width: 639px) and (max-width: 1025px){\n .item-title-button{\n display: inline-block;\n margin: 0 0 0 10px;\n }\n }\n @media (min-width: 1023px){\n .item-title-button{\n display: inline-block;\n margin: 0 0 0 10px;\n } \n }\n}"],"names":[],"mappings":"AAAA,AAAA,WAAW,AAAA,CACP,OAAO,CAAE,CAAC,CACb,AAED,AAAK,IAAD,CAAC,4BAA4B,AAAC,CAgB9B,UAAU,CAAE,IAAI,CA6CnB,AA7DD,AAEQ,IAFJ,CAAC,4BAA4B,CAC7B,oBAAoB,CAChB,YAAY,AAAA,CACR,WAAW,CAAE,IAAI,CACjB,SAAS,CAAE,IAAI,CAClB,AALT,AAMO,IANH,CAAC,4BAA4B,CAC7B,oBAAoB,CAKjB,GAAG,AAAA,CACC,KAAK,CAAE,eAAe,CACtB,WAAW,CAAE,GAAG,CAChB,MAAM,CAAE,aAAa,CACxB,AAVR,AAiBI,IAjBA,CAAC,4BAA4B,CAiB7B,IAAI,AAAA,CACA,WAAW,CAAE,IAAI,CACpB,AAnBL,AAqBI,IArBA,CAAC,4BAA4B,CAqB7B,oBAAoB,AAAA,CAChB,aAAa,CAAE,IAAI,CAOtB,AA7BL,AAwBY,IAxBR,CAAC,4BAA4B,CAqB7B,oBAAoB,CAEhB,gBAAgB,CACZ,IAAI,AAAA,CACA,SAAS,CAAE,IAAI,CAClB,AA1Bb,AA+BQ,IA/BJ,CAAC,4BAA4B,CA8B7B,kBAAkB,CACd,oBAAoB,AAAA,CAChB,SAAS,CAAE,KAAK,CACnB,AAjCT,AAkCQ,IAlCJ,CAAC,4BAA4B,CA8B7B,kBAAkB,CAId,kBAAkB,AAAA,CACd,MAAM,CAAE,IAAI,CACf,AAGL,MAAM,CAAC,MAAM,MAAM,SAAS,EAAE,KAAK,EAvCvC,AAwCQ,IAxCJ,CAAC,4BAA4B,CAwCzB,kBAAkB,AAAA,CACd,OAAO,CAAE,KAAK,CACd,SAAS,CAAE,KAAK,CAChB,MAAM,CAAE,MAAM,CACjB,AA5CT,AA6CQ,IA7CJ,CAAC,4BAA4B,CA6CzB,kBAAkB,AAAA,CACd,aAAa,CAAE,IAAI,CACtB,CAEL,MAAM,EAAE,SAAS,EAAE,KAAK,OAAO,SAAS,EAAE,MAAM,EAjDpD,AAkDQ,IAlDJ,CAAC,4BAA4B,CAkDzB,kBAAkB,AAAA,CACd,OAAO,CAAE,YAAY,CACrB,MAAM,CAAE,UAAU,CACrB,CAEL,MAAM,EAAE,SAAS,EAAE,MAAM,EAvD7B,AAwDQ,IAxDJ,CAAC,4BAA4B,CAwDzB,kBAAkB,AAAA,CACd,OAAO,CAAE,YAAY,CACrB,MAAM,CAAE,UAAU,CACrB"}
\ No newline at end of file
+{"version":3,"file":"front.css","sources":["front.scss"],"sourcesContent":[".no-padding{\n padding: 0;\n}\n.front-item-list-wrapper{\n span{\n font-weight: bold;\n }\n .front-list-item{\n padding: 10px 0;\n border-bottom: 1px solid lightgray;\n }\n div{\n line-height: 1.1;\n padding: 5px;\n }\n .front-list-topic{\n padding: 5px;\n width: 100px;\n text-align: center;\n color: white;\n border-radius: 5px;\n margin-bottom: 10px;\n }\n .item-wanted{\n background: green;\n }\n .item-sale{\n background: red;\n }\n}"],"names":[],"mappings":"AAAA,AAAA,WAAW,AAAA,CACP,OAAO,CAAE,CAAC,CACb,AACD,AACI,wBADoB,CACpB,IAAI,AAAA,CACA,WAAW,CAAE,IAAI,CACpB,AAHL,AAII,wBAJoB,CAIpB,gBAAgB,AAAA,CACZ,OAAO,CAAE,MAAM,CACf,aAAa,CAAE,mBAAmB,CACrC,AAPL,AAQI,wBARoB,CAQpB,GAAG,AAAA,CACC,WAAW,CAAE,GAAG,CAChB,OAAO,CAAE,GAAG,CACf,AAXL,AAYI,wBAZoB,CAYpB,iBAAiB,AAAA,CACb,OAAO,CAAE,GAAG,CACZ,KAAK,CAAE,KAAK,CACZ,UAAU,CAAE,MAAM,CAClB,KAAK,CAAE,KAAK,CACZ,aAAa,CAAE,GAAG,CAClB,aAAa,CAAE,IAAI,CACtB,AAnBL,AAoBI,wBApBoB,CAoBpB,YAAY,AAAA,CACR,UAAU,CAAE,KAAK,CACpB,AAtBL,AAuBI,wBAvBoB,CAuBpB,UAAU,AAAA,CACN,UAAU,CAAE,GAAG,CAClB"}
\ No newline at end of file
* PHP version 5.5
*
* @category glmWordPressPlugin
- * @package glmMembersBuySell
+ * @package glmMembersForSale
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
* @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
* This class performs all necessary additional work when this
* plugin is deactivated.
*/
-class glmMembersBuySellPluginDeactivate
+class glmMembersForSalePluginDeactivate
{
/**
$this->config = $config;
// Delete our version from WordPress Options
- delete_option('glmMembersBuySellPluginVersion');
+ delete_option('glmMembersForSalePluginVersion');
}
}
// NOTE: Plugin & Database versions are defined in "/glm-member-db.php".
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_NAME', 'GLM Members Database Buy Sell');
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_SHORT_NAME', 'Buy Sell');
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG', 'glm-member-db-buy-sell');
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_NAME', 'GLM Members Database For Sale');
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_SHORT_NAME', 'For Sale');
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG', 'glm-member-db-for-sale');
// Database table prefixes - change if using add-on tables
global $wpdb;
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_DB_PREFIX', $wpdb->prefix.'glm_membersBuySell_');
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_ACTIVE_DB_OPTION', 'glmMembersBuySellDbVersion');
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_DB_PREFIX', $wpdb->prefix.'glm_membersForSale_');
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_ACTIVE_DB_OPTION', 'glmMembersForSaleDbVersion');
// Determine which system we're running on - If not provided, assume PRODUCTION
$host = getenv('GLM_HOST_ID');
if (trim($host) == '') {
$host = 'PRODUCTION';
}
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_HOST', $host);
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_HOST', $host);
// Determine current http/https protocol
$pageProtocol = 'http';
if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443') {
$pageProtocol = 'https';
}
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_HTTP_PROTOCOL', $pageProtocol);
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_HTTP_PROTOCOL', $pageProtocol);
// Get various pieces of the URL
$urlParts = parse_url(get_bloginfo('url'));
* Create a copy of the plugin slug that can be used as a variable prefix used to keep
* global instances from clashing with instances in other plugins.
*/
-$vprefix = str_replace('-', '_', GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG);
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_PREFIX', $vprefix.'_');
+$vprefix = str_replace('-', '_', GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG);
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_PREFIX', $vprefix.'_');
// URLs
-define('GLM_MEMBERS_BUY_SELL_SITE_BASE_URL', home_url('/') );
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_URL', plugin_dir_url(__FILE__));
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_ADMIN_URL', admin_url('admin.php'));
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_BASE_URL', WP_PLUGIN_URL.'/'.GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG);
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_CURRENT_URL', $urlParts['scheme'].'://'.$urlParts['host'].$pageUri[0]);
+define('GLM_MEMBERS_FOR_SALE_SITE_BASE_URL', home_url('/') );
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_URL', plugin_dir_url(__FILE__));
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_ADMIN_URL', admin_url('admin.php'));
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_BASE_URL', WP_PLUGIN_URL.'/'.GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG);
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_CURRENT_URL', $urlParts['scheme'].'://'.$urlParts['host'].$pageUri[0]);
// Directories
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_PATH', dirname(__FILE__));
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_SETUP_PATH', GLM_MEMBERS_BUY_SELL_PLUGIN_PATH.'/setup');
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_DB_SCRIPTS', GLM_MEMBERS_BUY_SELL_PLUGIN_SETUP_PATH.'/databaseScripts');
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_CLASS_PATH', GLM_MEMBERS_BUY_SELL_PLUGIN_PATH.'/classes');
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_CONFIG_PATH', GLM_MEMBERS_BUY_SELL_PLUGIN_PATH.'/config');
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_PATH', dirname(__FILE__));
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_SETUP_PATH', GLM_MEMBERS_FOR_SALE_PLUGIN_PATH.'/setup');
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_DB_SCRIPTS', GLM_MEMBERS_FOR_SALE_PLUGIN_SETUP_PATH.'/databaseScripts');
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_CLASS_PATH', GLM_MEMBERS_FOR_SALE_PLUGIN_PATH.'/classes');
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_CONFIG_PATH', GLM_MEMBERS_FOR_SALE_PLUGIN_PATH.'/config');
// Parameters related to the Main GLM Member DB plugin - Depending on what's going on these may already defined by the main plugin
-$pluginsPath = str_replace(GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG, '', GLM_MEMBERS_BUY_SELL_PLUGIN_PATH);
-define('GLM_MEMBERS_BUY_SELL_MAIN_PLUGIN_PATH', $pluginsPath.'/glm-member-db');
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_LIB_PATH', GLM_MEMBERS_BUY_SELL_MAIN_PLUGIN_PATH.'/lib');
+$pluginsPath = str_replace(GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG, '', GLM_MEMBERS_FOR_SALE_PLUGIN_PATH);
+define('GLM_MEMBERS_FOR_SALE_MAIN_PLUGIN_PATH', $pluginsPath.'/glm-member-db');
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_LIB_PATH', GLM_MEMBERS_FOR_SALE_MAIN_PLUGIN_PATH.'/lib');
<?php
/**
- * Plugin Name: GLM Members Database Buy Sell
+ * Plugin Name: GLM Members Database For Sale
* Plugin URI: http://www.gaslightmedia.com/
* Description: {descrString}
* Version: 0.0.1
* PHP version 5.5
*
* @category glmWordPressPluginChild
- * @package glmMembersBuySellAddOn
+ * @package glmMembersForSaleAddOn
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
* @version 0.0.1
* so that we're sure the other add-ons see an up to date
* version from this plugin.
*/
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_VERSION', '0.0.1');
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_DB_VERSION', '0.0.1');
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_VERSION', '0.0.1');
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_DB_VERSION', '0.0.1');
// This is the minimum version of the GLM Members DB plugin require for this plugin.
-define('GLM_MEMBERS_BUY_SELL_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0');
+define('GLM_MEMBERS_FOR_SALE_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0');
// Check if plugin version is not current in WordPress option and if needed updated it
-if (GLM_MEMBERS_BUY_SELL_PLUGIN_VERSION != get_option('glmMembersBuySellPluginVersion')) {
- update_option('glmMembersBuySellPluginVersion', GLM_MEMBERS_BUY_SELL_PLUGIN_VERSION);
+if (GLM_MEMBERS_FOR_SALE_PLUGIN_VERSION != get_option('glmMembersForSalePluginVersion')) {
+ update_option('glmMembersForSalePluginVersion', GLM_MEMBERS_FOR_SALE_PLUGIN_VERSION);
}
/*
*/
// Check if database version should be defined and it isn't - This would be a plugin/add-on setup issue
-if (is_file(GLM_MEMBERS_BUY_SELL_PLUGIN_PATH.'/setup/databaseScripts/dbVersions.php') && !defined('GLM_MEMBERS_BUY_SELL_PLUGIN_DB_VERSION')) {
+if (is_file(GLM_MEMBERS_FOR_SALE_PLUGIN_PATH.'/setup/databaseScripts/dbVersions.php') && !defined('GLM_MEMBERS_FOR_SALE_PLUGIN_DB_VERSION')) {
die('You have database scripts but have not defined a current database version at the top of index.php for this plugin/add-on!');
}
*/
// Check for main plugin and that it's active
-function glmMembersBuySellPluginRequired() {
+function glmMembersForSalePluginRequired() {
echo '
<div class="error">
- <p>The '.GLM_MEMBERS_BUY_SELL_PLUGIN_NAME.' add-on requires the base GLM Member DB plugin to be installed and active!</p>
- <p>The '.GLM_MEMBERS_BUY_SELL_PLUGIN_NAME.' plugin has been de-activated.</p>
+ <p>The '.GLM_MEMBERS_FOR_SALE_PLUGIN_NAME.' add-on requires the base GLM Member DB plugin to be installed and active!</p>
+ <p>The '.GLM_MEMBERS_FOR_SALE_PLUGIN_NAME.' plugin has been de-activated.</p>
</div>
';
}
$plugin_name = 'glm-member-db/index.php';
$is_active = is_plugin_active($plugin_name);
if ($is_active != '1') {
- add_action( 'admin_notices', 'glmMembersBuySellPluginRequired' );
- deactivate_plugins('/'.GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG.'/index.php');
+ add_action( 'admin_notices', 'glmMembersForSalePluginRequired' );
+ deactivate_plugins('/'.GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG.'/index.php');
}
// Check for Minimum DB version for main Member DB
-function glmMembersBuySellMinVerRequired() {
+function glmMembersForSaleMinVerRequired() {
echo '
<div class="error">
- <p>The '.GLM_MEMBERS_BUY_SELL_PLUGIN_NAME.' requires that the main GLM Member DB plugin version be no older than '
- .GLM_MEMBERS_BUY_SELL_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION.'!<br>
- '.GLM_MEMBERS_BUY_SELL_MIN_VERSION_NOTE.'</p>
- <p>The '.GLM_MEMBERS_BUY_SELL_PLUGIN_NAME.' plugin has been de-activated.</p>
+ <p>The '.GLM_MEMBERS_FOR_SALE_PLUGIN_NAME.' requires that the main GLM Member DB plugin version be no older than '
+ .GLM_MEMBERS_FOR_SALE_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION.'!<br>
+ '.GLM_MEMBERS_FOR_SALE_MIN_VERSION_NOTE.'</p>
+ <p>The '.GLM_MEMBERS_FOR_SALE_PLUGIN_NAME.' plugin has been de-activated.</p>
</div>
';
}
$glmMembersDatabasePluginVersion = get_option('glmMembersDatabasePluginVersion');
-if (version_compare($glmMembersDatabasePluginVersion, GLM_MEMBERS_BUY_SELL_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION) < 0) {
- define('GLM_MEMBERS_BUY_SELL_MIN_VERSION_NOTE', "Members DB: $glmMembersDatabasePluginVersion, Buy Sell Requires: ".GLM_MEMBERS_BUY_SELL_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION);
- add_action( 'admin_notices', 'glmMembersBuySellMinVerRequired');
- deactivate_plugins('/'.GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG.'/'.GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG.'.php');
+if (version_compare($glmMembersDatabasePluginVersion, GLM_MEMBERS_FOR_SALE_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION) < 0) {
+ define('GLM_MEMBERS_FOR_SALE_MIN_VERSION_NOTE', "Members DB: $glmMembersDatabasePluginVersion, Buy Sell Requires: ".GLM_MEMBERS_FOR_SALE_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION);
+ add_action( 'admin_notices', 'glmMembersForSaleMinVerRequired');
+ deactivate_plugins('/'.GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG.'/'.GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG.'.php');
}
/*
* Register this add-on with the main GLM Member DB plugin and get information on all add-ons loaded.
*/
-require_once GLM_MEMBERS_BUY_SELL_PLUGIN_SETUP_PATH.'/validActions.php';
-require_once GLM_MEMBERS_BUY_SELL_PLUGIN_SETUP_PATH.'/shortcodes.php';
-if (is_file(GLM_MEMBERS_BUY_SELL_PLUGIN_DB_SCRIPTS.'/dbVersions.php')) {
- require_once GLM_MEMBERS_BUY_SELL_PLUGIN_DB_SCRIPTS.'/dbVersions.php';
+require_once GLM_MEMBERS_FOR_SALE_PLUGIN_SETUP_PATH.'/validActions.php';
+require_once GLM_MEMBERS_FOR_SALE_PLUGIN_SETUP_PATH.'/shortcodes.php';
+if (is_file(GLM_MEMBERS_FOR_SALE_PLUGIN_DB_SCRIPTS.'/dbVersions.php')) {
+ require_once GLM_MEMBERS_FOR_SALE_PLUGIN_DB_SCRIPTS.'/dbVersions.php';
}
// Load Add-On Management Settings data
/* None - Need to figure out a smooth way to do this.
-$glmMembersBuySellManagementSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_BUY_SELL_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A );
-unset($glmMembersBuySellManagementSettings['id']);
+$glmMembersForSaleManagementSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_FOR_SALE_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A );
+unset($glmMembersForSaleManagementSettings['id']);
*/
-function glmMembersBuySellRegisterAddOn($addOns) {
+function glmMembersForSaleRegisterAddOn($addOns) {
// Add this add-on to the add-ons array
- $addOns[GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG] = array(
- 'dir' => GLM_MEMBERS_BUY_SELL_PLUGIN_PATH,
- 'name' => GLM_MEMBERS_BUY_SELL_PLUGIN_NAME,
- 'short_name' => GLM_MEMBERS_BUY_SELL_PLUGIN_SHORT_NAME,
- 'slug' => GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG,
- 'actions' => $GLOBALS['glmMembersBuySellAddOnValidActions'],
+ $addOns[GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG] = array(
+ 'dir' => GLM_MEMBERS_FOR_SALE_PLUGIN_PATH,
+ 'name' => GLM_MEMBERS_FOR_SALE_PLUGIN_NAME,
+ 'short_name' => GLM_MEMBERS_FOR_SALE_PLUGIN_SHORT_NAME,
+ 'slug' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG,
+ 'actions' => $GLOBALS['glmMembersForSaleAddOnValidActions'],
'config' => array(
),
- 'shortcodes' => $GLOBALS['glmMembersBuySellShortcodes'],
- 'shortcodesDescription' => $GLOBALS['glmMembersBuySellShortcodesDescription']
+ 'shortcodes' => $GLOBALS['glmMembersForSaleShortcodes'],
+ 'shortcodesDescription' => $GLOBALS['glmMembersForSaleShortcodesDescription']
);
// If we have database tables for this plugin/addon, provide that data also
- if (isset($GLOBALS['glmMembersBuySellDbVersions'])) {
- $addOns[GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG]['database'] = array(
- 'dbPrefix' => GLM_MEMBERS_BUY_SELL_PLUGIN_DB_PREFIX,
- 'dbCurrentVersion' => GLM_MEMBERS_BUY_SELL_PLUGIN_DB_VERSION,
- 'dbActiveVersionOption' => GLM_MEMBERS_BUY_SELL_PLUGIN_ACTIVE_DB_OPTION,
- 'dbScriptPath' => GLM_MEMBERS_BUY_SELL_PLUGIN_DB_SCRIPTS,
- 'dbVersions' => $GLOBALS['glmMembersBuySellDbVersions']
+ if (isset($GLOBALS['glmMembersForSaleDbVersions'])) {
+ $addOns[GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG]['database'] = array(
+ 'dbPrefix' => GLM_MEMBERS_FOR_SALE_PLUGIN_DB_PREFIX,
+ 'dbCurrentVersion' => GLM_MEMBERS_FOR_SALE_PLUGIN_DB_VERSION,
+ 'dbActiveVersionOption' => GLM_MEMBERS_FOR_SALE_PLUGIN_ACTIVE_DB_OPTION,
+ 'dbScriptPath' => GLM_MEMBERS_FOR_SALE_PLUGIN_DB_SCRIPTS,
+ 'dbVersions' => $GLOBALS['glmMembersForSaleDbVersions']
);
} else {
- $addOns[GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG]['database'] = false;
+ $addOns[GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG]['database'] = false;
}
// Return the array with our data added
return $addOns;
}
-add_filter('glm-member-db-register-addon','glmMembersBuySellRegisterAddOn', 10, 1);
+add_filter('glm-member-db-register-addon','glmMembersForSaleRegisterAddOn', 10, 1);
/*
* Plugin Update Support - uses Gaslight Media update server
*/
/* Not functional yet - Need to resolve JavaScript conflicts with this feature in other plugins
-require GLM_MEMBERS_BUY_SELL_PLUGIN_LIB_PATH.'/opentools-update-checker/opentools-update-checker.php';
-${GLM_MEMBERS_BUY_SELL_PLUGIN_PREFIX."updateChecker"} = new OpenToolsPluginUpdateChecker(
- 'http://www.gaslightmedia.com/update_server/?action=get_metadata&slug='.GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG,
+require GLM_MEMBERS_FOR_SALE_PLUGIN_LIB_PATH.'/opentools-update-checker/opentools-update-checker.php';
+${GLM_MEMBERS_FOR_SALE_PLUGIN_PREFIX."updateChecker"} = new OpenToolsPluginUpdateChecker(
+ 'http://www.gaslightmedia.com/update_server/?action=get_metadata&slug='.GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG,
__FILE__,
- GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG
+ GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG
);
-${GLM_MEMBERS_BUY_SELL_PLUGIN_PREFIX."updateChecker"}->declareCredentials(array(
+${GLM_MEMBERS_FOR_SALE_PLUGIN_PREFIX."updateChecker"}->declareCredentials(array(
'license_key' => __('License Key:')
));
*/
*/
// Activate
- function glmMembersBuySellPluginActivate ()
+ function glmMembersForSalePluginActivate ()
{
global $wpdb, $config;
- require_once GLM_MEMBERS_BUY_SELL_PLUGIN_PATH . '/activate.php';
- new glmMembersBuySellPluginActivate($wpdb, $config);
+ require_once GLM_MEMBERS_FOR_SALE_PLUGIN_PATH . '/activate.php';
+ new glmMembersForSalePluginActivate($wpdb, $config);
}
- register_activation_hook(__FILE__, 'glmMembersBuySellPluginActivate');
+ register_activation_hook(__FILE__, 'glmMembersForSalePluginActivate');
// Deactivate
- function glmMembersBuySellPluginDeactivate ()
+ function glmMembersForSalePluginDeactivate ()
{
global $wpdb, $config;
- require_once GLM_MEMBERS_BUY_SELL_PLUGIN_PATH . '/deactivate.php';
- $x = new glmMembersBuySellPluginDeactivate($wpdb, $config);
+ require_once GLM_MEMBERS_FOR_SALE_PLUGIN_PATH . '/deactivate.php';
+ $x = new glmMembersForSalePluginDeactivate($wpdb, $config);
return false;
}
- register_deactivation_hook(__FILE__, 'glmMembersBuySellPluginDeactivate');
+ register_deactivation_hook(__FILE__, 'glmMembersForSalePluginDeactivate');
/*
* Hooks for testing capabilities provided by this add-on
*/
-require_once GLM_MEMBERS_BUY_SELL_PLUGIN_SETUP_PATH.'/permissions.php';
+require_once GLM_MEMBERS_FOR_SALE_PLUGIN_SETUP_PATH.'/permissions.php';
+++ /dev/null
-<?php
-/**
- * Gaslight Media Members Database
- * Buy Sell
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package glmMembersDatabase
- * @author Chuck Scott <cscott@gaslightmedia.com>
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
- * @link http://dev.gaslightmedia.com/
- */
-
-// Load Contacts data abstract
-require_once GLM_MEMBERS_BUY_SELL_PLUGIN_CLASS_PATH .'/data/dataBuySell.php';
-require_once GLM_MEMBERS_PLUGIN_CLASS_PATH .'/data/dataMembers.php';
-
-class GlmMembersAdmin_buySell_index extends GlmDataBuySell
-{
-
- /**
- * WordPress Database Object
- *
- * @var $wpdb
- * @access public
- */
- public $wpdb;
- /**
- * Plugin Configuration Data
- *
- * @var $config
- * @access public
- */
- public $config;
- /**
- * item ID
- *
- * @var $item ID
- * @access public
- */
- public $item_id = false;
-
- /*
- * Constructor
- *
- * This contructor performs the work for this model. This model returns
- * an array containing the following.
- *
- * 'status'
- *
- * True if successfull and false if there was a fatal failure.
- *
- * 'view'
- *
- * A suggested view name that the contoller 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.
- *
- * @wpdb object WordPress database object
- *
- * @return array Array containing status, suggested view, and any data
- */
- public function __construct ($wpdb, $config)
- {
-
- // Save WordPress Database object
- $this->wpdb = $wpdb;
-
- // Save plugin configuration object
- $this->config = $config;
-
- /*
- * Run constructor for the Contacts data class
- *
- * Note, the third parameter is a flag that indicates to the Contacts
- * data class that it should flag a group of fields as 'view_only'.
- */
- parent::__construct(false, false, true);
- }
-
- public function modelAction($actionData = false)
- {
- $members = new GlmDataMembers($this->wpdb, $this->config);
- $member_list = $members->getList();
-
-
- $success_message = "";
- $haveItem = false;
- $option = false;
- $item = false;
- $item_data = false;
- $itemUpdated = false;
- $itemUpdateError = false;
- $itemAdded = false;
- $itemAddError = false;
- $view_file = 'index';
- $lockedToMember = false;
- $isModerated = false;
- $memberID = false;
- $haveMember = false;
- $where = '';
-
- // Check if there's a logged in user who is locked to their own entity
- $lockedToMember = apply_filters('glm_members_locked_to_member_id', false);
- if ($lockedToMember) {
-
- $isModerated = apply_filters('glm_user_is_moderated', $lockedToMember);
- $memberID = $lockedToMember;
-
- $this->fields['admin_name']['required'] = true;
- $this->fields['admin_email']['required'] = true;
- $this->fields['admin_phone']['required'] = true;
-
- // Check for Member Menu Use
- } elseif (defined('GLM_item_MEMBER_MENU')) {
-
- // Try to get member ID
- $memberID = (isset($_REQUEST['member']) ? $_REQUEST['member'] : 0);
-
- // If there's no valid member ID, we can't continue
- if ($memberID == 0) {
- return array(
- 'status' => false,
- 'menuItemRedirect' => 'error',
- 'modelRedirect' => 'index',
- 'view' => 'admin/error/index.html',
- 'data' => array(
- 'reason' => 'No member ID was provided.'
- )
- );
- }
- }
-
- // If not a valid member ID
- if ($memberID > 0) {
-
- // Get base member information
- require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMembers.php';
-
- $memberData = $members->getEntry($memberID);
- $where .= "member = $memberID";
- if (!$memberData) {
- return array(
- 'status' => false,
- 'menuItemRedirect' => 'error',
- 'modelRedirect' => 'index',
- 'view' => 'admin/error/index.html',
- 'data' => array(
- 'reason' => 'No member data found for provided member ID.'
- )
- );
- } else{
- $haveMember = true;
- $memberName = $memberData['name'];
- }
-
- }
-
- if (isset($_REQUEST['option']) && trim($_REQUEST['option']) != '') {
- $option = $_REQUEST['option'];
- }
-
- // get the item id for use in the edit, add and delete options
- // Get obit ID if supplied
- if (isset($_REQUEST['item'])) {
-
- // Make sure it's numeric
- $this->item_id= ($_REQUEST['item'] - 0);
-
- if ($this->item_id <= 0) {
- $this->item_id = false;
- }
- }
-
- $item_data = $this->getList($where);
-
-// echo '<pre>', print_r($this->getList()), '</pre>';
- // echo '<pre>', print_r($_REQUEST), '</pre>';
-
- switch ($option) {
-
- case 'add':
- $item = $this->newEntry();
- $view_file = 'edit';
-
- break;
-
- case 'insert':
- $item = $this->insertEntry();
- $this->item_id = $item['fieldData']['id'];
-
- if ($item['status']) {
- $haveItem = true;
- $itemAdded = true;
-
- // Update created timestamp and name slug for URLs
- //$this->updateSlug($this->itemID);
-
- // Get this again so we have the created date
- $item = $this->editEntry($this->item_id);
-
- $option = 'edit';
- $itemAdded = true;
-
- } else {
- $option = 'add';
- $itemAddError = true;
- }
-
- $view_file = 'edit';
-
- break;
-
- case 'edit':
- $item = $this->editEntry($this->item_id);
-
- // If we have a good item
- if ($item['status']) {
- $haveItem = true;
- }
-
- $view_file = 'edit';
- break;
-
- case 'update':
- // Try to update this item
- $item = $this->updateEntry($this->item_id);
-
- // Check if that was successful
- if ($item['status']) {
- $itemUpdated = true;
-
- $item = $this->editEntry($this->item_id);
-
- } else {
- $itemUpdateError = true;
- }
-
- $haveItem = true;
- $view_file = 'edit';
-
- break;
-
- case 'delete':
- $item = $this->deleteEntry($this->item_id,true);
-
- if ($item) {
- $itemDeleted = true;
- } else {
- $itemDeleteError = true;
- }
- $view_file = "list";
- $item_data = $this->getList();
- break;
- default:
- $item_data = $this->getList($where);
- $view_file = 'list';
- break;
- }
-// 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_BUY_SELL_PLUGIN_URL . 'assets/',
-
- );
-
- // Return status, any suggested view, and any data to controller
- return array(
- 'status' => true,
- 'modelRedirect' => false,
- 'view' => 'admin/buySell/'.$view_file.'.html',
- 'data' => $templateData
- );
- }
-}
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * Buy Sell
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link http://dev.gaslightmedia.com/
+ */
+
+// Load Contacts data abstract
+require_once GLM_MEMBERS_FOR_SALE_PLUGIN_CLASS_PATH .'/data/dataForSale.php';
+require_once GLM_MEMBERS_PLUGIN_CLASS_PATH .'/data/dataMembers.php';
+
+class GlmMembersAdmin_forSale_index extends GlmDataForSale
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * item ID
+ *
+ * @var $item ID
+ * @access public
+ */
+ public $item_id = false;
+
+ /*
+ * Constructor
+ *
+ * This contructor performs the work for this model. This model returns
+ * an array containing the following.
+ *
+ * 'status'
+ *
+ * True if successfull and false if there was a fatal failure.
+ *
+ * 'view'
+ *
+ * A suggested view name that the contoller 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.
+ *
+ * @wpdb object WordPress database object
+ *
+ * @return array Array containing status, suggested view, and any data
+ */
+ public function __construct ($wpdb, $config)
+ {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ /*
+ * Run constructor for the Contacts data class
+ *
+ * Note, the third parameter is a flag that indicates to the Contacts
+ * data class that it should flag a group of fields as 'view_only'.
+ */
+ parent::__construct(false, false, true);
+ }
+
+ public function modelAction($actionData = false)
+ {
+ $members = new GlmDataMembers($this->wpdb, $this->config);
+ $member_list = $members->getList();
+
+
+ $success_message = "";
+ $haveItem = false;
+ $option = false;
+ $item = false;
+ $item_data = false;
+ $itemUpdated = false;
+ $itemUpdateError = false;
+ $itemAdded = false;
+ $itemAddError = false;
+ $view_file = 'index';
+ $lockedToMember = false;
+ $isModerated = false;
+ $memberID = false;
+ $haveMember = false;
+ $where = '';
+
+ // Check if there's a logged in user who is locked to their own entity
+ $lockedToMember = apply_filters('glm_members_locked_to_member_id', false);
+ if ($lockedToMember) {
+
+ $isModerated = apply_filters('glm_user_is_moderated', $lockedToMember);
+ $memberID = $lockedToMember;
+
+ $this->fields['admin_name']['required'] = true;
+ $this->fields['admin_email']['required'] = true;
+ $this->fields['admin_phone']['required'] = true;
+
+ // Check for Member Menu Use
+ } elseif (defined('GLM_item_MEMBER_MENU')) {
+
+ // Try to get member ID
+ $memberID = (isset($_REQUEST['member']) ? $_REQUEST['member'] : 0);
+
+ // If there's no valid member ID, we can't continue
+ if ($memberID == 0) {
+ return array(
+ 'status' => false,
+ 'menuItemRedirect' => 'error',
+ 'modelRedirect' => 'index',
+ 'view' => 'admin/error/index.html',
+ 'data' => array(
+ 'reason' => 'No member ID was provided.'
+ )
+ );
+ }
+ }
+
+ // If not a valid member ID
+ if ($memberID > 0) {
+
+ // Get base member information
+ require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMembers.php';
+
+ $memberData = $members->getEntry($memberID);
+ $where .= "member = $memberID";
+ if (!$memberData) {
+ return array(
+ 'status' => false,
+ 'menuItemRedirect' => 'error',
+ 'modelRedirect' => 'index',
+ 'view' => 'admin/error/index.html',
+ 'data' => array(
+ 'reason' => 'No member data found for provided member ID.'
+ )
+ );
+ } else{
+ $haveMember = true;
+ $memberName = $memberData['name'];
+ }
+
+ }
+
+ if (isset($_REQUEST['option']) && trim($_REQUEST['option']) != '') {
+ $option = $_REQUEST['option'];
+ }
+
+ // get the item id for use in the edit, add and delete options
+ // Get obit ID if supplied
+ if (isset($_REQUEST['item'])) {
+
+ // Make sure it's numeric
+ $this->item_id= ($_REQUEST['item'] - 0);
+
+ if ($this->item_id <= 0) {
+ $this->item_id = false;
+ }
+ }
+
+ $item_data = $this->getList($where);
+
+// echo '<pre>', print_r($this->getList()), '</pre>';
+ // echo '<pre>', print_r($_REQUEST), '</pre>';
+
+ switch ($option) {
+
+ case 'add':
+ $item = $this->newEntry();
+ $view_file = 'edit';
+
+ break;
+
+ case 'insert':
+ $item = $this->insertEntry();
+ $this->item_id = $item['fieldData']['id'];
+
+ if ($item['status']) {
+ $haveItem = true;
+ $itemAdded = true;
+
+ // Update created timestamp and name slug for URLs
+ //$this->updateSlug($this->itemID);
+
+ // Get this again so we have the created date
+ $item = $this->editEntry($this->item_id);
+
+ $option = 'edit';
+ $itemAdded = true;
+
+ } else {
+ $option = 'add';
+ $itemAddError = true;
+ }
+
+ $view_file = 'edit';
+
+ break;
+
+ case 'edit':
+ $item = $this->editEntry($this->item_id);
+
+ // If we have a good item
+ if ($item['status']) {
+ $haveItem = true;
+ }
+
+ $view_file = 'edit';
+ break;
+
+ case 'update':
+ // Try to update this item
+ $item = $this->updateEntry($this->item_id);
+
+ // Check if that was successful
+ if ($item['status']) {
+ $itemUpdated = true;
+
+ $item = $this->editEntry($this->item_id);
+
+ } else {
+ $itemUpdateError = true;
+ }
+
+ $haveItem = true;
+ $view_file = 'edit';
+
+ break;
+
+ case 'delete':
+ $item = $this->deleteEntry($this->item_id,true);
+
+ if ($item) {
+ $itemDeleted = true;
+ } else {
+ $itemDeleteError = true;
+ }
+ $view_file = "list";
+ $item_data = $this->getList();
+ break;
+ default:
+ $item_data = $this->getList($where);
+ $view_file = 'list';
+ break;
+ }
+// 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/',
+
+ );
+
+ // Return status, any suggested view, and any data to controller
+ return array(
+ 'status' => true,
+ 'modelRedirect' => false,
+ 'view' => 'admin/forSale/'.$view_file.'.html',
+ 'data' => $templateData
+ );
+ }
+}
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * Buy Sell
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link http://dev.gaslightmedia.com/
+ */
+
+// Load Contacts data abstract
+require_once GLM_MEMBERS_FOR_SALE_PLUGIN_CLASS_PATH.'/data/dataForSale.php';
+
+
+class GlmMembersFront_forSale_detail extends GlmDataForSale
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * Contact Info
+ *
+ * @var $contactInfo
+ * @access public
+ */
+ public $contactInfo = false;
+ /**
+ * Member ID
+ *
+ * @var $memberID
+ * @access public
+ */
+ public $memberID = false;
+ /**
+ * Contact ID
+ *
+ * @var $contactID
+ * @access public
+ */
+ public $contactID = false;
+ public $item_id;
+
+ /*
+ * Constructor
+ *
+ * This contructor performs the work for this model. This model returns
+ * an array containing the following.
+ *
+ * 'status'
+ *
+ * True if successfull and false if there was a fatal failure.
+ *
+ * 'view'
+ *
+ * A suggested view name that the contoller 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.
+ *
+ * @wpdb object WordPress database object
+ *
+ * @return array Array containing status, suggested view, and any data
+ */
+ public function __construct ($wpdb, $config)
+ {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ /*
+ * Run constructor for the Contacts data class
+ *
+ * Note, the third parameter is a flag that indicates to the Contacts
+ * data class that it should flag a group of fields as 'view_only'.
+ */
+ parent::__construct(false, false, true);
+
+
+ }
+
+ public function modelAction($actionData = false)
+ {
+ echo "ASF";
+ $success_message = "";
+ $option = false;
+ if (isset($_REQUEST['option']) && trim($_REQUEST['option']) != '') {
+ $option = $_REQUEST['option'];
+ }
+ // get the Item id for use in the edit, add and delete options
+ // Get obit ID if supplied
+ if (isset($_REQUEST['item'])) {
+
+ // Make sure it's numeric
+ $this->item_id= ($_REQUEST['item'] - 0);
+
+ if ($this->item_id <= 0) {
+ $this->item_id = false;
+ }
+ }
+ $where = "id = $this->item_id";
+
+ $item = $this->getList($where);
+
+ foreach($item as $i){
+ $item = $i;
+ }
+ // Compile template data
+ $templateData = array(
+ 'itemData' => $item,
+ 'siteBaseUrl' => GLM_MEMBERS_FOR_SALE_SITE_BASE_URL,
+ 'currentUrl' => GLM_MEMBERS_FOR_SALE_PLUGIN_CURRENT_URL,
+ );
+
+ // Return status, any suggested view, and any data to controller
+ return array(
+ 'status' => true,
+ 'modelRedirect' => false,
+ 'view' => 'front/forSale/detail.html',
+ 'data' => $templateData
+ );
+ }
+}
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * For Sale
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link http://dev.gaslightmedia.com/
+ */
+
+// Load Contacts data abstract
+require_once GLM_MEMBERS_FOR_SALE_PLUGIN_CLASS_PATH.'/data/dataForSale.php';
+
+class GlmMembersFront_forSale_list extends GlmDataForSale
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * Contact Info
+ *
+ * @var $contactInfo
+ * @access public
+ */
+ public $contactInfo = false;
+ /**
+ * Member ID
+ *
+ * @var $memberID
+ * @access public
+ */
+ public $memberID = false;
+ /**
+ * Contact ID
+ *
+ * @var $contactID
+ * @access public
+ */
+ public $contactID = false;
+
+
+ /*
+ * Constructor
+ *
+ * This contructor performs the work for this model. This model returns
+ * an array containing the following.
+ *
+ * 'status'
+ *
+ * True if successfull and false if there was a fatal failure.
+ *
+ * 'view'
+ *
+ * A suggested view name that the contoller 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.
+ *
+ * @wpdb object WordPress database object
+ *
+ * @return array Array containing status, suggested view, and any data
+ */
+ public function __construct ($wpdb, $config)
+ {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ /*
+ * Run constructor for the Contacts data class
+ *
+ * Note, the third parameter is a flag that indicates to the Contacts
+ * data class that it should flag a group of fields as 'view_only'.
+ */
+ parent::__construct(false, false, true);
+
+
+ }
+
+ public function modelAction($actionData = false)
+ {
+ $where = "";
+
+ $success_message = "";
+ $option = false;
+ if (isset($_REQUEST['option']) && trim($_REQUEST['option']) != '') {
+ $option = $_REQUEST['option'];
+ }
+ $where .= "CURDATE() <= DATE_ADD(post_date, INTERVAL item_expiration DAY) ";
+
+ $item_data = $this->getList($where);
+
+
+ $view_file = 'list';
+
+ // Compile template data
+ $templateData = array(
+ 'itemData' => $item_data,
+ 'siteBaseUrl' => GLM_MEMBERS_FOR_SALE_SITE_BASE_URL,
+ 'currentUrl' => GLM_MEMBERS_FOR_SALE_PLUGIN_CURRENT_URL,
+ );
+
+ // Return status, any suggested view, and any data to controller
+ return array(
+ 'status' => true,
+ 'modelRedirect' => false,
+ 'view' => 'front/forSale/'.$view_file.'.html',
+ 'data' => $templateData
+ );
+
+ }
+
+}
.no-padding{
padding: 0;
}
-
-body .front-item-listings-wrapper {
- .item-detail-wrapper{
- .front-title{
- font-weight: bold;
- font-size: 20px;
- }
- div{
- float: none !important;
- line-height: 1.1;
- margin: 8px 8px 8px 0;
- }
- }
- // .front-item-search{
- // max-width: 530px;
- // margin: 0 auto;
- // }
- margin-top: 20px;
+.front-item-list-wrapper{
span{
font-weight: bold;
}
-
- .front-item-list-row{
- margin-bottom: 20px;
- .item-title-list{
- span{
- font-size: 20px;
- }
- }
-
+ .front-list-item{
+ padding: 10px 0;
+ border-bottom: 1px solid lightgray;
}
- .item-title-search{
- #item_title_dropdown{
- max-width: 450px;
- }
- .item-title-button{
- height: 39px;
- }
+ div{
+ line-height: 1.1;
+ padding: 5px;
}
-
- @media screen and (max-width: 641px){
- .item-title-button{
- display: block;
- max-width: 100px;
- margin: 0 auto;
- }
- .front-item-search{
- margin-bottom: 20px;
- }
+ .front-list-topic{
+ padding: 5px;
+ width: 100px;
+ text-align: center;
+ color: white;
+ border-radius: 5px;
+ margin-bottom: 10px;
}
- @media (min-width: 639px) and (max-width: 1025px){
- .item-title-button{
- display: inline-block;
- margin: 0 0 0 10px;
- }
+ .item-wanted{
+ background: green;
}
- @media (min-width: 1023px){
- .item-title-button{
- display: inline-block;
- margin: 0 0 0 10px;
- }
+ .item-sale{
+ background: red;
}
}
\ No newline at end of file
if (isset($this->config['loggedInUser']) && isset($this->config['loggedInUser']['contactUser']) && $this->config['loggedInUser']['contactUser']) {
add_submenu_page(
$mainMenuSlug,
- 'Buy Sell',
- 'Buy Sell',
+ 'For Sale',
+ 'For Sale',
'glm_members_edit_my_entity',
- 'glm-members-admin-menu-buy-sell-index',
- function(){$this->controller('buySell');}
+ 'glm-members-admin-menu-for-sale-index',
+ function(){$this->controller('forSale');}
);
} else {
add_submenu_page(
'glm-members-admin-menu-members',
- 'Buy Sell',
- 'Buy Sell',
+ 'For Sale',
+ 'For Sale',
'edit_posts',
- 'glm-members-admin-menu-buySell-index',
- function(){$this->controller('buySell');}
+ 'glm-members-admin-menu-for-sale-index',
+ function(){$this->controller('forSale');}
);
}
--- Gaslight Media Members Database - Buy Sell
+-- Gaslight Media Members Database - For Sale
-- File Created: 12/02/15 15:27:15
-- Database Version: 0.0.1
-- Database Creation Script
----
--- Job Titles default entries in table
+-- default entries in table
INSERT INTO {prefix}items (
id,title,descr,topic,contact_email,contact_name,contact_phone,post_date,visible,
terms,location,item_expiration,image_3,post,image_1,
**********************************************************************/
-$glmMembersBuySellDbVersions = array(
+$glmMembersForSaleDbVersions = array(
'0.0.1' => array('version' => '0.0.1', 'tables' => 1, 'date' => '09/15/2017'),
);
*
* $permit is a boolean set before this function call for passing on permissions.
*/
-add_filter('glm_members_permit_admin_members_buy_sell',
+add_filter('glm_members_permit_admin_members_for_sale',
function($permit) {
return glmMembersUserCan('glm_members_edit_any_member', $permit);
}
);
// Logged in member user may edit an event only for their own entity
-add_filter('glm_members_permit_admin_member_buy_sell',
+add_filter('glm_members_permit_admin_member_for_sale',
function($permit) {
return glmMembersUserCan('glm_members_edit_my_member', $permit);
}
* PHP version 5.5
*
* @category glmWordPressPlugin
- * @package glmMembersBuySell
+ * @package glmMembersForSale
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
* @release shortcodes.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
* </tr>
*/
- $glmMembersBuySellShortcodes = array(
- 'glm-members-buy-sell' => array(
- 'plugin' => GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG,
- 'menu' => 'Buy Sell',
+ $glmMembersForSaleShortcodes = array(
+ 'glm-members-for-sale-list' => array(
+ 'plugin' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG,
+ 'menu' => 'forSale',
'action' => 'list',
'table' => false,
'attributes' => array(
- 'id' => true,
- 'member_only' => true
+ 'id' => false,
+ 'member_only' => false
)
),
- 'glm-members-buy-sell-detail' => array(
- 'plugin' => GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG,
- 'menu' => 'Buy Sell',
+ 'glm-members-for-sale-detail' => array(
+ 'plugin' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG,
+ 'menu' => 'forSale',
'action' => 'detail',
'table' => false,
'attributes' => array(
'id' => false,
+ 'member_only' => false
)
),
);
-$glmMembersBuySellShortcodesDescription = '';
+$glmMembersForSaleShortcodesDescription = '';
* PHP version 5.5
*
* @category glmWordPressPlugin
- * @package glmMembersBuySell
+ * @package glmMembersForSale
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
* @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
*
* EXAMPLE
*
- * $glmMembersBuySellAddOnValidActions = array(
+ * $glmMembersForSaleAddOnValidActions = array(
* 'adminActions' => array(
* 'members' => array(
- * 'sample' => GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG,
+ * 'sample' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG,
* ),
* 'sample' => array(
- * 'index' => GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG,
- * 'more' => GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG,
+ * 'index' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG,
+ * 'more' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG,
* ),
* 'info' => array(
- * 'index' => GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG
+ * 'index' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG
* )
* ),
* 'frontActions' => array(
* 'sample' => array(
- * 'list' => GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG,
- * 'detail' => GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG
+ * 'list' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG,
+ * 'detail' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG
* )
* )
* );
*/
- $glmMembersBuySellAddOnValidActions = array(
+ $glmMembersForSaleAddOnValidActions = array(
'adminActions' => array(
- 'buySell' => array(
- 'index' => GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG,
+ 'forSale' => array(
+ 'index' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG,
),
),
'frontActions' => array(
- 'buySell' => array(
- 'list' => GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG,
- 'detail' => GLM_MEMBERS_BUY_SELL_PLUGIN_SLUG,
+ 'forSale' => array(
+ 'list' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG,
+ 'detail' => GLM_MEMBERS_FOR_SALE_PLUGIN_SLUG,
),
)
);
+++ /dev/null
-{include file='admin/header.html'}
-
-{if ($option == 'add' || $haveItem)}
- <a href="{$thisUrl}?page={$thisPage}&glm_action=index" class="button button-secondary glm-button glm-right">Return to items List</a>
-
- {if $option == 'edit' || $option == 'update'}
- <a id="deleteItemButton" class="button button-secondary glm-button glm-right">Delete this Item</a>
- <h2>Edit Item Posting
- {else}
- <h2>Add New Item Posting
- {/if}
-
- {if $itemUpdated}<span class="glm-notice glm-flash-updated">Item Updated</span>{/if}
- {if $itemUpdateError}<span class="glm-error glm-flash-updated">Item Update Error</span>{/if}
- {if $itemAdded}<span class="glm-notice glm-flash-updated">Item Added</span>{/if}
- {if $itemAddError}<span class="glm-error glm-flash-updated">Item Add Error</span>{/if}
- </h2>
-
- {if $itemUpdateError || $itemAddError}
- <h1 class="glm-error">NOTICE: Your Item has not yet been submitted.<br>Please select the tabs indicating a problem, correct the indicated fields and resubmit.</h1>
- {else}
- {/if}
- <form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
- <input type="hidden" name="glm_action" value="index">
- {if $haveItem}
- <input type="hidden" name="option" value="update">
- <input type="hidden" name="item" value="{$item.fieldData.id}">
- {else}
- <input type="hidden" name="option" value="insert">
- {/if}
-
- <h2 class="nav-tab-wrapper" style="margin-bottom: 1em;">
- <a id="glm-item-descr" data-show-table="glm-table-descr" class="glm-item-tab nav-tab nav-tab-active">Item Postings</a>
- </h2>
- <!-- ITEM TITLE -->
- <div class="glm-item-row glm-row">
- <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
- Item
- </div>
- <div class="glm-small-12 glm-medium-8 glm-columns admin-item-input">
- <input type="text" name="title" {if $item.fieldData.title} value='{$item.fieldData.title}' {/if}>
- </div>
- </div>
- <!-- MEMBER for admins only-->
- {if !$lockedToMember}
- <div class="glm-item-row glm-row">
- <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
- Member
- </div>
- <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
- <select id="member" data-id="member" name="member">
- <option value="">Select a Member</option>
- {foreach from=$memberList item=m}
- {if 'fieldData'|array_key_exists:$item}
- <option value="{$m.id}" {if $item.fieldData.member.name == {$m.name}} selected="selected"{/if}>
- {else if}
- <option value="{$m.id}">
- {/if}
- {$m.name}
- </option>
- {/foreach}
- </select>
- </div>
- </div>
- {else}
- <!-- hidden MEMBER ID field here -->
- <input type="hidden" name="member" value="{$item.fieldData.member.value}">
- {/if}
-
- <!-- COMPANY -->
- <div class="glm-item-row glm-row">
- <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
- Company
- </div>
- <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
- <input type="text" name="company" {if $item.fieldData.company} value='{$item.fieldData.company}' {/if}>
- </div>
- </div>
- <!-- DESCRIPTION -->
- <div class="glm-item-row glm-row">
- <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
- Description
- </div>
- <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
- {php}
- wp_editor(
-
- '{$item.fieldData.descr|escape:quotes}',
-
- 'descr', array(
- 'media_buttons' => false,
- 'tinymce' => false,
- // 'quicktags' => false,
- // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text.
- 'textarea_name' => 'descr',
- 'editor_height' => 200, // Height in px, overrides editor_rows
- // 'textarea_rows' => 8
- ));
- {/php}
- </div>
- </div>
- <!-- CONTACT NAME -->
- <div class="glm-item-row glm-row">
- <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
- Contact Name
- </div>
- <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
- <input type="text" name="contactname" {if $item.fieldData.contact_name} value='{$item.fieldData.contact_name}' {/if}>
- </div>
- </div>
- <!-- EMAIL TO -->
- <div class="glm-item-row glm-row">
- <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
- Contact Email
- </div>
- <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
- <input type="text" name="email_location" {if $item.fieldData.contact_email} value='{$item.fieldData.contact_email}' {/if}>
- </div>
- </div>
- <!-- CONTACT PHONE -->
- <div class="glm-item-row glm-row">
- <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
- Contact Phone
- </div>
- <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
- <input type="text" name="contactphone" {if $item.fieldData.contact_phone} value='{$item.fieldData.contact_phone}' {/if}>
- </div>
- </div>
- <br>
- {include file='admin/buySell/parts/image_input.html'}
- <br>
- <!-- VISIBLE -->
- <div class="glm-item-row glm-row">
- <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
- Visible
- </div>
- <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
- <input id="item-visible" data-id="item-visible" type="checkbox" name="visible" class="visible-checkbox" {if $item.fieldData.visible.value} checked{/if}>
- </div>
- </div>
- <!-- ITEM EXPIRATION-->
- <div class="glm-item-row glm-row">
- <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
- Item Expiration
- </div>
- <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
- <select id="item_expiration" data-id="item_expiration" name="item_expiration">
- <option value="">Number of Days</option>
- {foreach $item.fieldData.item_expiration.list as $exp}
- {if 'fieldData'|array_key_exists:$item}
- <option value="{$exp.value}" {if $item.fieldData.item_expiration.value == {$exp.value}} selected="selected"{/if}>
- {else if}
- <option value="{$exp.value}">
- {/if}
- {$exp.name}
- </option>
- {/foreach}
- </select>
- </div>
- </div>
-
-
- <input id="updateItem" type="submit" value="{if $haveItem}Update Item{else}Save New Item{/if}">
- </form>
-
-{else} <!-- Can just display -->
-
- <h3>Sorry, no Item found or permission not granted.</h3>
-
-{/if}
-
- <!-- Delete Item Dialog Box -->
-
- <div id="deleteItemDialog" class="glm-dialog-box" title="Delete Item">
- <center>
- <p><a id="deleteItemCancel" class="button button-primary">Cancel</a></p>
- <p><input id="deleteitemubmit" type="submit" value="Delete this Item"></p>
- </center>
- <div class="glm-item-container">
- <p><center><span class="glm-error">WARNING:</span></center></p>
- <p>
- <span class="glm-warning">Clicking the "Delete this Item" button above will
- delete all of the data and images associated with this Item.
- </span>
- </p>
- <p>
- <span class="glm-error">
- Once deleted, this information will no longer be available and cannot be retrieved!
- If you are unsure that you want to completely remove this data, consider changing the status
- of this Item to "Archived" instead.
- </span>
- </p>
- </div>
- </div>
- <script type="text/javascript">
- jQuery(document).ready(function($) {
-
- {if $haveItem}
- // Delete Item dialog
- $("#deleteItemDialog").dialog({
- autoOpen: false,
- minWidth: 400,
- dialogClass: "glm-dialog-no-close"
- });
- $('#deleteItemButton').click( function() {
- $('#deleteItemDialog').dialog('open');
- });
- $('#deleteItemCancel').click( function() {
- $("#deleteItemDialog").dialog("close");
- });
- $('#deleteitemubmit').click( function() {
- window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=index&option=delete&item={$item.fieldData.id}");
- });
- {/if}
-
- // Flash certain elements for a short time after display
- $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
-
- });
- </script>
-
-
-{include file='admin/footer.html'}
+++ /dev/null
-{include file='admin/header.html'}
-{if $haveMember}
-<input type="hidden" name="member" value="{$memberID}">
-{if !$lockedToMember}
-<input type="hidden" name="glm_action" value="item">
-{/if}
-<input type="hidden" name="option" value="list">
-{/if}
- {if $itemData}
- <div class="admin-new-item">
- <a class="admin-new-item-link" href="{$thisUrl}?page={$thisPage}&glm_action=index&option=add">New item</a>
- </div>
- <div class="admin-item-list-header glm-row">
- <div class="item-title-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Topic</div>
- <div class="item-company-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Forsale Item</div>
- <div class="item-date-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Item Post Date</div>
- <div class="item-date-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Post For</div>
- </div>
- {foreach $itemData as $item=>$data}
- <div class='glm-row admin-item-list-row'>
- <div class="glm-small-12 glm-columns admin-item-list">
- <div class="glm-row admin-item-data">
- <div class="item-title-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.topic.name}</div>
- <div class="item-company-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.title}</div>
- <div class="item-date-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.post_date.timestamp|date_format:"%Y-%m-%d"}</div>
- <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>
- </div>
- {/foreach}
- <script>
- jQuery(document).ready(function($) {
-
- });
- </script>
- {else if}
- <div class="no-item-data"> No Items</div>
- {/if}
-{include file='admin/footer.html'}
\ No newline at end of file
+++ /dev/null
-<div class="glm-item-row glm-row item-image-row">
- <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
- Image 1:
- </div>
- <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
- {if $item.fieldData.image_1}
- <img class="item-image" src="{$glmPluginMediaUrl}/images/small/{$item.fieldData.image_1}">
- {/if}
- <b>New image:</b> <input type="file" name="image_1_new">
- <div>
- <input type="checkbox" name="image_1_delete"> Delete Image<br>
- </div>
- </div>
-</div>
-<div class="glm-item-row glm-row item-image-row">
- <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
- Image 2:
- </div>
- <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
-
- {if $item.fieldData.image_2}
- <img class="item-image" src="{$glmPluginMediaUrl}/images/small/{$item.fieldData.image_2}">
- {/if}
- <b>New image:</b> <input type="file" name="image_2_new">
- <div>
- <input type="checkbox" name="image_2_delete"> Delete Image<br>
- </div>
- </div>
-</div>
-<div class="glm-item-row glm-row item-image-row">
- <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label ">
- Image 3:
- </div>
- <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
-
- {if $item.fieldData.image_3}
- <img class="item-image" src="{$glmPluginMediaUrl}/images/small/{$item.fieldData.image_3}">
- {/if}
- <b>New image:</b> <input type="file" name="image_3_new">
- <div>
- <input type="checkbox" name="image_3_delete"> Delete Image<br>
- </div>
- </div>
-</div>
\ No newline at end of file
--- /dev/null
+{include file='admin/header.html'}
+
+{if ($option == 'add' || $haveItem)}
+ <a href="{$thisUrl}?page={$thisPage}&glm_action=index" class="button button-secondary glm-button glm-right">Return to items List</a>
+
+ {if $option == 'edit' || $option == 'update'}
+ <a id="deleteItemButton" class="button button-secondary glm-button glm-right">Delete this Item</a>
+ <h2>Edit Item Posting
+ {else}
+ <h2>Add New Item Posting
+ {/if}
+
+ {if $itemUpdated}<span class="glm-notice glm-flash-updated">Item Updated</span>{/if}
+ {if $itemUpdateError}<span class="glm-error glm-flash-updated">Item Update Error</span>{/if}
+ {if $itemAdded}<span class="glm-notice glm-flash-updated">Item Added</span>{/if}
+ {if $itemAddError}<span class="glm-error glm-flash-updated">Item Add Error</span>{/if}
+ </h2>
+
+ {if $itemUpdateError || $itemAddError}
+ <h1 class="glm-error">NOTICE: Your Item has not yet been submitted.<br>Please select the tabs indicating a problem, correct the indicated fields and resubmit.</h1>
+ {else}
+ {/if}
+ <form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
+ <input type="hidden" name="glm_action" value="index">
+ {if $haveItem}
+ <input type="hidden" name="option" value="update">
+ <input type="hidden" name="item" value="{$item.fieldData.id}">
+ {else}
+ <input type="hidden" name="option" value="insert">
+ {/if}
+
+ <h2 class="nav-tab-wrapper" style="margin-bottom: 1em;">
+ <a id="glm-item-descr" data-show-table="glm-table-descr" class="glm-item-tab nav-tab nav-tab-active">Item Postings</a>
+ </h2>
+ <div class="glm-item-row glm-row">
+ <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+ Topic
+ </div>
+
+ <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+ <select id="topic" data-id="item-topic" name="topic">
+ <option value="">Topic</option>
+ {foreach $item.fieldData.topic.list as $topic}
+ <option value="{$topic.value}" {if $item.fieldData.topic.value == {$topic.value}} selected="selected"{/if}>
+ {$topic.name}
+ </option>
+ {/foreach}
+ </select>
+ </div>
+ </div>
+
+ <!-- ITEM TITLE -->
+ <div class="glm-item-row glm-row">
+ <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+ Item
+ </div>
+ <div class="glm-small-12 glm-medium-8 glm-columns admin-item-input">
+ <input type="text" name="title" {if $item.fieldData.title} value='{$item.fieldData.title}' {/if}>
+ </div>
+ </div>
+ <!-- MEMBER for admins only-->
+ {if !$lockedToMember && $memberList}
+ <!-- <pre>{$item.fieldData|@print_r:true}</pre> -->
+ <div class="glm-item-row glm-row">
+ <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+ Member
+ </div>
+ <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+ <select id="member" data-id="member" name="member">
+ <option value="">Select a Member</option>
+ {foreach from=$memberList item=m}
+ <option value="{$m.id}" {if $item.fieldData.member.value == {$m.id}} selected="selected"{/if}>
+ {$m.name}
+ </option>
+ {/foreach}
+ </select>
+ </div>
+ </div>
+ {else}
+ <!-- hidden MEMBER ID field here -->
+ <input type="hidden" name="member" value="{$item.fieldData.member.value}">
+ {/if}
+
+ <!-- COMPANY -->
+ <div class="glm-item-row glm-row">
+ <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+ Company
+ </div>
+ <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+ <input type="text" name="company" {if $item.fieldData.company} value='{$item.fieldData.company}' {/if}>
+ </div>
+ </div>
+ <!-- DESCRIPTION -->
+ <div class="glm-item-row glm-row">
+ <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+ Description
+ </div>
+ <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+ {php}
+ wp_editor(
+
+ '{$item.fieldData.descr|escape:quotes}',
+
+ 'descr', array(
+ 'media_buttons' => false,
+ 'tinymce' => false,
+ // 'quicktags' => false,
+ // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text.
+ 'textarea_name' => 'descr',
+ 'editor_height' => 200, // Height in px, overrides editor_rows
+ // 'textarea_rows' => 8
+ ));
+ {/php}
+ </div>
+ </div>
+ <!-- CONTACT NAME -->
+ <div class="glm-item-row glm-row">
+ <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+ Contact Name
+ </div>
+ <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+ <input type="text" name="contact_name" {if $item.fieldData.contact_name} value='{$item.fieldData.contact_name}' {/if}>
+ </div>
+ </div>
+ <!-- EMAIL TO -->
+ <div class="glm-item-row glm-row">
+ <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+ Contact Email
+ </div>
+ <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+ <input type="text" name="contact_email" {if $item.fieldData.contact_email} value='{$item.fieldData.contact_email}' {/if}>
+ </div>
+ </div>
+ <!-- CONTACT PHONE -->
+ <div class="glm-item-row glm-row">
+ <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+ Contact Phone
+ </div>
+ <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+ <input type="text" name="contact_phone" {if $item.fieldData.contact_phone} value='{$item.fieldData.contact_phone}' {/if}>
+ </div>
+ </div>
+ <br>
+ {include file='admin/forSale/parts/image_input.html'}
+ <br>
+ <!-- VISIBLE -->
+ <div class="glm-item-row glm-row">
+ <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+ Visible
+ </div>
+ <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+ <input id="item-visible" data-id="item-visible" type="checkbox" name="visible" class="visible-checkbox" {if $item.fieldData.visible.value} checked{/if}>
+ </div>
+ </div>
+ <!-- ITEM EXPIRATION-->
+ <div class="glm-item-row glm-row">
+ <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+ Item Expiration
+ </div>
+ <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+ <select id="item_expiration" data-id="item_expiration" name="item_expiration">
+ <option value="">Number of Days</option>
+ {foreach $item.fieldData.item_expiration.list as $exp}
+ {if 'fieldData'|array_key_exists:$item}
+ <option value="{$exp.value}" {if $item.fieldData.item_expiration.value == {$exp.value}} selected="selected"{/if}>
+ {else if}
+ <option value="{$exp.value}">
+ {/if}
+ {$exp.name}
+ </option>
+ {/foreach}
+ </select>
+ </div>
+ </div>
+
+
+ <input id="updateItem" type="submit" value="{if $haveItem}Update Item{else}Save New Item{/if}">
+ </form>
+
+{else} <!-- Can just display -->
+
+ <h3>Sorry, no Item found or permission not granted.</h3>
+
+{/if}
+
+ <!-- Delete Item Dialog Box -->
+
+ <div id="deleteItemDialog" class="glm-dialog-box" title="Delete Item">
+ <center>
+ <p><a id="deleteItemCancel" class="button button-primary">Cancel</a></p>
+ <p><input id="deleteitemubmit" type="submit" value="Delete this Item"></p>
+ </center>
+ <div class="glm-item-container">
+ <p><center><span class="glm-error">WARNING:</span></center></p>
+ <p>
+ <span class="glm-warning">Clicking the "Delete this Item" button above will
+ delete all of the data and images associated with this Item.
+ </span>
+ </p>
+ <p>
+ <span class="glm-error">
+ Once deleted, this information will no longer be available and cannot be retrieved!
+ If you are unsure that you want to completely remove this data, consider changing the status
+ of this Item to "Archived" instead.
+ </span>
+ </p>
+ </div>
+ </div>
+ <script type="text/javascript">
+ jQuery(document).ready(function($) {
+
+ {if $haveItem}
+ // Delete Item dialog
+ $("#deleteItemDialog").dialog({
+ autoOpen: false,
+ minWidth: 400,
+ dialogClass: "glm-dialog-no-close"
+ });
+ $('#deleteItemButton').click( function() {
+ $('#deleteItemDialog').dialog('open');
+ });
+ $('#deleteItemCancel').click( function() {
+ $("#deleteItemDialog").dialog("close");
+ });
+ $('#deleteitemubmit').click( function() {
+ window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=index&option=delete&item={$item.fieldData.id}");
+ });
+ {/if}
+
+ // Flash certain elements for a short time after display
+ $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
+
+ });
+ </script>
+
+
+{include file='admin/footer.html'}
--- /dev/null
+{include file='admin/header.html'}
+{if $haveMember}
+<input type="hidden" name="member" value="{$memberID}">
+{if !$lockedToMember}
+<input type="hidden" name="glm_action" value="item">
+{/if}
+<input type="hidden" name="option" value="list">
+{/if}
+ {if $itemData}
+ <div class="admin-new-item">
+ <a class="admin-new-item-link" href="{$thisUrl}?page={$thisPage}&glm_action=index&option=add">New item</a>
+ </div>
+ <div class="admin-item-list-header glm-row">
+ <div class="item-title-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Topic</div>
+ <div class="item-company-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Forsale Item</div>
+ <div class="item-date-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Item Post Date</div>
+ <div class="item-date-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Post For</div>
+ </div>
+
+ {foreach $itemData as $item=>$data}
+ <div class='glm-row admin-item-list-row'>
+ <div class="glm-small-12 glm-columns admin-item-list">
+ <div class="glm-row admin-item-data">
+ <div class="item-title-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.topic.name}</div>
+ <div class="item-company-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.title}</div>
+ <div class="item-date-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.post_date.timestamp|date_format:"%Y-%m-%d"}</div>
+ <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>
+ </div>
+ {/foreach}
+ <script>
+ jQuery(document).ready(function($) {
+
+ });
+ </script>
+ {else if}
+ <div class="no-item-data"> No Items</div>
+ {/if}
+{include file='admin/footer.html'}
\ No newline at end of file
--- /dev/null
+<div class="glm-item-row glm-row item-image-row">
+ <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+ Image 1:
+ </div>
+ <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+ {if $item.fieldData.image_1}
+ <img class="item-image" src="{$glmPluginMediaUrl}/images/small/{$item.fieldData.image_1}">
+ {/if}
+ <b>New image:</b> <input type="file" name="image_1_new">
+ <div>
+ <input type="checkbox" name="image_1_delete"> Delete Image<br>
+ </div>
+ </div>
+</div>
+<div class="glm-item-row glm-row item-image-row">
+ <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+ Image 2:
+ </div>
+ <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+ {if $item.fieldData.image_2}
+ <img class="item-image" src="{$glmPluginMediaUrl}/images/small/{$item.fieldData.image_2}">
+ {/if}
+ <b>New image:</b> <input type="file" name="image_2_new">
+ <div>
+ <input type="checkbox" name="image_2_delete"> Delete Image<br>
+ </div>
+ </div>
+</div>
+<div class="glm-item-row glm-row item-image-row">
+ <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label ">
+ Image 3:
+ </div>
+ <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+ {if $item.fieldData.image_3}
+ <img class="item-image" src="{$glmPluginMediaUrl}/images/small/{$item.fieldData.image_3}">
+ {/if}
+ <b>New image:</b> <input type="file" name="image_3_new">
+ <div>
+ <input type="checkbox" name="image_3_delete"> Delete Image<br>
+ </div>
+ </div>
+</div>
\ No newline at end of file
--- /dev/null
+
+<div class="front-item-list-wrapper">
+ {if !empty($itemData)}
+ {foreach $itemData as $item=>$data}
+ <div class="front-list-item glm-row">
+ <!-- <pre>{$data|@print_r}</pre> -->
+ <div class="glm-small-12 glm-medium-9 glm-columns no-padding">
+ <div class="glm-small-12 glm-columns front-item-title no-padding">
+
+ <span>{$data.title}</span>
+ </div>
+ <div class="glm-small-12 glm-columns front-item-company no-padding">
+ <span>Company: </span>
+ {$data.company}
+ </div>
+ <div class="glm-small-12 glm-columns front-item-description no-padding">
+ <span>Description: </span>
+ {$data.descr}
+ </div>
+ <div class="glm-small-12 glm-columns front-item-name no-padding">
+ <span>Contact: </span>
+ {$data.contact_name}
+ </div>
+ <div class="glm-small-12 glm-columns front-item-phone no-padding">
+ <span>Contact Phone: </span>
+ {$data.contact_phone}
+ </div>
+ <div class="glm-small-12 glm-columns front-item-email no-padding">
+ <a href="mailto:{$data.contact_email}">{$data.contact_email}</a>
+ </div>
+ </div>
+ <div class="glm-small-12 glm-medium-3 glm-columns">
+ {if $data.topic.value == 1}
+ <div class="front-list-topic item-wanted">Wanted</div>
+ {else}
+ <div class="front-list-topic item-sale">For Sale</div>
+ {/if}
+ {if $data.image_1}
+ <img src="{$glmPluginMediaUrl}/images/small/{$data.image_1}" alt="">
+ {/if}
+ <a href="{$siteBaseUrl}for-sale-detail/?item={$data.id}">Item Details</a>
+ </div>
+ </div>
+ {/foreach}
+ {else}
+ No Items Found
+ {/if}
+</div>
\ No newline at end of file