Support » Plugin: Queue Posts » Post with days between posts

  • novakcs

    (@novakcs)


    Hello, for my website, I needed to be able to choose 1, 2 or 3 days between posts, instead of hours or minutes.
    So I modified these lines and it works perfectly. In case someone is worth:

    
    <select id="queue-posts-minimum-interval-type" name="minimum-interval-type">
      <option value="h"><?php echo _('hour(s)'); ?></option>
      <option value="m"><?php echo _('minute(s)'); ?></option>				
    </select>
    

    Add option:

    		
    <option value="d"><?php echo _('day(s)'); ?></option>	
    

    RESULT:

    
    <select id="queue-posts-minimum-interval-type" name="minimum-interval-type">
      <option value="h"><?php echo _('hour(s)'); ?></option>
      <option value="m"><?php echo _('minute(s)'); ?></option>	
      <option value="d"><?php echo _('day(s)'); ?></option>			
    </select>	
    

    iN 187 LINE APROX:

    
    if ( $iMinimumIntervalType === 'h' ) {
    				/* Convert hours to minutes. */
    				$iMinimumInterval   = $iMinimumInterval * 60;
    				$iAddRandomInterval = rand(0, (60 * 60)); // Minutes
    			}
    } 
    			else {
    				$iAddRandomInterval = rand(0, ($iMinimumInterval * 60) * 0.2) + rand(0, 60); // Minutes + seconds
    			}
    

    add between if and else:

    	
    			else if($iMinimumIntervalType === 'd' ){
    				/* Convert hours to minutes. */
    				$iMinimumInterval   = $iMinimumInterval * 1440;
    				$iAddRandomInterval = rand(0, (60 * 60)); // Minutes
    

    RESULT:

    
    if ( $iMinimumIntervalType === 'h' ) {
    				/* Convert hours to minutes. */
    				$iMinimumInterval   = $iMinimumInterval * 60;
    				$iAddRandomInterval = rand(0, (60 * 60)); // Minutes
    			}
    			/* A√ĎADIDO DAVID PARA QUE FUNCIONE CON DIAS */
    			else if($iMinimumIntervalType === 'd' ){
    				/* Convert hours to minutes. */
    				$iMinimumInterval   = $iMinimumInterval * 1440;
    				$iAddRandomInterval = rand(0, (60 * 60)); // Minutes
    			} 
    			else {
    				$iAddRandomInterval = rand(0, ($iMinimumInterval * 60) * 0.2) + rand(0, 60); // Minutes + seconds
    			}

    sorry for my bad english and my code, i’m a novice coder.

    Thanks for the plugin!!

    • This topic was modified 9 months ago by novakcs.
    • This topic was modified 9 months ago by novakcs.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Post with days between posts’ is closed to new replies.