WordPress.org

Plugin Directory

Changeset 974779


Ignore:
Timestamp:
08/28/14 17:20:23 (3 years ago)
Author:
mashwebdesign
Message:

Location Schema Generator Added.
Bug Fixes

Location:
mash-manage-general-website-information/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • mash-manage-general-website-information/trunk/includes/options-page.php

    r955844 r974779  
    2525                           <form name="mash_general_options_form" method="post" action=""> 
    2626                            <table class="form-table"> 
     27                               <tr> 
     28                                <td><label for="mash_dynamic_company_name">Company Name</label></td> 
     29                                <td><input name="mash_dynamic_company_name" id="mash_dynamic_company_name" type="text" value="<?php echo $options['company_name']; ?>" class="regular-text" /></td> 
     30                                <td><a class="button-secondary mash_dynamic_button" href="javascript:void(0)" title="View Code"><?php _e( 'View Code' ); ?></a> </td> 
     31                            </tr> 
    2732                            <tr> 
    2833                                <td><label for="mash_dynamic_telephone">Telephone</label></td> 
     
    3641                            </tr> 
    3742                             <tr> 
    38                                 <td><label for="mash_dynamic_address_1">Address Line 1</label></td> 
     43                                <td><label for="mash_dynamic_address_1">Street Address</label></td> 
    3944                                <td><input name="mash_dynamic_address_1" id="mash_dynamic_address_1" type="text" value="<?php echo $options['address_1']; ?>" class="regular-text" /></td> 
    4045                                <td><a class="button-secondary mash_dynamic_button" href="javascript:void(0)" title="View Code"><?php _e( 'View Code' ); ?></a> </td> 
    4146                            </tr> 
    4247                             <tr> 
    43                                 <td><label for="mash_dynamic_address_2">Address Line 2</label></td> 
    44                                 <td><input name="mash_dynamic_address_2" id="mash_dynamic_address_2" type="text" value="<?php echo $options['address_2']; ?>" class="regular-text" /></td> 
     48                                <td><label for="mash_dynamic_address_locality">Town / City</label></td> 
     49                                <td><input name="mash_dynamic_address_locality" id="mash_dynamic_address_locality" type="text" value="<?php echo $options['address_2']; ?>" class="regular-text" /></td> 
    4550                                <td><a class="button-secondary mash_dynamic_button" href="javascript:void(0)" title="View Code"><?php _e( 'View Code' ); ?></a> </td> 
    4651                            </tr> 
    4752                             <tr> 
    48                                 <td><label for="mash_dynamic_address_3">Address Line 3</label></td> 
    49                                 <td><input name="mash_dynamic_address_3" id="mash_dynamic_address_3" type="text" value="<?php echo $options['address_3']; ?>" class="regular-text" /></td> 
     53                                <td><label for="mash_dynamic_address_region">Region</label></td> 
     54                                <td><input name="mash_dynamic_address_region" id="mash_dynamic_address_region" type="text" value="<?php echo $options['address_3']; ?>" class="regular-text" /></td> 
    5055                                <td><a class="button-secondary mash_dynamic_button" href="javascript:void(0)" title="View Code"><?php _e( 'View Code' ); ?></a> </td> 
    5156                            </tr> 
    5257                             <tr> 
    53                                 <td><label for="mash_dynamic_address_4">Address Line 4</label></td> 
    54                                 <td><input name="mash_dynamic_address_4" id="mash_dynamic_address_4" type="text" value="<?php echo $options['address_4']; ?>" class="regular-text" /></td> 
     58                                <td><label for="mash_dynamic_postcode">Post Code</label></td> 
     59                                <td><input name="mash_dynamic_postcode" id="mash_dynamic_postcode" type="text" value="<?php echo $options['address_4']; ?>" class="regular-text" /></td> 
    5560                                <td><a class="button-secondary mash_dynamic_button" href="javascript:void(0)" title="View Code"><?php _e( 'View Code' ); ?></a> </td> 
    5661                            </tr> 
     
    6671                            </tr> 
    6772                              <tr> 
     73                                <td><label for="mash_dynamic_reg_number">Company Registration Number</label></td> 
     74                                <td><input name="mash_dynamic_reg_number" id="mash_dynamic_reg_number" type="text" value="<?php echo $options['reg_number']; ?>" class="regular-text" /></td> 
     75                                <td><a class="button-secondary mash_dynamic_button" href="javascript:void(0)" title="View Code"><?php _e( 'View Code' ); ?></a> </td> 
     76                            </tr> 
     77                               <tr> 
     78                                <td><label for="mash_dynamic_copyright">Footer Copyright Details</label></td> 
     79                                <td><input name="mash_dynamic_copyright" id="mash_dynamic_copyright" type="text" value="<?php echo $options['copyright']; ?>" class="regular-text" /></td> 
     80                                <td><a class="button-secondary mash_dynamic_button" href="javascript:void(0)" title="View Code"><?php _e( 'View Code' ); ?></a> </td> 
     81                            </tr> 
     82                              <tr> 
    6883                                <td><label for="mash_dynamic_twitter_url">Twitter URL</label></td> 
    6984                                <td><input name="mash_dynamic_twitter_url" id="mash_dynamic_twitter_url" type="text" value="<?php echo $options['twitter_url']; ?>" class="regular-text" /></td> 
     
    7590                                <td><a class="button-secondary mash_dynamic_button" href="javascript:void(0)" title="View Code"><?php _e( 'View Code' ); ?></a> </td> 
    7691                            </tr> 
     92                           
    7793                              <tr> 
    7894                                <td><label for="mash_dynamic_google_url">Google Plus URL</label></td> 
  • mash-manage-general-website-information/trunk/js/scripts.js

    r955844 r974779  
    2525        if($('.messagecontainer').length){ 
    2626        $('.messagecontainer').fadeOut('slow', function(){ 
    27             $('.messagecontainer').html('<div style="width:99%; padding: 5px;" class="codemessage updated below-h2"><p>Insert the following code into your theme: <span style="padding: 6px 20px; background-color: #FA8D03; color: #fff; margin-left: 21px; font-weight: bold;">getWebOptions(\'' + code +'\');</span></p></div>'); 
     27            $('.messagecontainer').html('<div style="width:99%; padding: 5px;" class="codemessage updated below-h2"><p>Insert the following code into your theme: <span style="padding: 6px 20px; background-color: #FA8D03; color: #fff; margin-left: 21px; font-weight: bold;">echo getWebOptions(\'' + code +'\'); </span></p></div>'); 
    2828            }); 
    2929        $('.messagecontainer').fadeIn(); 
    3030        } 
    3131        else{ 
    32         $('#poststuff').before('<div class="messagecontainer"> <div style="display: none;" style="width:99%; padding: 5px;" class="codemessage updated below-h2"><p>Insert the following code into your theme: <span style="padding: 6px 20px; background-color: #FA8D03; color: #fff; margin-left: 21px; font-weight: bold;">getWebOptions(\'' + code +'\');</span></p></div></div>'); 
     32        $('#poststuff').before('<div class="messagecontainer"> <div style="display: none;" style="width:99%; padding: 5px;" class="codemessage updated below-h2"><p>Insert the following code into your theme: <span style="padding: 6px 20px; background-color: #FA8D03; color: #fff; margin-left: 21px; font-weight: bold;">echo getWebOptions(\'' + code +'\');</span></p></div></div>'); 
    3333        $('.codemessage').fadeIn(800); 
    3434        } 
    3535    } 
    36  
    37 function savedAlert(){ 
    38     alert('dsf'); 
    39 } 
    4036}); 
  • mash-manage-general-website-information/trunk/mash-manage-general-website-info.php

    r956727 r974779  
    55     * Plugin URI: http://www.mash-webdesign.co.uk 
    66     * Description: A plugin that allows clients to dynamically control business information. 
    7      * Version: 0.2 
     7     * Version: 0.3 
    88     * Author: Adam Collins 
    99     * Author URI: http://www.mash-webdesign.co.uk 
     
    2020    /* add_options_page( $page_title, $menu_title, $capability, $menu_slug, $function); */ 
    2121     
    22         add_options_page(  
     22        add_menu_page( 
    2323            'General Business Information', 
    2424            'Manage Information', 
     
    2828        ); 
    2929 
    30    
     30        add_submenu_page( 'mash-general-info', 'Local Business Schema', 'Local Business Schema', 'manage_options', 'mash-local-schema', 'mash_general_schema' );  
     31         
     32         
    3133    } 
    3234  
     
    5052                $mash_tel_2 = $_POST['mash_dynamic_telephone_2']; 
    5153                $mash_add_1 = $_POST['mash_dynamic_address_1']; 
    52                 $mash_add_2 = $_POST['mash_dynamic_address_2']; 
    53                 $mash_add_3 = $_POST['mash_dynamic_address_3']; 
    54                 $mash_add_4 = $_POST['mash_dynamic_address_4']; 
     54                $mash_add_2 = $_POST['mash_dynamic_address_locality']; 
     55                $mash_add_3 = $_POST['mash_dynamic_address_region']; 
     56                $mash_add_4 = $_POST['mash_dynamic_postcode']; 
    5557                $mash_email = $_POST['mash_dynamic_email']; 
    5658                $mash_strapline = $_POST['mash_dynamic_strapline']; 
     
    5961                $mash_google = $_POST['mash_dynamic_google_url']; 
    6062                $mash_youtube = $_POST['mash_dynamic_youtube_url']; 
     63                $mash_company_reg = $_POST['mash_dynamic_reg_number']; 
     64                $mash_copright = $_POST['mash_dynamic_copyright']; 
     65                $mash_dynamic_company_name = $_POST['mash_dynamic_company_name']; 
    6166                 
    6267                 
     
    7378                $options['google_url'] = $mash_google; 
    7479                $options['youtube_url'] = $mash_youtube; 
     80                $options['reg_number'] = $mash_company_reg; 
     81                $options['copyright'] = $mash_copright; 
     82                $options['company_name'] = $mash_dynamic_company_name; 
    7583                $options['last_updated'] = time(); 
    7684                 
     
    96104      
    97105     } 
     106      
     107      
     108      
     109     function mash_general_schema(){ 
     110     
     111        if(current_user_can('manage_options')): 
     112         
     113            require('includes/schema-page.php'); 
     114         
     115        endif; 
     116          
     117    } 
    98118  
    99119  
     
    102122        $options = get_option('mash_general_info'); 
    103123 
    104         echo $options[$type]; 
     124        return $options[$type]; 
    105125 
     126    } 
     127     
     128    function getSchemaOptions(){ 
     129         
     130        $options = get_option('mash_general_info'); 
     131         
     132        $schema = '<div itemscope itemtype="http://schema.org/LocalBusiness">'; 
     133     
     134        if(!empty($options['company_name'])): 
     135         
     136            $schema .= '<span itemprop="legalName">'.$options['company_name'] .'</span>'; 
     137             
     138        endif; 
     139         
     140        $schema .= '<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">'; 
     141         
     142        if(!empty($options['address_1'])): 
     143         
     144            $schema .= '<span itemprop="streetAddress">'.$options['address_1'] .'</span>'; 
     145             
     146        endif; 
     147         
     148        if(!empty($options['address_2'])): 
     149         
     150            $schema .= '<span itemprop="addressLocality">'.$options['address_2'] .'</span>'; 
     151             
     152        endif; 
     153         
     154        if(!empty($options['address_3'])): 
     155         
     156            $schema .= '<span itemprop="addressRegion">'.$options['address_3'] .'</span>'; 
     157             
     158        endif; 
     159         
     160        if(!empty($options['address_4'])): 
     161         
     162            $schema .= '<span itemprop="postalCode">'.$options['address_4'] .'</span>'; 
     163             
     164        endif; 
     165         
     166        $schema .= '</div>'; 
     167         
     168        if(!empty($options['telephone'])): 
     169         
     170            $schema .= '<p><span>Phone:</span> <span itemprop="telephone">'.$options['telephone'] .'</span></p>'; 
     171             
     172        endif; 
     173         
     174        if(!empty($options['email'])): 
     175         
     176            $schema .= '<p><span>Email:</span> <span itemprop="email">'.$options['email'] .'</span></p>'; 
     177             
     178        endif; 
     179         
     180        $schema .= '</div>'; 
     181         
     182        return $schema; 
     183                 
    106184    } 
    107185     
  • mash-manage-general-website-information/trunk/readme.txt

    r956724 r974779  
    22Contributors: mashwebdesign 
    33Donate link: http://www.mash-webdesign.co.uk 
    4 Tags: Mash, general information, business information, theme options 
     4Tags: Mash, general information, business information, theme options, location schema, schema generator 
    55Requires at least: 3.0.1 
    66Tested up to: 3.9.1 
    7 Stable tag: 0.2 
     7Stable tag: 0.3 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    1111Mash General Information creates theme options for users to manage site information brought out in the site header, footer and contact page. 
    1212 
     13The plugin also generates location schema for use throughout the website. 
     14 
    1315== Description == 
    1416 
    1517Mash General Information gives developers the opportunity to offer their clients the full content managed experience. By simply adding dynamic PHP code to your website theme, you are enabling your clients to be able to fully manage theme options that are often found in headers, footers and on contact us pages.  
     18 
     19The plugin also generates location schema based on the user information entered. You are then generated either a short code for use throughout the backend of Wordpress or a basic snippet of PHP code to call throughout your themes template files. 
    1620 
    1721Clients can easily manage:  
     
    2125* Emails Addresses 
    2226* Strap lines 
     27* Company Number 
     28* Copyright Details 
    2329* Social Media URLS 
     30* Location Schema 
    2431 
    2532You can learn more about [Mash Manage General Website Information](http://mash-webdesign.co.uk) on our website. 
     
    33401. Fill in and manage your general information from the Administrator Dashboard via 'Settings > Manage Information'. 
    34411. Add dynamic code to your theme by simply choosing View Code 
     421. Add Location Schema by using either the dynamic code or short code generated. 
    3543 
    3644== Frequently Asked Questions == 
     
    5361* Fixed View Code Issues 
    5462 
     63= 0.3 = 
     64* Snippet Bug Fix 
     65* Schema Location Generator Added 
     66* Additional Fields Added 
     67 
    5568== Upgrade Notice == 
    5669 
     
    6275* Amended Plugin Naming Conventions 
    6376* Fixed View Code Issues 
     77 
     78= 0.3 = 
     79 
     80* Schema Location Generator Added to the Plugin 
Note: See TracChangeset for help on using the changeset viewer.