Adding comments to code for usage instructions
authorLaury GvR <laury@gaslightmedia.com>
Mon, 20 Feb 2017 16:46:40 +0000 (11:46 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Mon, 20 Feb 2017 16:46:40 +0000 (11:46 -0500)
glm-simple-messageboard.php
views/optionsPage.php

index 6d13ea3..428a3c9 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
  * Plugin Name: GLM Simple Messageboard
- * Description: Option Setting for the name address and phone numbers. Includes Widget
- * Version: 1.0.0
+ * Description: Option Setting for displaying two fields; a name and a message
+ * Version: 1.0.6
  * Author: Gaslight Media
  * Author URI: http://www.gaslightmedia.com
  * License: All right reserved
  * USAGE:       
  *          
     This part goes into your functions.php
-                <?php                    
+                <?php
+                    // This part will be placed into your functions.php
                     if ( !function_exists( 'glm_get_simplemessageboard_option' ) ) {
-                        function glm_get_simplemessageboard_option( $option_name )
+                        function glm_get_simplemessageboard_option( $option_name ) 
                         {
                             $settings = get_option( 'glmsimplemessageboard_settings' );
-                            return ( $settings && $settings[$option_name] )
-                                ? $settings[$option_name]
-                                : null;
+                            if ($settings && array_key_exists( $option_name, $settings ) ) {
+                                return $settings[ $option_name ];
+                            } else {
+                                return null;
+                            }
                         }
                     }
                 ?>
  * 
     This part goes where you want to display the data
             <div>
-                <?php if (function_exists( 'glm_get_simplemessageboard_option' ) ) {?>
-                    <span> <?php echo glm_get_simplemessageboard_option( 'title' );?></span>
-                    <?php if ( glm_get_simplemessageboard_option( 'message' ) ) {?>
-                        <span><?php echo glm_get_simplemessageboard_option( 'message' );?></span>
+                <?php 
+                    // This part will be placed wherever you want to display the data
+                    if (function_exists( 'glm_get_simplemessageboard_option' ) ) {?>
+                        <?php if ( glm_get_simplemessageboard_option( 'active' ) ) { ?>
+                            <span> <?php echo glm_get_simplemessageboard_option( 'title' );?></span>
+                            <?php if ( glm_get_simplemessageboard_option( 'message' ) ) {?>
+                                <span><?php echo glm_get_simplemessageboard_option( 'message' );?></span>
+                            <?php } ?>
+                        <?php } ?>
                     <?php } ?>
-                <?php } ?>
 
             </div>
+
  */
 
 define('GLM_SIMPLEMESSAGEBOARD_SETTINGS', 'glmsimplemessageboard_settings');
index 5337a3b..17bf5fd 100644 (file)
@@ -1,11 +1,11 @@
 <div class="wrap">
     <form action="options.php" method="post">
-        <h1>Gaslight Client Info</h1>
+        <h1>GLM Simple Messageboard</h1>
         <div style="clear: both;">
             <?php submit_button();?>
         </div>
-        <div id="glm-client-info-wrapper" class="row">
-            <div id="glm-client-info-primary" class="glm-client-info-section"><br>
+        <div id="glm-simple-messageboard-wrapper" class="row">
+            <div id="glm-simple-messageboard-primary" class="glm-simple-messageboard-section"><br>
                 <?php
                     settings_fields('simpleMessageboardPrimary');
                     do_settings_sections('simpleMessageboardPrimary');
             </div>
         </div>
     </form>
-</div>
-<script>
-    jQuery( document ).ready(function() { 
-//        if (jQuery( window ).width() > 640) {
-//            jQuery('.glm-client-info-section').width('50%').css("float","left");
-//        } else {
-//            jQuery('.glm-client-info-section').width('100%');
-//        }
-//        jQuery( window ).resize(function() {
-//            if (jQuery( window ).width() > 640) {
-//                jQuery('.glm-client-info-section').width('50%').css("float","left");
-//            } else {
-//                jQuery('.glm-client-info-section').width('100%');
-//            }
-//        });
-//        if (jQuery('#showSecondaryInfo').is(':checked')) {
-//            jQuery("#glm-client-info-secondary").show();
-//            
-//        } else {
-//            jQuery("#glm-client-info-secondary").hide();
-//        }
-//        jQuery('#showSecondaryInfo').change(function(){
-//            if (this.checked) {
-//                jQuery("#glm-client-info-secondary").show();
-//            } else {
-//                jQuery("#glm-client-info-secondary").hide();
-//            }
-//        });
-    });
-</script>
\ No newline at end of file
+</div>
\ No newline at end of file