Plugin Directory

Changeset 881987


Ignore:
Timestamp:
03/25/2014 10:04:32 PM (12 years ago)
Author:
brs
Message:

Version 1.1.1 update

Location:
optin-forms
Files:
89 added
3 edited

Legend:

Unmodified
Added
Removed
  • optin-forms/trunk/includes/functions-forms.php

    r877905 r881987  
    11<?php
     2
     3// Get excluded posts and create an array
     4function optinforms_get_excluded_posts() {
     5    global $optinforms_form_exclude_posts;
     6    if(empty($optinforms_form_exclude_posts)) {
     7        $optinforms_get_excluded_posts = '0';
     8    }
     9    if(!is_string($optinforms_form_exclude_posts)) {
     10        $optinforms_get_excluded_posts = '0';
     11    }
     12    else {
     13      $optinforms_get_excluded_posts = explode(',', $optinforms_form_exclude_posts);
     14    }
     15    return $optinforms_get_excluded_posts;
     16}
     17
     18// Get excluded pages and create an array
     19function optinforms_get_excluded_pages() {
     20    global $optinforms_form_exclude_pages;
     21    if(empty($optinforms_form_exclude_pages)) {
     22        $optinforms_get_excluded_pages = '0';
     23    }
     24    if(!is_string($optinforms_form_exclude_pages)) {
     25        $optinforms_get_excluded_pages = '0';
     26    }
     27    else {
     28      $optinforms_get_excluded_pages = explode(',', $optinforms_form_exclude_pages);
     29    }
     30    return $optinforms_get_excluded_pages;
     31}
    232
    333// Insert form on post, after first paragraph
     
    636function optinform_insert_form_first_paragraph_post($content) {
    737    global $optinforms_form_placement_post, $optinforms_form_exclude_posts;
     38    $optinforms_get_excluded_posts = optinforms_get_excluded_posts(); // THIS ONE IS NEW !!!
    839    if($optinforms_form_placement_post == '1'){
    940        $ad_code = optinforms_create_form();
    10         $optinforms_form_exclude_posts = explode(',', $optinforms_form_exclude_posts);
    11         if(is_single()) {
    12             if(is_single($optinforms_form_exclude_posts)) {
     41        if(empty($optinforms_form_exclude_posts) && is_single()) {
     42            return optinform_insert_form_after_paragraph($ad_code, 1, $content);
     43        }
     44        elseif (!empty($optinforms_form_exclude_posts) && is_single()) {
     45            if(is_single($optinforms_get_excluded_posts)) {
    1346                // do nothing
    1447            }
     
    2861
    2962function optinform_insert_form_first_paragraph_page($content) {
    30     global $optinforms_form_placement_page, $optinforms_form_exclude_pages;
     63    global $optinforms_form_placement_page;
     64    $optinforms_get_excluded_pages = optinforms_get_excluded_pages(); // THIS ONE IS NEW !!!
    3165    if($optinforms_form_placement_page == '1'){
    3266        $ad_code = optinforms_create_form();
    33         $optinforms_form_exclude_pages = explode(',', $optinforms_form_exclude_pages);
    3467        if(is_page()) {
    35             if(is_page($optinforms_form_exclude_pages)) {
     68            if(is_page($optinforms_get_excluded_pages)) {
    3669                // do nothing
    3770            }
     
    5184
    5285function optinform_insert_form_second_paragraph_post($content) {
    53     global $optinforms_form_placement_post, $optinforms_form_exclude_posts;
     86    global $optinforms_form_placement_post;
     87    $optinforms_get_excluded_posts = optinforms_get_excluded_posts(); // THIS ONE IS NEW !!!
    5488    if($optinforms_form_placement_post == '2'){
    5589        $ad_code = optinforms_create_form();
    56         $optinforms_form_exclude_posts = explode(',', $optinforms_form_exclude_posts);
    5790        if(is_single()) {
    58             if(is_single($optinforms_form_exclude_posts)) {
     91            if(is_single($optinforms_get_excluded_posts)) {
    5992                // do nothing
    6093            }
     
    74107
    75108function optinform_insert_form_second_paragraph_page($content) {
    76     global $optinforms_form_placement_page, $optinforms_form_exclude_pages;
     109    global $optinforms_form_placement_page;
     110    $optinforms_get_excluded_pages = optinforms_get_excluded_pages(); // THIS ONE IS NEW !!!
    77111    if($optinforms_form_placement_page == '2'){
    78112        $ad_code = optinforms_create_form();
    79         $optinforms_form_exclude_pages = explode(',', $optinforms_form_exclude_pages);
    80113        if(is_page()) {
    81             if(is_page($optinforms_form_exclude_pages)) {
     114            if(is_page($optinforms_get_excluded_pages)) {
    82115                // do nothing
    83116            }
     
    113146function optinforms_insert_form_after_post($content) {
    114147    global $optinforms_form_placement_post, $optinforms_form_exclude_posts;
     148    $optinforms_get_excluded_posts = optinforms_get_excluded_posts(); // THIS ONE IS NEW !!!
    115149    if($optinforms_form_placement_post == '3' || empty($optinforms_form_placement_post)) {
    116         $optinforms_form_exclude_posts = explode(',', $optinforms_form_exclude_posts);
    117         if(is_single()) {
    118             if(is_single($optinforms_form_exclude_posts)) {
     150       
     151        if(empty($optinforms_form_exclude_posts) && is_single()) {
     152            $content .= optinforms_create_form();
     153        }
     154        elseif (!empty($optinforms_form_exclude_posts) && is_single()) {
     155            if(is_single($optinforms_get_excluded_posts)) {
    119156                // do nothing
    120157            }
     
    123160            }
    124161        }
     162
    125163    }
    126164    return $content;
     
    132170function optinforms_insert_form_after_page($content) {
    133171    global $optinforms_form_placement_page, $optinforms_form_exclude_pages;
     172    $optinforms_get_excluded_pages = optinforms_get_excluded_pages(); // THIS ONE IS NEW !!!
    134173    if($optinforms_form_placement_page == '3' || empty($optinforms_form_placement_page)) {
    135         $optinforms_form_exclude_pages = explode(',', $optinforms_form_exclude_pages);
    136174        if(is_page()) {
    137             if(is_page($optinforms_form_exclude_pages)) {
     175            if(is_page($optinforms_get_excluded_pages)) {
    138176                // do nothing
    139177            }
  • optin-forms/trunk/optin-forms.php

    r877905 r881987  
    55Description: Create beautiful optin forms with ease. Choose a form design, customize it, and add your form to your blog with a simple mouse-click.
    66Author: Codeleon
    7 Version: 1.1
     7Version: 1.1.1
    88Author URI: http://www.codeleon.com
    9 License: Free
    109Text Domain: optinforms
    1110Domain Path:   /languages/
     11License:
     12  Copyright 2014 codeleon.com
     13 
     14  This program is free software; you can redistribute it and/or modify
     15  it under the terms of the GNU General Public License, version 2, as
     16  published by the Free Software Foundation.
     17 
     18  This program is distributed in the hope that it will be useful,
     19  but WITHOUT ANY WARRANTY; without even the implied warranty of
     20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     21  GNU General Public License for more details.
     22 
     23  You should have received a copy of the GNU General Public License
     24  along with this program; if not, write to the Free Software
     25  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1226*/
    1327
     
    92106        <div id="icon-optinforms" class="icon32">
    93107        </div><!--icon-32-->
    94        
    95108        <h2 class="title"><?php echo optinforms_menu_tabs(); ?></h2>
    96109    </div><!--wrap-->
  • optin-forms/trunk/readme.txt

    r877905 r881987  
    44Requires at least: 3.2
    55Tested up to: 3.8.1
    6 Stable tag: 1.1
     6Stable tag: 1.1.1
    77
    88Create beautiful optin forms with ease. Choose a form design, customize it, and add your form to your blog with a simple mouse-click.
     
    4949== Changelog ==
    5050
     51= 1.1.1 =
     52* Fixed exclude function.
     53
    5154= 1.1 =
    5255* Added exclude options.
     
    6164== Upgrade Notice ==
    6265
     66= 1.1.1 =
     67Fixed exclude function that caused warnings on certain installations.
     68
    6369= 1.1 =
    6470New display options, exclude your optin form on specific posts and pages, and add your form with a shortcode!
Note: See TracChangeset for help on using the changeset viewer.