Plugin Directory

Changeset 884705


Ignore:
Timestamp:
03/30/2014 05:08:38 PM (12 years ago)
Author:
hintsolutions
Message:

Added shortcode [floating_button]

Location:
profit-button/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • profit-button/trunk/probtn.php

    r875562 r884705  
    7878}
    7979
     80function probtninit_function() {
     81    $options = get_option( 'probtn_settings' );
     82    if (($options['state']==null) || ($options['state']=='')) {
     83        $options['state'] = 'on';
     84    };
     85    if (($options['probtn_image']==null) || ($options['probtn_image']=='')) {
     86        $options['probtn_image'] = 'http://admin.probtn.com/eqwid_btn_nonpress.png';
     87    };
     88    if (($options['source']==null) || ($options['source']=='')) {
     89        $options['source'] = 'probtn.com';
     90        $source = 1;
     91    } else {
     92        $source = 0;
     93    }
     94
     95    $mainStyleCss = parse_url('https://pizzabtn.herokuapp.com/stylesheets/probtn.css');
     96    $jqueryPepPath = parse_url("https://pizzabtn.herokuapp.com/javascripts/jquery.pep.min.js");
     97
     98    if ($options['state']=="off") {
     99$output = '
     100<script>
     101FloatingButtonFunc();
     102
     103function runYourFunctionWhenJQueryIsLoaded() {
     104    if (window.$){
     105        FloatingButtonFunc();
     106    } else {
     107        setTimeout(runYourFunctionWhenJQueryIsLoaded, 50);
     108    }
     109}
     110
     111function FloatingButtonFunc() {   
     112    jQuery(document).ready(function() {
     113        setTimeout(InitButton, 2500);
     114    });
     115}
     116
     117function InitButton() {
     118    jQuery(document).StartButton({
     119            "mainStyleCss": "https://pizzabtn.herokuapp.com/stylesheets/probtn.css",
     120            ';
     121            if ($source==1) {
     122                $output = $output. '
     123                "jqueryPepPath": ""jqueryPepPath": "'.$jqueryPepPath["path"].'",
     124                "ButtonImage": "'.$options['probtn_image'].'",
     125                "ButtonDragImage": "'.$options['probtn_image'].'",
     126                "ButtonOpenImage": "'.$options['probtn_image'].'",
     127                "ButtonInactiveImage": "http://localhost:55737/",
     128                "domain": "wordpress.plugin",
     129                "ContentURL": "'.$options['probtn_contenturl'].'",
     130                "HintText",": "'.$options['probtn_hinttext'].'"
     131                ';
     132            } else {
     133                $output = $output. '"jqueryPepPath": "'.$jqueryPepPath["path"].'"';
     134            }
     135             $output = $output. '}); } </script>';
     136            return $output;
     137        } else {
     138            return "";
     139        }
     140}
     141
     142add_shortcode('floating_button', 'probtninit_function');
     143
    80144add_action('admin_init', 'probtn_register_settings');
    81145
     
    236300        Floating button is a new way to add survey, ads or some other additional content without adding any changes to your design.<br/>
    237301        Functionality is implemented like floating button above your site, and after clicking on button would be opened additional modal window with nessesary content.<br/>
    238         For better usability users can use admin panel with settings and button targeting, and also some detailed statistics and analytics.
     302        For better usability users can use admin panel with settings and button targeting, and also some detailed statistics and analytics.<br/>
     303        Shortcode to insert plugin - <strong><i>[floating_button]</i></strong>
    239304        </p>
    240305    </div>
  • profit-button/trunk/readme.txt

    r875562 r884705  
    55Requires at least: 3.3
    66Tested up to: 3.5.1
    7 Stable tag: 1.9.4
     7Stable tag: 1.9.5
    88License: Licenced under LGPL
    99License URI: http://opensource.org/licenses/LGPL-3.0
     
    1818
    1919For better usability users can use admin panel with settings and button targeting, and also some detailed statistics and analytics.
     20
     21Shortcode to insert plugin - [floating_button]
    2022
    2123== Installation ==
     
    6668Change its value to "false" and click Save.
    6769
     70= How to show button only on some nessesary pages? =
     71
     72You need to set "Button state" to off and add shortcode [floating_button] at nessesary pages, where you'd like to see button.
     73
    6874== Screenshots ==
    6975
     
    7581
    7682== Changelog ==
     83
     84= 1.9.5 =
     85Added shortcode [floating_button] (require button state set to off) to add button only on nessesary pages.
    7786
    7887= 1.9.4 =
Note: See TracChangeset for help on using the changeset viewer.