--- /dev/null
+<?php
+/**
+ * GLM Member-DB WordPress Add-On Plugin
+ * Data Class Social
+ *
+ * PHP version 5.3
+ *
+ * @category Data
+ * @package GLM Member-DB
+ * @author Gaslight Media <dev@gaslightmedia.com>
+ * @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');
+
+/**
+ * GlmDataUrls class
+ *
+ * PHP version 5
+ *
+ * @category Data
+ * @package GLM Member DB
+ * @author Gaslight Media <dev@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 GlmDataSocialUrls 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 . 'social_urls';
+
+ /*
+ * Table Data Fields
+ */
+
+ $this->fields = array (
+ // The id of this url record
+ 'id' => array (
+ 'field' => 'id',
+ 'type' => 'integer',
+ 'view_only' => true,
+ 'use' => 'a'
+ ),
+
+ // Reference Type - Insert new record
+ 'ref_type_insert' => array (
+ 'field' => 'ref_type',
+ 'type' => 'integer',
+ 'use' => 'i'
+ ),
+
+ // Reference Type - Output only
+ 'ref_type' => array (
+ 'field' => 'ref_type',
+ 'type' => 'list',
+ 'list' => $this->config['ref_type'],
+ 'use' => 'lged'
+ ),
+
+ // Ref_name (member name - need to update this to be Reference Type aware)
+ 'ref_dest' => array (
+ 'field' => 'ref_dest',
+ 'type' => 'pointer',
+ 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'members',
+ 'p_field' => 'name',
+ 'p_orderby' => 'name',
+ 'p_blank' => true,
+ 'use' => 'a'
+ ),
+
+ // Reference Target ID
+ 'ref_dest_id' => array (
+ 'field' => 'ref_dest',
+ 'as' => 'ref_dest_id',
+ 'type' => 'integer',
+ 'use' => 'ilged'
+ ),
+
+
+ // The member's URL for a certain medium
+ 'url' => array (
+ 'field' => 'url',
+ 'type' => 'text',
+ 'default' => true,
+ 'use' => 'a'
+ ),
+ // The social medium
+ 'social' => array (
+ 'field' => 'social',
+ 'type' => 'pointer',
+ 'p_table' => GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX . 'socials',
+ 'p_field' => 'name',
+ 'p_orderby' => 'name',
+ 'p_blank' => 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;
+ }
+
+}
+
+?>
* @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');
-
/**
* GlmDataSocials class
*
'default' => true,
'use' => 'a'
),
-
- // X Position of icon in sprite
- 'xpos' => array (
+
+ // Base 64 Image Icon
+ 'b64icon' => array (
'field' => 'xpos',
'type' => 'integer',
'view_only' => true,
'use' => 'a'
),
- // Y Position of icon in sprite
- 'ypos' => array(
- 'field' => 'ypos',
- 'type' => 'integer',
- 'required' => true,
- 'use' => 'a'
- ),
-
// Base url of the social record
'baseurl' => array(
'field' => 'baseurl',
'use' => 'a'
)
);
+
}
/*
+++ /dev/null
-<?php
-/**
- * GLM Member-DB WordPress Add-On Plugin
- * Data Class Social
- *
- * PHP version 5.3
- *
- * @category Data
- * @package GLM Member-DB
- * @author Gaslight Media <dev@gaslightmedia.com>
- * @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');
-
-/**
- * GlmDataUrls class
- *
- * PHP version 5
- *
- * @category Data
- * @package GLM Member DB
- * @author Gaslight Media <dev@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 GlmDataUrls 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 . 'urls';
-
- /*
- * Table Data Fields
- */
-
- $this->fields = array (
- // The id of this url record
- 'id' => array (
- 'field' => 'id',
- 'type' => 'integer',
- 'view_only' => true,
- 'use' => 'a'
- ),
-
- // The id of the associated member
- 'member_id' => array (
- 'field' => 'member_id',
- 'type' => 'integer',
- 'default' => true,
- 'use' => 'a'
- ),
- // The member's URL for a certain medium
- 'url' => array (
- 'field' => 'url',
- 'type' => 'text',
- 'default' => true,
- 'use' => 'a'
- ),
- // The social medium
- 'medium' => array (
- 'field' => 'medium',
- 'type' => 'text',
- '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;
- }
-
-}
-
-?>
* version from this plugin.
*/
define('GLM_MEMBERS_SOCIAL_PLUGIN_VERSION', '0.0.6');
-define('GLM_MEMBERS_SOCIAL_PLUGIN_DB_VERSION', '0.0.1');
+define('GLM_MEMBERS_SOCIAL_PLUGIN_DB_VERSION', '0.0.2');
// This is the minimum version of the GLM Members DB plugin require for this plugin.
define('GLM_MEMBERS_SOCIAL_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '1.0.57');
* Some initial setup and tests
*/
-$startupNotices = '';
-
// Get standard defined parameters
require_once('defines.php');
* Check installation, activation, and version of main Member DB plugin
*/
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
-$plugin_name = 'glm-member-db/glm-member-db.php';
+$plugin_name = 'glm-member-db/index.php';
$is_active = is_plugin_active($plugin_name);
// If it's not active, then warn user and deactivate this add-on plugin
if ($is_active != '1') {
add_action( 'admin_notices', 'glmMembersSocialPluginRequired' );
- deactivate_plugins('/'.GLM_MEMBERS_SOCIAL_PLUGIN_SLUG.'/'.GLM_MEMBERS_SOCIAL_PLUGIN_SLUG.'.php');
+ deactivate_plugins('/'.GLM_MEMBERS_SOCIAL_PLUGIN_SLUG.'/index.php');
}
// Function to generate message regarding main GLM Member DB plugin version is not receint enought to run this add-on
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * Admin Member User Profile
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Gaslight Media <dev@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 Management Social data abstract
+require_once GLM_MEMBERS_SOCIAL_PLUGIN_CLASS_PATH.'/data/dataSocials.php';
+
+/**
+ * GlmMembersAdmin_management_socials
+ *
+ * PHP version 5
+ *
+ * @category Model
+ * @package GLM Member DB
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release SVN: $Id: packaging.php,v 1.0 2011/01/25 19:31:47 cscott
+ * Exp $
+ */
+class GlmMembersAdmin_management_social extends GlmDataSocials
+{
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * Member ID
+ *
+ * @var $memberID
+ * @access public
+ */
+ public $memberID = false;
+ /*
+ * Constructor
+ *
+ * This contructor performs the work for this model. This model returns
+ * an array containing the following.
+ *
+ * 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 social data class
+ parent::__construct(false, false);
+
+ }
+
+ public function modelAction($actionData = false)
+ {
+
+ $success = true;
+ $socialUpdated = false;
+ $socialError = false;
+ $statusMessage = 'Social Updated';
+ $option = false;
+ $debug = true;
+
+ $socialList = $this->getList();
+
+ if (isset($_REQUEST['option'])) {
+ $option = trim(filter_var($_REQUEST['option'],FILTER_SANITIZE_STRING));
+ } else {
+ $option = "default";
+ }
+
+ switch ($option) {
+ case "submit":
+ $Socials->updateEntry();
+ break;
+ case "social";
+ default:
+
+ break;
+ }
+
+ // If we had a fatal error, redirect to the error page
+ if ($socialError) {
+ return array(
+ 'status' => $success,
+ 'option' => $option,
+ 'menuItemRedirect' => 'error',
+ 'modelRedirect' => 'index',
+ 'view' => 'admin/error/index.html',
+ 'data' => false
+ );
+ }
+
+// if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+// glmMembersAdmin::addNotice($memberTypes, 'DataBlock', 'Member Types Data');
+// }
+ // Refresh the URL list before sending it to the front
+
+ // Compile template data
+ $templateData = array(
+ 'assetsUrl' => GLM_MEMBERS_SOCIAL_PLUGIN_ASSETS_URL,
+ 'socialUpdated' => $socialUpdated,
+ 'socialError' => $socialError,
+ 'option' => $option,
+ 'socials' => $socialList,
+ 'statusMessage' => $statusMessage
+ );
+
+ // Return status, any suggested view, and any data to controller
+ return array(
+ 'status' => true,
+ 'modelRedirect' => false,
+ 'view' => 'admin/management/social.html',
+ 'data' => $templateData
+ );
+ }
+}
* @link http://dev.gaslightmedia.com/
*/
-class GlmMembersAdmin_member_social //extends GlmDataUrls
+
+// Load Management Social data abstract
+require_once GLM_MEMBERS_SOCIAL_PLUGIN_CLASS_PATH.'/data/dataSocialUrls.php';
+
+/**
+ * GlmMembersAdmin_member_social
+ *
+ * PHP version 5
+ *
+ * @category Model
+ * @package GLM Member DB
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release SVN: $Id: packaging.php,v 1.0 2011/01/25 19:31:47 cscott
+ * Exp $
+ */
+class GlmMembersAdmin_member_social extends GlmDataSocialUrls
{
/**
* WordPress Database Object
// Save plugin configuration object
$this->config = $config;
+
+ // Run constructor for social data class
+ parent::__construct(false, false);
+
}
public function modelAction($actionData = false)
'data' => false
);
}
- $displayData = 'Hello, World! This is the Social Add-On "social" model talking to you from inside WordPress.';
$success = true;
$urlUpdated = false;
$haveMember = true;
$option = false;
$debug = false;
$statusMessage = "Update complete";
-
+
require_once(GLM_MEMBERS_SOCIAL_PLUGIN_CLASS_PATH.'/data/dataUrls.php');
$Urls = new GlmDataUrls($this->wpdb, $this->config);
$urlStats = $Urls->getStats();
}
$urlList = $Urls->getList("member_id = " . $memberID);
//$urlList = $Urls->getList();
-
+
require_once(GLM_MEMBERS_SOCIAL_PLUGIN_CLASS_PATH.'/data/dataSocials.php');
$Socials = new GlmDataSocials($this->wpdb, $this->config);
$socialList = $Socials->getList();
-
+
// Get the option or set to default
if (isset($_REQUEST['option'])) {
$option = trim(filter_var($_REQUEST['option'],FILTER_SANITIZE_STRING));
} else {
$option = "default";
}
-
+
switch ($option) {
case "submit":
$statusMessage = "Social Media URLs Updated";
$urlList = $Urls->getList("member_id = " . $memberID);
break;
- case "social";
+ case "social";
default:
break;
}
-
+
// If we had a fatal error, redirect to the error page
if ($socialError) {
return array(
echo "<pre>".print_r($urlList[$memberID], true)."</pre>";
echo "<hr />sociallist:<table>";
echo "<pre>".print_r($socialList, true)."</pre>";
- echo "</table>";
+ echo "</table>";
}
-
+
$templateData = array(
- 'displayData' => $displayData,
'socials' => $socialList,
'urlList' => $memberUrlList,
'assetsUrl' => GLM_MEMBERS_SOCIAL_PLUGIN_ASSETS_URL,
+++ /dev/null
-<?php
-/**
- * Gaslight Media Members Database
- * Admin Member User Profile
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package glmMembersDatabase
- * @author Gaslight Media <dev@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/
- */
-
-class GlmMembersAdmin_settings_social // extends GlmDataContacts
-{
- /**
- * WordPress Database Object
- *
- * @var $wpdb
- * @access public
- */
- public $wpdb;
- /**
- * Plugin Configuration Data
- *
- * @var $config
- * @access public
- */
- public $config;
- /**
- * Member ID
- *
- * @var $memberID
- * @access public
- */
- public $memberID = false;
- /*
- * Constructor
- *
- * This contructor performs the work for this model. This model returns
- * an array containing the following.
- *
- * 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;
-
- }
-
- public function modelAction($actionData = false)
- {
- $displayData = 'Hello, World! This is the Social Add-On "settings" model talking to you from inside WordPress.';
- $success = true;
- $socialUpdated = false;
- $socialError = false;
- $statusMessage = 'Social Updated';
- $option = false;
- $debug = true;
-
- require_once(GLM_MEMBERS_SOCIAL_PLUGIN_CLASS_PATH.'/data/dataSocials.php');
- $Socials = new GlmDataSocials($this->wpdb, $this->config);
- $socialList = $Socials->getList();
-
- if (isset($_REQUEST['option'])) {
- $option = trim(filter_var($_REQUEST['option'],FILTER_SANITIZE_STRING));
- } else {
- $option = "default";
- }
-
- echo "<hr />Request:<table>";
- if ($debug) {
- echo "<hr />Request:<table>";
- foreach($_REQUEST as $key=>$value) {
- echo("<tr><td>$key</td><td>$value</td></tr>");
- }
- echo "</table>";
-// echo "<hr />UrlList:<table>";
-// echo "<pre>".print_r($urlList[$memberID], true)."</pre>";
-// echo "<hr />Recordlist:<table>";
- echo "<pre>".print_r($socialList, true)."</pre>";
-// echo "</table>";
- }
-
- switch ($option) {
- case "submit":
- $Socials->updateEntry();
- break;
- case "social";
- default:
-
- break;
- }
-
- // If we had a fatal error, redirect to the error page
- if ($socialError) {
- return array(
- 'status' => $success,
- 'option' => $option,
- 'menuItemRedirect' => 'error',
- 'modelRedirect' => 'index',
- 'view' => 'admin/error/index.html',
- 'data' => false
- );
- }
-
-// if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
-// glmMembersAdmin::addNotice($memberTypes, 'DataBlock', 'Member Types Data');
-// }
- // Refresh the URL list before sending it to the front
-
- // Compile template data
- $templateData = array(
- 'displayData' => $displayData,
- 'assetsUrl' => GLM_MEMBERS_SOCIAL_PLUGIN_ASSETS_URL,
- 'socialUpdated' => $socialUpdated,
- 'socialError' => $socialError,
- 'option' => $option,
- 'socials' => $socialList,
- 'statusMessage' => $statusMessage
- );
-
- // Return status, any suggested view, and any data to controller
- return array(
- 'status' => true,
- 'modelRedirect' => false,
- 'view' => 'admin/settings/social.html',
- 'data' => $templateData
- );
- }
-}
return $addOnTabs;
}
);
-add_filter('glm-member-db-add-tab-for-settings',
+add_filter('glm-member-db-add-tab-for-management',
function($addOnTabs) {
$newTabs = array(
array(
+++ /dev/null
--- 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 recent 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
-
-CREATE TABLE {prefix}urls (
- id INT NOT NULL AUTO_INCREMENT,
- member_id INT NULL,
- url TINYTEXT NULL,
- medium TINYTEXT NULL,
- PRIMARY KEY (id),
- INDEX(id)
-);
-
-----
-
-CREATE TABLE {prefix}socials (
- id INT NOT NULL AUTO_INCREMENT,
- name TINYTEXT NULL,
- xpos int NULL,
- ypos int NULL,
- baseurl TINYTEXT NULL,
- active BOOLEAN NOT NULL DEFAULT '1',
- PRIMARY KEY (id),
- INDEX(id)
-);
-
-----
-
-INSERT INTO {prefix}socials
- (name, xpos, ypos, baseurl, active)
- VALUES ('Facebook',-5,-5,'www.facebook.com',true),
- ('Twitter',-44,-5,'www.twitter.com',true),
- ('Pinterest',-84,-5,'www.pinterest.com',true),
- ('GooglePlus',-124,-5,'www.google.com',true),
- ('Digg',-163,-5,'www.digg.com',true),
- ('LinkedIn',-203,-5,'www.linkedin.com',true),
- ('Instagram',-242,-5,'www.instagram.com',true),
- ('YouTube',-322,-5,'www.youtube.com',true),
- ('Flickr',-44,-44,'www.flickr.com',true),
- ('blog',-124,-45, '#',true),
- ('Photobucket',-282,-45,'www.photobucket.com',true),
- ('RSS',-282,-5,'#',false)
-;
-
-----
-
-INSERT INTO {prefix}urls
- (member_id, url, medium)
- VALUES (1,'facebook.com/1','Facebook'),
- (1,'pinterest.com/1','Pinterest'),
- (1,'Twitter.com/1','Twitter'),
- (2,'pinterest.com/2','Pinterest'),
- (2,'facebook.com/2','Facebook'),
- (2,'Twitter.com/2','Twitter'),
- (2,'instagram.com/2','Instagram'),
- (2,'youtube.com/2','YouTube'),
- (2,'flickr.com/2','Flickr'),
- (1,'flickr.com/1','Flickr')
-;
\ No newline at end of file
--- /dev/null
+-- 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 recent 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
+
+CREATE TABLE {prefix}socials (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NULL,
+ b64icon TEXT NULL,
+ baseurl TINYTEXT NULL,
+ active BOOLEAN NOT NULL DEFAULT '1',
+ PRIMARY KEY (id),
+ INDEX(id)
+);
+
+----
+
+CREATE TABLE {prefix}social_urls (
+ id INT NOT NULL AUTO_INCREMENT,
+ ref_type TINYINT NULL,
+ ref_dest INT NULL,
+ url TINYTEXT NULL,
+ social TINYINT NULL,
+ PRIMARY KEY (id),
+ INDEX(id)
+);
+
+----
+
+-- Add default social media types and icons (base64encoded icons)
+INSERT INTO {prefix}socials
+ (name, b64icon, baseurl, active)
+ VALUES ('Facebook','','www.facebook.com',true),
+ ('Twitter','','www.twitter.com',true),
+ ('Pinterest','','www.pinterest.com',true),
+ ('GooglePlus','','www.google.com',true),
+ ('Digg','','www.digg.com',true),
+ ('LinkedIn','','www.linkedin.com',true),
+ ('Instagram','','www.instagram.com',true),
+ ('YouTube','','www.youtube.com',true),
+ ('Flickr','','www.flickr.com',true),
+ ('blog','', '#',true),
+ ('Photobucket','','www.photobucket.com',true),
+ ('RSS','','#',false)
+;
$glmMembersSocialDbVersions = array(
- '0.0.1' => array('version' => '0.0.1', 'tables' => 2)
+ '0.0.1' => array('version' => '0.0.1', 'tables' => 2),
+ '0.0.2' => array('version' => '0.0.2', 'tables' => 2, 'date' => '5/12/2016')
);
This directory contains database creation and update scripts for this add-on.
-This directly is optional. If there are no data tables added by this add-on,
-this directory should be omitted.
+The files in this directory are checked by the checkDatabase() function in the
+main plugin classes/glmPluginSupport.php file.
+
+This directory is optional. If there are no data tables that need to be created
+for this add-on, there should be no files in this directory. The directory may
+also be deleted.
+
+See the "examples" directory for a sample of what can go in this directory.
+Procedure to update database
+-----------------------------
+
+0) Make a backup copy of the site's database.
+
+1) Rename "create_database_Vx.x.x.sql" to new version number.
+ example: create_database_V0.0.9.sql -> create_database_V0.0.10.sql
+
+2) Edit renamed create database file and make desired changes
+
+3) Add a new "update_database_Vx.x.x.sql" named with the correct version #.
+
+4) Edit new update database files with SQL script to make the necessary changes
+ from the previous version to the new version. (i.e. to add new fields,
+ rename fields, insert records, ...)
+
+5) Optionally add an "update_database_Vx.x.x.php" file if PHP scripting is
+ needed to update database content. (i.e. to make changes to database content)
+
+6) Edit the "dbVersions.php" file and add a new line for the new version.
+ *** Now please be sure to add a date for each entry ***
+ i.e. '1.1.2' => array('version' => '1.1.2', 'tables' => 14, 'date' => '4/11/16')
+
+7) When this is all done, edit the index.php file for the plugin/add-on and
+ change "GLM_MEMBERS_{addon}_PLUGIN_DB_VERSION" defined parameter where
+ {addon} is the add-on name.
+
+8) Go to an admin menu item for the main member db plugin or any add-on. If all
+ goes well, the main plugin should have detected the change and updated the
+ database. If not, restore the database and try again.
+9) Check the database to make sure the changes to fields and data are correct.
--- /dev/null
+-- Gaslight Media Members Database - Events Add-On
+-- File Created: 12/09/14 15:27:15
+-- Database Version: 0.0.9
+-- 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
+
+
+
+-- Drop existing socials table
+DROP TABLE {prefix}socials;
+
+----
+
+-- Create new socials table
+CREATE TABLE {prefix}socials (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NULL,
+ b64icon TEXT NULL,
+ baseurl TINYTEXT NULL,
+ active BOOLEAN NOT NULL DEFAULT '1',
+ PRIMARY KEY (id),
+ INDEX(id)
+);
+
+----
+
+-- Add default social media types and icons (base64encoded icons)
+-- NEED TO ADD DEFAULT ICON DATA HERE
+INSERT INTO {prefix}socials
+ (name, b64icon, baseurl, active)
+ VALUES ('Facebook','','www.facebook.com',true),
+ ('Twitter','','www.twitter.com',true),
+ ('Pinterest','','www.pinterest.com',true),
+ ('GooglePlus','','www.google.com',true),
+ ('Digg','','www.digg.com',true),
+ ('LinkedIn','','www.linkedin.com',true),
+ ('Instagram','','www.instagram.com',true),
+ ('YouTube','','www.youtube.com',true),
+ ('Flickr','','www.flickr.com',true),
+ ('blog','', '#',true),
+ ('Photobucket','','www.photobucket.com',true),
+ ('RSS','','#',false)
+;
+
+----
+
+-- Drop existing urls table
+DROP TABLE {prefix}urls;
+
+----
+
+-- Create new social_urls table (replaces urls)
+CREATE TABLE {prefix}social_urls (
+ id INT NOT NULL AUTO_INCREMENT,
+ ref_type TINYINT NULL,
+ ref_dest INT NULL,
+ url TINYTEXT NULL,
+ social TINYINT NULL,
+ PRIMARY KEY (id),
+ INDEX(id)
+);
+
+
'member' => array(
'social' => GLM_MEMBERS_SOCIAL_PLUGIN_SLUG,
),
- 'settings' => array(
+ 'management' => array(
'social' => GLM_MEMBERS_SOCIAL_PLUGIN_SLUG
)
),
--- /dev/null
+{include file='admin/management/header.html'}
+
+ <h2>{if $socialUpdated}<span class="glm-notice glm-flash-updated glm-right">{$statusMessage}</span>{/if}</h2>
+
+ <h3>Social Media Types</h3>
+
+ <div id="glm-admin-content-container">
+
+ <table class="glm-admin-table">
+ <tr><th>Active</th><th>Name</th><th>Image</th></tr>
+ {foreach $socials as $s}
+ <tr>
+ <td class="glm-member-db-social-management-checkbox">
+ {$s.active.name}
+ </td>
+ <td>
+ <div id="glm-member-db-admin-social-{$socialItem.name|lower}" title="{$socialItem.name}" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll {$socialItem.xpos}px {$socialItem.ypos}px;height:33px;width:33px;display:block;">
+ </div>
+ </td>
+ <td class="glm-member-db-social-management-name">
+ {$socialItem.name}
+ </td>
+ <td>
+ <div class="glm-galleryImage" data-id="logo">
+ <img src="{$glmPluginMediaUrl}/images/small/{$member.fieldData.logo}">
+ </div>
+ <div id="glm-galleryImageLarger_logo" class="glm-imageDialog">
+ <div id="glm-member-db-admin-social-{$socialItem.name|lower}" title="{$socialItem.name}" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll {$socialItem.xpos}px {$socialItem.ypos}px;height:33px;width:33px;display:block;">
+ </div>
+ </div>
+ </td>
+
+ <td class="glm-admin-image-edit-table">
+ <div class="glm-galleryImage" data-id="logo">
+ <div id="glm-member-db-admin-social-{$socialItem.name|lower}" title="{$socialItem.name}" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll {$socialItem.xpos}px {$socialItem.ypos}px;height:33px;width:33px;display:block;">
+ </div>
+ </div>
+ </td>
+ <td colspan="2"><b>New image:</b> <input type="file" name="logo_new"></td>
+ <td><div id="glm-galleryImageLarger_logo" class="glm-imageDialog"></div></td>
+ </tr>
+ {/foreach}
+ </table>
+ <input type="submit" class="button glm-button submit" value="submit" name='submit'>
+ </form>
+ </div>
+
+
+ <script type="text/javascript">
+ jQuery(document).ready(function($) {
+ // 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).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
+ });
+</script>
+{include file='admin/footer.html'}
-{include file='admin/members/header.html'}
+{include file='admin/member/header.html'}
<h2>{if $urlUpdated}<span class="glm-notice glm-flash-updated glm-right">{$statusMessage}</span>{/if}</h2>
<h3>Member Social Tab</h3>
<script type="text/javascript">
jQuery(document).ready(function($) {
+
// 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).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
+
+ // Image pop-up dialog box
$("#editMemberTypeDialog").dialog({
autoOpen: false,
minWidth: 400,
$('.editMemberType').click( function() {
var typeID = $(this).attr('data-memberTypeID');
var typeName = $(this).text();
+
+
// var typeDescr = $('#editMemberTypeDescr_' + typeID).html();
$('#glmSocName').text(typeName);
$('#editMemberTypeName').val(typeName.trim());
+++ /dev/null
-{include file='admin/members/header.html'}
-<h2>{if $socialUpdated}<span class="glm-notice glm-flash-updated glm-right">{$statusMessage}</span>{/if}</h2>
- <h3>Member Social Tab</h3>
- <p>{$displayData}</p>
- <div id="glm-admin-content-container">
- <form id="glm-member-db-social-management" action="{$thisUrl}?page={$thisPage}&glm_action=social" method="post" enctype="multipart/form-data">
- <input type="submit" class="button glm-button submit" value="submit" name='submit'>
- <input type="hidden" name="option" value="submit">
- <div class="button glm-button right">Update</div>
- <table class="glm-admin-table">
- aaaa
- {foreach from=$socials key=k item=socialItem}
- {$socialField = $socialItem.name|lower}
- <tr>
- <th class="glm-member-db-social-management-checkbox">
- <input type="checkbox" id="{$socialItem.name|lower}" name="{$socialItem.name|lower}" class="glm-form-text-input" value="{$socialField}" {if $socialItem.active.value == 1}checked{/if}>
- </th>
- <td class="glm-member-db-social-management-icon">
- <div id="glm-member-db-admin-social-{$socialItem.name|lower}" title="{$socialItem.name}" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll {$socialItem.xpos}px {$socialItem.ypos}px;height:33px;width:33px;display:block;">
- </div>
- </td>
- <td class="glm-member-db-social-management-name">
- {$socialItem.name}
- </td>
-- <td>
- <input type="button" class="button glm-button submit" value="Change Icon" name="newSocialIcon">
- </td>
- <td>
- <div class="glm-galleryImage" data-id="logo">
- <img src="{$glmPluginMediaUrl}/images/small/{$member.fieldData.logo}">
- </div>
- <div id="glm-galleryImageLarger_logo" class="glm-imageDialog">
- <div id="glm-member-db-admin-social-{$socialItem.name|lower}" title="{$socialItem.name}" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll {$socialItem.xpos}px {$socialItem.ypos}px;height:33px;width:33px;display:block;">
- </div>
- </div>
- </td>
-
- <td class="glm-admin-image-edit-table">
- <div class="glm-galleryImage" data-id="logo">
- <div id="glm-member-db-admin-social-{$socialItem.name|lower}" title="{$socialItem.name}" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll {$socialItem.xpos}px {$socialItem.ypos}px;height:33px;width:33px;display:block;">
- </div>
- </div>
- </td>
- <td colspan="2"><b>New image:</b> <input type="file" name="logo_new"></td>
- <td><div id="glm-galleryImageLarger_logo" class="glm-imageDialog"></div></td>
- </tr>
- {/foreach}
- </table>
- <input type="submit" class="button glm-button submit" value="submit" name='submit'>
- </form>
- </div>
-
-
- <script type="text/javascript">
- jQuery(document).ready(function($) {
- // 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).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
- });
-</script>
-{include file='admin/footer.html'}