Changeset 756431
- Timestamp:
- 08/15/2013 01:10:23 AM (13 years ago)
- Location:
- evergreen-post-tweeter/trunk
- Files:
-
- 2 added
- 5 edited
-
css/evergreen-post-tweeter.css (modified) (3 diffs)
-
ept-admin.php (modified) (13 diffs)
-
ept-core.php (modified) (9 diffs)
-
evergreen.php (modified) (5 diffs)
-
js (added)
-
js/application.js (added)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
evergreen-post-tweeter/trunk/css/evergreen-post-tweeter.css
r748326 r756431 47 47 text-align: left; 48 48 } 49 50 51 #ept_opt .option ul.option-schedule-days { 52 float: left; 53 width: 650px; 54 padding-top: 5px; 55 padding-left: 0px; 56 margin-top: 0px; 57 } 58 59 #ept_opt .option ul.option-schedule-days label { 60 text-align: left; 61 } 62 63 #ept_opt .option ul.option-schedule-days .schedule-day-checkbox { 64 float: left; 65 width: 90px; 66 text-align: center; 67 border: solid 1px #808080; 68 } 69 70 #ept_opt .option ul.option-schedule-days li.checked { 71 background-color: #eeefff; 72 } 73 74 #ept_opt .option ul.option-schedule-days li.schedule-day-checkbox input { 75 display: none; 76 } 77 78 #ept_opt .option ul.option-schedule-days li.schedule-day-checkbox label { 79 width: 90px; 80 text-align: center; 81 font-weight: bold; 82 padding-bottom: 5px; 83 } 84 85 #ept_opt .option ol.option-schedule-times { 86 float: left; 87 width: 200px; 88 padding-top: 5px; 89 padding-left: 0px; 90 margin-top: 5px; 91 margin-left: 0px; 92 list-style: none; 93 } 94 95 #ept_opt .option ul.option-schedule-times label { 96 text-align: left; 97 } 98 49 99 #ept_opt .option span { 50 100 display: block; … … 53 103 margin-top: 6px;**/ 54 104 clear: left; 105 color: #666; 55 106 } 56 107 57 108 #ept_opt p.submit { 58 109 overflow: hidden; 59 }60 #ept_opt .option span {61 color: #666;62 display: block;63 110 } 64 111 … … 124 171 } 125 172 173 #add-item { 174 float: left; 175 } 176 177 #ept_opt .option span#scheduled-days { 178 float: none; 179 display: inline; 180 color: #333; 181 } 182 183 #schedule-times li { 184 position: relative; 185 } 186 187 #schedule-times li .remove-time { 188 position: absolute; 189 top: 0px; 190 cursor: pointer; 191 font-size: 26px; 192 padding: 3px 3px 3px 5px; 193 } 194 126 195 .updated a { 127 196 text-decoration: underline; -
evergreen-post-tweeter/trunk/ept-admin.php
r748326 r756431 92 92 93 93 94 if (get_option('next_tweet_time')=='0'){95 $next_tweet_time = time()+ get_option('ept_opt_interval') * 60 * 60;94 if ( get_option('next_tweet_time')=='0' ){ 95 $next_tweet_time = ept_determine_next_update(); 96 96 update_option('next_tweet_time', $next_tweet_time); 97 97 } 98 98 99 //if submit and if bitly selected its fields are filled then save 99 100 if (isset($_POST['submit']) && $save) { … … 229 230 } 230 231 231 //tweet interval 232 if (isset($_POST['ept_opt_interval'])) { 233 if (is_numeric($_POST['ept_opt_interval']) && $_POST['ept_opt_interval'] > 0) { 234 update_option('ept_opt_interval', $_POST['ept_opt_interval']); 235 } else { 236 update_option('ept_opt_interval', "4"); 237 } 238 } 239 240 $next_tweet_time = time()+ get_option('ept_opt_interval') * 60 * 60; 241 update_option('next_tweet_time', $next_tweet_time); 242 243 //random interval 244 if (isset($_POST['ept_opt_interval_slop'])) { 245 if (is_numeric($_POST['ept_opt_interval_slop']) && $_POST['ept_opt_interval_slop'] > 0) { 246 update_option('ept_opt_interval_slop', $_POST['ept_opt_interval_slop']); 247 } else { 248 update_option('ept_opt_interval_slop', "2"); 249 } 250 } 232 $next_tweet_time = ept_determine_next_update(); 233 update_option('next_tweet_time', $next_tweet_time); 251 234 252 235 //minimum post age to tweet … … 255 238 update_option('ept_opt_age_limit', $_POST['ept_opt_age_limit']); 256 239 } else { 257 update_option('ept_opt_age_limit', " 30");240 update_option('ept_opt_age_limit', "0"); 258 241 } 259 242 } … … 293 276 } 294 277 } 278 279 // set schedule day - monday 280 if (isset($_POST['ept_opt_schedule_day_mon'])) { 281 update_option('ept_opt_schedule_day_mon', $_POST['ept_opt_schedule_day_mon']); 282 } else { 283 update_option('ept_opt_schedule_day_mon', ""); 284 } 285 286 // set schedule day - tuesday 287 if (isset($_POST['ept_opt_schedule_day_tue'])) { 288 update_option('ept_opt_schedule_day_tue', $_POST['ept_opt_schedule_day_tue']); 289 } else { 290 update_option('ept_opt_schedule_day_tue', ""); 291 } 292 293 // set schedule day - wednesday 294 if (isset($_POST['ept_opt_schedule_day_wed'])) { 295 update_option('ept_opt_schedule_day_wed', $_POST['ept_opt_schedule_day_wed']); 296 } else { 297 update_option('ept_opt_schedule_day_wed', ""); 298 } 299 300 // set schedule day - thursday 301 if (isset($_POST['ept_opt_schedule_day_thu'])) { 302 update_option('ept_opt_schedule_day_thu', $_POST['ept_opt_schedule_day_thu']); 303 } else { 304 update_option('ept_opt_schedule_day_thu', ""); 305 } 306 307 // set schedule day - friday 308 if (isset($_POST['ept_opt_schedule_day_fri'])) { 309 update_option('ept_opt_schedule_day_fri', $_POST['ept_opt_schedule_day_fri']); 310 } else { 311 update_option('ept_opt_schedule_day_fri', ""); 312 } 313 314 // set schedule day - saturday 315 if (isset($_POST['ept_opt_schedule_day_sat'])) { 316 update_option('ept_opt_schedule_day_sat', $_POST['ept_opt_schedule_day_sat']); 317 } else { 318 update_option('ept_opt_schedule_day_sat', ""); 319 } 320 321 // set schedule day - sunday 322 if (isset($_POST['ept_opt_schedule_day_sun'])) { 323 update_option('ept_opt_schedule_day_sun', $_POST['ept_opt_schedule_day_sun']); 324 } else { 325 update_option('ept_opt_schedule_day_sun', ""); 326 } 327 328 // set schedule time - counter 329 if (isset($_POST['ept_opt_schedule_times_counter'])) { 330 update_option('ept_opt_schedule_times_counter', $_POST['ept_opt_schedule_times_counter']); 331 } else { 332 update_option('ept_opt_schedule_times_counter', array()); 333 } 334 335 // set schedule time - hour 336 if (isset($_POST['ept_opt_schedule_times_hour'])) { 337 update_option('ept_opt_schedule_times_hour', $_POST['ept_opt_schedule_times_hour']); 338 } else { 339 update_option('ept_opt_schedule_times_hour', array()); 340 } 341 342 // set schedule time - minute 343 if (isset($_POST['ept_opt_schedule_times_minute'])) { 344 update_option('ept_opt_schedule_times_minute', $_POST['ept_opt_schedule_times_minute']); 345 } else { 346 update_option('ept_opt_schedule_times_minute', array()); 347 } 295 348 296 349 //option to enable log 297 350 if ( isset($_POST['ept_enable_log'])) { 298 351 update_option('ept_enable_log', true); 299 global $ept_debug; 300 $ept_debug->enable( true ); 301 302 } 303 else{ 352 global $ept_debug; 353 $ept_debug->enable( true ); 354 } else{ 304 355 update_option('ept_enable_log', false); 305 356 global $ept_debug; 306 $ept_debug->enable( false );357 $ept_debug->enable( false ); 307 358 } 308 359 … … 322 373 //tweet now clicked 323 374 elseif (isset($_POST['tweet'])) { 324 update_option('ept_opt_last_update',time() );375 update_option('ept_opt_last_update',time() ); 325 376 $tweet_msg = ept_opt_tweet_old_post(); 326 377 print(' … … 464 515 if (!isset($twitter_hashtags)) { 465 516 $twitter_hashtags = ept_opt_HASHTAGS; 466 }467 468 //interval469 $interval = get_option('ept_opt_interval');470 if (!(isset($interval) && is_numeric($interval))) {471 $interval = ept_opt_INTERVAL;472 }473 474 //random interval475 $slop = get_option('ept_opt_interval_slop');476 if (!(isset($slop) && is_numeric($slop))) {477 $slop = ept_opt_INTERVAL_SLOP;478 517 } 479 518 … … 526 565 } 527 566 567 // get schedule day - monday 568 $ept_opt_schedule_day_mon = get_option('ept_opt_schedule_day_mon'); 569 if (!(isset($ept_opt_schedule_day_mon))) { 570 $ept_opt_schedule_day_mon = ""; 571 } 572 573 // get schedule day - tuesday 574 $ept_opt_schedule_day_tue = get_option('ept_opt_schedule_day_tue'); 575 if (!(isset($ept_opt_schedule_day_tue))) { 576 $ept_opt_schedule_day_tue = ""; 577 } 578 579 // get schedule day - wednesday 580 $ept_opt_schedule_day_wed = get_option('ept_opt_schedule_day_wed'); 581 if (!(isset($ept_opt_schedule_day_wed))) { 582 $ept_opt_schedule_day_wed = ""; 583 } 584 585 // get schedule day - thursday 586 $ept_opt_schedule_day_thu = get_option('ept_opt_schedule_day_thu'); 587 if (!(isset($ept_opt_schedule_day_thu))) { 588 $ept_opt_schedule_day_thu = ""; 589 } 590 591 // get schedule day - friday 592 $ept_opt_schedule_day_fri = get_option('ept_opt_schedule_day_fri'); 593 if (!(isset($ept_opt_schedule_day_fri))) { 594 $ept_opt_schedule_day_fri = ""; 595 } 596 597 // get schedule day - saturday 598 $ept_opt_schedule_day_sat = get_option('ept_opt_schedule_day_sat'); 599 if (!(isset($ept_opt_schedule_day_sat))) { 600 $ept_opt_schedule_day_sat = ""; 601 } 602 603 // get schedule day - sunday 604 $ept_opt_schedule_day_sun = get_option('ept_opt_schedule_day_sun'); 605 if (!(isset($ept_opt_schedule_day_sun))) { 606 $ept_opt_schedule_day_sun = ""; 607 } 608 609 $ept_opt_schedule_times_counter = get_option( 'ept_opt_schedule_times_counter' ); 610 if (!(isset($ept_opt_schedule_times_counter)) || ! is_array($ept_opt_schedule_times_counter)) { 611 $ept_opt_schedule_times_counter = array(); 612 } 613 614 $ept_opt_schedule_times_hour = get_option( 'ept_opt_schedule_times_hour' ); 615 if (!(isset($ept_opt_schedule_times_hour)) || ! is_array($ept_opt_schedule_times_hour)) { 616 $ept_opt_schedule_times_hour = array(); 617 } 618 619 $ept_opt_schedule_times_minute = get_option( 'ept_opt_schedule_times_minute' ); 620 if (!(isset($ept_opt_schedule_times_minute)) || ! is_array($ept_opt_schedule_times_minute)) { 621 $ept_opt_schedule_times_minute = array(); 622 } 623 528 624 $x = WP_PLUGIN_URL . '/' . str_replace(basename(__FILE__), "", plugin_basename(__FILE__)); 529 625 … … 568 664 $ept_tag_tweet = get_option('ept_tag_tweet'); 569 665 570 571 666 print('</div> 572 667 </div> 573 668 574 <div class="countdown_opt" style="width:100%;height:auto;overflow: hidden;float:none;border-bottom: d ashed 1px #ccc;"><br />669 <div class="countdown_opt" style="width:100%;height:auto;overflow: hidden;float:none;border-bottom: dotted 3px #eeefff;"><br /> 575 670 <label style="margin-left:40px;"><strong>Next Tweet coming in:</strong></label> 576 671 <div id="defaultCountdown" style="width:20%;margin-left:15%;margin-bottom:40px;"></div> … … 635 730 </div> 636 731 </div> 637 638 <div class="option" >639 <label for="ept_opt_interval">' . __('Time Between Tweets: ', 'Evergreen') . '</label>640 <input type="text" id="ept_opt_interval" maxlength="5" value="' . $interval . '" name="ept_opt_interval" /> Hour / Hours <strong>(0 will default to 4 hours.)</strong>641 642 </div>643 732 <div class="option" > 644 733 <label for="ept_opt_age_limit">' . __('Minimum Age of Post: ', 'Evergreen') . '</label> … … 684 773 685 774 <div class="option"> 686 <label for="ept_opt_use_pause_tweet">' . __('Prevent Automatic Tweeting Between Certain Hours?: ', 'Evergreen') . '</label> 687 <input onchange="return showPauseTweet()" type="checkbox" name="ept_opt_use_pause_tweet" id="ept_opt_use_pause_tweet" ' . $use_pause_tweet . ' /> 688 </div> 689 690 <div id="pausetweet"> 691 <div class="option"> 692 <label class="ttip">' . __('Start Time to Pause Tweet: ', 'Evergreen') . ': </label> 693 <input type="text" id="ept_opt_start_pause_time" value="' . $ept_opt_start_pause_time . '" name="ept_opt_start_pause_time" /> 694 <strong>Default 22:00</strong> 695 </div> 696 697 <div class="option"> 698 <label class="ttip">' . __('End Time to Pause Tweet: ', 'Evergreen') . ': </label> 699 <input type="text" id="ept_opt_end_pause_time" value="' . $ept_opt_end_pause_time . '" name="ept_opt_end_pause_time" /> 700 <strong>Default 05:00</strong> 701 </div> 775 <label for="ept_opt_schedule_tweet">' . __('Schedule Tweets: ', 'Evergreen') . '</label> 776 <ul id="schedule-days-table" class="option-schedule-days"> 777 <li class="schedule-day-checkbox' . (1 == $ept_opt_schedule_day_mon ? ' checked' : '') . '"> 778 <label><input type="checkbox" name="ept_opt_schedule_day_mon" value="1" id="day1" ' . checked( 1, $ept_opt_schedule_day_mon, false ) . ' />Monday</label> 779 </li> 780 <li class="schedule-day-checkbox' . (2 == $ept_opt_schedule_day_tue ? ' checked' : '') . '"> 781 <label><input type="checkbox" name="ept_opt_schedule_day_tue" value="2" id="day2" ' . checked( 2, $ept_opt_schedule_day_tue, false ) . ' />Tuesday</label> 782 </li> 783 <li class="schedule-day-checkbox' . (3 == $ept_opt_schedule_day_wed ? ' checked' : '') . '"> 784 <label><input type="checkbox" name="ept_opt_schedule_day_wed" value="3" id="day3" ' . checked( 3, $ept_opt_schedule_day_wed, false ) . ' />Wednesday</label> 785 </li> 786 <li class="schedule-day-checkbox' . (4 == $ept_opt_schedule_day_thu ? ' checked' : '') . '"> 787 <label><input type="checkbox" name="ept_opt_schedule_day_thu" value="4" id="day4" ' . checked( 4, $ept_opt_schedule_day_thu, false ) . ' />Thursday</label> 788 </li> 789 <li class="schedule-day-checkbox' . (5 == $ept_opt_schedule_day_fri ? ' checked' : '') . '"> 790 <label><input type="checkbox" name="ept_opt_schedule_day_fri" value="5" id="day5" ' . checked( 5, $ept_opt_schedule_day_fri, false ) . ' />Friday</label> 791 </li> 792 <li class="schedule-day-checkbox' . (6 == $ept_opt_schedule_day_sat ? ' checked' : '') . '"> 793 <label><input type="checkbox" name="ept_opt_schedule_day_sat" value="6" id="day6" ' . checked( 6, $ept_opt_schedule_day_sat, false ) . ' />Saturday</label> 794 </li> 795 <li class="schedule-day-checkbox' . (7 == $ept_opt_schedule_day_sun ? ' checked' : '') . '"> 796 <label><input type="checkbox" name="ept_opt_schedule_day_sun" value="7" id="day7" ' . checked( 7, $ept_opt_schedule_day_sun, false ) . ' />Sunday</label> 797 </li> 798 </ul> 799 <div style="clear: left;"></div> 800 <label></label> 801 <div>Tweet at these times on <span id="scheduled-days"></span><div> 802 <div style="clear: left;"></div> 803 <label></label> 804 <ol id="schedule-times" class="option-schedule-times">'); 805 foreach ($ept_opt_schedule_times_counter as $key => $time) { 806 print(' 807 <li> 808 <input type="hidden" name="ept_opt_schedule_times_counter[]" /> 809 <select name="ept_opt_schedule_times_hour[]" style="width: 60px"> 810 '); 811 for ($i=0; $i < 24; $i++) { 812 if ($i < 10) 813 $index = "0" . $i; 814 else 815 $index = "" . $i; 816 print('<option value="' . $index . '" ' . selected( $ept_opt_schedule_times_hour[$key], (String)$index ) . '>' . $index . '</option>'); 817 } 818 print(' 819 </select> 820 <select name="ept_opt_schedule_times_minute[]" style="width: 60px"> 821 '); 822 for ($i=0; $i < 60; $i++) { 823 if ($i <= 9) 824 $index = "0" . $i; 825 else 826 $index = "" . $i; 827 print('<option value="' . $index . '" ' . selected( $ept_opt_schedule_times_minute[$key], (String)$index ) . '>' . $index . '</option>'); 828 } 829 print(' 830 </select> 831 <a class="remove-time tooltip" original-title="Remove posting time">×</a> 832 </li> 833 '); 834 } 835 print(' 836 </ol> 837 <div style="clear: left;"></div> 838 <label></label> 839 <a id="add-time" class="button">Add Tweeting Time</a> 702 840 </div> 703 841 … … 752 890 } 753 891 } 754 if(trim(document.getElementById("ept_opt_interval").value) != "" && !isNumber(trim(document.getElementById("ept_opt_interval").value))) 755 { 756 alert("Enter only numeric in Minimum interval between tweet"); 757 document.getElementById("ept_opt_interval").focus(); 758 return false; 759 } 892 760 893 if(trim(document.getElementById("ept_opt_age_limit").value) != "" && !isNumber(trim(document.getElementById("ept_opt_age_limit").value))) 761 894 { … … 809 942 } 810 943 811 function showPauseTweet()812 {813 814 815 if((document.getElementById("ept_opt_use_pause_tweet").checked))816 {817 document.getElementById("pausetweet").style.display="block";818 }819 else820 {821 document.getElementById("pausetweet").style.display="none";822 }823 }824 944 function setFormAction() 825 945 { … … 838 958 showURLAPI(); 839 959 showshortener(); 840 showPauseTweet();841 960 842 961 </script>'); 843 844 845 //echo "<script type='text/javascript' src='".plugins_url('countdown/jquery-1.7.1.min.js', __FILE__)."'></script>";846 847 // echo "<script type='text/javascript' src='".plugins_url('countdown/jquery.countdown.pack.js', __FILE__)."'></script>";848 849 850 // echo "<script type='text/javascript'>851 852 // </script>";853 854 962 } else { 855 963 print(' -
evergreen-post-tweeter/trunk/ept-core.php
r748326 r756431 133 133 //check last tweet time against set interval and span 134 134 //also check if it isn't in pause time 135 if (ept_opt_update_time() && ! ept_in_pause_time()) { 136 update_option('ept_opt_last_update', time()); 137 ept_opt_tweet_old_post(); 135 // if (ept_opt_update_time() && ! ept_in_pause_time()) { 136 // update_option('ept_opt_last_update', current_time('timestamp', 0)); 137 // ept_opt_tweet_old_post(); 138 // } 139 140 // if ( ept_opt_update_time() ) { 141 // update_option('ept_opt_last_update', current_time('timestamp', 0)); 142 // ept_opt_tweet_old_post(); 143 // } 144 145 if ( ept_check_day_update() && ept_new_to_update() ) { 146 update_option('ept_opt_last_update', current_time('timestamp', 0)); 147 ept_opt_tweet_old_post(); 138 148 } 139 149 } … … 281 291 ept_w3tc_cache_flush(); 282 292 283 $next_tweet_time = time()+ get_option('ept_opt_interval') * 60 * 60;293 $next_tweet_time = ept_determine_next_update(); 284 294 update_option('next_tweet_time', $next_tweet_time); 285 295 … … 560 570 //check time and update the last tweet time 561 571 function ept_opt_update_time() { 562 563 564 return ept_to_update(); 565 572 return ept_to_update(); 566 573 } 567 574 568 575 ept_w3tc_cache_flush(); 576 577 function ept_new_to_update() 578 { 579 global $wpdb; 580 $last = $wpdb->get_var("select SQL_NO_CACHE option_value from $wpdb->options where option_name = 'ept_opt_last_update';"); 581 582 $ept_opt_schedule_times_counter = get_option( 'ept_opt_schedule_times_counter' ); 583 if (!(isset($ept_opt_schedule_times_counter)) || ! is_array($ept_opt_schedule_times_counter)) { 584 $ept_opt_schedule_times_counter = array(); 585 } 586 587 $ept_opt_schedule_times_hour = get_option( 'ept_opt_schedule_times_hour' ); 588 if (!(isset($ept_opt_schedule_times_hour)) || ! is_array($ept_opt_schedule_times_hour)) { 589 $ept_opt_schedule_times_hour = array(); 590 } 591 592 $ept_opt_schedule_times_minute = get_option( 'ept_opt_schedule_times_minute' ); 593 if (!(isset($ept_opt_schedule_times_minute)) || ! is_array($ept_opt_schedule_times_minute)) { 594 $ept_opt_schedule_times_minute = array(); 595 } 596 597 $ret = false; 598 599 600 foreach ($ept_opt_schedule_times_counter as $key => $time) { 601 $ept_time_start = strtotime($ept_opt_schedule_times_hour[$key] . ':' . $ept_opt_schedule_times_minute[$key]); 602 $ept_time_end = $ept_time_start + (60 * 10); 603 if ( 604 $ept_time_start < current_time('timestamp', 0) && 605 current_time('timestamp', 0) < $ept_time_end && 606 ( ! ( $ept_time_start < $last && $last < $ept_time_end ) ) 607 ) { 608 $ret = true; 609 break; 610 } 611 } 612 613 return $ret; 614 } 615 616 function ept_determine_next_update() 617 { 618 $ept_opt_schedule_times_counter = get_option( 'ept_opt_schedule_times_counter' ); 619 if (!(isset($ept_opt_schedule_times_counter)) || ! is_array($ept_opt_schedule_times_counter)) { 620 $ept_opt_schedule_times_counter = array(); 621 } 622 623 $ept_opt_schedule_times_hour = get_option( 'ept_opt_schedule_times_hour' ); 624 if (!(isset($ept_opt_schedule_times_hour)) || ! is_array($ept_opt_schedule_times_hour)) { 625 $ept_opt_schedule_times_hour = array(); 626 } 627 628 $ept_opt_schedule_times_minute = get_option( 'ept_opt_schedule_times_minute' ); 629 if (!(isset($ept_opt_schedule_times_minute)) || ! is_array($ept_opt_schedule_times_minute)) { 630 $ept_opt_schedule_times_minute = array(); 631 } 632 633 $ept_times = array(); 634 635 foreach ($ept_opt_schedule_times_counter as $key => $value) { 636 637 $ept_time_start = strtotime($ept_opt_schedule_times_hour[$key] . ':' . $ept_opt_schedule_times_minute[$key], current_time('timestamp', 0)); 638 $remaining_time = $ept_time_start - current_time('timestamp', 0); 639 if ( 0 < $remaining_time ) { 640 $ept_times[] = $remaining_time; 641 } 642 } 643 644 // return $ept_times; 645 646 if ( empty($ept_times) ) { 647 return 0; 648 } 649 650 return (Integer)(time() + $ept_times[min(array_keys($ept_times, min($ept_times)))]); 651 } 652 653 function ept_check_day_update() 654 { 655 $current_day = date( 'N', current_time('timestamp', 0) ); 656 $ept_opt_schedule_day_mon = get_option('ept_opt_schedule_day_mon'); 657 $ept_opt_schedule_day_tue = get_option('ept_opt_schedule_day_tue'); 658 $ept_opt_schedule_day_wed = get_option('ept_opt_schedule_day_wed'); 659 $ept_opt_schedule_day_thu = get_option('ept_opt_schedule_day_thu'); 660 $ept_opt_schedule_day_fri = get_option('ept_opt_schedule_day_fri'); 661 $ept_opt_schedule_day_sat = get_option('ept_opt_schedule_day_sat'); 662 $ept_opt_schedule_day_sun = get_option('ept_opt_schedule_day_sun'); 663 $ret = false; 664 665 if ($current_day == $ept_opt_schedule_day_mon) { 666 $ret = true; 667 } else if ($current_day == $ept_opt_schedule_day_tue) { 668 $ret = true; 669 } else if ($current_day == $ept_opt_schedule_day_wed) { 670 $ret = true; 671 } else if ($current_day == $ept_opt_schedule_day_thu) { 672 $ret = true; 673 } else if ($current_day == $ept_opt_schedule_day_fri) { 674 $ret = true; 675 } else if ($current_day == $ept_opt_schedule_day_sat) { 676 $ret = true; 677 } else if ($current_day == $ept_opt_schedule_day_sun) { 678 $ret = true; 679 } 680 681 return $ret; 682 } 569 683 570 684 function ept_to_update() { … … 572 686 //have to use normal query to prevent the caching plug-in from caching the last update time 573 687 $last = $wpdb->get_var("select SQL_NO_CACHE option_value from $wpdb->options where option_name = 'ept_opt_last_update';"); 574 //$last_test = get_option('ept_opt_last_update');575 688 $interval = get_option('ept_opt_interval'); 576 689 $slop = get_option('ept_opt_interval_slop'); … … 584 697 } 585 698 586 587 699 if (!(isset($slop))) { 588 700 $slop = ept_opt_INTERVAL_SLOP; … … 593 705 } 594 706 595 596 $passed = time() - $last; 597 //old testing code to test the actual values going into the DB 598 //$wpdb->query("insert into wp_timetable (time,last,ret,url) values('".time()."',$last,$passed,'".$_SERVER['PHP_SELF']."');"); 707 $passed = current_time('timestamp', 0) - $last; 599 708 600 709 $interval = $interval * 60 * 60; … … 699 808 update_option('ept_opt_add_text',''); 700 809 update_option('ept_opt_add_text_at','beginning'); 701 update_option('ept_opt_age_limit',30);702 810 update_option('ept_opt_bitly_key',''); 703 811 update_option('ept_opt_bitly_user',''); … … 710 818 update_option('ept_opt_hashtag_length','20'); 711 819 update_option('ept_opt_include_link','yes'); 712 update_option('ept_opt_interval',4);713 update_option('ept_opt_interval_slop',2);714 820 delete_option('ept_opt_last_update'); 715 update_option('ept_opt_max_age_limit',60); 821 update_option('ept_opt_age_limit', 0); 822 update_option('ept_opt_max_age_limit', 0); 716 823 update_option('ept_opt_omit_cats',''); 717 824 update_option('ept_opt_tweet_type','title'); … … 723 830 update_option('ept_cat_tweet', ''); 724 831 update_option('ept_tag_tweet', ''); 725 update_option('ept_opt_start_pause_time', "22:00");726 update_option('ept_opt_end_pause_time', "05:00");727 832 } 728 833 -
evergreen-post-tweeter/trunk/evergreen.php
r748326 r756431 5 5 Description: Evergreen Post Tweeter enables you to automatically tweet out links to old posts based upon a tag or tags. 6 6 Author: Tom Ewer 7 Version: 1. 77 Version: 1.8 8 8 Author URI: http://www.leavingworkbehind.com/about-me/ 9 9 */ … … 30 30 wp_register_script( 'ept_plugin_script_countdown', plugins_url( 'countdown/jquery.countdown.min.js', __FILE__ ) ); 31 31 // don't finish 32 wp_register_script( 'ept_plugin_script_app', plugins_url( 'countdown/ept-app.js', __FILE__) );32 // wp_register_script( 'ept_plugin_script_app', plugins_url( 'countdown/ept-app.js', __FILE__) ); 33 33 } 34 34 … … 36 36 /* Link our already registered script to a page */ 37 37 wp_enqueue_script( 'ept_plugin_script_countdown' ); 38 wp_enqueue_script( 'ept_plugin_script_app' ); 38 wp_enqueue_script( 'ept_plugin_script_app', plugins_url( 'countdown/ept-app.js', __FILE__), array( 'jquery', 'ept_plugin_script_countdown' ) ); 39 wp_enqueue_script( 'ept_plugin_application', plugins_url( 'js/application.js', __FILE__ ), array( 'jquery' ) ); 39 40 $next_tweet_time = get_option('next_tweet_time') ; 40 41 wp_localize_script( 'ept_plugin_script_app', 'nextTweetTime', $next_tweet_time ); … … 56 57 define('ept_opt_INTERVAL', 4); 57 58 define('ept_opt_INTERVAL_SLOP', 4); 58 define('ept_opt_AGE_LIMIT', 30); // 120 days59 define('ept_opt_MAX_AGE_LIMIT', 60); // 120 days59 define('ept_opt_AGE_LIMIT', 0); // 0 days 60 define('ept_opt_MAX_AGE_LIMIT', 0); // 0 days 60 61 define('ept_opt_OMIT_CATS', ""); 61 62 define('ept_opt_TWEET_PREFIX',""); … … 70 71 $ept_db_version = "1.0"; 71 72 72 function ept_admin_actions() {73 $page_hook_suffix = add_submenu_page(74 'options-general.php',75 "Evergreen Post Tweeter Settings",76 "Evergreen Post Tweeter",77 1,78 "Evergreen",79 "ept_admin"80 );81 add_action('admin_print_scripts-' . $page_hook_suffix, 'ept_admin_scripts');82 }83 84 add_action('admin_menu', 'ept_admin_actions');85 add_action('admin_head', 'ept_opt_head_admin');86 add_action('init','ept_tweet_old_post');87 add_action('admin_init','ept_authorize',1);73 function ept_admin_actions() { 74 $page_hook_suffix = add_submenu_page( 75 'options-general.php', 76 "Evergreen Post Tweeter Settings", 77 "Evergreen Post Tweeter", 78 1, 79 "Evergreen", 80 "ept_admin" 81 ); 82 add_action('admin_print_scripts-' . $page_hook_suffix, 'ept_admin_scripts'); 83 } 84 85 add_action('admin_menu', 'ept_admin_actions'); 86 add_action('admin_head', 'ept_opt_head_admin'); 87 add_action('init','ept_tweet_old_post'); 88 add_action('admin_init','ept_authorize',1); 88 89 89 function ept_authorize() 90 { 91 90 function ept_authorize() 91 { 92 93 94 if ( isset( $_REQUEST['oauth_token'] ) ) { 95 $auth_url= str_replace('oauth_token', 'oauth_token1', ept_currentPageURL()); 96 $ept_url = get_option('ept_opt_admin_url') . substr($auth_url,strrpos($auth_url, "page=Evergreen") + strlen("page=Evergreen")); 97 echo '<script language="javascript">window.open ("'.$ept_url.'","_self")</script>'; 92 98 93 if ( isset( $_REQUEST['oauth_token'] ) ) { 94 $auth_url= str_replace('oauth_token', 'oauth_token1', ept_currentPageURL()); 95 $ept_url = get_option('ept_opt_admin_url') . substr($auth_url,strrpos($auth_url, "page=Evergreen") + strlen("page=Evergreen")); 96 echo '<script language="javascript">window.open ("'.$ept_url.'","_self")</script>'; 97 98 die; 99 } 100 101 } 99 die; 100 } 101 102 } 102 103 103 104 add_filter('plugin_action_links', 'ept_plugin_action_links', 10, 2); -
evergreen-post-tweeter/trunk/readme.txt
r748326 r756431 5 5 Tags: twitter, auto tweet 6 6 Requires at least: 3.5 7 Tested up to: 3. 5.28 Stable tag: 1. 77 Tested up to: 3.6 8 Stable tag: 1.8 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 56 56 == Upgrade Notice == 57 57 58 = 1.8 = 59 * Change option for scheduling tweets from interval based to days and times scheduling. 60 * Remove option Time Between Tweets. 61 * Remove option to Prevent Automatic Tweeting Between Certain Hours. 62 58 63 = 1.7 = 59 64 * Add option to tracking url click on Twitter (Google Analytics). … … 95 100 == Changelog == 96 101 102 = 1.8 = 103 * Change option for scheduling tweets from interval based to days and times scheduling. 104 * Remove option Time Between Tweets. 105 * Remove option to Prevent Automatic Tweeting Between Certain Hours. 106 97 107 = 1.7 = 98 108 * Add option to tracking url click on Twitter (Google Analytics).
Note: See TracChangeset
for help on using the changeset viewer.