Plugin Directory

Changeset 2086725


Ignore:
Timestamp:
05/13/2019 11:07:52 AM (7 years ago)
Author:
kernelroni
Message:

Interval Feature updated

Location:
splashpopup
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • splashpopup/trunk/admin/class-splash-popup-admin.php

    r2085126 r2086725  
    111111        $post = $_POST['splashinfo'];
    112112        $info = 0;
    113        
    114        
     113
    115114       
    116115        if(intval($post['duration'])  <= 0 ){
  • splashpopup/trunk/admin/partials/splash-popup-admin-display.php

    r2085126 r2086725  
    22
    33if(intval($duration) == 0){
    4     $duration = 30;
     4    $duration = 30; // sec
     5}
     6
     7if(intval($popup_interval) == 0){
     8    $popup_interval = 5; // 5min
    59}
    610
     
    102106    <tr>
    103107        <td class="left">
    104             Popup Duration (n)
     108            Popup Duration (N Sec)
    105109        </td>
    106110       
    107111        <td>
    108             <input type="text" name="splashinfo[duration]" id="splashduration" value="<?php echo intval($duration) ;?>" placeholder="30" />
     112            <input type="number" name="splashinfo[duration]" id="splashduration" value="<?php echo intval($duration) ;?>" placeholder="30" />
    109113            <small> Popup will automatically hide after n second (Default 30 Sec. )</small>
    110114           
    111115        </td>
    112     </tr>   
     116    </tr>
     117
     118
     119    <tr>
     120        <td class="left">
     121            Popup Interval (N Min)
     122        </td>
     123       
     124        <td>
     125            <input type="number" name="splashinfo[popup_interval]" id="splashinterval" value="<?php echo intval($popup_interval) ;?>" placeholder="5" />
     126            <small> Popup will apear every after N min, (Default 5 Min) </small>
     127           
     128        </td>
     129    </tr>
     130   
    113131   
    114132    <tr>
  • splashpopup/trunk/includes/class-splash-popup.php

    r2085126 r2086725  
    172172    private function define_public_hooks() {
    173173       
    174        
     174        $popup_cookie = "popup_cookie";
     175        $popup_cookie_value = "yes";       
    175176       
    176177       
     
    178179        $data = unserialize($splashinfo);       
    179180        extract($data);
    180        
    181         if(isset($is_active) && intval($is_active) == 1 && $this->splash_within_time_slot() ){ 
     181        $popup_interval = intval($popup_interval);
     182
     183        $popup_shown = $_COOKIE[$popup_cookie] == "yes";     // 1/0
     184       
     185
     186       
     187       
     188               
     189
     190
     191
     192
     193
     194
     195
     196
     197       
     198       
     199       
     200       
     201       
     202        if(isset($is_active) && intval($is_active) == 1 && $this->splash_within_time_slot() && !$popup_shown){ 
    182203
    183204           
     
    193214        }
    194215       
    195        
     216
     217       
     218       
     219
     220        if($popup_interval == 0 ){ // popup interval is with in the data var.
     221            $popup_interval = 5; // default 5 min           
     222        }       
     223       
     224        // popup already show in this session
     225        // save the interval into cookie
     226        setcookie($popup_cookie, $popup_cookie_value, time() + $popup_interval*60, "/"); // 60sec = 1 min       
    196227
    197228
  • splashpopup/trunk/splash-popup.php

    r2085126 r2086725  
    1717 * Plugin URI:        https://github.com/kernelroni/splashpopup
    1818 * Description:       This is a short description of what the plugin does. It's displayed in the WordPress admin area.
    19  * Version:           1.0.0
     19 * Version:           1.0.1
    2020 * Author:            Roni Das
    2121 * Author URI:        https://github.com/kernelroni
Note: See TracChangeset for help on using the changeset viewer.