From: Laury GvR Date: Wed, 17 Feb 2016 20:08:51 +0000 (-0500) Subject: Add social sprites and admin menu. Database broken though X-Git-Tag: v1.0.0^2~25 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=504ef776511f29594580993937044497e7ae225c;p=WP-Plugins%2Fglm-member-db-social.git Add social sprites and admin menu. Database broken though --- diff --git a/activate.php b/activate.php index f660963..7e41212 100644 --- a/activate.php +++ b/activate.php @@ -8,7 +8,7 @@ * * @category glmWordPressPlugin * @package glmMembersDatabaseSocial - * @author Chuck Scott + * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia * @release activate.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ * @link http://dev.gaslightmedia.com/ diff --git a/assets/social-color-sprite-s.jpg b/assets/social-color-sprite-s.jpg new file mode 100644 index 0000000..ded6155 Binary files /dev/null and b/assets/social-color-sprite-s.jpg differ diff --git a/assets/social-few-full-sprite.jpg b/assets/social-few-full-sprite.jpg new file mode 100644 index 0000000..a06926f Binary files /dev/null and b/assets/social-few-full-sprite.jpg differ diff --git a/assets/social-full-sprite.jpg b/assets/social-full-sprite.jpg new file mode 100644 index 0000000..8341566 Binary files /dev/null and b/assets/social-full-sprite.jpg differ diff --git a/assets/social-shadow-sprite-s.jpg b/assets/social-shadow-sprite-s.jpg new file mode 100644 index 0000000..3c6dc2c Binary files /dev/null and b/assets/social-shadow-sprite-s.jpg differ diff --git a/classes/data/dataSample.php b/classes/data/dataSample.php deleted file mode 100644 index 2a423fd..0000000 --- a/classes/data/dataSample.php +++ /dev/null @@ -1,172 +0,0 @@ - - * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataSocial.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ - */ - -/********************************************************************** - * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED - * - * Please change all references to social, Social, or SOCIAL to a name - * appropriate for your new Add-On. - * - * Data fields in this file are social only. - * - * Remove this message before using this file in production! - **********************************************************************/ - -// Member Info Data required -require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMemberInfo.php'); - -/** - * GlmDataSocial class - * - * PHP version 5 - * - * @category Data - * @package GLM Member DB - * @author Chuck Scott - * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott - * Exp $ - */ -class GlmDataSocial 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; - /** - * MemberInfo DB object - * - * @var $MemberInfo - * @access public - */ - public $MemberInfo; - - /** - * 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_SOCIAL_PLUGIN_DB_PREFIX . 'socialtable'; - - /* - * Table Data Fields - */ - - $this->fields = array ( - - 'id' => array ( - 'field' => 'id', - 'type' => 'integer', - 'view_only' => true, - 'use' => 'a' - ), - - // Active flag - 'active' => array ( - 'field' => 'active', - 'type' => 'checkbox', - 'default' => true, - '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 member result and also sort by member 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 diff --git a/classes/data/dataSocial.php b/classes/data/dataSocial.php new file mode 100644 index 0000000..4f1b998 --- /dev/null +++ b/classes/data/dataSocial.php @@ -0,0 +1,172 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataSocial.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + */ + +/********************************************************************** + * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED + * + * Please change all references to social, Social, or SOCIAL to a name + * appropriate for your new Add-On. + * + * Data fields in this file are social only. + * + * Remove this message before using this file in production! + **********************************************************************/ + +// Member Info Data required +require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMemberInfo.php'); + +/** + * GlmDataSocial class + * + * PHP version 5 + * + * @category Data + * @package GLM Member DB + * @author Gaslight Media + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott + * Exp $ + */ +class GlmDataSocial 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; + /** + * MemberInfo DB object + * + * @var $MemberInfo + * @access public + */ + public $MemberInfo; + + /** + * 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_SOCIAL_PLUGIN_DB_PREFIX . 'socialtable'; + + /* + * Table Data Fields + */ + + $this->fields = array ( + + 'id' => array ( + 'field' => 'id', + 'type' => 'integer', + 'view_only' => true, + 'use' => 'a' + ), + + // Active flag + 'active' => array ( + 'field' => 'active', + 'type' => 'checkbox', + 'default' => true, + '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 member result and also sort by member 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 diff --git a/css/admin.css b/css/admin.css new file mode 100644 index 0000000..4c16334 --- /dev/null +++ b/css/admin.css @@ -0,0 +1,14 @@ +/* +To change this license header, choose License Headers in Project Properties. +To change this template file, choose Tools | Templates +and open the template in the editor. +*/ +/* + Created on : Feb 17, 2016, 2:33:15 PM + Author : laury +*/ + +.glm-member-db-social-icon { + border-radius: 20px; + margin-bottom: 5px; +} \ No newline at end of file diff --git a/deactivate.php b/deactivate.php index 190a52e..3dbaade 100644 --- a/deactivate.php +++ b/deactivate.php @@ -7,7 +7,7 @@ * * @category glmWordPressPlugin * @package glmMembersDatabaseSocial - * @author Chuck Scott + * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ * @link http://dev.gaslightmedia.com/ diff --git a/defines.php b/defines.php index 89b8a7f..9befeaf 100644 --- a/defines.php +++ b/defines.php @@ -49,6 +49,7 @@ $WPUploadDir = wp_upload_dir(); // URLs define('GLM_MEMBERS_SOCIAL_SITE_BASE_URL', home_url('/') ); define('GLM_MEMBERS_SOCIAL_PLUGIN_URL', plugin_dir_url(__FILE__)); +define('GLM_MEMBERS_SOCIAL_PLUGIN_ASSETS_URL', GLM_MEMBERS_SOCIAL_PLUGIN_URL.'assets'); define('GLM_MEMBERS_SOCIAL_PLUGIN_ADMIN_URL', admin_url('admin.php')); define('GLM_MEMBERS_SOCIAL_PLUGIN_BASE_URL', WP_PLUGIN_URL.'/'.GLM_MEMBERS_SOCIAL_PLUGIN_SLUG); define('GLM_MEMBERS_SOCIAL_PLUGIN_CURRENT_URL', $urlParts['scheme'].'://'.$urlParts['host'].$pageUri[0]); diff --git a/index.php b/index.php index 869e66b..e9d8a08 100644 --- a/index.php +++ b/index.php @@ -3,8 +3,8 @@ * Plugin Name: GLM Members Database Social * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 0.0.6 - * Author: Chuck Scott + * Version: 0.0.1 + * Author: Gaslight Media * Author URI: http://www.gaslightmedia.com/ * License: GPL2 */ @@ -33,7 +33,7 @@ * * @category glmWordPressPluginChild * @package glmMembersDatabaseSocialAddOn - * @author Chuck Scott + * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia * @version 1.1.1 */ diff --git a/models/admin/info/index.php b/models/admin/info/index.php index f54525c..2440b68 100644 --- a/models/admin/info/index.php +++ b/models/admin/info/index.php @@ -7,7 +7,7 @@ * * @category glmWordPressPlugin * @package glmMembersDatabase - * @author Chuck Scott + * @author Gaslight Media * @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/ diff --git a/models/admin/member/social.php b/models/admin/member/social.php new file mode 100644 index 0000000..f3d5f11 --- /dev/null +++ b/models/admin/member/social.php @@ -0,0 +1,126 @@ + + * @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_CONTACTS_PLUGIN_CLASS_PATH.'/data/dataContacts.php'); + +class GlmMembersAdmin_member_social // extends GlmDataContacts +{ + + /** + * 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) + { + + $displayData = 'This is the Social "Member" "Social" model talking to you from inside WordPress.'; + + // Compile template data + $templateData = array( + 'displayData' => $displayData, + 'assetsUrl' => GLM_MEMBERS_SOCIAL_PLUGIN_ASSETS_URL + + ); + + // Return status, any suggested view, and any data to controller + return array( + 'status' => true, + 'modelRedirect' => false, + 'view' => 'admin/member/social.html', + 'data' => $templateData + ); + + } + +} diff --git a/models/admin/members/sample.php b/models/admin/members/sample.php deleted file mode 100644 index 161e970..0000000 --- a/models/admin/members/sample.php +++ /dev/null @@ -1,125 +0,0 @@ - - * @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_CONTACTS_PLUGIN_CLASS_PATH.'/data/dataContacts.php'); - -class GlmMembersAdmin_members_social // extends GlmDataContacts -{ - - /** - * 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) - { - - $displayData = 'This is the Social "Members" "Social" model talking to you from inside WordPress.'; - - // Compile template data - $templateData = array( - 'displayData' => $displayData - ); - - // Return status, any suggested view, and any data to controller - return array( - 'status' => true, - 'modelRedirect' => false, - 'view' => 'admin/members/social.html', - 'data' => $templateData - ); - - } - - -} diff --git a/models/admin/sample/index.php b/models/admin/sample/index.php deleted file mode 100644 index c987445..0000000 --- a/models/admin/sample/index.php +++ /dev/null @@ -1,125 +0,0 @@ - - * @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_CONTACTS_PLUGIN_CLASS_PATH.'/data/dataContacts.php'); - -class GlmMembersAdmin_social_index // extends GlmDataContacts -{ - - /** - * 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) - { - - $displayData = 'Hello, World! This is the Social Add-On "social" model talking to you from inside WordPress.'; - - // Compile template data - $templateData = array( - 'displayData' => $displayData - ); - - // Return status, any suggested view, and any data to controller - return array( - 'status' => true, - 'modelRedirect' => false, - 'view' => 'admin/social/index.html', - 'data' => $templateData - ); - - } - - -} diff --git a/models/admin/sample/more.php b/models/admin/sample/more.php deleted file mode 100644 index 8a3cd59..0000000 --- a/models/admin/sample/more.php +++ /dev/null @@ -1,125 +0,0 @@ - - * @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_CONTACTS_PLUGIN_CLASS_PATH.'/data/dataContacts.php'); - -class GlmMembersAdmin_social_more // extends GlmDataContacts -{ - - /** - * 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) - { - - $displayData = 'Welcome to more information!
This is the Social Add-On "social" model with action "more" talking to you from inside WordPress.'; - - // Compile template data - $templateData = array( - 'displayData' => $displayData - ); - - // Return status, any suggested view, and any data to controller - return array( - 'status' => true, - 'modelRedirect' => false, - 'view' => 'admin/social/more.html', - 'data' => $templateData - ); - - } - - -} diff --git a/models/admin/social/index.php b/models/admin/social/index.php new file mode 100644 index 0000000..8899c8e --- /dev/null +++ b/models/admin/social/index.php @@ -0,0 +1,125 @@ + + * @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_CONTACTS_PLUGIN_CLASS_PATH.'/data/dataContacts.php'); + +class GlmMembersAdmin_social_index // extends GlmDataContacts +{ + + /** + * 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) + { + + $displayData = 'Hello, World! This is the Social Add-On "social" model talking to you from inside WordPress.'; + + // Compile template data + $templateData = array( + 'displayData' => $displayData + ); + + // Return status, any suggested view, and any data to controller + return array( + 'status' => true, + 'modelRedirect' => false, + 'view' => 'admin/social/index.html', + 'data' => $templateData + ); + + } + + +} diff --git a/models/admin/social/more.php b/models/admin/social/more.php new file mode 100644 index 0000000..2cd5d0e --- /dev/null +++ b/models/admin/social/more.php @@ -0,0 +1,125 @@ + + * @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_CONTACTS_PLUGIN_CLASS_PATH.'/data/dataContacts.php'); + +class GlmMembersAdmin_social_more // extends GlmDataContacts +{ + + /** + * 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) + { + + $displayData = 'Welcome to more information!
This is the Social Add-On "social" model with action "more" talking to you from inside WordPress.'; + + // Compile template data + $templateData = array( + 'displayData' => $displayData + ); + + // Return status, any suggested view, and any data to controller + return array( + 'status' => true, + 'modelRedirect' => false, + 'view' => 'admin/social/more.html', + 'data' => $templateData + ); + + } + + +} diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 776ec3e..42fba48 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -7,7 +7,7 @@ * * @category glmWordPressPlugin * @package glmMembersDatabase - * @author Chuck Scott + * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia * @release adminHooks.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ * @link http://dev.gaslightmedia.com/ diff --git a/setup/adminMenus.php b/setup/adminMenus.php index c24f313..90c84c5 100644 --- a/setup/adminMenus.php +++ b/setup/adminMenus.php @@ -7,7 +7,7 @@ * * @category glmWordPressPlugin * @package glmMembersDatabase - * @author Chuck Scott + * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ * @link http://dev.gaslightmedia.com/ diff --git a/setup/adminTabs.php b/setup/adminTabs.php index a26787b..dd5514e 100644 --- a/setup/adminTabs.php +++ b/setup/adminTabs.php @@ -7,7 +7,7 @@ * * @category glmWordPressPlugin * @package glmMembersDatabase - * @author Chuck Scott + * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ * @link http://dev.gaslightmedia.com/ @@ -46,17 +46,16 @@ * */ -add_filter('glm-member-db-add-tab-for-members', +add_filter('glm-member-db-add-tab-for-member', function($addOnTabs) { $newTabs = array( array( 'text' => 'Social', - 'menu' => 'members', + 'menu' => 'member', 'action' => 'social' ) ); $addOnTabs = array_merge($addOnTabs, $newTabs); return $addOnTabs; } -); - +); \ No newline at end of file diff --git a/setup/databaseScripts/SAMPLE.create_database_V0.0.1.sql b/setup/databaseScripts/SAMPLE.create_database_V0.0.1.sql deleted file mode 100644 index abe65c1..0000000 --- a/setup/databaseScripts/SAMPLE.create_database_V0.0.1.sql +++ /dev/null @@ -1,42 +0,0 @@ --- Gaslight Media Members Database - Social --- File Created: 12/02/15 15:27:15 --- Database Version: 0.0.1 --- Database Creation Script --- --- This file is called to create a new set of tables for this --- add-on for the most receint database version for this add-on. --- --- There should only be one such file in this directory --- --- To permit each query below to be executed separately, --- all queries must be separated by a line with four dashes - - --- ********************************************************************** --- NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED --- --- Please change all references to social, Social, or SOCIAL to a name --- appropriate for your new Add-On. --- --- Tables and queries in this file are social only. --- --- Remove this message before using this file in production! --- **********************************************************************/ - - --- Social Management Settings -CREATE TABLE {prefix}management ( - id INT NOT NULL AUTO_INCREMENT, - canonical_social_page TINYTEXT NULL, -- Canonical page slug for detail - PRIMARY KEY (id) -); - ----- - --- Set default social management entry -INSERT INTO {prefix}management - ( id, canonical_social_page ) - VALUES - ( 1, 'social data' ) -; - diff --git a/setup/databaseScripts/SAMPLE.dbVersions.php b/setup/databaseScripts/SAMPLE.dbVersions.php deleted file mode 100644 index c022738..0000000 --- a/setup/databaseScripts/SAMPLE.dbVersions.php +++ /dev/null @@ -1,40 +0,0 @@ - - * @license http://www.gaslightmedia.com Gaslightmedia - * @release dbVersions.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ - * @link http://dev.gaslightmedia.com/ - */ - - -/********************************************************************** - * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED - * - * Please change all references to social, Social, or SOCIAL to a name - * appropriate for your new Add-On. - * - * This file lists all versions of the database tables for this add-on. - * The last entry in the array below should be for the most recent - * version and should match the "create_database_V..." file in this - * directory. - * - * NOTE: When first creating a new add-on with database tables, there - * should only be one line in the array below and there should be no - * "update_database..." files in this directory. - * - * Remove this message before using this file in production! - **********************************************************************/ - - -$glmMembersSocialDbVersions = array( - '0.0.1' => array('version' => '0.0.1', 'tables' => 2), - '0.0.2' => array('version' => '0.0.2', 'tables' => 3) -); - diff --git a/setup/databaseScripts/SAMPLE.update_database_V0.0.2.php b/setup/databaseScripts/SAMPLE.update_database_V0.0.2.php deleted file mode 100644 index 958c543..0000000 --- a/setup/databaseScripts/SAMPLE.update_database_V0.0.2.php +++ /dev/null @@ -1,54 +0,0 @@ -wpdb->get_results('SELECT id, title FROM '.GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX.'socials;', ARRAY_A); - -// If there's any social records -if ($socialRecords && count($socialRecords) > 0) { - - // For each social record - foreach ($socialRecords as $p) { - - // Create a slug from the title - $slug = sanitize_title($p['title']).'-'.$p['id']; - - // Store this value back into the record - $this->wpdb->update( - GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX.'socials', - array( - 'social_slug' => $slug - ), - array( 'id' => $p['id'] ), - array( '%s' ), - array( '%d') - ); - } - -} diff --git a/setup/databaseScripts/SAMPLE.update_database_V0.0.2.sql b/setup/databaseScripts/SAMPLE.update_database_V0.0.2.sql deleted file mode 100644 index 286cb84..0000000 --- a/setup/databaseScripts/SAMPLE.update_database_V0.0.2.sql +++ /dev/null @@ -1,30 +0,0 @@ --- Gaslight Media Members Database --- File Created: 12/09/14 15:27:15 --- Database Version: 0.0.2 --- Database Update From Previous Version Script --- --- To permit each query below to be executed separately, --- all queries must be separated by a line with four dashses - --- Package Management Settings -CREATE TABLE {prefix}management ( - id INT NOT NULL AUTO_INCREMENT, - canonical_package_page TINYTEXT NULL, -- Canonical page slug for package detail - PRIMARY KEY (id) -); - ----- - --- Set default package management entry -INSERT INTO {prefix}management - ( id, canonical_package_page ) - VALUES - ( 1, 'package-detail' ) -; - ----- - -ALTER TABLE {prefix}packages ADD COLUMN package_slug TINYTEXT; - - - diff --git a/setup/databaseScripts/SOCIAL.create_database_V0.0.1.sql b/setup/databaseScripts/SOCIAL.create_database_V0.0.1.sql new file mode 100644 index 0000000..dc9b501 --- /dev/null +++ b/setup/databaseScripts/SOCIAL.create_database_V0.0.1.sql @@ -0,0 +1,67 @@ +-- Gaslight Media Members Database - Social +-- File Created: 12/02/15 15:27:15 +-- Database Version: 0.0.1 +-- Database Creation Script +-- +-- This file is called to create a new set of tables for this +-- add-on for the most receint database version for this add-on. +-- +-- There should only be one such file in this directory +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashes + + +-- Social Management Settings +CREATE TABLE {prefix}management ( + id INT NOT NULL AUTO_INCREMENT, + canonical_social_page TINYTEXT NULL, -- Canonical page slug for detail + PRIMARY KEY (id) +); + +---- + +-- Set default social management entry +INSERT INTO {prefix}management + ( id, canonical_social_page ) + VALUES + ( 1, 'social data' ) +; + +---- + +CREATE TABLE {prefix}social ( + id INT NOT NULL AUTO_INCREMENT, + blogger_url TEXT NULL, + youtube_url TEXT NULL, + facebook_url TEXT NULL, + twitter_url TEXT NULL, + imgur_url TEXT NULL, + flickr_url TEXT NULL, + tumblr_url TEXT NULL, + instagram_url TEXT NULL, + linkedin_url TEXT NULL, + googleplus_url TEXT NULL, + flickr_url TEXT NULL, + PRIMARY KEY (id) +); + +---- + +CREATE TABLE {prefix}SOCIALTEST ( + id INT NOT NULL AUTO_INCREMENT, + active BOOLEAN NULL, -- Package is active + title TINYTEXT NULL, -- Title of package + package_slug TINYTEXT NULL, -- Package name slug for canonical URLs (lowercase, "-" for spaces, no punctuation) + descr TEXT NULL, -- Description of package + short_descr TINYTEXT NULL, -- Short description of package + image TINYTEXT NULL, -- Package image + start_date TIMESTAMP NULL, -- Date display of this package starts + end_date TIMESTAMP NULL, -- Date display of this package ends (last date of display) + expire_date TIMESTAMP NULL, -- Date package expires (first date it's expired) + position INT NULL, -- Display order position + pricing TINYTEXT NULL, -- Pricing, descriptive + ref_type INT NULL, -- Type of entity this package is associated with + ref_dest INT NULL, -- Pointer to the specific entity + PRIMARY KEY (id), +); diff --git a/setup/databaseScripts/SOCIAL.dbVersions.php b/setup/databaseScripts/SOCIAL.dbVersions.php new file mode 100644 index 0000000..1e8be37 --- /dev/null +++ b/setup/databaseScripts/SOCIAL.dbVersions.php @@ -0,0 +1,39 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release dbVersions.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ + * @link http://dev.gaslightmedia.com/ + */ + + +/********************************************************************** + * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED + * + * Please change all references to social, Social, or SOCIAL to a name + * appropriate for your new Add-On. + * + * This file lists all versions of the database tables for this add-on. + * The last entry in the array below should be for the most recent + * version and should match the "create_database_V..." file in this + * directory. + * + * NOTE: When first creating a new add-on with database tables, there + * should only be one line in the array below and there should be no + * "update_database..." files in this directory. + * + * Remove this message before using this file in production! + **********************************************************************/ + + +$glmMembersSocialDbVersions = array( + '0.0.1' => array('version' => '0.0.1', 'tables' => 3) +); + diff --git a/setup/frontHooks.php b/setup/frontHooks.php index 7af917d..3ed55df 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -7,7 +7,7 @@ * * @category glmWordPressPlugin * @package glmMembersDatabase - * @author Chuck Scott + * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia * @release frontHooks.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ * @link http://dev.gaslightmedia.com/ diff --git a/setup/permissions.php b/setup/permissions.php index 3d7dbd6..e66d3d7 100644 --- a/setup/permissions.php +++ b/setup/permissions.php @@ -7,7 +7,7 @@ * * @category glmWordPressPlugin * @package glmMembersDatabase - * @author Chuck Scott + * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia * @release permissions.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ * @link http://dev.gaslightmedia.com/ diff --git a/setup/rolesAndCapabilities.php b/setup/rolesAndCapabilities.php index 272268b..5b7a2d0 100644 --- a/setup/rolesAndCapabilities.php +++ b/setup/rolesAndCapabilities.php @@ -7,7 +7,7 @@ * * @category glmWordPressPlugin * @package glmMembersDatabase - * @author Chuck Scott + * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia * @release rolesAndPermissions.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ * @link http://dev.gaslightmedia.com/ diff --git a/setup/shortcodes.php b/setup/shortcodes.php index 8bdee73..97a1a0a 100644 --- a/setup/shortcodes.php +++ b/setup/shortcodes.php @@ -7,7 +7,7 @@ * * @category glmWordPressPlugin * @package glmMembersDatabase - * @author Chuck Scott + * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia * @release shortcodes.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ * @link http://dev.gaslightmedia.com/ diff --git a/setup/validActions.php b/setup/validActions.php index 7a7b757..30d3eb1 100644 --- a/setup/validActions.php +++ b/setup/validActions.php @@ -7,7 +7,7 @@ * * @category glmWordPressPlugin * @package glmMembersDatabase - * @author Chuck Scott + * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ * @link http://dev.gaslightmedia.com/ @@ -46,7 +46,7 @@ $glmMembersSocialAddOnValidActions = array( 'adminActions' => array( - 'members' => array( + 'member' => array( 'social' => GLM_MEMBERS_SOCIAL_PLUGIN_SLUG, ), 'social' => array( diff --git a/uninstall.php b/uninstall.php index 7bb1508..5bc5d9b 100644 --- a/uninstall.php +++ b/uninstall.php @@ -10,7 +10,7 @@ die('uninstall not configured - See plugin uninstall.php script!'); * * @category glmWordPressPlugin * @package glmMembersDatabaseSocial - * @author Chuck Scott + * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ * @link http://dev.gaslightmedia.com/ diff --git a/views/admin/member/social.html b/views/admin/member/social.html new file mode 100644 index 0000000..5f99600 --- /dev/null +++ b/views/admin/member/social.html @@ -0,0 +1,30 @@ +{include file='admin/members/header.html'} + +

Members Social Tab

+

{$displayData}

+ + + + + + + + + + + + + + + + + + + + +
Facebook
Twitter
Pinterest
Google Plus
Digg
LinkedIn
Instagram
RSS
YouTube
Wordpress
Flickr
Pinterest2
Blog
Wordpress2
?name?
?name?
Photobucket
Blog2
+{include file='admin/footer.html'} \ No newline at end of file diff --git a/views/admin/members/sample.html b/views/admin/members/sample.html deleted file mode 100644 index e3f9e8e..0000000 --- a/views/admin/members/sample.html +++ /dev/null @@ -1,6 +0,0 @@ -{include file='admin/members/header.html'} - -

Members Social Tab

-

{$displayData}

- -{include file='admin/footer.html'} \ No newline at end of file diff --git a/views/admin/sample/index.html b/views/admin/sample/index.html deleted file mode 100644 index 665f0f3..0000000 --- a/views/admin/sample/index.html +++ /dev/null @@ -1,7 +0,0 @@ -
-
-

Social Model

-

{$displayData}

- Click me to see more! -
-
\ No newline at end of file diff --git a/views/admin/sample/more.html b/views/admin/sample/more.html deleted file mode 100644 index bd2ae50..0000000 --- a/views/admin/sample/more.html +++ /dev/null @@ -1,6 +0,0 @@ -
-
-

Social Model - More Information

-

{$displayData}

-
-
\ No newline at end of file diff --git a/views/admin/social/index.html b/views/admin/social/index.html new file mode 100644 index 0000000..665f0f3 --- /dev/null +++ b/views/admin/social/index.html @@ -0,0 +1,7 @@ +
+
+

Social Model

+

{$displayData}

+ Click me to see more! +
+
\ No newline at end of file diff --git a/views/admin/social/more.html b/views/admin/social/more.html new file mode 100644 index 0000000..bd2ae50 --- /dev/null +++ b/views/admin/social/more.html @@ -0,0 +1,6 @@ +
+
+

Social Model - More Information

+

{$displayData}

+
+
\ No newline at end of file