Shows a proper view
authorLaury GvR <laury@gaslightmedia.com>
Wed, 24 Feb 2016 19:17:37 +0000 (14:17 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 24 Feb 2016 19:17:37 +0000 (14:17 -0500)
13 files changed:
index.php
models/admin/member/social.php
models/admin/social/index.php
models/admin/social/more.php
setup/databaseScripts/SOCIAL.create_database_V0.0.1.sql [deleted file]
setup/databaseScripts/SOCIAL.dbVersions.php [deleted file]
setup/databaseScripts/create_database_V0.0.1.sql [new file with mode: 0644]
setup/databaseScripts/dbVersions.php [new file with mode: 0644]
views/admin/error/badAction.html [new file with mode: 0644]
views/admin/error/header.html [new file with mode: 0644]
views/admin/error/index.html [new file with mode: 0644]
views/admin/member/social.html
views/admin/social/index.html

index e9d8a08..d003341 100644 (file)
--- a/index.php
+++ b/index.php
@@ -54,7 +54,7 @@
  *  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.1');
 
 // 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');
index f3d5f11..eb712d7 100644 (file)
@@ -14,9 +14,9 @@
  */
 
 // Load Contacts data abstract
-//require_once(GLM_MEMBERS_CONTACTS_PLUGIN_CLASS_PATH.'/data/dataContacts.php');
+require_once(GLM_MEMBERS_SOCIAL_PLUGIN_CLASS_PATH.'/data/dataSocial.php');
 
-class GlmMembersAdmin_member_social // extends GlmDataContacts
+class GlmMembersAdmin_member_social extends GlmDataSocial
 {
 
     /**
@@ -103,16 +103,187 @@ class GlmMembersAdmin_member_social // extends GlmDataContacts
 
     public function modelAction($actionData = false)
     {
+        $displayData = 'Hello, World! This is the Social Add-On "social" model talking to you from inside WordPress.';
+        $success = true;
+        $socials = false;
+        $socialUpdated = false;
+        $haveMember = false;
+        $socialError = false;
+        $newSocial = false;
+        $option = false;
+        
+        $socialArray = array(
+            'facebook' => array(
+                'name' => 'Facebook',
+                'xpos' => -5,
+                'ypos' => -5,
+                'baseurl' => 'www.facebook.com'
+            ),
+            'twitter' => array(
+                'name' => 'Twitter',
+                'xpos' => -44,
+                'ypos' => -5,
+                'baseurl' => 'www.twitter.com'
+            ),
+            'pinterest' => array(
+                'name' => 'Pinterest',
+                'xpos' => -84,
+                'ypos' => -5,
+                'baseurl' => 'www.pinterest.com'
+            ),
+            'googleplus' => array(
+                'name' => 'Google Plus',
+                'xpos' => -124,
+                'ypos' => -5,
+                'baseurl' => 'www.google.com'
+            ),
+            'digg' => array(
+                'name' => 'Digg',
+                'xpos' => -163,
+                'ypos' => -5,
+                'baseurl' => 'www.digg.com'
+            ),
+            'linkedin' => array(
+                'name' => 'LinkedIn',
+                'xpos' => -203,
+                'ypos' => -5,
+                'baseurl' => 'www.linkedin.com'
+            ),
+            'instagram' => array(
+                'name' => 'Instagram',
+                'xpos' => -242,
+                'ypos' => -5,
+                'baseurl' => 'www.instagram.com'
+            ),
+            'youtube' => array(
+                'name' => 'YouTube',
+                'xpos' => -322,
+                'ypos' => -5,
+                'baseurl' => 'www.youtube.com'
+            ),
+            'flickr' => array(
+                'name' => 'Flickr',
+                'xpos' => -44,
+                'ypos' => -44,
+                'baseurl' => 'www.flickr.com'
+            ),
+            'blog' => array(
+                'name' => 'blog',
+                'xpos' => -124,
+                'ypos' => -45,
+                'baseurl' => '#'
+            ),
+            'photobucket' => array(
+                'name' => 'Photobucket',
+                'xpos' => -282,
+                'ypos' => -45,
+                'baseurl' => 'www.photobucket.com'
+            ),
+        );
+        
+        // If there's an action option
+        if (isset($_REQUEST['option'])) {
+            $option = trim($_REQUEST['option']);
+        }
+        
+        $socialData = $this->editEntry($memberID);
+        
+        if (!$socialData) {
+            $socialData = $this->newEntry($memberID);
+            $newSocial = true;
+            
+        }
+//        switch($option) {
+//            case 'update':
+//            default:
+//                $this->updateEntry($memberID);
+//                if ($socialData) {
+//                    $socialUpdated = true;
+//                } else {
+//                    $socialError = true;
+//                }
+//                
+//                $option = 'update';
+//                break;
+//        }
+                
+        $memberID = 0;
+        if (isset($_REQUEST['member']) && ($_REQUEST['member']-0) > 0) {
+            $memberID = $_REQUEST['member'] - 0;
+        }
+        if ($memberID == 0) {
+
+            // There should have been a member ID - So failure
+            return array(
+                'status' => false,
+                'menuItemRedirect' => 'error',
+                'modelRedirect' => 'index',
+                'view' => 'admin/error/index.html',
+                'data' => false
+            );
+
+        }
+        
+//        if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'submit') {
+        if ($option == 'submit') {
+
+            $socialData = $this->updateEntry($memberID);
+
+            if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+                glmMembersAdmin::addNotice("<b>&nbsp;&nbsp;Social Update:</b> $memberID", 'Process');
+            }
 
-        $displayData = 'This is the Social "Member" "Social" model talking to you from inside WordPress.';
+            // If update was successful then use editEntry() to setup for the edit again.
+            if ($socialData) {
 
+                $socialData = $this->editEntry($memberID);
+                $socialUpdated = true;
+
+                // Also update all member info records with any possible name change
+                $sql = "
+                    UPDATE ".GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX."socialURL
+                       SET facebook_url = www.testval.com
+                     WHERE member_id = 1
+                ;";
+//                $sql = "
+//                    UPDATE ".GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX."socialURL
+//                       SET facebook_url = '".addslashes($socialData['fieldData']['name'])."'
+//                     WHERE member_id = $memberID
+//                ;";
+                $this->wpdb->query($sql);
+
+            }
+        }
+        
+        // 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');
+        }
+        
         // Compile template data
         $templateData = array(
             'displayData' => $displayData,
-            'assetsUrl' => GLM_MEMBERS_SOCIAL_PLUGIN_ASSETS_URL
-                
+            'socialArray' => $socialArray,
+            'assetsUrl' => GLM_MEMBERS_SOCIAL_PLUGIN_ASSETS_URL,
+            'socials' => $socials,
+            'socialUpdated' => $socialUpdated,
+            'socialError' => $socialError,
+            'haveMember' => $haveMember,
+            'memberID' => $memberID,
+            'option' => $option
         );
-        
+
         // Return status, any suggested view, and any data to controller
         return array(
                 'status' => true,
@@ -120,7 +291,5 @@ class GlmMembersAdmin_member_social // extends GlmDataContacts
                 'view' => 'admin/member/social.html',
                 'data' => $templateData
         );
-
     }
-
 }
index 8899c8e..de6e9d5 100644 (file)
@@ -16,6 +16,9 @@
 // Load Contacts data abstract
 //require_once(GLM_MEMBERS_CONTACTS_PLUGIN_CLASS_PATH.'/data/dataContacts.php');
 
+   
+
+
 class GlmMembersAdmin_social_index // extends GlmDataContacts
 {
 
@@ -103,12 +106,185 @@ class GlmMembersAdmin_social_index // extends GlmDataContacts
 
     public function modelAction($actionData = false)
     {
-
         $displayData = 'Hello, World! This is the Social Add-On "social" model talking to you from inside WordPress.';
+        $success = true;
+        $socials = false;
+        $socialUpdated = false;
+        $haveMember = false;
+        $socialError = false;
+        $newSocial = false;
+        $option = false;
+        
+        $socialArray = array(
+            'facebook' => array(
+                'name' => 'Facebook',
+                'xpos' => -5,
+                'ypos' => -5,
+                'baseurl' => 'www.facebook.com'
+            ),
+            'twitter' => array(
+                'name' => 'Twitter',
+                'xpos' => -44,
+                'ypos' => -5,
+                'baseurl' => 'www.twitter.com'
+            ),
+            'pinterest' => array(
+                'name' => 'Pinterest',
+                'xpos' => -84,
+                'ypos' => -5,
+                'baseurl' => 'www.pinterest.com'
+            ),
+            'googleplus' => array(
+                'name' => 'Google Plus',
+                'xpos' => -124,
+                'ypos' => -5,
+                'baseurl' => 'www.google.com'
+            ),
+            'digg' => array(
+                'name' => 'Digg',
+                'xpos' => -163,
+                'ypos' => -5,
+                'baseurl' => 'www.digg.com'
+            ),
+            'linkedin' => array(
+                'name' => 'LinkedIn',
+                'xpos' => -203,
+                'ypos' => -5,
+                'baseurl' => 'www.linkedin.com'
+            ),
+            'instagram' => array(
+                'name' => 'Instagram',
+                'xpos' => -242,
+                'ypos' => -5,
+                'baseurl' => 'www.instagram.com'
+            ),
+            'youtube' => array(
+                'name' => 'YouTube',
+                'xpos' => -322,
+                'ypos' => -5,
+                'baseurl' => 'www.youtube.com'
+            ),
+            'flickr' => array(
+                'name' => 'Flickr',
+                'xpos' => -44,
+                'ypos' => -44,
+                'baseurl' => 'www.flickr.com'
+            ),
+            'blog' => array(
+                'name' => 'blog',
+                'xpos' => -124,
+                'ypos' => -45,
+                'baseurl' => '#'
+            ),
+            'photobucket' => array(
+                'name' => 'Photobucket',
+                'xpos' => -282,
+                'ypos' => -45,
+                'baseurl' => 'www.photobucket.com'
+            ),
+        );
+        
+        // If there's an action option
+        if (isset($_REQUEST['option'])) {
+            $option = trim($_REQUEST['option']);
+        }
+        
+        $socialData = $this->editEntry($memberID);
+        
+        if (!$socialData) {
+            $socialData = $this->newEntry($memberID);
+            $newSocial = true;
+            
+        }
+//        switch($option) {
+//            case 'update':
+//            default:
+//                $this->updateEntry($memberID);
+//                if ($socialData) {
+//                    $socialUpdated = true;
+//                } else {
+//                    $socialError = true;
+//                }
+//                
+//                $option = 'update';
+//                break;
+//        }
+                
+        $memberID = 0;
+        if (isset($_REQUEST['member']) && ($_REQUEST['member']-0) > 0) {
+            $memberID = $_REQUEST['member'] - 0;
+        }
+        if ($memberID == 0) {
+
+            // There should have been a member ID - So failure
+            return array(
+                'status' => false,
+                'menuItemRedirect' => 'error',
+                'modelRedirect' => 'index',
+                'view' => 'admin/error/index.html',
+                'data' => false
+            );
+
+        }
+        
+//        if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'submit') {
+        if ($option == 'submit') {
+
+            $socialData = $this->updateEntry($memberID);
+
+            if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+                glmMembersAdmin::addNotice("<b>&nbsp;&nbsp;Social Update:</b> $memberID", 'Process');
+            }
 
+            // If update was successful then use editEntry() to setup for the edit again.
+            if ($socialData) {
+
+                $socialData = $this->editEntry($memberID);
+                $socialUpdated = true;
+
+                // Also update all member info records with any possible name change
+                $sql = "
+                    UPDATE ".GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX."socialURL
+                       SET facebook_url = www.testval.com
+                     WHERE member_id = 1
+                ;";
+//                $sql = "
+//                    UPDATE ".GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX."socialURL
+//                       SET facebook_url = '".addslashes($socialData['fieldData']['name'])."'
+//                     WHERE member_id = $memberID
+//                ;";
+                $this->wpdb->query($sql);
+
+            }
+        }
+        
+        // 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');
+        }
+        
         // Compile template data
         $templateData = array(
-            'displayData' => $displayData
+            'displayData' => $displayData,
+            'socialArray' => $socialArray,
+            'assetsUrl' => GLM_MEMBERS_SOCIAL_PLUGIN_ASSETS_URL,
+            'socials' => $socials,
+            'socialUpdated' => $socialUpdated,
+            'socialError' => $socialError,
+            'haveMember' => $haveMember,
+            'memberID' => $memberID,
+            'option' => $option
         );
 
         // Return status, any suggested view, and any data to controller
@@ -118,8 +294,5 @@ class GlmMembersAdmin_social_index // extends GlmDataContacts
                 'view' => 'admin/social/index.html',
                 'data' => $templateData
         );
-
     }
-
-
 }
index 2cd5d0e..a94575c 100644 (file)
@@ -105,10 +105,33 @@ class GlmMembersAdmin_social_more // extends GlmDataContacts
     {
 
         $displayData = 'Welcome to more information!<br>This is the Social Add-On "social" model with action "more" talking to you from inside WordPress.';
-
+        $socialArray = array(
+            'member1' => array(
+                'facebookurl' => 'www.facebook.com',
+                'youtubeurl' => 'www.youtube.com',
+                'googleurl' => 'www.google.com',
+                'gaslighturl' => 'www.gaslightmedia.com'           
+            ),
+            
+            'member2' => array(
+                'facebookurl' => 'www.facebook.com',
+                'youtubeurl' => 'www.youtube.com',
+                'googleurl' => 'www.google.com',
+                'gaslighturl' => 'www.gaslightmedia.com'           
+            ),
+            
+            'member2' => array(
+                'facebookurl' => 'www.facebook.com',
+                'youtubeurl' => 'www.youtube.com',
+                'googleurl' => 'www.google.com',
+                'gaslighturl' => 'www.gaslightmedia.com'           
+            )
+            
+        );
         // Compile template data
         $templateData = array(
-            'displayData' => $displayData
+            'displayData' => $displayData,
+            'socialArray' => $socialArray
         );
 
         // Return status, any suggested view, and any data to controller
diff --git a/setup/databaseScripts/SOCIAL.create_database_V0.0.1.sql b/setup/databaseScripts/SOCIAL.create_database_V0.0.1.sql
deleted file mode 100644 (file)
index dad54d8..0000000
+++ /dev/null
@@ -1,66 +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
-
-
--- 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,
-  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
deleted file mode 100644 (file)
index 1e8be37..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-/**
- * Gaslight Media Members Database
- * GLM Members Social DB Versions
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package  glmMembersDatabase
- * @author   Gaslight Media <dev@gaslightmedia.com>
- * @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/databaseScripts/create_database_V0.0.1.sql b/setup/databaseScripts/create_database_V0.0.1.sql
new file mode 100644 (file)
index 0000000..a91530c
--- /dev/null
@@ -0,0 +1,45 @@
+-- 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}socialURL (
+  member_id INT NULL,
+  facebook_url TEXT NULL,
+  twitter_url TEXT NULL,
+  pinterest_url TEXT NULL,
+  googleplus_url TEXT NULL,
+  digg_url TEXT NULL,
+  linkedin_url TEXT NULL,
+  instagram_url TEXT NULL,
+  rss_url TEXT NULL,
+  youtube_url TEXT NULL,
+  flickr_url TEXT NULL,
+  blog_url TEXT NULL,
+  photobucket_url TEXT NULL  
+  PRIMARY KEY (member_id),
+  INDEX(member_id)
+);
+
+----
+
+CREATE TABLE {prefix}socialMEDIA (
+  id INT NOT NULL AUTO_INCREMENT,
+  social_name TINYTEXT NULL,
+  social_xpos int NULL,
+  social_ypos int NULL,
+  social_baseurl TINYTEXT NULL,
+  PRIMARY KEY (id)
+);
+
+----
+
+INSERT INTO 
\ No newline at end of file
diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php
new file mode 100644 (file)
index 0000000..1b2aa23
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Gaslight Media Members Database
+ * GLM Members Social DB Versions
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Gaslight Media <dev@gaslightmedia.com>
+ * @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' => 1)
+);
diff --git a/views/admin/error/badAction.html b/views/admin/error/badAction.html
new file mode 100644 (file)
index 0000000..a203586
--- /dev/null
@@ -0,0 +1,11 @@
+{include file='admin/error/header.html'}
+    
+    <h2>Sorry, we've had an error.</h2>
+    
+    <p><b>Error: </b>: An invalid action has been specified.</p>
+    
+    {if $errorMsg}<p>{$errorMsg}</p>{/if}
+
+    <p>Please try again. If you still get the same error, contact Gaslight Media at 231-487-0692 for assistance.</p>
+      
+{include file='admin/footer.html'}
diff --git a/views/admin/error/header.html b/views/admin/error/header.html
new file mode 100644 (file)
index 0000000..f9fdb91
--- /dev/null
@@ -0,0 +1,5 @@
+<div class="wrap">
+       
+    <h2>{$glmPluginName}</h2>
+    
+  
\ No newline at end of file
diff --git a/views/admin/error/index.html b/views/admin/error/index.html
new file mode 100644 (file)
index 0000000..02945e3
--- /dev/null
@@ -0,0 +1,12 @@
+{include file='admin/error/header.html'}
+    
+    <center>
+    
+        <h3>Sorry, we've had some type of fatal error.</h3>
+        
+        <p>Please try again. If you still get the same error, contact Gaslight Media at 231-487-0692 for assistance.</p>
+          
+    </center>
+    
+{include file='admin/footer.html'}
+
index 5f99600..27ee18e 100644 (file)
@@ -3,28 +3,30 @@
     <h3>Members Social Tab</h3>
     <p>{$displayData}</p>
 <table class="glm-admin-table">
-<!-- foreach $socials as $social
-{foreach from=$socials item=social}
-<tr><th><div id="glm-member-db-admin-social-{$social->name|lower}" title="{$social->name}" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -5px -5px;height:{$social->xpos};width:{$social->ypos);display:block;"></div>{$social->name}</th><td><input type="text" placeholder="{$social->name} url" name="{$social->name}" class="glm-form-text-input"></td></tr>
-{/foreach}
---->
-<tr><th><div id="glm-member-db-admin-social-facebook" title="facebook" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -5px -5px;height:33px;width:33px;display:block;"></div>Facebook</th><td><input type="text" placeholder="Facebook URL" name="facebook" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-twitter" title="twitter" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -44px -5px;height:33px;width:33px;display:block;"></div>Twitter</th><td><input type="text" name="Twitter" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-pinterest" title="pinterest" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -84px -5px;height:33px;width:33px;display:block;"></div>Pinterest</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-googleplus" title="googleplus" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -124px -5px;height:33px;width:33px;display:block;"></div>Google Plus</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-digg" title="digg" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -163px -5px;height:33px;width:33px;display:block;"></div>Digg</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-linkedin" title="linkedin" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -203px -5px;height:33px;width:33px;display:block;"></div>LinkedIn</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-instagram" title="instagram" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -242px -5px;height:33px;width:33px;display:block;"></div>Instagram</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-rss" title="" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -282px -5px;height:33px;width:33px;display:block;"></div>RSS</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-youtube" title="youtube" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -322px -5px;height:33px;width:33px;display:block;"></div>YouTube</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-wordpress" title="wordpress" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -5px -44px;height:33px;width:33px;display:block;"></div>Wordpress</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-flickr" title="flickr" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -44px -44px;height:33px;width:33px;display:block;"></div>Flickr</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-pinterest" title="" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -84px -45px;height:33px;width:33px;display:block;"></div>Pinterest2</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-blog" title="" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -124px -45px;height:33px;width:33px;display:block;"></div>Blog</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-wordpress" title="" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -163px -45px;height:33px;width:33px;display:block;"></div>Wordpress2</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-X" title="" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -203px -45px;height:33px;width:33px;display:block;"></div>?name?</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-X" title="" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -242px -45px;height:33px;width:33px;display:block;"></div>?name?</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-photobucket" title="" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -282px -45px;height:33px;width:33px;display:block;"></div>Photobucket</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-<tr><th><div id="glm-member-db-admin-social-blg2" title="" class="glm-member-db-social-icon" style="background: url('{$assetsUrl}/social-few-full-sprite.jpg') repeat scroll -322px -46px;height:33px;width:33px;display:block;"></div>Blog2</th><td><input type="text" name="name" class="glm-form-text-input"></td></tr>
-</table>
+    <div class="wrap">
+    <div id="glm-admin-content-container">
+        <h3>Social Model</h3>
+        <p>{$displayData}</p>
+        <a href="{$thisURL}?page={$thisPage}&glm_action=more">Click me to see more!</a>
+        <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
+            <input type="submit" class="button glm-button submit" value="{if $memberInfoID && $memberInfo}Update member information{else}Add new member information{/if}">
+            <div class="button glm-button right">Update</div>
+            <table class="glm-admin-table">
+            {foreach from=$socialArray key=k item=socialItem}
+                <tr>
+                    <th>
+                        <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>
+                        {$socialItem.name}
+                    </th>
+                    <td>
+                        <input type="text" placeholder="{$socialItem.name} URL" name="{$socialItem.name|lower}" class="glm-form-text-input">
+                    </td>
+                </tr>
+            {/foreach}
+            </table>
+            <input type="submit" class="button glm-button submit" value="{if $memberInfoID && $memberInfo}Update member information{else}Add new member information{/if}">
+        </form>
+    </div>
+</div>
 {include file='admin/footer.html'}
\ No newline at end of file
index 665f0f3..244479e 100644 (file)
@@ -3,5 +3,26 @@
         <h3>Social Model</h3>
         <p>{$displayData}</p>
         <a href="{$thisURL}?page={$thisPage}&glm_action=more">Click me to see more!</a>
+        
+        <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
+            <input type="submit" class="button glm-button submit" value="{if $memberInfoID && $memberInfo}Update member information{else}Add new member information{/if}">
+            <div class="button glm-button right">Update</div>
+            <table class="glm-admin-table">
+            {foreach from=$socialArray key=k item=socialItem}
+                <tr>
+                    <th>
+                        <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>
+                        {$socialItem.name}
+                    </th>
+                    <td>
+                        <input type="text" placeholder="{$socialItem.name} URL" name="{$socialItem.name|lower}" class="glm-form-text-input">
+                    </td>
+                </tr>
+            {/foreach}
+            </table>
+            <input type="submit" class="button glm-button submit" value="{if $memberInfoID && $memberInfo}Update member information{else}Add new member information{/if}">
+        </form>
+        
     </div>
 </div>
\ No newline at end of file