← Back
Editing: fbomatic-rules-list.php
<?php function fbomatic_items_panel() { $fbomatic_Main_Settings = get_option('fbomatic_Main_Settings', false); if(isset($fbomatic_Main_Settings['app_id']) && $fbomatic_Main_Settings['app_id'] != '') { if(isset($fbomatic_Main_Settings['app_secret']) && $fbomatic_Main_Settings['app_secret'] != '') { } else { ?> <h1><?php echo esc_html__("You must add a Facebook App Secret before you can use this feature!", 'fbomatic-facebook-post-generator');?></h1> <?php return; } } else { ?> <h1><?php echo esc_html__("You must add a Facebook App ID and Secret before you can use this feature!", 'fbomatic-facebook-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=fbomatic_items_panel"> <?php wp_nonce_field('fbomatic_save_rules', '_fbomaticr_nonce'); if (isset($_GET['settings-updated'])) { ?> <div> <p class="cr_saved_notif"><strong><?php echo esc_html__("Settings saved.", 'fbomatic-facebook-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 class="cr_td_z"> <?php echo esc_html__("ID", 'fbomatic-facebook-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__("This is the ID of the rule. ", 'fbomatic-facebook-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("Group/Page Type", 'fbomatic-facebook-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( __( "Select if you want to get post from a Facebook Public Group or a Facebook page. You can also select 'Auto' to auto detect the type of the page. Note that if you want to post from a private user's profile, your App needs <strong>user_posts</strong> permission. Details <a href='%s' target='_blank'>here</a>.", 'fbomatic-facebook-post-generator'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url_raw( 'https://developers.facebook.com/docs/facebook-login/review/how-to-submit' ) ); ?> </div> </div> </th> <th> <?php echo esc_html__("Group/Page URL or ID", 'fbomatic-facebook-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__("Input the Facebook Public Group/Page URL or numeric ID. For information about how to get numeric IDs, check plugin documentation - Update: nested shortcodes also supported (shortcodes generated by rules from other plugins).", 'fbomatic-facebook-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("Schedule", 'fbomatic-facebook-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('fbomatic_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.", 'fbomatic-facebook-post-generator'); } else { echo esc_html__("Select the interval in hours after which you want this rule to run. Defined in hours.", 'fbomatic-facebook-post-generator'); } ?> </div> </div> </th> <th> <?php echo esc_html__("Max # Posts", 'fbomatic-facebook-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 posts that this rule can create at once. 0-100 interval allowed.", 'fbomatic-facebook-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("More Options", 'fbomatic-facebook-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.", 'fbomatic-facebook-post-generator'); ?> </div> </div> </th> <th class="cr_max_width_40"> <?php echo esc_html__("Del", 'fbomatic-facebook-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?", 'fbomatic-facebook-post-generator'); ?> </div> </div> </th> <th class="cr_max_55"> <?php echo esc_html__("Active", 'fbomatic-facebook-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).", 'fbomatic-facebook-post-generator'); ?> </div> </div> <br/> <input type="checkbox" onchange="thisonChangeHandler(this)" id="exclusion"> </th> <th class="cr_max_42"> <?php echo esc_html__("Info", 'fbomatic-facebook-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.", 'fbomatic-facebook-post-generator'); ?> </div> </div> </th> <th class="cr_actions"> <?php echo esc_html__("Actions", 'fbomatic-facebook-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.", 'fbomatic-facebook-post-generator'); ?> </div> </div> </th> </tr> </thead> <tbody> <?php echo fbomatic_expand_rules_manual(); ?> <tr> <td class="cr_short_td"><input type="text" name="fbomatic_rules_list[rule_description][]" id="rule_description" class="cr_center" placeholder="Rule ID" value="" class="cr_width_full"/></td> <td class="cr_min_width_70 cr_width_70"> <select id="rule_type" name="fbomatic_rules_list[rule_type][]" class="cr_width_70"> <option selected value="profile"><?php echo esc_html__("Profile or Page", 'fbomatic-facebook-post-generator');?></option> <option value="group"><?php echo esc_html__("Group", 'fbomatic-facebook-post-generator');?></option> <option value="page"><?php echo esc_html__("Legacy Page", 'fbomatic-facebook-post-generator');?></option> </select> </td> <td class="cr_select_option"><input type="text" name="fbomatic_rules_list[textids][]" placeholder="Please input the page/group URL or ID" value="" class="cr_width_full"/></td> <td class="cr_comm_td"><input type="number" step="1" min="1" name="fbomatic_rules_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="fbomatic_rules_list[max][]" placeholder="Select the max # of generated posts" value="10" class="cr_width_60"/></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="fbomatic_close" class="codeclosefzr">×</span> <h2><span class="cr_color_white"><?php echo esc_html__("New Rule", 'fbomatic-facebook-post-generator');?></span> <?php echo esc_html__("Advanced Settings", 'fbomatic-facebook-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 title of the generated posts for user rules. You can use the following shortcodes: %%item_short_content%%, %%author%%, %%item_description%%, %%item_date%%, %%random_sentence%%, %%random_sentence2%%, %%item_title%%, %%item_description%%, %%item_content%%, %%item_cat%%, %%item_tags%%", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Generated Post Title:", 'fbomatic-facebook-post-generator');?></b> <b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">ⓘ</a></b> </td> <td> <input type="text" name="fbomatic_rules_list[post_title][]" value="%%item_title%%" placeholder="Please insert your desired post title. Example: %%item_title%%" class="cr_width_full"> </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__("Set the content of the generated posts for user rules. You can use the following shortcodes: %%item_date%%, %%facebook_like_button%%, %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_title%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_link%%, %%item_url%%, %%item_embed%%, %%item_cat%%, %%item_tags%%, %%item_read_more_button%%, %%item_show_image%%, %%item_image_URL%%, %%author%%, %%author_link%%, %%item_screenshot_url%%, %%item_show_screenshot%%", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Generated Post Content:", 'fbomatic-facebook-post-generator');?></b> <b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">ⓘ</a></b> </td> <td> <textarea rows="2" cols="70" name="fbomatic_rules_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?", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Cache Items For Continuous Posting (disable to get latest posts only):", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="continue_search" name="fbomatic_rules_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__("Select the status that you want for the automatically generated posts to have.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Generated Post Status:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <select id="submit_status" name="fbomatic_rules_list[submit_status][]" class="cr_width_70"> <option value="pending"><?php echo esc_html__("Pending -> Moderate", 'fbomatic-facebook-post-generator');?></option> <option value="draft"><?php echo esc_html__("Draft -> Moderate", 'fbomatic-facebook-post-generator');?></option> <option value="publish" selected><?php echo esc_html__("Published", 'fbomatic-facebook-post-generator');?></option> <option value="private"><?php echo esc_html__("Private", 'fbomatic-facebook-post-generator');?></option> <option value="trash"><?php echo esc_html__("Trash", 'fbomatic-facebook-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"> <?php echo esc_html__("Select the type (post/page) for your automatically generated item.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Generated Post Type:", 'fbomatic-facebook-post-generator');?></b> </td> <td><select id="default_type" name="fbomatic_rules_list[default_type][]" class="cr_width_auto"> <?php $is_first = true; foreach ( get_post_types( '', 'names' ) as $post_type ) { echo '<option value="' . esc_attr($post_type) . '"'; if($is_first === true) { echo ' selected'; $is_first = false; } echo '>' . esc_html($post_type) . '</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"> <?php echo esc_html__("Select the author that you want to assign for the automatically generated posts. ", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Generated Post Author:", 'fbomatic-facebook-post-generator');?></b> </td> <td><select id="post_author" name="fbomatic_rules_list[post_author][]" class="cr_width_auto cr_max_width_150"> <?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> </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 disable the automatic post excerpt generation?", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Disable Automatic Excerpt Generation:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="no_excerpt" name="fbomatic_rules_list[no_excerpt][]"> </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 set post date as the original date from Facebook?", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Set Post Original Date:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="original_date" name="fbomatic_rules_list[original_date][]"> </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 strip images from generated content?", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Strip Images From Content:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="strip_images" name="fbomatic_rules_list[strip_images][]"> </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 strip title from generated content and leave only images or videos?", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Strip Title From Content:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="strip_text" name="fbomatic_rules_list[strip_text][]"> </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__("This feature will try to remove the WordPress's default post category. This may fail in case no additional categories are added, because WordPress requires at least one post category for every post.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Remove WP Default Post Category:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="remove_default" name="fbomatic_rules_list[remove_default][]" 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__("Choose if you wish to skip posts that do not contain at least one URL.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Skip Posts That Don't Contain At Least An URL In Their Content:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="skip_no_url" name="fbomatic_rules_list[skip_no_url][]"> </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__("Skip these Facebook post types when inserting blog posts. Valid values are: link, status, photo, video, event, offer. Separate multiple entries by comma. Ex: 'status, offer, link'. To disable this feature, leave this textfield blank. For more info about Facebook post types, check plugin documentation.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Facebook Post Types To Skip:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="text" id="skip_posts" name="fbomatic_rules_list[skip_posts][]" value="" placeholder="Input the post types to skip" 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__("If you wish to assign tags to specific posts that contain a keyword, specify in this settings field a rule, like this: keyword1 => tag1, keyword2 => tag2. If the post contains keyword1", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("When Keyword Found Add Tags To Generated Posts:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="text" id="keyword_tag" name="fbomatic_rules_list[keyword_tag][]" value="" placeholder="keyword => tag, keyword2 => tag2" 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__("If you wish to assign categories to specific posts that contain a keyword, specify in this settings field a rule, like this: keyword1 => category_slug1, keyword2 => category_slug2. If the post contains keyword1", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("When Keyword Found Add Categories To Generated Posts:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="text" id="keyword_cat" name="fbomatic_rules_list[keyword_cat][]" value="" placeholder="keyword => category_slug1, keyword2 => category_slug2" 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__("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.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Required Words List:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="text" id="require_words" name="fbomatic_rules_list[require_words][]" value="" placeholder="Input some comma separated required words" 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__("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.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Banned Words List:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="text" id="banned_words" name="fbomatic_rules_list[banned_words][]" value="" placeholder="Input some comma separated banned words" 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__("Do you want to limit the title's length to a specific word count? To disable this feature, leave this field blank.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Limit Title Word Count:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="number" min="1" step="1" id="limit_title_word_count" name="fbomatic_rules_list[limit_title_word_count][]" value="" placeholder="Input a limit for the title" 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__("Run regex on post content. To disable this feature, leave this field blank. You can add multiple Regex expressions, each on a different line.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Run Regex On Content:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <textarea rows="1" class="cr_width_full" name="fbomatic_rules_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. You can add multiple replacement expressions, each on a different line.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Replace Matches From Regex:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <textarea rows="1" class="cr_width_full" name="fbomatic_rules_list[replace_regex][]" placeholder="regex replacement" class="cr_width_full"></textarea> </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__("If your template supports 'Post Formats', than you can select one here. If not, leave this at it's default value.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Generated Post Format:", 'fbomatic-facebook-post-generator');?></b> </td> <td class="cr_min_width_200"> <select id="post_format" name="fbomatic_rules_list[post_format][]" class="cr_width_full"> <option value="post-format-standard" selected><?php echo esc_html__("Standard", 'fbomatic-facebook-post-generator');?></option> <option value="post-format-aside"><?php echo esc_html__("Aside", 'fbomatic-facebook-post-generator');?></option> <option value="post-format-gallery"><?php echo esc_html__("Gallery", 'fbomatic-facebook-post-generator');?></option> <option value="post-format-link"><?php echo esc_html__("Link", 'fbomatic-facebook-post-generator');?></option> <option value="post-format-image"><?php echo esc_html__("Image", 'fbomatic-facebook-post-generator');?></option> <option value="post-format-quote"><?php echo esc_html__("Quote", 'fbomatic-facebook-post-generator');?></option> <option value="post-format-status"><?php echo esc_html__("Status", 'fbomatic-facebook-post-generator');?></option> <option value="post-format-video"><?php echo esc_html__("Video", 'fbomatic-facebook-post-generator');?></option> <option value="post-format-audio"><?php echo esc_html__("Audio", 'fbomatic-facebook-post-generator');?></option> <option value="post-format-chat"><?php echo esc_html__("Chat", 'fbomatic-facebook-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__("Select the post category that you want for the automatically generated posts to have.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Additional Post Category:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <select multiple id="default_category" name="fbomatic_rules_list[default_category][]" class="cr_width_full" onmouseover="this.size=this.length;" onmouseout="this.size=4;"> <option value="fbomatic_no_category_12345678" selected><?php echo esc_html__("Do Not Add a Category", 'fbomatic-facebook-post-generator');?></option> <?php $cat_args = array( 'orderby' => 'name', 'hide_empty' => 0, 'order' => 'ASC' ); $categories = get_categories($cat_args); foreach ($categories as $category) { ?> <option value="<?php echo esc_html($category->term_id); ?>"><?php echo esc_html(sanitize_text_field($category->name)); ?></option> <?php } ?> </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"> <?php echo esc_html__("Do you want to automatically add post categories from the Facebook items?", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Auto Add Categories:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="auto_categories" name="fbomatic_rules_list[auto_categories][]"> </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 auto created categories parent category id. If you leave this field blank, automatically created categories will be a root category (no parent).", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Auto Created Categories Parent Category ID:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="number" min="0" step="1" id="parent_category_id" name="fbomatic_rules_list[parent_category_id][]" value="" placeholder="Parent category id" 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__("Do you want to automatically add post tags from the Facebook items?", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Auto Add Tags:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="auto_tags" name="fbomatic_rules_list[auto_tags][]"> </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 post tags that you want for the automatically generated posts to have.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Additional Post Tags:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="text" name="fbomatic_rules_list[default_tags][]" value="" placeholder="Please insert your additional post tags here" 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__("Do you want to enable comments for the generated posts?", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Enable Comments For Posts:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="enable_comments" name="fbomatic_rules_list[enable_comments][]" 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__("Do you want to enable pingbacks/trackbacks for the generated posts?", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Enable Pingback/Trackback:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="enable_pingback" name="fbomatic_rules_list[enable_pingback][]" checked> </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__("Set the custom fields that will be set for generated posts. The syntax for this field is the following: custom_field_name1 => custom_field_value1, custom_field_name2 => custom_field_value2, ... . In custom_field_valueX, you can use shortcodes, same like in post content. You can also assign the data to array custom fields, using this format: array_field[index_name1] => custom_field_value1, array_field[index_name2] => custom_field_value2. Example (without quotes): 'title_custom_field => %%item_title%%'. You can use the following shortcodes: %%item_pub_date%%, %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_title%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_link%%, %%item_url%%, %%item_embed%%, %%item_cat%%, %%item_tags%%, %%item_read_more_button%%, %%item_show_image%%, %%item_image_URL%%, %%author%%, %%author_link%%, %%item_screenshot_url%%, %%item_show_screenshot%%, %%author_email%%", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Post Custom Fields:", 'fbomatic-facebook-post-generator');?></b> <b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">ⓘ</a></b> </td> <td> <textarea rows="1" cols="70" name="fbomatic_rules_list[custom_fields][]" placeholder="Please insert your desired custom fields. Example: title_custom_field => %%item_title%%" class="cr_width_full"></textarea> </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__("Set the custom taxonomies that will be set for generated posts. The syntax for this field is the following: custom_taxonomy_name1 => custom_taxonomy_value1A, custom_taxonomy_value1B; custom_taxonomy_name2 => custom_taxonomy_value2A, custom_taxonomy_value2B; ... . In custom_taxonomy_valueX, you can use shortcodes. Example (without quotes): 'cats_taxonomy_field => manualtax1, %%auto_tax%%; tags_taxonomy_field => manualtax2, %%auto_tax%%'. You can use the following shortcodes: %%auto_tax%%, %%item_pub_date%%, %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_title%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_link%%, %%item_url%%, %%item_embed%%, %%item_cat%%, %%item_tags%%, %%item_read_more_button%%, %%item_show_image%%, %%item_image_URL%%, %%author%%, %%author_link%%, %%item_screenshot_url%%, %%item_show_screenshot%%, %%author_email%%", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Post Custom Taxonomies:", 'fbomatic-facebook-post-generator');?></b> <b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">ⓘ</a></b> </td> <td> <textarea rows="1" cols="70" name="fbomatic_rules_list[custom_tax][]" placeholder="Please insert your desired custom taxonomies. Example: custom_taxonomy_name => %%item_cats%%" 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__("Do you want to set featured image for generated post (to the first image that was found in the post)?", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Auto Get Featured Image:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="featured_image" name="fbomatic_rules_list[featured_image][]" checked> </div> </td> </tr> <tr> <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__("Insert a comma separated list of links to valid images that will be set randomly for the featured image for the posts that do not have a valid image attached or if you disabled automatical featured image generation. You can also use image numeric IDs from images found in the Media Gallery. To disable this feature, leave this field blank.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Default Featured Image List:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input class="cr_width_60p" type="text" name="fbomatic_rules_list[image_url][]" placeholder="Please insert the link to a valid image" id="cr_input_box" value=""/> <input class="cr_width_33p fbomatic_image_button" type="button" value=">>>"/> </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__("This works only if you configured phantomjs usage, from the Main Settings of the plugin. Choose if you want to use phantomjs to generate the screenshot for the page you are crawling and attach it to the generated post, regardless if you use the %%item_show_screenshot%% and %%item_screenshot_url%% shortcodes.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Attach Screenshot to All Generated Posts", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="attach_screen" name="fbomatic_rules_list[attach_screen][]"> </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" class="cr_min_360"> <?php echo esc_html__("Do you want to automatically generate post comments from item's comments feed?", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Import Comments:", 'fbomatic-facebook-post-generator');?></b> </div> </td> <td> <div> <select id="auto_generate_comments" name="fbomatic_rules_list[auto_generate_comments][]" class="cr_width_full"> <option value="0" selected><?php echo esc_html__("Do Not Import Comments", 'fbomatic-facebook-post-generator');?></option> <?php for ($i = 1; $i <= 50; $i++) { echo '<option value="' . esc_attr($i) . '">' . esc_html($i) . '</option>'; } ?> <option value="99999"><?php echo esc_html__("All", 'fbomatic-facebook-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"> <?php echo esc_html__("Do you want to append imported comments to post content, instead of generating WordPress comments?", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Append Comments to Post Content:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="append_comments" name="fbomatic_rules_list[append_comments][]"> </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__("When importing video posts, select if you want to display also the video thumbnail in the post, or just the video itself.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("For Video Posts, Do Not Show Post Image:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="checkbox" id="video_no_img" name="fbomatic_rules_list[video_no_img][]"> </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__("Custom imported Facebook post content shortcode creator. If you wish to import multiple content from the imported pages, and use them in post content/post custom fields/taxonomies, you can configure them from here. Syntax for this field: shortcode_name => [regex expression] (to specify multiple shortcodes and crawling values, separate them by a new line. Example: my_custom_shortcode => #my-regex# Afterwards, you can use shortcodes in the any settings field that supports shortcodes (ex: 'Generated Post Content' settings field), like this: %%my_custom_shortcode%%. Official format is %%name_of_custom_shortcode%%", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Custom Shortcode Creator", 'fbomatic-facebook-post-generator');?>:</b> </div> </td> <td> <div> <textarea rows="2" cols="70" name="fbomatic_rules_list[custom_crawling_expre][]" placeholder="shortcode_name => [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__("Set the default title for posts that do not have text attached to them (text/video).", 'fbomatic-facebook-post-generator'). ' ' . sprintf( wp_kses( __( "To learn how to get it, please click <a href='%s' target='_blank'>here</a>.", 'fbomatic-facebook-post-generator'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url_raw( 'http://coderevolution.ro/knowledge-base/faq/how-to-get-cookie-values-for-the-fbomatic-plugin/' ) ); ?> </div> </div> <b><?php echo esc_html__("Default Title for Posts Without Text:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="text" id="default_title" name="fbomatic_rules_list[default_title][]" value="Facebook post" placeholder="Default title" 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__("Input the value of the xs cookie.", 'fbomatic-facebook-post-generator'). ' ' . sprintf( wp_kses( __( "To learn how to get it, please click <a href='%s' target='_blank'>here</a>.", 'fbomatic-facebook-post-generator'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url_raw( 'http://coderevolution.ro/knowledge-base/faq/how-to-get-cookie-values-for-the-fbomatic-plugin/' ) ); ?> </div> </div> <b><?php echo esc_html__("c_user Cookie Value:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="text" id="cuser_cookie" name="fbomatic_rules_list[cuser_cookie][]" value="" placeholder="c_user cookie Value" 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__("Input the value of the xs cookie.", 'fbomatic-facebook-post-generator'). ' ' . sprintf( wp_kses( __( "To learn how to get it, please click <a href='%s' target='_blank'>here</a>.", 'fbomatic-facebook-post-generator'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url_raw( 'http://coderevolution.ro/knowledge-base/faq/how-to-get-cookie-values-for-the-fbomatic-plugin/' ) ); ?> </div> </div> <b><?php echo esc_html__("xs Cookie Value:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="password" id="xs_cookie" name="fbomatic_rules_list[xs_cookie][]" value="" placeholder="xs cookie Value" 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__("Input the timeout in milliseconds to between each Facebook page request. To disable this feature, leave this field blank.", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Timeout Between Facebook Page Requests:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="number" min="0" step="1" id="page_timeout" name="fbomatic_rules_list[page_timeout][]" value="2000" placeholder="Request timeout (milliseconds)" 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_top cr_min_260px"> <?php echo esc_html__("Enter a 2 letter language code that will be assigned as the WPML/Polylang language for posts. Example: for German, input: de", 'fbomatic-facebook-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Assign WPML/Polylang Language to Posts:", 'fbomatic-facebook-post-generator');?></b> </td> <td> <input type="text" class="cr_width_full" name="fbomatic_rules_list[wpml_lang][]" value="" placeholder="WPML language" class="cr_width_full"> </div> </td> </tr> </table> </div> </div> <div class="codemodalfzr-footer"> <br/> <h3 class="cr_inline">F-omatic Automatic Post Generator</h3> <span id="fbomatic_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="fbomatic_rules_list[active][]" value="1" checked /> <input type="hidden" name="fbomatic_rules_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.", 'fbomatic-facebook-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", 'fbomatic-facebook-post-generator');?></option> <option value="run" onclick=""><?php echo esc_html__("Run This Rule Now", 'fbomatic-facebook-post-generator');?></option> <option value="trash" onclick=""><?php echo esc_html__("Move All Posts To Trash", 'fbomatic-facebook-post-generator');?></option> <option value="duplicate" onclick=""><?php echo esc_html__("Duplicate This Rule", 'fbomatic-facebook-post-generator');?></option> <option value="delete" onclick=""><?php echo esc_html__("Permanently Delete All Posts", 'fbomatic-facebook-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", 'fbomatic-facebook-post-generator');?>"/></p> </div> <div> <?php echo esc_html__("New! AI generated shortcodes supported, click for details:", 'fbomatic-facebook-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!", 'fbomatic-facebook-post-generator');?></a><br/><?php echo esc_html__("Confused about rule running status icons?", 'fbomatic-facebook-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", 'fbomatic-facebook-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", 'fbomatic-facebook-post-generator');?> - <b><?php echo esc_html__("Importing is Running", 'fbomatic-facebook-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", 'fbomatic-facebook-post-generator');?> - <b><?php echo esc_html__("New Posts Created", 'fbomatic-facebook-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", 'fbomatic-facebook-post-generator');?> - <b><?php echo esc_html__("An Error Occurred.", 'fbomatic-facebook-post-generator');?> <b><?php echo esc_html__("Please check 'Activity and Logging' plugin menu for details.", 'fbomatic-facebook-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", 'fbomatic-facebook-post-generator');?> - <b><?php echo esc_html__("Possible reasons:", 'fbomatic-facebook-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", 'fbomatic-facebook-post-generator');?></li> <li>► <?php echo esc_html__("Some restrictions you defined in the plugin's 'Main Settings'", 'fbomatic-facebook-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'", 'fbomatic-facebook-post-generator');?>)</i> <?php echo esc_html__("prevent posting of new posts.", 'fbomatic-facebook-post-generator');?></li> </ul> </td> </tr> </table> </div> </div> </form> </div> </div> <?php } if (isset($_POST['fbomatic_rules_list'])) { add_action('admin_init', 'fbomatic_save_rules_manual'); } function fbomatic_save_rules_manual($data2) { check_admin_referer('fbomatic_save_rules', '_fbomaticr_nonce'); $data2 = $_POST['fbomatic_rules_list']; $rules = array(); $cont = 0; $cat_cont = 0; if (isset($data2['textids'][0])) { for ($i = 0; $i < sizeof($data2['textids']); ++$i) { $bundle = array(); if (isset($data2['schedule'][$i]) && $data2['schedule'][$i] != '' && $data2['textids'][$i] != '') { $bundle[] = trim($data2['textids'][$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['submit_status'][$i])); $bundle[] = trim(sanitize_text_field($data2['default_type'][$i])); $bundle[] = trim(sanitize_text_field($data2['post_author'][$i])); $bundle[] = trim(sanitize_text_field($data2['default_tags'][$i])); if($i == sizeof($data2['textids']) - 1) { if(isset($data2['default_category'])) { $bundle[] = $data2['default_category']; } else { if(!isset($data2['default_category' . $cat_cont])) { $cat_cont++; } if(!isset($data2['default_category' . $cat_cont])) { $bundle[] = array('fbomatic_no_category_12345678'); } else { $bundle[] = $data2['default_category' . $cat_cont]; } } } else { if(!isset($data2['default_category' . $cat_cont])) { $cat_cont++; } if(!isset($data2['default_category' . $cat_cont])) { $bundle[] = array('fbomatic_no_category_12345678'); } else { $bundle[] = $data2['default_category' . $cat_cont]; } } $bundle[] = trim(sanitize_text_field($data2['auto_categories'][$i])); $bundle[] = trim(sanitize_text_field($data2['auto_tags'][$i])); $bundle[] = trim(sanitize_text_field($data2['enable_comments'][$i])); $bundle[] = trim(sanitize_text_field($data2['featured_image'][$i])); $bundle[] = trim($data2['image_url'][$i]); $bundle[] = $data2['post_title'][$i]; $bundle[] = $data2['post_content'][$i]; $bundle[] = trim(sanitize_text_field($data2['enable_pingback'][$i])); $bundle[] = trim(sanitize_text_field($data2['post_format'][$i])); $bundle[] = trim(sanitize_text_field($data2['rule_type'][$i])); $bundle[] = trim(sanitize_text_field($data2['auto_generate_comments'][$i])); $bundle[] = trim(sanitize_text_field($data2['strip_images'][$i])); $bundle[] = trim(sanitize_text_field($data2['limit_title_word_count'][$i])); $bundle[] = trim(sanitize_text_field($data2['original_date'][$i])); $bundle[] = trim(sanitize_text_field($data2['strip_text'][$i])); $bundle[] = trim(sanitize_text_field($data2['remove_default'][$i])); $bundle[] = trim(sanitize_text_field($data2['skip_posts'][$i])); $bundle[] = trim(sanitize_text_field($data2['no_excerpt'][$i])); $bundle[] = trim(sanitize_text_field($data2['rule_description'][$i])); $bundle[] = trim(sanitize_text_field($data2['video_no_img'][$i])); $bundle[] = trim(sanitize_text_field($data2['continue_search'][$i])); $bundle[] = trim($data2['custom_fields'][$i]); $bundle[] = trim($data2['custom_tax'][$i]); $bundle[] = trim(sanitize_text_field($data2['append_comments'][$i])); $bundle[] = $data2['require_words'][$i]; $bundle[] = $data2['banned_words'][$i]; $bundle[] = trim(sanitize_text_field($data2['parent_category_id'][$i])); $bundle[] = trim(sanitize_text_field($data2['keyword_tag'][$i])); $bundle[] = trim(sanitize_text_field($data2['keyword_cat'][$i])); $bundle[] = trim($data2['strip_by_regex'][$i]); $bundle[] = trim($data2['replace_regex'][$i]); $bundle[] = trim($data2['cuser_cookie'][$i]); $bundle[] = trim($data2['xs_cookie'][$i]); $bundle[] = trim(sanitize_text_field($data2['page_timeout'][$i])); $bundle[] = trim($data2['default_title'][$i]); $bundle[] = trim($data2['custom_crawling_expre'][$i]); $bundle[] = trim($data2['skip_no_url'][$i]); $bundle[] = trim(sanitize_text_field($data2['attach_screen'][$i])); $bundle[] = trim(sanitize_text_field($data2['wpml_lang'][$i])); $rules[$cont] = $bundle; $cont++; $cat_cont++; } } } update_option('fbomatic_rules_list', $rules, false); } function fbomatic_expand_rules_manual() { $cat_args = array( "orderby" => "name", "hide_empty" => 0, "order" => "ASC" ); $categories = get_categories($cat_args); if (!get_option('fbomatic_running_list')) { $running = array(); } else { $running = get_option('fbomatic_running_list'); } $fbomatic_Main_Settings = get_option('fbomatic_Main_Settings', false); $GLOBALS['wp_object_cache']->delete('fbomatic_rules_list', 'options'); $rules = get_option('fbomatic_rules_list'); if(!is_array($rules)) { $rules = array(); } $output = ''; $cont = 0; if (!empty($rules)) { $posted_items = array(); $post_list = array(); $postsPerPage = 50000; $paged = 0; if (isset($fbomatic_Main_Settings['no_check']) && $fbomatic_Main_Settings['no_check'] == 'on') { } else { do { $postOffset = $paged * $postsPerPage; $query = array( 'post_status' => array( 'publish', 'draft', 'pending', 'trash', 'private', 'future' ), 'post_type' => array( 'any' ), 'numberposts' => $postsPerPage, 'meta_key' => 'fbomatic_parent_rule', 'fields' => 'ids', 'offset' => $postOffset ); $got_me = get_posts($query); $post_list = array_merge($post_list, $got_me); $paged++; }while(!empty($got_me)); } wp_suspend_cache_addition(true); foreach ($post_list as $post) { $rule_id = get_post_meta($post, 'fbomatic_parent_rule', true); if ($rule_id != '') { $posted_items[] = $rule_id; } } wp_suspend_cache_addition(false); $unlocker = get_option('fbomatic_minute_running_unlocked', false); $counted_vals = array_count_values($posted_items); 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]);}} $textids = $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]; $status = $array_my_values[5]; $def_type = $array_my_values[6]; $post_user_name = $array_my_values[7]; $default_tags = $array_my_values[8]; $default_category = $array_my_values[9]; $auto_categories = $array_my_values[10]; $auto_tags = $array_my_values[11]; $enable_comments = $array_my_values[12]; $featured_image = $array_my_values[13]; $image_url = $array_my_values[14]; $post_title = $array_my_values[15]; $post_content = $array_my_values[16]; $enable_pingback = $array_my_values[17]; $post_format = $array_my_values[18]; $rule_type = $array_my_values[19]; $auto_generate_comments = $array_my_values[20]; $strip_images = $array_my_values[21]; $limit_title_word_count = $array_my_values[22]; $original_date = $array_my_values[23]; $strip_text = $array_my_values[24]; $remove_default = $array_my_values[25]; $skip_posts = $array_my_values[26]; $no_excerpt = $array_my_values[27]; $rule_description = $array_my_values[28]; $video_no_img = $array_my_values[29]; $continue_search = $array_my_values[30]; $custom_fields = $array_my_values[31]; $custom_tax = $array_my_values[32]; $append_comments = $array_my_values[33]; $require_words = $array_my_values[34]; $banned_words = $array_my_values[35]; $parent_category_id = $array_my_values[36]; $keyword_tag = $array_my_values[37]; $keyword_cat = $array_my_values[38]; $strip_by_regex = $array_my_values[39]; $replace_regex = $array_my_values[40]; $cuser_cookie = $array_my_values[41]; $xs_cookie = $array_my_values[42]; $page_timeout = $array_my_values[43]; $default_title = $array_my_values[44]; $custom_crawling_expre = $array_my_values[45]; $skip_no_url = $array_my_values[46]; $attach_screen = $array_my_values[47]; $wpml_lang = $array_my_values[48]; if($rule_description == '') { $rule_description = $cont; } wp_add_inline_script('fbomatic-footer-script', 'createAdmin(' . esc_html($cont) . ');', 'after'); $output .= '<tr> <td class="cr_short_td"><input type="text" name="fbomatic_rules_list[rule_description][]" id="rule_description' . esc_html($cont) . '" class="cr_center" placeholder="Rule ID" value="' . esc_html($rule_description) . '" class="cr_width_full"/>'; $output .= '</td> <td class="cr_min_width_70 cr_width_70"><select id="rule_type" name="fbomatic_rules_list[rule_type][]" class="cr_width_70"> <option value="profile"'; if ($rule_type == 'profile') { $output .= ' selected'; } $output .= '>' . esc_html__("Profile or Page", 'fbomatic-facebook-post-generator') . '</option> <option value="group"'; if ($rule_type == 'group') { $output .= ' selected'; } $output .= '>' . esc_html__("Group", 'fbomatic-facebook-post-generator') . '</option> <option value="page"'; if ($rule_type == 'page') { $output .= ' selected'; } $output .= '>' . esc_html__("Legacy Page", 'fbomatic-facebook-post-generator') . '</option> </select> </td> <td class="cr_select_option"><input type="text" placeholder="The field URL/ID is required" name="fbomatic_rules_list[textids][]" value="' . esc_attr($textids) . '" class="cr_width_full" required></td> <td class="cr_comm_td"><input type="number" step="1" min="1" placeholder="# h" name="fbomatic_rules_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="fbomatic_rules_list[max][]" value="' . esc_attr($max) . '" class="cr_width_60" required></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="fbomatic_close' . esc_html($cont) . '" class="codeclosefzr">×</span> <h2>' . esc_html__('Rule', 'fbomatic-facebook-post-generator') . ' <span class="cr_color_white">ID ' . esc_html($cont) . '</span> ' . esc_html__('Advanced Settings', 'fbomatic-facebook-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 title of the generated posts for user rules. You can use the following shortcodes: %%item_short_content%%, %%author%%, %%item_description%%, %%item_date%%, %%random_sentence%%, %%random_sentence2%%, %%item_title%%, %%item_description%%, %%item_content%%, %%item_cat%%, %%item_tags%%", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Generated Post Title", 'fbomatic-facebook-post-generator') . ':</b> <b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">ⓘ</a></b> </td><td> <input type="text" name="fbomatic_rules_list[post_title][]" value="' . esc_attr(htmlspecialchars($post_title)) . '" placeholder="Please insert your desired post title. Example: %%item_title%%" class="cr_width_full"> </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">' . esc_html__("Set the content of the generated posts for user rules. You can use the following shortcodes: %%item_date%%, %%facebook_like_button%%, %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_title%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_link%%, %%item_url%%, %%item_embed%%, %%item_cat%%, %%item_tags%%, %%item_read_more_button%%, %%item_show_image%%, %%item_image_URL%%, %%author%%, %%author_link%%, %%item_screenshot_url%%, %%item_show_screenshot%%", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Generated Post Content", 'fbomatic-facebook-post-generator') . ':</b> <b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">ⓘ</a></b> </td><td> <textarea rows="2" cols="70" name="fbomatic_rules_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?", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Cache Items For Continuous Posting (disable to get latest posts only)", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="continue_search" name="fbomatic_rules_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__('Select the status that you want for the automatically generated posts to have.', 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Generated Post Status", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <select id="submit_status" name="fbomatic_rules_list[submit_status][]" class="cr_width_70"> <option value="pending"'; if($status == 'pending') { $output .= ' selected'; } $output .= '>' . esc_html__("Pending -> Moderate", 'fbomatic-facebook-post-generator') . '</option> <option value="draft"'; if($status == 'draft') { $output .= ' selected'; } $output .= '>' . esc_html__("Draft -> Moderate", 'fbomatic-facebook-post-generator') . '</option> <option value="publish"'; if($status == 'publish') { $output .= ' selected'; } $output .= '>' . esc_html__("Published", 'fbomatic-facebook-post-generator') . '</option> <option value="private"'; if($status == 'private') { $output .= ' selected'; } $output .= '>' . esc_html__("Private", 'fbomatic-facebook-post-generator') . '</option> <option value="trash"'; if($status == 'trash') { $output .= ' selected'; } $output .= '>' . esc_html__("Trash", 'fbomatic-facebook-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__('Select the type (post/page) for your automatically generated item.', 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Generated Post Type", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <select id="default_type" name="fbomatic_rules_list[default_type][]" class="cr_width_auto">'; foreach ( get_post_types( '', 'names' ) as $post_type ) { $output .= '<option value="' . esc_attr($post_type) . '"'; if ($def_type == $post_type) { $output .= ' selected'; } $output .= '>' . esc_html($post_type) . '</option>'; } $output .= '</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__('Select the author that you want to assign for the automatically generated posts.', 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Generated Post Author", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <select id="post_author" name="fbomatic_rules_list[post_author][]" class="cr_width_auto cr_max_width_150">'; $blogusers = get_users( [ 'role__in' => [ 'contributor', 'author', 'editor', 'administrator' ] ] ); foreach ($blogusers as $user) { $output .= '<option value="' . esc_html($user->ID) . '"'; if ($post_user_name == $user->ID) { $output .= " selected"; } $output .= '>' . esc_html($user->display_name) . '</option>'; } $output .= '</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 disable the automatic post excerpt generation?", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Disable Automatic Excerpt Generation", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="no_excerpt" name="fbomatic_rules_list[no_excerpt][]"'; if ($no_excerpt == '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 set post date as the original date from Facebook?", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Set Post Original Date", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="original_date" name="fbomatic_rules_list[original_date][]"'; if ($original_date == '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 strip images from generated content?", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Strip Images From Content", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="strip_images" name="fbomatic_rules_list[strip_images][]"'; if ($strip_images == '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 strip title from generated content and leave only images and videos?", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Strip Title From Content", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="strip_text" name="fbomatic_rules_list[strip_text][]"'; if ($strip_text == '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__("This feature will try to remove the WordPress\'s default post category. This may fail in case no additional categories are added, because WordPress requires at least one post category for every post.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Remove WP Default Post Category", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="remove_default" name="fbomatic_rules_list[remove_default][]"'; if($remove_default == '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__("Choose if you wish to skip posts that do not contain at least one URL.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Skip Posts That Don't Contain At Least An URL In Their Content", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="skip_no_url" name="fbomatic_rules_list[skip_no_url][]"'; if($skip_no_url == '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__("Skip these Facebook post types when inserting blog posts. Valid values are: <strong>link, status, photo, video, event, offer</strong>. Separate multiple entries by comma. Ex: \'status, offer, link\'. To disable this feature, leave this textfield blank. For more info about Facebook post types, check plugin documentation.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Facebook Post Types To Skip", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="text" id="skip_posts" name="fbomatic_rules_list[skip_posts][]" value="' . esc_attr($skip_posts) . '" placeholder="Input the post types to skip" 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__("If you wish to assign tags to specific posts that contain a keyword, specify in this settings field a rule, like this: keyword1 => tag1, keyword2 => tag2. If the post contains keyword1", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("When Keyword Found Add Tags To Generated Posts", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="text" id="keyword_tag" name="fbomatic_rules_list[keyword_tag][]" placeholder="keyword => tag, keyword2 => tag2" class="cr_width_full" value="' . esc_attr($keyword_tag) . '"> </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__("If you wish to assign categories to specific posts that contain a keyword, specify in this settings field a rule, like this: keyword1 => category_slug1, keyword2 => category_slug2. If the post contains keyword1", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("When Keyword Found Add Categories To Generated Posts", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="text" id="keyword_cat" name="fbomatic_rules_list[keyword_cat][]" value="' . esc_attr($keyword_cat) . '" placeholder="keyword => category_slug1, keyword2 => category_slug2" 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.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Required Words List", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="text" id="require_words" name="fbomatic_rules_list[require_words][]" value="' . esc_attr($require_words) . '" placeholder="Input some comma separated required words" 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 contains at least one of these words. Separate words by comma. To disable this feature, leave this field blank.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Banned Words List", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="text" id="banned_words" name="fbomatic_rules_list[banned_words][]" value="' . esc_attr($banned_words) . '" placeholder="Input some comma separated banned words" 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 you want to limit the title\'s length to a specific word count? To disable this feature, leave this field blank.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Limit Title Word Count", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="number" min="1" step="1" id="limit_title_word_count" name="fbomatic_rules_list[limit_title_word_count][]" value="' . esc_attr($limit_title_word_count) . '" placeholder="Input a limit for the title" 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__("Run regex on post content. To disable this feature, leave this field blank. You can add multiple Regex expressions, each on a different line.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Run Regex On Content", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <textarea rows="1" class="cr_width_full" name="fbomatic_rules_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. You can add multiple replacement expressions, each on a different line.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Replace Matches From Regex", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <textarea rows="1" class="cr_width_full" name="fbomatic_rules_list[replace_regex][]" placeholder="regex replacement" class="cr_width_full">' . esc_textarea($replace_regex) . '</textarea> </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">' . esc_html__('If your template supports "Post Formats", than you can select one here. If not, leave this at it\'s default value.', 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Generated Post Format", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <select id="post_format" name="fbomatic_rules_list[post_format][]" class="cr_width_full"> <option value="post-format-standard"'; if ($post_format == 'post-format-standard') { $output .= ' selected'; } $output .= '>' . esc_html__("Standard", 'fbomatic-facebook-post-generator') . '</option> <option value="post-format-aside"'; if ($post_format == 'post-format-aside') { $output .= ' selected'; } $output .= '>' . esc_html__("Aside", 'fbomatic-facebook-post-generator') . '</option> <option value="post-format-gallery"'; if ($post_format == 'post-format-gallery') { $output .= ' selected'; } $output .= '>' . esc_html__("Gallery", 'fbomatic-facebook-post-generator') . '</option> <option value="post-format-link"'; if ($post_format == 'post-format-link') { $output .= ' selected'; } $output .= '>' . esc_html__("Link", 'fbomatic-facebook-post-generator') . '</option> <option value="post-format-image"'; if ($post_format == 'post-format-image') { $output .= ' selected'; } $output .= '>' . esc_html__("Image", 'fbomatic-facebook-post-generator') . '</option> <option value="post-format-quote"'; if ($post_format == 'post-format-quote') { $output .= ' selected'; } $output .= '>' . esc_html__("Quote", 'fbomatic-facebook-post-generator') . '</option> <option value="post-format-status"'; if ($post_format == 'post-format-status') { $output .= ' selected'; } $output .= '>' . esc_html__("Status", 'fbomatic-facebook-post-generator') . '</option> <option value="post-format-video"'; if ($post_format == 'post-format-video') { $output .= ' selected'; } $output .= '>' . esc_html__("Video", 'fbomatic-facebook-post-generator') . '</option> <option value="post-format-audio"'; if ($post_format == 'post-format-audio') { $output .= ' selected'; } $output .= '>' . esc_html__("Audio", 'fbomatic-facebook-post-generator') . '</option> <option value="post-format-chat"'; if ($post_format == 'post-format-chat') { $output .= ' selected'; } $output .= '>' . esc_html__("Chat", 'fbomatic-facebook-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">' . esc_html__("Select the post category that you want for the automatically generated posts to have.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Additional Post Category", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <select multiple class="cr_width_full" id="default_category" name="fbomatic_rules_list[default_category' . esc_html($cont) . '][]" onmouseover="this.size=this.length;" onmouseout="this.size=4;"> <option value="fbomatic_no_category_12345678"'; if(!is_array($default_category)) { $default_category = array($default_category); } if(count($default_category) == 1) { foreach($default_category as $dc) { if ("fbomatic_no_category_12345678" == $dc) { $output .= ' selected'; break; } } } $output .= '>' . esc_html__("Do Not Add a Category", 'fbomatic-facebook-post-generator') . '</option>'; foreach ($categories as $category) { $output .= '<option value="' . esc_attr($category->term_id) . '"'; foreach($default_category as $dc) { if ($category->term_id == $dc) { $output .= ' selected'; break; } } $output .= '>' . sanitize_text_field($category->name) . '</option>'; } $output .= '</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 automatically add post categories from the feed items?", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Auto Add Categories", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="auto_categories" name="fbomatic_rules_list[auto_categories][]"'; if ($auto_categories == '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__("Select the auto created categories parent category id. If you leave this field blank, automatically created categories will be a root category (no parent).", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Auto Created Categories Parent Category ID", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="number" min="0" step="1" id="parent_category_id" name="fbomatic_rules_list[parent_category_id][]" value="' . esc_attr($parent_category_id) . '" placeholder="Parent category id" 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 you want to automatically add post tags from the feed items?", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Auto Add Tags", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="auto_tags" name="fbomatic_rules_list[auto_tags][]"'; if ($auto_tags == '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__("Select the post tags that you want for the automatically generated posts to have.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Additional Post Tags", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input class="cr_width_full" type="text" name="fbomatic_rules_list[default_tags][]" value="' . esc_attr($default_tags) . '" placeholder="Please insert your additional post tags here" > </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 enable comments for the generated posts?", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Enable Comments For Posts", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="enable_comments" name="fbomatic_rules_list[enable_comments][]"'; if ($enable_comments == '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 enable pingbacks and trackbacks for the generated posts?", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Enable Pingback/Trackback", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="enable_pingback" name="fbomatic_rules_list[enable_pingback][]"'; if ($enable_pingback == '1') { $output .= ' checked'; } $output .= '> </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">' . esc_html__("Set the custom fields that will be set for generated posts. The syntax for this field is the following: custom_field_name1 => custom_field_value1, custom_field_name2 => custom_field_value2, ... . In custom_field_valueX, you can use shortcodes, same like in post content. You can also assign the data to array custom fields, using this format: array_field[index_name1] => custom_field_value1, array_field[index_name2] => custom_field_value2. Example (without quotes): \'title_custom_field => %%item_title%%\'. You can use the following shortcodes: %%item_pub_date%%, %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_title%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_link%%, %%item_url%%, %%item_embed%%, %%item_cat%%, %%item_tags%%, %%item_read_more_button%%, %%item_show_image%%, %%item_image_URL%%, %%author%%, %%author_link%%, %%item_screenshot_url%%, %%item_show_screenshot%%, %%author_email%%", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Post Custom Fields", 'fbomatic-facebook-post-generator') . ':</b> <b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">ⓘ</a></b> </td><td> <textarea rows="1" cols="70" name="fbomatic_rules_list[custom_fields][]" placeholder="Please insert your desired custom fields. Example: title_custom_field => %%item_title%%" class="cr_width_full">' . esc_textarea($custom_fields) . '</textarea> </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">' . esc_html__("Set the custom taxonomies that will be set for generated posts. The syntax for this field is the following: custom_taxonomy_name1 => custom_taxonomy_value1A, custom_taxonomy_value1B; custom_taxonomy_name2 => custom_taxonomy_value2A, custom_taxonomy_value2B; ... . In custom_taxonomy_valueX, you can use shortcodes. Example (without quotes): \'cats_taxonomy_field => manualtax1, %%auto_tax%%; tags_taxonomy_field => manualtax2, %%auto_tax%%\'. You can use the following shortcodes: %%auto_tax%%, %%item_pub_date%%, %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_title%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_link%%, %%item_url%%, %%item_embed%%, %%item_cat%%, %%item_tags%%, %%item_read_more_button%%, %%item_show_image%%, %%item_image_URL%%, %%author%%, %%author_link%%, %%item_screenshot_url%%, %%item_show_screenshot%%, %%author_email%%", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Post Custom Taxonomies", 'fbomatic-facebook-post-generator') . ':</b> <b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">ⓘ</a></b> </td><td> <textarea rows="1" cols="70" name="fbomatic_rules_list[custom_tax][]" placeholder="Please insert your desired custom taxonomies. Example: custom_taxonomy_name => %%item_cats%%" class="cr_width_full">' . esc_textarea($custom_tax) . '</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 set featured image for generated post (to the first image that was found in the post)?", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Auto Get Featured Image", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="featured_image" name="fbomatic_rules_list[featured_image][]"'; if ($featured_image == '1') { $output .= ' checked'; } $output .= '> </div> </td></tr><tr><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">' . esc_html__("Insert a comma separated list of links to valid images that will be set randomly for the featured image for the posts that do not have a valid image attached or if you disabled automatical featured image generation. You can also use image numeric IDs from images found in the Media Gallery. To disable this feature, leave this field blank.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Default Featured Image List", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input class="cr_width_full" type="text" name="fbomatic_rules_list[image_url][]" placeholder="Please insert the link to a valid image" value="' . esc_attr($image_url) . '"/> </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__("This works only if you configured phantomjs usage, from the Main Settings of the plugin. Choose if you want to use phantomjs to generate the screenshot for the page you are crawling and attach it to the generated post, regardless if you use the %%item_show_screenshot%% and %%item_screenshot_url%% shortcodes.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Attach Screenshot to All Generated Posts", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="attach_screen" name="fbomatic_rules_list[attach_screen][]"'; if ($attach_screen == '1') { $output .= ' checked'; } $output .= '> </div> </td></tr><tr><td> <div class="hideComm"> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text" class="cr_min_360">' . esc_html__('Do you want to automatically generate post comments from item\'s comments feed?', 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Import Comments", 'fbomatic-facebook-post-generator') . ':</b> </div> </td><td> <div class="hideComm"> <select id="auto_generate_comments" name="fbomatic_rules_list[auto_generate_comments][]" class="cr_width_full"> <option value="0"'; if ($auto_generate_comments == '0') { $output .= ' selected'; } $output .= '>' . esc_html__("Do Not Import Comments", 'fbomatic-facebook-post-generator') . '</option>'; for ($i = 1; $i <= 50; $i++) { $output .= '<option value="' . esc_attr($i) . '"'; if ($auto_generate_comments == $i) { $output .= ' selected'; } $output .= '>' . esc_html($i) . '</option>'; } $output .= '<option value="99999"'; if ($auto_generate_comments == '99999') { $output .= ' selected'; } $output .= '>' . esc_html__("All", 'fbomatic-facebook-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 append imported comments to post content, instead of generating WordPress comments?", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Append Comments to Post Content", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="append_comments" name="fbomatic_rules_list[append_comments][]"'; if ($append_comments == '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__("When importing video posts, select if you want to display also the video thumbnail in the post, or just the video itself.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("For Video Posts, Do Not Show Post Image", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="checkbox" id="video_no_img" name="fbomatic_rules_list[video_no_img][]"'; if ($video_no_img == '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__("Custom imported Facebook post content shortcode creator. If you wish to import multiple content from the imported pages, and use them in post content/post custom fields/taxonomies, you can configure them from here. Syntax for this field: shortcode_name => [regex expression] (to specify multiple shortcodes and crawling values, separate them by a new line. Example: my_custom_shortcode => #my-regex# Afterwards, you can use shortcodes in the any settings field that supports shortcodes (ex: 'Generated Post Content' settings field), like this: %%my_custom_shortcode%%. Official format is %%name_of_custom_shortcode%%", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Custom Shortcode Creator", 'fbomatic-facebook-post-generator') . ':</b> </div> </td><td> <div> <textarea rows="2" cols="70" name="fbomatic_rules_list[custom_crawling_expre][]" placeholder="shortcode_name => [regex expression]" class="cr_width_full">' . esc_textarea($custom_crawling_expre) . '</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__("Set the default title for posts that do not have text attached to them (text/video)", 'fbomatic-facebook-post-generator') . ' ' . sprintf( wp_kses( __( "To learn how to get it, please click <a href='%s' target='_blank'>here</a>.", 'fbomatic-facebook-post-generator'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url_raw( 'http://coderevolution.ro/knowledge-base/faq/how-to-get-cookie-values-for-the-fbomatic-plugin/' ) ) . ' </div> </div> <b>' . esc_html__("Default Title for Posts Without Text", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="text" id="default_title" name="fbomatic_rules_list[default_title][]" value="' . esc_attr($default_title) . '" placeholder="Default title" 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__("Input the value of the c_user cookie.", 'fbomatic-facebook-post-generator') . ' ' . sprintf( wp_kses( __( "To learn how to get it, please click <a href='%s' target='_blank'>here</a>.", 'fbomatic-facebook-post-generator'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url_raw( 'http://coderevolution.ro/knowledge-base/faq/how-to-get-cookie-values-for-the-fbomatic-plugin/' ) ) . ' </div> </div> <b>' . esc_html__("c_user Cookie Value", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="text" id="cuser_cookie" name="fbomatic_rules_list[cuser_cookie][]" value="' . esc_attr($cuser_cookie) . '" placeholder="c_user cookie value" 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__("Input the value of the xs cookie.", 'fbomatic-facebook-post-generator') . ' ' . sprintf( wp_kses( __( "To learn how to get it, please click <a href='%s' target='_blank'>here</a>.", 'fbomatic-facebook-post-generator'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url_raw( 'http://coderevolution.ro/knowledge-base/faq/how-to-get-cookie-values-for-the-fbomatic-plugin/' ) ) . ' </div> </div> <b>' . esc_html__("xs Cookie Value", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="password" id="xs_cookie" name="fbomatic_rules_list[xs_cookie][]" value="' . esc_attr($xs_cookie) . '" placeholder="xs cookie value" 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__("Input the timeout in milliseconds to between each Facebook page request. To disable this feature, leave this field blank.", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Timeout Between Facebook Page Requests", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="number" min="0" step="1" id="page_timeout" name="fbomatic_rules_list[page_timeout][]" value="' . esc_attr($page_timeout) . '" placeholder="Request timeout (milliseconds)" 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_top cr_min_260px">' . esc_html__("Enter a 2 letter language code that will be assigned as the WPML/Polylang language for posts. Example: for German, input: de", 'fbomatic-facebook-post-generator') . ' </div> </div> <b>' . esc_html__("Assign WPML/Polylang Language to Posts", 'fbomatic-facebook-post-generator') . ':</b> </td><td> <input type="text" class="cr_width_full" name="fbomatic_rules_list[wpml_lang][]" value="' . esc_attr($wpml_lang) . '" placeholder="WPML language" class="cr_width_full"> </div> </td></tr></table></div> </div> <div class="codemodalfzr-footer"> <br/> <h3 class="cr_inline">F-omatic Automatic Post Generator</h3><span id="fbomatic_ok' . esc_html($cont) . '" class="codeokfzr cr_inline">OK </span> <br/><br/> </div> </div> </div> </td> <td class="cr_shrt_td2"><span class="wpfbomatic-delete">X</span></td> <td class="cr_short_td"><input type="checkbox" name="fbomatic_rules_list[active][]" class="activateDeactivateClass" value="1"'; if (isset($active) && $active === '1') { $output .= ' checked'; } $output .= '/> <input type="hidden" name="fbomatic_rules_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">' . sprintf( wp_kses( __( 'Shortcode for this rule<br/>(to cross-post from this plugin in other plugins):', 'fbomatic-facebook-post-generator'), array( 'br' => array( ) ) ) ) . '<br/><b>%%fbomatic_0_' . esc_html($cont) . '%% and %%fbomatic_title_0_' . esc_html($cont) . '%%</b><br/>' . esc_html__('Posts Generated:', 'fbomatic-facebook-post-generator') . ' '; if (isset($fbomatic_Main_Settings['no_check']) && $fbomatic_Main_Settings['no_check'] == 'on') { $output .= esc_html__('post count checking disabled from plugin settings', 'fbomatic-facebook-post-generator') . '<br/>'; } else { $output .= esc_html($generated_posts) . '<br/>'; } if ($generated_posts != 0) { if (isset($fbomatic_Main_Settings['post_source_custom']) && $fbomatic_Main_Settings['post_source_custom'] != '') { $output .= '<a href="' . get_admin_url() . 'edit.php?coderevolution_post_source=' . str_replace(' ', '-', $fbomatic_Main_Settings['post_source_custom']) . '&post_type=' . esc_html($def_type) . '" target="_blank">' . esc_html__('View Generated Posts', 'fbomatic-facebook-post-generator') . '</a><br/>'; } else { $output .= '<a href="' . get_admin_url() . 'edit.php?coderevolution_post_source=FBomatic_' . esc_html($cont) . '&post_type=' . esc_html($def_type) . '" target="_blank">' . esc_html__('View Generated Posts', 'fbomatic-facebook-post-generator') . '</a><br/>'; } } $output .= esc_html__('Last Run: ', 'fbomatic-facebook-post-generator'); if ($last_run == '1988-01-27 00:00:00') { $output .= 'Never'; } else { $output .= $last_run; } $output .= '<br/>' . esc_html__('Next Run: ', 'fbomatic-facebook-post-generator'); if($unlocker == '1') { $nextrun = fbomatic_add_minute($last_run, $schedule); } else { $nextrun = fbomatic_add_hour($last_run, $schedule); } $now = fbomatic_get_date_now(); if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) { $output .= esc_html__('WP-CRON Disabled. Rules will not automatically run!', 'fbomatic-facebook-post-generator'); } else { if (isset($active) && $active === '1') { if($unlocker == '1') { $fbomatic_hour_diff = (int)fbomatic_minute_diff($now, $nextrun); } else { $fbomatic_hour_diff = (int)fbomatic_hour_diff($now, $nextrun); } if ($fbomatic_hour_diff >= 0) { if($unlocker == '1') { $append = 'Now.'; } else { $append = 'Now.'; } $cron = _get_cron_array(); if ($cron != FALSE) { $date_format = _x('Y-m-d H:i:s', 'Date Time Format1', 'fbomatic-facebook-post-generator'); foreach ($cron as $timestamp => $cronhooks) { foreach ((array) $cronhooks as $hook => $events) { if ($hook == 'fbomaticaction') { foreach ((array) $events as $key => $event) { $append = date_i18n($date_format, $timestamp); } } } } } $output .= $append; } else { $output .= $nextrun; } } else { $output .= esc_html__('Rule Disabled', 'fbomatic-facebook-post-generator'); } } $output .= '<br/>' . esc_html__('Local Time: ', 'fbomatic-facebook-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)) { $f = fopen(get_temp_dir() . 'fbomatic_' . $cont, 'w'); if($f !== false) { flock($f, LOCK_UN); fclose($f); global $wp_filesystem; if ( ! is_a( $wp_filesystem, 'WP_Filesystem_Base') ){ include_once(ABSPATH . 'wp-admin/includes/file.php');$creds = request_filesystem_credentials( site_url() ); wp_filesystem($creds); } $wp_filesystem->delete(get_temp_dir() . 'fbomatic_' . $cont); } $output .= ' cr_hidden'; } else { $f = fopen(get_temp_dir() . 'fbomatic_' . $cont, 'w'); if($f !== false) { if (!flock($f, LOCK_EX | LOCK_NB)) { } else { flock($f, LOCK_UN); $output .= ' cr_hidden'; if (($xxkey = array_search($cont, $running)) !== false) { unset($running[$xxkey]); update_option('fbomatic_running_list', $running); } } } } } else { $f = fopen(get_temp_dir() . 'fbomatic_' . $cont, 'w'); if($f !== false) { flock($f, LOCK_UN); fclose($f); global $wp_filesystem; if ( ! is_a( $wp_filesystem, 'WP_Filesystem_Base') ){ include_once(ABSPATH . 'wp-admin/includes/file.php');$creds = request_filesystem_credentials( site_url() ); wp_filesystem($creds); } $wp_filesystem->delete(get_temp_dir() . 'fbomatic_' . $cont); } $output .= ' cr_hidden'; } $output .= '" title="status"> <div class="codemainfzr"> <select id="actions" class="actions" name="actions" onchange="actionsChangedManual(' . esc_html($cont) . ', this.value);" onfocus="this.selectedIndex = 0;"> <option value="select" disabled selected>' . esc_html__("Select an Action", 'fbomatic-facebook-post-generator') . '</option> <option value="run">' . esc_html__("Run This Rule Now", 'fbomatic-facebook-post-generator') . '</option> <option value="trash">' . esc_html__("Move All Posts To Trash", 'fbomatic-facebook-post-generator') . '</option> <option value="duplicate">' . esc_html__("Duplicate This Rule", 'fbomatic-facebook-post-generator') . '</option> <option value="delete">' . esc_html__("Permanently Delete All Posts", 'fbomatic-facebook-post-generator') . '</option> </select> </div> </div> </td> </tr> '; $cont = $cont + 1; } } return $output; } ?>
Save File
Cancel