Plugin Directory

Changeset 1574482


Ignore:
Timestamp:
01/14/2017 06:45:43 AM (9 years ago)
Author:
davidrichied
Message:

Tagging version 1.2: added ability to add multiple popups, and popups are now displayed on a post or page using shortcode

Location:
simple-popup-content
Files:
5 edited
14 copied

Legend:

Unmodified
Added
Removed
  • simple-popup-content/tags/1.0/simple-popup-content.php

    r1555855 r1574482  
    11<?php
    22/*
    3 Plugin Name: Popup Page
     3Plugin Name: Simple Popup Content
    44Plugin URI: https://richiedmedia.com
    55Description: Create a popup page.
  • simple-popup-content/tags/1.2/README.txt

    r1555865 r1574482  
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
    99
    10 Create a simple popup and have it popup on any page you want.
     10Create a simple popup and have it popup on any page you want using a shortcode.
    1111
    1212== Description ==
    1313
    14 Create a simple Popup. Put whatever you want in it. Whatever you put in a page or post can be put into the popup. The possibilities are endless. When someone visits the page that you want the popup to appear on, they will see the popup.
     14Create a simple Popup, and put many different kinds of content in it: pictures, text, and even shortcode! The possibilities are endless. When someone visits the page that you want the popup to appear on, they will see the popup. Please note: <strong>not all shortcodes can execute in the popup</strong>. Gravity Forms shortcodes will work, but Ninja Forms shortcode will not. Place content in the popups at your own risk!
    1515
    1616== Installation ==
     
    2020    <li>Upload the plugin folder to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly (don't forget to zip the plugin folder before uploading the plugin using this method!).</li>
    2121    <li>Activate the plugin through the 'Plugins' screen in WordPress</li>
    22     <li>Use the Settings -> Webpage Popup screen to add content to your popup page.</li>
    23     <li>Specify where you want the popup to appear.</li>
     22    <li>Add a Popup in the WordPress Dashboard area menu under Simple Popups -> Add New Popup Item</li>
     23    <li>Add content to the popup</li>
     24    <li>Copy the popup's shortcode and paste it at the bottom of the page or post where you want it to appear.</li>
    2425</ul>
    2526
     
    2930= What can this plugin do? =
    3031
    31 Create a normal WordPress page/post and have it popup on any page you want. The possibilities are endless. When someone visits the page that you want the popup to appear on, they will see the popup.
     32Create a popup and have it popup on any page you want by placing its shortcode on that page. The possibilities are endless. When someone visits the page that you want the popup to appear on, they will see the popup.
    3233
    3334== Screenshots ==
    3435
    35 1. Back end settings for Simple Popup Content. Just add content to the content editor and specify which page you want it to appear on.
     361. Back end creator for the popups. The back end creator uses the same WordPress editor that you're familiar with! Just add content to the content editor, publish the popup, copy the shortcode, and paste it at the bottom of any page or post where you want it to appear.
    36372. Appearance of Simple Popup Content in action.
    3738
    3839== Changelog ==
    3940
    40 = 1.0 =
    41 *
     41= [1.2] 2017-01-14 =
     42
     43* 1.2 is a "major" update. It is now possible to create multiple popups. Also, in order to display a popup on a post or page, you must copy its shortcode and paste it at the bottom of the post or page where you want it to appear.
     44
     45= [1.0]
    4246
    4347== Upgrade Notice ==
  • simple-popup-content/tags/1.2/gateway.php

    r1555855 r1574482  
    1 <?php
    2 foreach (glob(dirname(__FILE__) . '/lib/classes/*.php') as $classfilename) {
    3     include_once $classfilename;
    4 }
    5 
    6 $DRM_SPC_SimplePopupContent = new DRM_SPC_Simple_Popup_Content();
    7 
    8 class DRM_SPC_Simple_Popup_Content {
    9     private static $cache = array();
    10 
    11     private static $pluginBasename;
    12 
    13     private static $pluginUrl;
    14 
    15     public function __construct()
    16     {
    17         self::$pluginBasename = dirname( plugin_basename( __FILE__ ) );
    18         self::$pluginUrl = plugin_dir_url(__FILE__);
    19     }
    20 
    21 
    22     public static function manageScripts()
    23     {
    24         if (!isset(self::$cache['manageScripts'])) {
    25             self::$cache['manageScripts'] = new DRM_SPC_ManageScripts(self::$pluginUrl);
    26         }
    27         return self::$cache['manageScripts'];
    28     }
    29 
    30     public static function ajaxFunctions()
    31     {
    32         if (!isset(self::$cache['ajaxFunctions'])) {
    33             self::$cache['ajaxFunctions'] = new DRM_SPC_AjaxFunctions();
    34         }
    35         return self::$cache['ajaxFunctions'];
    36     }
    37 
    38     public static function mySettingsPage()
    39     {
    40         if (!isset(self::$cache['mySettingsPage'])) {
    41             self::$cache['mySettingsPage'] = new DRM_SPC_MySettingsPage();
    42         }
    43         return self::$cache['mySettingsPage'];
    44     }
    45 
    46 }
  • simple-popup-content/tags/1.2/js/simple-popup-content.js

    r1555855 r1574482  
    2525  |*|
    2626  \*/
    27 
    2827  var docCookies = {
    2928    getItem: function (sKey) {
     
    7170
    7271
     72  var popup_cookie_name = 'disable_popup_' + spc_ajax.popup_post_id;
    7373
    74   if (docCookies.hasItem("disable_popup")) {
     74  if (docCookies.hasItem(popup_cookie_name)) {
    7575    return;
    7676  }
     
    8484  data_for_user['action'] = 'return_simple_popup_content_results';
    8585  data_for_user['tag'] = 'get_content';
     86  data_for_user['popup_post_id'] = spc_ajax.popup_post_id;
    8687
    8788  jQuery.ajax({
     
    99100        ],
    100101        afterOpen: function() {
     102          var popup_cookie_name = 'disable_popup_' + spc_ajax.popup_post_id;
    101103          // Send request for do not show session
    102104          jQuery("#disable_popup").change(function(){
    103             setCookie( 'disable_popup', jQuery(this).prop('checked') );
     105            setCookie( jQuery(this).prop('checked') );
    104106          });
    105107         
    106           function setCookie( tag, param ){
    107             if (param) {
    108               docCookies.setItem("disable_popup", "Popup Disabled", '"Wed, 19 Feb 2127 01:04:55 EST"', '/', null, false);
     108          function setCookie( checked ){
     109            if (checked) {
     110              docCookies.setItem(popup_cookie_name, "Popup Disabled", '"Wed, 19 Feb 2127 01:04:55 EST"', '/', null, false);
    109111            } else {
    110               docCookies.removeItem("disable_popup", "/", null);
     112              docCookies.removeItem(popup_cookie_name, "/", null);
    111113            }
    112114          }
  • simple-popup-content/tags/1.2/simple-popup-content.php

    r1555855 r1574482  
    11<?php
    22/*
    3 Plugin Name: Popup Page
     3Plugin Name: Simple Popup Content
    44Plugin URI: https://richiedmedia.com
    5 Description: Create a popup page.
    6 Version: 1.0
     5Description: Create a popup and display it anywhere using a shortcode.
     6Version: 1.2
    77Author: David Richied
    88Author URI: https://richiedmedia.com
     
    1313
    1414
    15 require_once 'gateway.php';
     15
     16require_once 'lib/Richied/Main.php';
     17
     18//Register the custom post type
     19add_action('init', array(Richied__Main::registerEntities(), 'registerPostTypes'));
     20
     21add_action('wp_enqueue_scripts', array(Richied__Main::manageScripts(), 'enqueue_simple_popup_content'));
     22
     23// Setup Shortcodes
     24add_action( 'plugins_loaded', array( Richied__Main::addShortcode(), 'hook' ) );
    1625
    1726
    18 add_action('wp_enqueue_scripts', array(DRM_SPC_Simple_Popup_Content::manageScripts(), 'enqueue_simple_popup_content'));
    19 
    2027if (is_admin()) {
    21     add_action( 'admin_menu', array( DRM_SPC_Simple_Popup_Content::mySettingsPage(), 'add_plugin_page' ) );
    22     add_action( 'admin_init', array( DRM_SPC_Simple_Popup_Content::mySettingsPage(), 'page_init' ) );   
     28    add_action('admin_menu', array(Richied__Main::mySettingsPage(), 'addMenuEntry'));   
    2329}
    2430
    25 add_action('wp_ajax_return_simple_popup_content_results', array(DRM_SPC_Simple_Popup_Content::ajaxFunctions(), 'returnSearchResults'));
    26 add_action('wp_ajax_nopriv_return_simple_popup_content_results', array(DRM_SPC_Simple_Popup_Content::ajaxFunctions(), 'returnSearchResults'));
     31add_action('wp_ajax_return_simple_popup_content_results', array(Richied__Main::ajaxFunctions(), 'returnSearchResults'));
     32add_action('wp_ajax_nopriv_return_simple_popup_content_results', array(Richied__Main::ajaxFunctions(), 'returnSearchResults'));
  • simple-popup-content/trunk/README.txt

    r1555865 r1574482  
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
    99
    10 Create a simple popup and have it popup on any page you want.
     10Create a simple popup and have it popup on any page you want using a shortcode.
    1111
    1212== Description ==
    1313
    14 Create a simple Popup. Put whatever you want in it. Whatever you put in a page or post can be put into the popup. The possibilities are endless. When someone visits the page that you want the popup to appear on, they will see the popup.
     14Create a simple Popup, and put many different kinds of content in it: pictures, text, and even shortcode! The possibilities are endless. When someone visits the page that you want the popup to appear on, they will see the popup. Please note: <strong>not all shortcodes can execute in the popup</strong>. Gravity Forms shortcodes will work, but Ninja Forms shortcode will not. Place content in the popups at your own risk!
    1515
    1616== Installation ==
     
    2020    <li>Upload the plugin folder to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly (don't forget to zip the plugin folder before uploading the plugin using this method!).</li>
    2121    <li>Activate the plugin through the 'Plugins' screen in WordPress</li>
    22     <li>Use the Settings -> Webpage Popup screen to add content to your popup page.</li>
    23     <li>Specify where you want the popup to appear.</li>
     22    <li>Add a Popup in the WordPress Dashboard area menu under Simple Popups -> Add New Popup Item</li>
     23    <li>Add content to the popup</li>
     24    <li>Copy the popup's shortcode and paste it at the bottom of the page or post where you want it to appear.</li>
    2425</ul>
    2526
     
    2930= What can this plugin do? =
    3031
    31 Create a normal WordPress page/post and have it popup on any page you want. The possibilities are endless. When someone visits the page that you want the popup to appear on, they will see the popup.
     32Create a popup and have it popup on any page you want by placing its shortcode on that page. The possibilities are endless. When someone visits the page that you want the popup to appear on, they will see the popup.
    3233
    3334== Screenshots ==
    3435
    35 1. Back end settings for Simple Popup Content. Just add content to the content editor and specify which page you want it to appear on.
     361. Back end creator for the popups. The back end creator uses the same WordPress editor that you're familiar with! Just add content to the content editor, publish the popup, copy the shortcode, and paste it at the bottom of any page or post where you want it to appear.
    36372. Appearance of Simple Popup Content in action.
    3738
    3839== Changelog ==
    3940
    40 = 1.0 =
    41 *
     41= [1.2] 2017-01-14 =
     42
     43* 1.2 is a "major" update. It is now possible to create multiple popups. Also, in order to display a popup on a post or page, you must copy its shortcode and paste it at the bottom of the post or page where you want it to appear.
     44
     45= [1.0]
    4246
    4347== Upgrade Notice ==
  • simple-popup-content/trunk/js/simple-popup-content.js

    r1555855 r1574482  
    2525  |*|
    2626  \*/
    27 
    2827  var docCookies = {
    2928    getItem: function (sKey) {
     
    7170
    7271
     72  var popup_cookie_name = 'disable_popup_' + spc_ajax.popup_post_id;
    7373
    74   if (docCookies.hasItem("disable_popup")) {
     74  if (docCookies.hasItem(popup_cookie_name)) {
    7575    return;
    7676  }
     
    8484  data_for_user['action'] = 'return_simple_popup_content_results';
    8585  data_for_user['tag'] = 'get_content';
     86  data_for_user['popup_post_id'] = spc_ajax.popup_post_id;
    8687
    8788  jQuery.ajax({
     
    99100        ],
    100101        afterOpen: function() {
     102          var popup_cookie_name = 'disable_popup_' + spc_ajax.popup_post_id;
    101103          // Send request for do not show session
    102104          jQuery("#disable_popup").change(function(){
    103             setCookie( 'disable_popup', jQuery(this).prop('checked') );
     105            setCookie( jQuery(this).prop('checked') );
    104106          });
    105107         
    106           function setCookie( tag, param ){
    107             if (param) {
    108               docCookies.setItem("disable_popup", "Popup Disabled", '"Wed, 19 Feb 2127 01:04:55 EST"', '/', null, false);
     108          function setCookie( checked ){
     109            if (checked) {
     110              docCookies.setItem(popup_cookie_name, "Popup Disabled", '"Wed, 19 Feb 2127 01:04:55 EST"', '/', null, false);
    109111            } else {
    110               docCookies.removeItem("disable_popup", "/", null);
     112              docCookies.removeItem(popup_cookie_name, "/", null);
    111113            }
    112114          }
  • simple-popup-content/trunk/simple-popup-content.php

    r1555855 r1574482  
    11<?php
    22/*
    3 Plugin Name: Popup Page
     3Plugin Name: Simple Popup Content
    44Plugin URI: https://richiedmedia.com
    5 Description: Create a popup page.
    6 Version: 1.0
     5Description: Create a popup and display it anywhere using a shortcode.
     6Version: 1.2
    77Author: David Richied
    88Author URI: https://richiedmedia.com
     
    1313
    1414
    15 require_once 'gateway.php';
     15
     16require_once 'lib/Richied/Main.php';
     17
     18//Register the custom post type
     19add_action('init', array(Richied__Main::registerEntities(), 'registerPostTypes'));
     20
     21add_action('wp_enqueue_scripts', array(Richied__Main::manageScripts(), 'enqueue_simple_popup_content'));
     22
     23// Setup Shortcodes
     24add_action( 'plugins_loaded', array( Richied__Main::addShortcode(), 'hook' ) );
    1625
    1726
    18 add_action('wp_enqueue_scripts', array(DRM_SPC_Simple_Popup_Content::manageScripts(), 'enqueue_simple_popup_content'));
    19 
    2027if (is_admin()) {
    21     add_action( 'admin_menu', array( DRM_SPC_Simple_Popup_Content::mySettingsPage(), 'add_plugin_page' ) );
    22     add_action( 'admin_init', array( DRM_SPC_Simple_Popup_Content::mySettingsPage(), 'page_init' ) );   
     28    add_action('admin_menu', array(Richied__Main::mySettingsPage(), 'addMenuEntry'));   
    2329}
    2430
    25 add_action('wp_ajax_return_simple_popup_content_results', array(DRM_SPC_Simple_Popup_Content::ajaxFunctions(), 'returnSearchResults'));
    26 add_action('wp_ajax_nopriv_return_simple_popup_content_results', array(DRM_SPC_Simple_Popup_Content::ajaxFunctions(), 'returnSearchResults'));
     31add_action('wp_ajax_return_simple_popup_content_results', array(Richied__Main::ajaxFunctions(), 'returnSearchResults'));
     32add_action('wp_ajax_nopriv_return_simple_popup_content_results', array(Richied__Main::ajaxFunctions(), 'returnSearchResults'));
Note: See TracChangeset for help on using the changeset viewer.