← Back
Editing: twitomatic-comments-list.php
<?php $twitter_language_codes = array( 'en' => 'English' , 'aa' => 'Afar' , 'ab' => 'Abkhazian' , 'af' => 'Afrikaans' , 'am' => 'Amharic' , 'ar' => 'Arabic' , 'as' => 'Assamese' , 'ay' => 'Aymara' , 'az' => 'Azerbaijani' , 'ba' => 'Bashkir' , 'be' => 'Byelorussian' , 'bg' => 'Bulgarian' , 'bh' => 'Bihari' , 'bi' => 'Bislama' , 'bn' => 'Bengali/Bangla' , 'bo' => 'Tibetan' , 'br' => 'Breton' , 'ca' => 'Catalan' , 'co' => 'Corsican' , 'cs' => 'Czech' , 'cy' => 'Welsh' , 'da' => 'Danish' , 'de' => 'German' , 'dz' => 'Bhutani' , 'el' => 'Greek' , 'eo' => 'Esperanto' , 'es' => 'Spanish' , 'et' => 'Estonian' , 'eu' => 'Basque' , 'fa' => 'Persian' , 'fi' => 'Finnish' , 'fj' => 'Fiji' , 'fo' => 'Faeroese' , 'fr' => 'French' , 'fy' => 'Frisian' , 'ga' => 'Irish' , 'gd' => 'Scots/Gaelic' , 'gl' => 'Galician' , 'gn' => 'Guarani' , 'gu' => 'Gujarati' , 'ha' => 'Hausa' , 'hi' => 'Hindi' , 'hr' => 'Croatian' , 'hu' => 'Hungarian' , 'hy' => 'Armenian' , 'ia' => 'Interlingua' , 'ie' => 'Interlingue' , 'ik' => 'Inupiak' , 'in' => 'Indonesian' , 'is' => 'Icelandic' , 'it' => 'Italian' , 'iw' => 'Hebrew' , 'ja' => 'Japanese' , 'ji' => 'Yiddish' , 'jw' => 'Javanese' , 'ka' => 'Georgian' , 'kk' => 'Kazakh' , 'kl' => 'Greenlandic' , 'km' => 'Cambodian' , 'kn' => 'Kannada' , 'ko' => 'Korean' , 'ks' => 'Kashmiri' , 'ku' => 'Kurdish' , 'ky' => 'Kirghiz' , 'la' => 'Latin' , 'ln' => 'Lingala' , 'lo' => 'Laothian' , 'lt' => 'Lithuanian' , 'lv' => 'Latvian/Lettish' , 'mg' => 'Malagasy' , 'mi' => 'Maori' , 'mk' => 'Macedonian' , 'ml' => 'Malayalam' , 'mn' => 'Mongolian' , 'mo' => 'Moldavian' , 'mr' => 'Marathi' , 'ms' => 'Malay' , 'mt' => 'Maltese' , 'my' => 'Burmese' , 'na' => 'Nauru' , 'ne' => 'Nepali' , 'nl' => 'Dutch' , 'no' => 'Norwegian' , 'oc' => 'Occitan' , 'om' => '(Afan)/Oromoor/Oriya' , 'pa' => 'Punjabi' , 'pl' => 'Polish' , 'ps' => 'Pashto/Pushto' , 'pt' => 'Portuguese' , 'qu' => 'Quechua' , 'rm' => 'Rhaeto-Romance' , 'rn' => 'Kirundi' , 'ro' => 'Romanian' , 'ru' => 'Russian' , 'rw' => 'Kinyarwanda' , 'sa' => 'Sanskrit' , 'sd' => 'Sindhi' , 'sg' => 'Sangro' , 'sh' => 'Serbo-Croatian' , 'si' => 'Singhalese' , 'sk' => 'Slovak' , 'sl' => 'Slovenian' , 'sm' => 'Samoan' , 'sn' => 'Shona' , 'so' => 'Somali' , 'sq' => 'Albanian' , 'sr' => 'Serbian' , 'ss' => 'Siswati' , 'st' => 'Sesotho' , 'su' => 'Sundanese' , 'sv' => 'Swedish' , 'sw' => 'Swahili' , 'ta' => 'Tamil' , 'te' => 'Tegulu' , 'tg' => 'Tajik' , 'th' => 'Thai' , 'ti' => 'Tigrinya' , 'tk' => 'Turkmen' , 'tl' => 'Tagalog' , 'tn' => 'Setswana' , 'to' => 'Tonga' , 'tr' => 'Turkish' , 'ts' => 'Tsonga' , 'tt' => 'Tatar' , 'tw' => 'Twi' , 'uk' => 'Ukrainian' , 'ur' => 'Urdu' , 'uz' => 'Uzbek' , 'vi' => 'Vietnamese' , 'vo' => 'Volapuk' , 'wo' => 'Wolof' , 'xh' => 'Xhosa' , 'yo' => 'Yoruba' , 'zh' => 'Chinese' , 'zu' => 'Zulu' , ); function twitomatic_comments_panel() { $twitomatic_Main_Settings = get_option('twitomatic_Main_Settings', false); if(isset($twitomatic_Main_Settings['app_id']) && trim($twitomatic_Main_Settings['app_id']) != '') { if(isset($twitomatic_Main_Settings['app_secret']) && $twitomatic_Main_Settings['app_secret'] != '') { } else { ?> <h1><?php echo esc_html__("You must add a Twitter App Secret before you can use this feature!", 'twitomatic-twitter-post-generator');?></h1> <?php return; } } else { ?> <h1><?php echo esc_html__("You must add a Twitter App ID and Secret before you can use this feature!", 'twitomatic-twitter-post-generator');?></h1> <?php return; } ?> <div class="wp-header-end"></div> <div class="wrap gs_popuptype_holder seo_pops"> <div> <form id="myForm" method="post" action="admin.php?page=twitomatic_comments_panel"> <?php wp_nonce_field('twitomatic_save_rules', '_twitomaticr_nonce'); if (isset($_GET['settings-updated'])) { ?> <div> <p class="cr_saved_notif"><strong><?php echo esc_html__("Settings saved.", 'twitomatic-twitter-post-generator');?></strong></p> </div> <?php } ?> <div> <div class="hideMain"> <hr/> <div class="table-responsive"> <table id="mainRules" class="responsive table cr_main_table"> <thead> <tr> <th> <?php echo esc_html__("ID", 'twitomatic-twitter-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo sprintf( wp_kses( __( "This is the ID of the rule.", 'twitomatic-twitter-post-generator'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ) ); ?> </div> </div> </th> <th> <?php echo esc_html__("Keyword Search", 'twitomatic-twitter-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo sprintf( wp_kses( __( "Input your queried keyword. Comments will be generated based on these keywords. <a href='%s' target='_blank'>Check out more info about keywords structure</a>. Maximum 500 characters allowed.", 'twitomatic-twitter-post-generator'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url_raw( 'https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query' ) ); ?> </div> </div> </th> <th> <?php echo esc_html__("Source Language", 'twitomatic-twitter-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Select the language which you want to restrict search to.", 'twitomatic-twitter-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("Schedule", 'twitomatic-twitter-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php $unlocker = get_option('twitomatic_minute_running_unlocked', false); if($unlocker == '1') { echo esc_html__("Select the interval in minutes after which you want this rule to run. Defined in minutes.", 'twitomatic-twitter-post-generator'); } else { echo esc_html__("Select the interval in hours after which you want this rule to run. Defined in hours.", 'twitomatic-twitter-post-generator'); } ?> </div> </div> </th> <th> <?php echo esc_html__("Max # Comments", 'twitomatic-twitter-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Select the maximum number of comments that this rule can create at once. 0-100 interval allowed.", 'twitomatic-twitter-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("Comment Status", 'twitomatic-twitter-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Select the status of the comment that will be imported. You can choose between: approved, unapproved and spam.", 'twitomatic-twitter-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("Target Post", 'twitomatic-twitter-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Select the target post, where the comments will be generated.", 'twitomatic-twitter-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("Comment Author", 'twitomatic-twitter-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Select the author that you want to assign for the automatically generated comments.", 'twitomatic-twitter-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("More Options", 'twitomatic-twitter-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Shows advanced settings for this rule.", 'twitomatic-twitter-post-generator'); ?> </div> </div> </th> <th class="cr_max_width_40"> <?php echo esc_html__("Del", 'twitomatic-twitter-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Do you want to delete this rule?", 'twitomatic-twitter-post-generator'); ?> </div> </div> </th> <th class="cr_max_55"> <?php echo esc_html__("Active", 'twitomatic-twitter-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Do you want to enable this rule? You can deactivate any rule (you don't have to delete them to deactivate them).", 'twitomatic-twitter-post-generator'); ?> </div> </div> <br/> <input type="checkbox" onchange="thisonChangeHandler(this)" id="exclusion"> </th> <th class="cr_max_42"> <?php echo esc_html__("Info", 'twitomatic-twitter-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("The number of items (posts, pages) this rule has generated so far.", 'twitomatic-twitter-post-generator'); ?> </div> </div> </th> <th class="cr_actions"> <?php echo esc_html__("Actions", 'twitomatic-twitter-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Do you want to run this rule now? Note that only one instance of a rule is allowed at once.", 'twitomatic-twitter-post-generator'); ?> </div> </div> </th> </tr> </thead> <tbody> <?php echo twitomatic_expand_rules_comments(); ?> <tr> <td class="cr_short_td">-</td> <td class="cr_select_option"><input type="text" name="twitomatic_comments_list[rule_keywords][]" placeholder="Please input your search keywords" value="" class="cr_width_full"/></td> <td class="cr_olk"> <select id="ids" name="twitomatic_comments_list[ids][]" class="cr_width_full"> <option value="any" selected><?php echo esc_html__("Any", 'twitomatic-twitter-post-generator');?></option> <?php foreach ($GLOBALS['twitter_language_codes'] as $key => $value) { echo '<option value="' . esc_attr($key) . '"'; echo '>' . esc_html($value) . '</option>'; } ?> </select> </td> <td class="cr_comm_td"><input type="number" step="1" min="1" name="twitomatic_comments_list[schedule][]" max="8765812" class="cr_width_60" placeholder="Select the rule schedule interval" value="24"/></td> <td class="cr_comm_td"><input type="number" step="1" min="0" max="100" name="twitomatic_comments_list[max][]" placeholder="Select the max # of generated posts" value="10" class="cr_width_60"/></td> <td class="cr_status"> <select id="submit_status" name="twitomatic_comments_list[submit_status][]" class="cr_width_70"> <option value="approve" selected><?php echo esc_html__("Approved", 'twitomatic-twitter-post-generator');?></option> <option value="pending"><?php echo esc_html__("Unapproved", 'twitomatic-twitter-post-generator');?></option> <option value="spam"><?php echo esc_html__("Spam", 'twitomatic-twitter-post-generator');?></option> </select> </td> <td class="cr_xoq"><select id="default_type" name="twitomatic_comments_list[default_type][]" class="cr_width_full"> <?php $post_list = array(); $postsPerPage = 50000; $paged = 0; do { $postOffset = $paged * $postsPerPage; $query = array( 'post_status' => array( 'publish', 'draft', 'pending', 'trash', 'private', 'future' ), 'post_type' => array( 'any' ), 'numberposts' => $postsPerPage, 'fields' => 'ids', 'offset' => $postOffset ); $got_me = get_posts($query); $post_list = array_merge($post_list, $got_me); $paged++; }while(!empty($got_me)); $is_first = true; foreach ($post_list as $post) { echo '<option value="' . esc_attr($post) . '"'; if($is_first === true) { echo ' selected'; $is_first = false; } echo '>' . get_the_title($post) . '</option>'; } ?> </select> </td> <td class="cr_author"> <select id="post_author" name="twitomatic_comments_list[post_author][]" class="cr_width_full"> <option value="original" selected><?php echo esc_html__("Original Author", 'twitomatic-twitter-post-generator');?></option> <?php $blogusers = get_users( [ 'role__in' => [ 'contributor', 'author', 'editor', 'administrator' ] ] ); foreach ($blogusers as $user) { echo '<option value="' . esc_html($user->ID) . '"'; echo '>' . esc_html($user->display_name) . '</option>'; } ?> </select> </td> <td class="cr_width_70"> <input type="button" id="mybtnfzr" value="Settings"> <div id="mymodalfzr" class="codemodalfzr"> <div class="codemodalfzr-content"> <div class="codemodalfzr-header"> <span id="twitomatic_close" class="codeclosefzr">×</span> <h2><span class="cr_color_white"><?php echo esc_html__("New Rule", 'twitomatic-twitter-post-generator');?></span> <?php echo esc_html__("Advanced Settings", 'twitomatic-twitter-post-generator');?></h2> </div> <div class="codemodalfzr-body"> <div class="table-responsive"> <table class="responsive table cr_main_table_nowr"> <tr> <td class="cr_min_width_200"> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Set the content of the generated comments for user rules. You can use the following shortcodes: %%item_latitude%%, %%item_longitude%%, %%author%%, %%author_link%%, %%item_media%%, %%item_card%%, %%item_show_image%%, %%twitter_tweet_button%%, %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_title%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_img_url%%, %%video_url%%, %%item_url%%, %%item_cat%%, %%item_tags%%, %%item_read_more_button%%, %%item_show_image%%, %%item_image_URL%%, %%author%%, %%author_link%%, %%author_email%%", 'twitomatic-twitter-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Generated Comment Content:", 'twitomatic-twitter-post-generator');?></b> </td> <td> <textarea rows="2" cols="70" name="twitomatic_comments_list[post_content][]" placeholder="Please insert your desired post content. Example:%%item_content%%" class="cr_width_full">%%item_content%%</textarea> </div> </td> </tr> <tr> <td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Do you want to remember last posted item and continue search from it the next time the importing rule runs?", 'twitomatic-twitter-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Cache Items For Continuous Posting (disable to get latest posts only):", 'twitomatic-twitter-post-generator');?></b> </td> <td> <input type="checkbox" id="continue_search" name="twitomatic_comments_list[continue_search][]" checked> </div> </td> </tr> <tr> <td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Run regex on post content. To disable this feature, leave this field blank. No Regex separators are required here. You can add also multiple Regex expressions, each on a new line.", 'twitomatic-twitter-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Run Regex On Content:", 'twitomatic-twitter-post-generator');?></b> </td> <td> <textarea rows="1" class="cr_width_full" name="twitomatic_comments_list[strip_by_regex][]" placeholder="regex expression" class="cr_width_full"></textarea> </div> </td> </tr> <tr> <td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Replace the above regex matches with this regex expression. If you want to strip matched content, leave this field blank. No Regex separators are required here. You can add also multiple replacement expressions, each on a new line.", 'twitomatic-twitter-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Replace Matches From Regex (Content):", 'twitomatic-twitter-post-generator');?></b> </td> <td> <textarea rows="1" class="cr_width_full" name="twitomatic_comments_list[replace_regex][]" placeholder="regex replacement" class="cr_width_full"></textarea> </div> </td> </tr> <tr> <td colspan="2"> <h3><?php echo esc_html__("Scheduling Options:", 'twitomatic-twitter-post-generator');?></h3> </td> </tr> <tr> <td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Add a time period between the plugin will run importing at a schedule. To disable this feature, leave this field blank. This works based on your current server timezone and time. Your current server time is: ", 'twitomatic-twitter-post-generator') . date("h:i A"); ?> </div> </div> <b><?php echo esc_html__("Automatically Run Rules Only Between These Hour Periods Each Day:", 'twitomatic-twitter-post-generator');?></b> </td> <td> <input type="time" id="run_after" name="twitomatic_comments_list[run_after][]" value="" placeholder="<?php echo esc_html__("Run Rules Only After This Hour", 'twitomatic-twitter-post-generator');?>"> - <input type="time" id="run_before" name="twitomatic_comments_list[run_before][]" value="" placeholder="<?php echo esc_html__("Run Rules Only Before This Hour", 'twitomatic-twitter-post-generator');?>"> </div> </td> </tr> <tr> <td colspan="2"> <h3><?php echo esc_html__("Posting Restrictions:", 'twitomatic-twitter-post-generator');?></h3> </td> </tr> <tr> <td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Do not include posts that's title or content contains at least one of these words. Separate words by comma. To disable this feature, leave this field blank.", 'twitomatic-twitter-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Banned Words List:", 'twitomatic-twitter-post-generator');?></b> </td> <td> <input type="text" class="cr_width_full" name="twitomatic_comments_list[banned_words][]" value="" placeholder="banned1, banned2, banned3" class="cr_width_full"> </div> </td> </tr> <tr> <td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Include only posts that's title or content contains at least one of these words. Separate words by comma. To disable this feature, leave this field blank. If you wish to input a keyword that must be required in all cases (AND), please use it in this format: &&keyword. Example: granny, dad, &&mom. This translates into: (granny OR dad) AND MOM", 'twitomatic-twitter-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Required Words List:", 'twitomatic-twitter-post-generator');?></b> </td> <td> <input type="text" class="cr_width_full" name="twitomatic_comments_list[required_words][]" value="" placeholder="required1, required2, required3" class="cr_width_full"> </div> </td> </tr> <tr> <td colspan="2"> <h3><?php echo esc_html__("Post Customizations:", 'twitomatic-twitter-post-generator');?></h3> </td> </tr> <tr> <td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Select the address from where the tweets will be collected. In the first textfield, you can input a street address or a latitude, longitude pair (ex: '37.781157 -122.398720' or 'Oxford street, London'. In the second textfield, you can input a radius for this location, in miles or kilometers (ex: '1mi' or '3km')Returns tweets by users located within a given radius of the given latitude/longitude. The location is preferentially taking from the Geotagging API, but will fall back to their Twitter profile. The parameter value is specified by latitude,longitude,radius, where radius units must be specified as either mi (miles) or km (kilometers). To disable this feature, leave both textfields blank.", 'twitomatic-twitter-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Tweet Source Location:", 'twitomatic-twitter-post-generator');?></b> </td> <td> <input type="text" name="twitomatic_comments_list[coord][]" value="" placeholder="37.781157 -122.398720" class="cr_width_65p"> <input type="text" name="twitomatic_comments_list[radius][]" value="" placeholder="1mi" class="cr_width_30p"> </div> </td> </tr> <tr> <td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Select the result type you want to get from the query. Valid types are: mixed, recent or popular.", 'twitomatic-twitter-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Result Type:", 'twitomatic-twitter-post-generator');?></b> </td> <td> <select id="result_type" name="twitomatic_comments_list[result_type][]" class="cr_width_full"> <option value="mixed" selected><?php echo esc_html__("Mixed", 'twitomatic-twitter-post-generator');?></option> <option value="popular"><?php echo esc_html__("Popular", 'twitomatic-twitter-post-generator');?></option> <option value="recent"><?php echo esc_html__("Recent", 'twitomatic-twitter-post-generator');?></option> </select> </div> </td> </tr> <tr> <td class="cr_min_width_200"> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Do you want to skip retweets?", 'twitomatic-twitter-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Skip Retweets:", 'twitomatic-twitter-post-generator');?></b> </td> <td> <input type="checkbox" id="skip_retweets" name="twitomatic_comments_list[skip_retweets][]"> </div> </td> </tr> <tr> <td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Do you want to skip replies?", 'twitomatic-twitter-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Skip Replies:", 'twitomatic-twitter-post-generator');?></b> </td> <td> <input type="checkbox" id="skip_replies" name="twitomatic_comments_list[skip_replies][]"> </div> </td> </tr> </table> </div> </div> <div class="codemodalfzr-footer"> <br/> <h3 class="cr_inline">Twitomatic Automatic Post Generator</h3> <span id="twitomatic_ok" class="codeokfzr cr_inline">OK </span> <br/><br/> </div> </div> </div> </td> <td class="cr_shrt_td2"><span class="cr_gray20">X</span></td> <td class="cr_short_td"><input type="checkbox" name="twitomatic_comments_list[active][]" value="1" checked /> <input type="hidden" name="twitomatic_comments_list[last_run][]" value="1988-01-27 00:00:00"/> </td> <td class="cr_short_td"> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("No info.", 'twitomatic-twitter-post-generator'); ?> </div> </div> </td> <td class="cr_center"> <div> <img src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/running.gif'); ?>" alt="Running" class="cr_running"> <div class="codemainfzr cr_gray_back"> <select id="actions" class="actions" name="actions" disabled> <option value="select" disabled selected><?php echo esc_html__("Select an Action", 'twitomatic-twitter-post-generator');?></option> <option value="run" onclick=""><?php echo esc_html__("Run This Rule Now", 'twitomatic-twitter-post-generator');?></option> <option value="trash" onclick=""><?php echo esc_html__("Move All Comments To Trash", 'twitomatic-twitter-post-generator');?></option> <option value="duplicate" onclick=""><?php echo esc_html__("Duplicate This Rule", 'twitomatic-twitter-post-generator');?></option> <option value="delete" onclick=""><?php echo esc_html__("Permanently Delete All Comments", 'twitomatic-twitter-post-generator');?></option> </select> </div> </div> </td> </tr> </tbody> </table> </div> </div> </div> <hr/> <div> <p class="crsubmit"><input type="submit" name="btnSubmit" id="btnSubmit" class="button button-primary" onclick="unsaved = false;" value="<?php echo esc_html__("Save Settings", 'twitomatic-twitter-post-generator');?>"/></p> </div> <div> <?php echo esc_html__("New! AI generated shortcodes supported, click for details:", 'twitomatic-twitter-post-generator');?> <a href="https://coderevolution.ro/knowledge-base/faq/how-to-create-ai-generated-content-from-any-plugin-built-by-coderevolution/" target="_blank"><img src="https://i.ibb.co/WGQ1rtF/ai.webp" alt="artificial-intelligence-badge" title="AI content generator support, when used together with the Aiomatic plugin"></a><br/><br/><a href="https://www.youtube.com/watch?v=5rbnu_uis7Y" target="_blank"><?php echo esc_html__("Nested Shortcodes also supported!", 'twitomatic-twitter-post-generator');?></a><br/><?php echo esc_html__("Confused about rule running status icons?", 'twitomatic-twitter-post-generator');?> <a href="http://coderevolution.ro/knowledge-base/faq/how-to-interpret-the-rule-running-visual-indicators-red-x-yellow-diamond-green-tick-from-inside-plugins/" target="_blank"><?php echo esc_html__("More info", 'twitomatic-twitter-post-generator');?></a><br/> <div class="cr_none" id="midas_icons"> <table> <tr> <td><img id="run_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/running.gif');?>" alt="Running" title="status"></td> <td><?php echo esc_html__("In Progress", 'twitomatic-twitter-post-generator');?> - <b><?php echo esc_html__("Importing is Running", 'twitomatic-twitter-post-generator');?></b></td> </tr> <tr> <td><img id="ok_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/ok.gif');?>" alt="OK" title="status"></td> <td><?php echo esc_html__("Success", 'twitomatic-twitter-post-generator');?> - <b><?php echo esc_html__("New Posts Created", 'twitomatic-twitter-post-generator');?></b></td> </tr> <tr> <td><img id="fail_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/failed.gif');?>" alt="Faield" title="status"></td> <td><?php echo esc_html__("Failed", 'twitomatic-twitter-post-generator');?> - <b><?php echo esc_html__("An Error Occurred.", 'twitomatic-twitter-post-generator');?> <b><?php echo esc_html__("Please check 'Activity and Logging' plugin menu for details.", 'twitomatic-twitter-post-generator');?></b></td> </tr> <tr> <td><img id="nochange_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/nochange.gif');?>" alt="NoChange" title="status"></td> <td><?php echo esc_html__("No Change - No New Posts Created", 'twitomatic-twitter-post-generator');?> - <b><?php echo esc_html__("Possible reasons:", 'twitomatic-twitter-post-generator');?></b></td> </tr> <tr> <td></td> <td> <ul> <li>► <?php echo esc_html__("Already all posts are published that match your search and posts will be posted when new content will be available", 'twitomatic-twitter-post-generator');?></li> <li>► <?php echo esc_html__("Some restrictions you defined in the plugin's 'Main Settings'", 'twitomatic-twitter-post-generator');?> <i>(<?php echo esc_html__("example: 'Minimum Content Word Count', 'Maximum Content Word Count', 'Minimum Title Word Count', 'Maximum Title Word Count', 'Banned Words List', 'Reuired Words List', 'Skip Posts Without Images'", 'twitomatic-twitter-post-generator');?>)</i> <?php echo esc_html__("prevent posting of new posts.", 'twitomatic-twitter-post-generator');?></li> </ul> </td> </tr> </table> </div> </div> </form> </div> </div> <?php } if (isset($_POST['twitomatic_comments_list'])) { add_action('admin_init', 'twitomatic_save_rules_comments'); } function twitomatic_save_rules_comments($data2) { check_admin_referer('twitomatic_save_rules', '_twitomaticr_nonce'); $data2 = $_POST['twitomatic_comments_list']; $rules = array(); $cont = 0; if (isset($data2['rule_keywords'][0])) { for ($i = 0; $i < sizeof($data2['rule_keywords']); ++$i) { $bundle = array(); if (isset($data2['schedule'][$i]) && $data2['schedule'][$i] != '' && $data2['rule_keywords'][$i] != '') { $bundle[] = trim(sanitize_text_field($data2['ids'][$i])); $bundle[] = trim(sanitize_text_field($data2['schedule'][$i])); if (isset($data2['active'][$i])) { $bundle[] = trim(sanitize_text_field($data2['active'][$i])); } else { $bundle[] = '0'; } $bundle[] = trim(sanitize_text_field($data2['last_run'][$i])); $bundle[] = trim(sanitize_text_field($data2['max'][$i])); $bundle[] = trim(sanitize_text_field($data2['default_type'][$i])); $bundle[] = $data2['post_content'][$i]; $bundle[] = trim(sanitize_text_field($data2['rule_keywords'][$i])); $bundle[] = trim(sanitize_text_field($data2['skip_retweets'][$i])); $bundle[] = trim(sanitize_text_field($data2['skip_replies'][$i])); $bundle[] = trim(sanitize_text_field($data2['coord'][$i])); $bundle[] = trim(sanitize_text_field($data2['radius'][$i])); $bundle[] = trim(sanitize_text_field($data2['result_type'][$i])); $bundle[] = trim(sanitize_text_field($data2['submit_status'][$i])); $bundle[] = trim(sanitize_text_field($data2['post_author'][$i])); $bundle[] = trim(sanitize_text_field($data2['continue_search'][$i])); $bundle[] = trim($data2['strip_by_regex'][$i]); $bundle[] = trim($data2['replace_regex'][$i]); $bundle[] = trim(sanitize_text_field($data2['banned_words'][$i])); $bundle[] = trim(sanitize_text_field($data2['required_words'][$i])); $bundle[] = trim(sanitize_text_field($data2['run_after'][$i])); $bundle[] = trim(sanitize_text_field($data2['run_before'][$i])); $rules[$cont] = $bundle; $cont++; } } } update_option('twitomatic_comments_list', $rules, false); } function twitomatic_expand_rules_comments() { if (!get_option('twitomatic_running_list')) { $running = array(); } else { $running = get_option('twitomatic_running_list'); } $GLOBALS['wp_object_cache']->delete('twitomatic_comments_list', 'options'); $rules = get_option('twitomatic_comments_list'); if(!is_array($rules)) { $rules = array(); } $output = ''; $cont = 0; if (!empty($rules)) { $posted_items = array(); $query = array( 'status' => 'any', 'fields' => 'ids', 'meta_key' => 'twitomatic_parent_rule' ); $post_list = get_comments($query); foreach ($post_list as $comm) { $rule_id = get_comment_meta($comm, 'twitomatic_parent_rule', true); if ($rule_id != '') { $exp = explode('-', $rule_id); if(isset($exp[0]) && isset($exp[1]) && $exp[0] == '1') { $posted_items[] = $exp[1]; } } } $post_list = array(); $postsPerPage = 50000; $paged = 0; do { $postOffset = $paged * $postsPerPage; $query = array( 'post_status' => array( 'publish', 'draft', 'pending', 'trash', 'private', 'future' ), 'post_type' => array( 'any' ), 'numberposts' => $postsPerPage, 'fields' => 'ids', 'offset' => $postOffset ); $got_me = get_posts($query); $post_list = array_merge($post_list, $got_me); $paged++; }while(!empty($got_me)); $counted_vals = array_count_values($posted_items); $unlocker = get_option('twitomatic_minute_running_unlocked', false); foreach ($rules as $request => $bundle[]) { if (isset($counted_vals[$cont])) { $generated_posts = $counted_vals[$cont]; } else { $generated_posts = 0; } $bundle_values = array_values($bundle); $myValues = $bundle_values[$cont]; $array_my_values = array_values($myValues);for($iji=0;$iji<count($array_my_values);++$iji){if(is_string($array_my_values[$iji])){$array_my_values[$iji]=stripslashes($array_my_values[$iji]);}} $ids = $array_my_values[0]; $schedule = $array_my_values[1]; $active = $array_my_values[2]; $last_run = $array_my_values[3]; $max = $array_my_values[4]; $def_type = $array_my_values[5]; $post_content = $array_my_values[6]; $rule_keywords = $array_my_values[7]; $skip_retweets = $array_my_values[8]; $skip_replies = $array_my_values[9]; $coord = $array_my_values[10]; $radius = $array_my_values[11]; $result_type = $array_my_values[12]; $submit_status = $array_my_values[13]; $post_author = $array_my_values[14]; $continue_search = $array_my_values[15]; $strip_by_regex = $array_my_values[16]; $replace_regex = $array_my_values[17]; $banned_words = $array_my_values[18]; $required_words = $array_my_values[19]; $run_after = $array_my_values[20]; $run_before = $array_my_values[21]; wp_add_inline_script('twitomatic-footer-script', 'createAdmin(' . esc_html($cont) . ');', 'after'); $output .= '<tr> <td class="cr_short_td">' . esc_html($cont) . '</td> <td class="cr_select_option"><input type="text" name="twitomatic_comments_list[rule_keywords][]" placeholder="Please input your search keywords" value="' . esc_attr($rule_keywords) . '" class="cr_width_full"/></td> </td> <td class="cr_ts_min_cust"><select id="ids" name="twitomatic_comments_list[ids][]" class="cr_width_full"><option value="any"'; if($ids == 'any') { $output .= ' selected'; } $output .= '>' . esc_html__("Any", 'twitomatic-twitter-post-generator') . '</option>'; foreach ($GLOBALS['twitter_language_codes'] as $key => $value) { $output .= '<option value="' . esc_attr($key) . '"'; if($ids == $key) { $output .= ' selected'; } $output .= '>' . esc_html($value) . '</option>'; } $output .= '</select></td> <td class="cr_comm_td"><input type="number" step="1" min="1" placeholder="# h" name="twitomatic_comments_list[schedule][]" max="8765812" value="' . esc_attr($schedule) . '" class="cr_width_60" required></td> <td class="cr_comm_td"><input type="number" step="1" min="0" placeholder="# max" max="100" name="twitomatic_comments_list[max][]" value="' . esc_attr($max) . '" class="cr_width_60" required></td> <td class="cr_status"><select id="submit_status" name="twitomatic_comments_list[submit_status][]" class="cr_width_70"> <option value="approve"'; if ($submit_status == 'approve') { $output .= ' selected'; } $output .= '>' . esc_html__("Approved", 'twitomatic-twitter-post-generator') . '</option> <option value="pending"'; if ($submit_status == 'pending') { $output .= ' selected'; } $output .= '>' . esc_html__("Unapproved", 'twitomatic-twitter-post-generator') . '</option> <option value="spam"'; if ($submit_status == 'spam') { $output .= ' selected'; } $output .= '>' . esc_html__("Spam", 'twitomatic-twitter-post-generator') . '</option> </select> </td> <td class="cr_xoq"><select id="default_type" name="twitomatic_comments_list[default_type][]" class="cr_width_full">'; foreach ($post_list as $post) { $output .= '<option value="' . esc_attr($post) . '"'; if ($def_type == $post) { $output .= ' selected'; } $output .= '>' . get_the_title($post) . '</option>'; } $output .= '</select> </td> <td class="cr_author"><select id="post_author" name="twitomatic_comments_list[post_author][]" class="cr_width_full"> <option value="original"'; if ($post_author == 'original') { $output .= " selected"; } $output .= '>' . esc_html__("Original Author", 'twitomatic-twitter-post-generator') . '</option>'; $blogusers = get_users( [ 'role__in' => [ 'contributor', 'author', 'editor', 'administrator' ] ] ); foreach ($blogusers as $user) { $output .= '<option value="' . esc_html($user->ID) . '"'; if ($post_author == $user->ID) { $output .= " selected"; } $output .= '>' . esc_html($user->display_name) . '</option>'; } $output .= '</select> </td> <td class="cr_width_70"> <input type="button" id="mybtnfzr' . esc_html($cont) . '" value="Settings"> <div id="mymodalfzr' . esc_html($cont) . '" class="codemodalfzr"> <div class="codemodalfzr-content"> <div class="codemodalfzr-header"> <span id="twitomatic_close' . esc_html($cont) . '" class="codeclosefzr">×</span> <h2>' . esc_html__('Rule', 'twitomatic-twitter-post-generator') . ' <span class="cr_color_white">ID ' . esc_html($cont) . '</span> ' . esc_html__('Advanced Settings', 'twitomatic-twitter-post-generator') . '</h2> </div> <div class="codemodalfzr-body"> <div class="table-responsive"> <table class="responsive table cr_main_table_nowr"> <tr><td class="cr_min_width_200"> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the content of the generated comments for user rules. You can use the following shortcodes: %%item_latitude%%, %%item_longitude%%, %%author%%, %%author_link%%, %%item_show_image%%, %%item_read_more_button%%, %%item_media%%, %%item_card%%, %%twitter_tweet_button%%, %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_title%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_img_url%%, %%video_url%%, %%item_url%%, %%item_cat%%, %%item_tags%%", 'twitomatic-twitter-post-generator') . ' </div> </div> <b>' . esc_html__("Generated Comments Content", 'twitomatic-twitter-post-generator') . ':</b> </td><td> <textarea rows="2" cols="70" name="twitomatic_comments_list[post_content][]" placeholder="Please insert your desired post content. Example:%%item_content%%" class="cr_width_full">' . htmlspecialchars($post_content) . '</textarea> </div> </td></tr><tr><td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to remember last posted item and continue search from it the next time the importing rule runs?", 'twitomatic-twitter-post-generator') . ' </div> </div> <b>' . esc_html__("Cache Items For Continuous Posting (disable to get latest posts only)", 'twitomatic-twitter-post-generator') . ':</b> </td><td> <input type="checkbox" id="continue_search" name="twitomatic_comments_list[continue_search][]"'; if ($continue_search == '1') { $output .= ' checked'; } $output .= '> </div> </td></tr><tr><td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Run regex on post content. To disable this feature, leave this field blank. No Regex separators are required here. You can add also multiple Regex expressions, each on a new line.", 'twitomatic-twitter-post-generator') . ' </div> </div> <b>' . esc_html__("Run Regex On Content", 'twitomatic-twitter-post-generator') . ':</b> </td><td> <textarea rows="1" class="cr_width_full" name="twitomatic_comments_list[strip_by_regex][]" placeholder="regex" class="cr_width_full">' . esc_textarea($strip_by_regex) . '</textarea> </div> </td></tr><tr><td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Replace the above regex matches with this regex expression. If you want to strip matched content, leave this field blank. No Regex separators are required here. You can add also multiple replacement expressions, each on a new line.", 'twitomatic-twitter-post-generator') . ' </div> </div> <b>' . esc_html__("Replace Matches From Regex (Content)", 'twitomatic-twitter-post-generator') . ':</b> </td><td> <textarea rows="1" class="cr_width_full" name="twitomatic_comments_list[replace_regex][]" placeholder="regex replacement" class="cr_width_full">' . esc_textarea($replace_regex) . '</textarea> </div> </td></tr> <tr> <td colspan="2"> <h3>' . esc_html__("Scheduling Options:", 'twitomatic-twitter-post-generator') . '</h3> </td> </tr> <tr><td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Add a time period between the plugin will run importing at a schedule. To disable this feature, leave this field blank. This works based on your current server timezone and time. Your current server time is: ", 'twitomatic-twitter-post-generator') . date("h:i A") . ' </div> </div> <b>' . esc_html__("Automatically Run Rules Only Between These Hour Periods Each Day", 'twitomatic-twitter-post-generator') . ':</b> </td><td> <input type="time" id="run_after" name="twitomatic_comments_list[run_after][]" value="' . esc_attr($run_after) . '" placeholder="' . esc_html__("Run Rules Only After This Hour", 'twitomatic-twitter-post-generator') . '"> - <input type="time" id="run_before" name="twitomatic_comments_list[run_before][]" value="' . esc_attr($run_before) . '" placeholder="' . esc_html__("Run Rules Only Before This Hour", 'twitomatic-twitter-post-generator') . '"> </div> </td></tr> <tr> <td colspan="2"> <h3>' . esc_html__("Posting Restrictions:", 'twitomatic-twitter-post-generator') . '</h3> </td> </tr><tr><td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do not include posts that\'s title or content contains at least one of these words. Separate words by comma. To disable this feature, leave this field blank.", 'twitomatic-twitter-post-generator') . ' </div> </div> <b>' . esc_html__("Banned Words List", 'twitomatic-twitter-post-generator') . ':</b> </td><td> <input type="text" class="cr_width_full" name="twitomatic_comments_list[banned_words][]" value="' . esc_attr($banned_words) . '" placeholder="banned1, banned2, banned3" class="cr_width_full"> </div> </td></tr><tr><td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do not include posts that\'s title or content does not contain at least one of these words. Separate words by comma. To disable this feature, leave this field blank. If you wish to input a keyword that must be required in all cases (AND), please use it in this format: &&keyword. Example: granny, dad, &&mom. This translates into: (granny OR dad) AND MOM", 'twitomatic-twitter-post-generator') . ' </div> </div> <b>' . esc_html__("Required Words List", 'twitomatic-twitter-post-generator') . ':</b> </td><td> <input type="text" class="cr_width_full" name="twitomatic_comments_list[required_words][]" value="' . esc_attr($required_words) . '" placeholder="required1, required2, required3" class="cr_width_full"> </div> </td></tr> <tr> <td colspan="2"> <h3>' . esc_html__("Post Customizations:", 'twitomatic-twitter-post-generator') . '</h3> </td> </tr><tr><td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select the address from where the tweets will be collected. In the first textfield, you can input a street address or a latitude, longitude pair (ex: \'37.781157 -122.398720\' or \'Oxford street, London\'. In the second textfield, you can input a radius for this location, in miles or kilometers (ex: \'1mi\' or \'3km\')Returns tweets by users located within a given radius of the given latitude/longitude. The location is preferentially taking from the Geotagging API, but will fall back to their Twitter profile. The parameter value is specified by latitude,longitude,radius, where radius units must be specified as either mi (miles) or km (kilometers). To disable this feature, leave both textfields blank.", 'twitomatic-twitter-post-generator') . '</div> </div> <b>' . esc_html__("Tweet Source Location", 'twitomatic-twitter-post-generator') . ':</b> </td><td> <input type="text" name="twitomatic_comments_list[coord][]" value="' . esc_attr($coord) . '" placeholder="37.781157 -122.398720" class="cr_width_65p"> <input type="text" name="twitomatic_comments_list[radius][]" value="' . esc_attr($radius) . '" placeholder="1mi" class="cr_width_30p"> </div> </td></tr><tr><td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select the result type you want to get from the query. Valid types are: mixed, recent or popular.", 'twitomatic-twitter-post-generator') . ' </div> </div> <b>' . esc_html__("Result Type", 'twitomatic-twitter-post-generator') . ':</b> </td><td> <select id="result_type" name="twitomatic_comments_list[result_type][]" class="cr_width_full"> <option value="mixed"'; if ($result_type == 'mixed') { $output .= ' selected'; } $output .= '>' . esc_html__("Mixed", 'twitomatic-twitter-post-generator') . '</option> <option value="popular"'; if ($result_type == 'popular') { $output .= ' selected'; } $output .= '>' . esc_html__("Popular", 'twitomatic-twitter-post-generator') . '</option> <option value="recent"'; if ($result_type == 'recent') { $output .= ' selected'; } $output .= '>' . esc_html__("Recent", 'twitomatic-twitter-post-generator') . '</option> </select> </div> </td></tr><tr><td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to skip retweets?", 'twitomatic-twitter-post-generator') . ' </div> </div> <b>' . esc_html__("Skip Retweets", 'twitomatic-twitter-post-generator') . ':</b> </td><td> <input type="checkbox" id="skip_retweets" name="twitomatic_comments_list[skip_retweets][]"'; if ($skip_retweets == '1') { $output .= ' checked'; } $output .= '> </div> </td></tr><tr><td> <div> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to skip replies?", 'twitomatic-twitter-post-generator') . ' </div> </div> <b>' . esc_html__("Skip Replies", 'twitomatic-twitter-post-generator') . ':</b> </td><td> <input type="checkbox" id="skip_replies" name="twitomatic_comments_list[skip_replies][]"'; if ($skip_replies == '1') { $output .= ' checked'; } $output .= '> </div> </td></tr></table></div> </div> <div class="codemodalfzr-footer"> <br/> <h3 class="cr_inline">Twitomatic Automatic Post Generator</h3><span id="twitomatic_ok' . esc_html($cont) . '" class="codeokfzr cr_inline">OK </span> <br/><br/> </div> </div> </div> </td> <td class="cr_shrt_td2"><span class="wptwitomatic-delete">X</span></td> <td class="cr_short_td"><input type="checkbox" name="twitomatic_comments_list[active][]" class="activateDeactivateClass" value="1"'; if (isset($active) && $active === '1') { $output .= ' checked'; } $output .= '/> <input type="hidden" name="twitomatic_comments_list[last_run][]" value="' . esc_attr($last_run) . '"/></td> <td class="cr_shrt_td2"><div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px">' . esc_html__('Comments Generated: ', 'twitomatic-twitter-post-generator') . esc_html($generated_posts) . '<br/>'; $output .= esc_html__('Last Run: ', 'twitomatic-twitter-post-generator'); if ($last_run == '1988-01-27 00:00:00') { $output .= 'Never'; } else { $output .= $last_run; } $output .= '<br/>' . esc_html__('Next Run: ', 'twitomatic-twitter-post-generator'); if($unlocker == '1') { $nextrun = twitomatic_add_minute($last_run, $schedule); } else { $nextrun = twitomatic_add_hour($last_run, $schedule); } $now = twitomatic_get_date_now(); if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) { $output .= esc_html__('WP-CRON Disabled. Rules will not automatically run!', 'twitomatic-twitter-post-generator'); } else { if (isset($active) && $active === '1') { if($unlocker == '1') { $twitomatic_hour_diff = (int) twitomatic_minute_diff($now, $nextrun); } else { $twitomatic_hour_diff = (int) twitomatic_hour_diff($now, $nextrun); } if ($twitomatic_hour_diff >= 0) { $append = 'Now.'; $cron = _get_cron_array(); if ($cron != FALSE) { $date_format = _x('Y-m-d H:i:s', 'Date Time Format1', 'twitomatic-twitter-post-generator'); foreach ($cron as $timestamp => $cronhooks) { foreach ((array) $cronhooks as $hook => $events) { if ($hook == 'twitomaticaction') { foreach ((array) $events as $key => $event) { $append = date_i18n($date_format, $timestamp); } } } } } $output .= $append; } else { $output .= $nextrun; } } else { $output .= esc_html__('Rule Disabled', 'twitomatic-twitter-post-generator'); } } $output .= '<br/>' . esc_html__('Local Time: ', 'twitomatic-twitter-post-generator') . $now; $output .= '</div> </div></td> <td class="cr_center"> <div> <img id="run_img' . esc_html($cont) . '" src="' . plugin_dir_url(dirname(__FILE__)) . 'images/running.gif' . '" alt="Running" class="cr_status_icon'; if (!empty($running)) { if (!in_array($cont, $running)) { $output .= ' cr_hidden'; } } else { $output .= ' cr_hidden'; } $output .= '" title="status"> <div class="codemainfzr"> <select id="actions" class="actions" name="actions" onchange="actionsChangedManual(' . esc_html($cont) . ', this.value, 1);" onfocus="this.selectedIndex = 0;"> <option value="select" disabled selected>' . esc_html__("Select an Action", 'twitomatic-twitter-post-generator') . '</option> <option value="run">' . esc_html__("Run This Rule Now", 'twitomatic-twitter-post-generator') . '</option> <option value="trash">' . esc_html__("Move All Comments To Trash", 'twitomatic-twitter-post-generator') . '</option> <option value="duplicate">' . esc_html__("Duplicate This Rule", 'twitomatic-twitter-post-generator') . '</option> <option value="delete">' . esc_html__("Permanently Delete All Comments", 'twitomatic-twitter-post-generator') . '</option> </select> </div> </div> </td> </tr> '; $cont = $cont + 1; } } return $output; } ?>
Save File
Cancel