← Back
Editing: tmomatic-rules-list.php
<?php function tmomatic_items_panel() { $tmomatic_Main_Settings = get_option('tmomatic_Main_Settings', false); if(isset($tmomatic_Main_Settings['app_id']) && $tmomatic_Main_Settings['app_id'] != '') { } else { ?> <h1><?php echo esc_html__("You must add a TicketMaster App ID before you can use this feature!", 'tmomatic-ticketmaster-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=tmomatic_items_panel"> <?php wp_nonce_field('tmomatic_save_rules', '_tmomaticr_nonce'); if (isset($_GET['settings-updated'])) { ?> <div> <p class="cr_saved_notif"><strong><?php echo esc_html__("Settings saved.", 'tmomatic-ticketmaster-post-generator');?></strong></p> </div> <?php } ?> <div> <div class="hideMain"> <hr/> <div class="table-responsive"> <table id="mainRules" class="responsive table cr_main_table"> <thead> <tr> <th> <?php echo esc_html__("ID", 'tmomatic-ticketmaster-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. ", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("Events Query", 'tmomatic-ticketmaster-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 query based on which you want to search for events. To search for all events in a specified country, for example, please fill in this parameter: '*' (without the quotes) - Update: nested shortcodes also supported (shortcodes generated by rules from other plugins).", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("Schedule", 'tmomatic-ticketmaster-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 interval in hours after which you want this rule to run. Defined in hours.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("Max # Posts", 'tmomatic-ticketmaster-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-50 interval allowed.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("Post Status", 'tmomatic-ticketmaster-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Select the status that you want for the automatically generated posts to have.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("Item Type", 'tmomatic-ticketmaster-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 type (post/page) for your automatically generated item.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("Post Author", 'tmomatic-ticketmaster-post-generator');?> <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle"> <div class="bws_hidden_help_text cr_min_260px"> <?php echo esc_html__("Select the author that you want to assign for the automatically generated posts.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> </th> <th> <?php echo esc_html__("More Options", 'tmomatic-ticketmaster-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.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> </th> <th class="cr_max_width_40"> <?php echo esc_html__("Del", 'tmomatic-ticketmaster-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?", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> </th> <th class="cr_max_55"> <?php echo esc_html__("Active", 'tmomatic-ticketmaster-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).", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <br/> <input type="checkbox" onchange="thisonChangeHandler(this)" id="exclusion"> </th> <th class="cr_max_42"> <?php echo esc_html__("Info", 'tmomatic-ticketmaster-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.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> </th> <th class="cr_actions"> <?php echo esc_html__("Actions", 'tmomatic-ticketmaster-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.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> </th> </tr> </thead> <tbody> <?php echo tmomatic_expand_rules_manual(); ?> <tr> <td class="cr_short_td">-</td> <td class="cr_sz"><input type="text" name="tmomatic_rules_list[date][]" class="cr_width_full" placeholder="Select your query" value="" class="cr_width_full"/></td> <td class="cr_comm_td"><input type="number" step="1" min="1" name="tmomatic_rules_list[schedule][]" max="8765812" class="cr_width_60" placeholder="Select the rule schedule interval" value="24"/></td> <td class="cr_author"><input type="number" min="0" step="1" max="50" name="tmomatic_rules_list[max][]" class="cr_width_full" value="10"/></td> <td class="cr_status"> <select id="submit_status" name="tmomatic_rules_list[submit_status][]" class="cr_width_70"> <option value="pending"><?php echo esc_html__("Pending -> Moderate", 'tmomatic-ticketmaster-post-generator');?></option> <option value="draft"><?php echo esc_html__("Draft -> Moderate", 'tmomatic-ticketmaster-post-generator');?></option> <option value="publish" selected><?php echo esc_html__("Published", 'tmomatic-ticketmaster-post-generator');?></option> <option value="private"><?php echo esc_html__("Private", 'tmomatic-ticketmaster-post-generator');?></option> <option value="trash"><?php echo esc_html__("Trash", 'tmomatic-ticketmaster-post-generator');?></option> </select> </td> <td class="cr_comm_td"><select id="default_type" name="tmomatic_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> </td> <td class="cr_author"><select id="post_author" name="tmomatic_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> </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="tmomatic_close" class="codeclosefzr">×</span> <h2><span class="cr_color_white"><?php echo esc_html__("New Rule", 'tmomatic-ticketmaster-post-generator');?></span> <?php echo esc_html__("Advanced Settings", 'tmomatic-ticketmaster-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: %%start_date%%, %%start_time%%, %%end_date%%, %%city%%, %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_description%%, %%item_title%%, %%item_url%%", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Generated Post Title:", 'tmomatic-ticketmaster-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="tmomatic_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: %%start_date%%, %%start_time%%, %%end_date%%, %%city%%, %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_read_more_button%%, %%item_url%%, %%item_show_image%%, %%item_image_URL%%, %%item_date%%, %%item_title%%, %%item_start_date_local%%, %%item_please_note%%, %%venue_city%%, %%venue_country%%, %%item_venue_address%%, %%item_venue_latitude%%, %%item_venue_longitude%%, %%item_openHoursDetail%%, %%item_willCallDetail%%, %%item_parkingDetail%%, %%item_accessibleSeatingDetail%%, %%item_generalInfo%%, %%item_childRule%%, %%item_adaPhones%%, %%item_adaCustomCopy%%, %%item_adaHours%%, %%item_seatmap_image_url%%, %%item_promoter%%, %%item_venues%%, %%item_attractions%% %%item_event_type%%, %%item_currency%%, %%item_min_price%%, %%item_max_price%%, %%item_sales_start%%, %%item_sales_end%%, %%item_presales_start%%, %%item_presales_end%%, %%item_locale%%, %%item_classification%%, %%item_classification_genre%%, %%item_classification_subgenre%%, %%item_cat%%, %%item_tags%%", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Generated Post Content:", 'tmomatic-ticketmaster-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="tmomatic_rules_list[post_content][]" placeholder="Please insert your desired post content. Example: %%item_content%%" class="cr_width_full">%%item_content%%<br/><br/>Get tickets for this event on: <a href='%%item_url%%' target='_blank'>TicketMaster</a>.</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 sort resulting events?", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Sort Results By:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <select id="sort" name="tmomatic_rules_list[sort][]" class="cr_width_full"> <option value="any" selected><?php echo esc_html__("No Sort", 'tmomatic-ticketmaster-post-generator');?></option> <option value="name,asc"><?php echo esc_html__("Name - Ascending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="name,desc"><?php echo esc_html__("Name - Descending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="date,asc"><?php echo esc_html__("Date - Ascending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="date,desc"><?php echo esc_html__("Date - Descending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="relevance,asc"><?php echo esc_html__("Relevance - Ascending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="relevance,desc"><?php echo esc_html__("Relevance - Descending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="distance,asc"><?php echo esc_html__("Distance - Ascending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="name,date,asc"><?php echo esc_html__("Name & Date - Ascending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="name,date,desc"><?php echo esc_html__("Name & Date - Descending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="date,name,asc"><?php echo esc_html__("Date & Name - Ascending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="date,name,desc"><?php echo esc_html__("Date & Name - Descending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="onsaleStartDate,asc"><?php echo esc_html__("Sale Start Date - Ascending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="id,asc"><?php echo esc_html__("ID - Ascending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="venueName,asc"><?php echo esc_html__("Venue Name - Ascending", 'tmomatic-ticketmaster-post-generator');?></option> <option value="venueName,desc"><?php echo esc_html__("Venue Name - Descending", 'tmomatic-ticketmaster-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 select a source for events?", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Events Source:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <select id="source" name="tmomatic_rules_list[source][]" class="cr_width_full"> <option value="any" selected><?php echo esc_html__("Any", 'tmomatic-ticketmaster-post-generator');?></option> <option value="ticketmaster"><?php echo esc_html__("TicketMaster", 'tmomatic-ticketmaster-post-generator');?></option> <option value="universe"><?php echo esc_html__("Universe", 'tmomatic-ticketmaster-post-generator');?></option> <option value="frontgate"><?php echo esc_html__("Frontgate", 'tmomatic-ticketmaster-post-generator');?></option> <option value="tmr"><?php echo esc_html__("TMR", 'tmomatic-ticketmaster-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 remember last posted item and continue search from it the next time the importing rule runs?", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Cache Items For Continuous Posting (disable to get latest posts only):", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="checkbox" id="continue_search" name="tmomatic_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 postal code of the location where you want to search for events.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Event Location Postal Code:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="text" id="address" name="tmomatic_rules_list[address][]" value="" placeholder="Please insert a postal code" 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__("Select the venue ID where you want to search for events.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Filter Events By Venue ID:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="text" id="venue_id" name="tmomatic_rules_list[venue_id][]" value="" placeholder="Please insert a venue 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__("Select the locale of the results. The locale in ISO code format. Multiple comma-separated values can be provided. When omitting the country part of the code (e.g. only 'en' or 'fr') then the first matching locale is used. When using a '*' it matches all locales. '*' can only be used at the end (e.g. 'en-us,en,*'). Default value is: en", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Event Locale:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="text" id="locale" name="tmomatic_rules_list[locale][]" value="" placeholder="Please insert a locale" 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__("Filter with a start date after this date.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Event Start Date:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="text" id="start_date" name="tmomatic_rules_list[start_date][]" value="" placeholder="Please insert a start date" 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__("Filter with a start date before this date.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Event End Date:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="text" id="end_date" name="tmomatic_rules_list[end_date][]" value="" placeholder="Please insert a end date" 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__("Filter with onsale start date after this date.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Event Sale Start Date:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="text" id="sale_start_date" name="tmomatic_rules_list[sale_start_date][]" value="" placeholder="Please insert a sale start date" 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__("Filter with onsale end date before this date.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Event Sale End Date:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="text" id="sale_end_date" name="tmomatic_rules_list[sale_end_date][]" value="" placeholder="Please insert a sale end date" 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__("The city of the event.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Event City:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="text" id="city" name="tmomatic_rules_list[city][]" value="" placeholder="Please insert a city" 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__("The country code of the event. This should be a 2 letter notation of the respective country.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Event Country Code:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="text" id="countryCode" name="tmomatic_rules_list[countryCode][]" value="" placeholder="Please insert a country code" 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__("Filter results by event state code.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Event State Code:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="text" id="stateCode" name="tmomatic_rules_list[stateCode][]" value="" placeholder="Please insert an event state code" 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__("Filter by classification name: name of any segment, genre, sub-genre, type, sub-type. Negative filtering is supported by using the following format '-'. Be aware that negative filters may cause decreased performance.", 'tmomatic-ticketmaster-post-generator');?> </div> </div> <b><?php echo esc_html__("Event Classification Name:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="text" id="classification" name="tmomatic_rules_list[classification][]" value="" placeholder="Please insert a classification name" 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__("Popularity boost by country, default is us.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Preffered Country:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <select id="pcountry" name="tmomatic_rules_list[pcountry][]" class="cr_width_full"> <option value="us" selected><?php echo esc_html__("US", 'tmomatic-ticketmaster-post-generator');?></option> <option value="ca"><?php echo esc_html__("Canada", 'tmomatic-ticketmaster-post-generator');?></option> </select> </div> </td> </tr> <tr> <td colspan="2"> <hr/> </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?", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Strip Images From Content:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="checkbox" id="strip_images" name="tmomatic_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 limit the title's length to a specific word count? To disable this feature, leave this field blank.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Limit Title Word Count:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="number" min="1" step="1" id="limit_title_word_count" name="tmomatic_rules_list[limit_title_word_count][]" value="" placeholder="Please insert a limit for 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__("If your template supports 'Post Formats', than you can select one here. If not, leave this at it's default value.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Generated Post Format:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td class="cr_min_width_200"> <select id="post_format" name="tmomatic_rules_list[post_format][]" class="cr_width_full"> <option value="post-format-standard" selected><?php echo esc_html__("Standard", 'tmomatic-ticketmaster-post-generator');?></option> <option value="post-format-aside"><?php echo esc_html__("Aside", 'tmomatic-ticketmaster-post-generator');?></option> <option value="post-format-gallery"><?php echo esc_html__("Gallery", 'tmomatic-ticketmaster-post-generator');?></option> <option value="post-format-link"><?php echo esc_html__("Link", 'tmomatic-ticketmaster-post-generator');?></option> <option value="post-format-image"><?php echo esc_html__("Image", 'tmomatic-ticketmaster-post-generator');?></option> <option value="post-format-quote"><?php echo esc_html__("Quote", 'tmomatic-ticketmaster-post-generator');?></option> <option value="post-format-status"><?php echo esc_html__("Status", 'tmomatic-ticketmaster-post-generator');?></option> <option value="post-format-video"><?php echo esc_html__("Video", 'tmomatic-ticketmaster-post-generator');?></option> <option value="post-format-audio"><?php echo esc_html__("Audio", 'tmomatic-ticketmaster-post-generator');?></option> <option value="post-format-chat"><?php echo esc_html__("Chat", 'tmomatic-ticketmaster-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__("Set the ID of the parent of created posts. This is useful for BBPress integration, to assign forum IDs for created topics or for other similar functionalities.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Post Parent ID:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="number" min="1" class="cr_width_full" name="tmomatic_rules_list[parent_id][]" value="" placeholder="Post parent ID" 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__("Select the post category that you want for the automatically generated posts to have.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Additional Post Category:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <select id="default_category" name="tmomatic_rules_list[default_category][]" class="cr_width_full"> <option value="tmomatic_no_category_12345678" selected><?php echo esc_html__("Do Not Add a Category", 'tmomatic-ticketmaster-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 TicketMaster items?", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Auto Add Categories:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <select id="auto_categories" name="tmomatic_rules_list[auto_categories][]" class="cr_width_full"> <option value="disabled" selected><?php echo esc_html__("Disabled", 'tmomatic-ticketmaster-post-generator');?></option> <option value="title"><?php echo esc_html__("Title", 'tmomatic-ticketmaster-post-generator');?></option> <option value="classification"><?php echo esc_html__("Classifications - Segment", 'tmomatic-ticketmaster-post-generator');?></option> <option value="classification-genre"><?php echo esc_html__("Classifications - Genre", 'tmomatic-ticketmaster-post-generator');?></option> <option value="classification-subgenre"><?php echo esc_html__("Classifications - SubGenre", 'tmomatic-ticketmaster-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__("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.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Remove WP Default Post Category:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="checkbox" id="remove_default" name="tmomatic_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__("Do you want to automatically add post tags from the TicketMaster items?", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Auto Add Tags:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <select id="auto_tags" name="tmomatic_rules_list[auto_tags][]" class="cr_width_full"> <option value="disabled" selected><?php echo esc_html__("Disabled", 'tmomatic-ticketmaster-post-generator');?></option> <option value="title"><?php echo esc_html__("Title", 'tmomatic-ticketmaster-post-generator');?></option> <option value="classification"><?php echo esc_html__("Classifications - Segment", 'tmomatic-ticketmaster-post-generator');?></option> <option value="classification-genre"><?php echo esc_html__("Classifications - Genre", 'tmomatic-ticketmaster-post-generator');?></option> <option value="classification-subgenre"><?php echo esc_html__("Classifications - SubGenre", 'tmomatic-ticketmaster-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 post tags that you want for the automatically generated posts to have.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Additional Post Tags:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="text" name="tmomatic_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?", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Enable Comments For Posts:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="checkbox" id="enable_comments" name="tmomatic_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?", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Enable Pingback/Trackback:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="checkbox" id="enable_pingback" name="tmomatic_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: %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_read_more_button%%, %%item_url%%, %%item_show_image%%, %%item_image_URL%%, %%item_date%%, %%item_title%%, %%item_start_date_local%%, %%item_please_note%%, %%venue_city%%, %%venue_country%%,, %%item_venue_address%%, %%item_venue_latitude%%, %%item_venue_longitude%%, %%item_openHoursDetail%%, %%item_willCallDetail%%, %%item_parkingDetail%%, %%item_accessibleSeatingDetail%%, %%item_generalInfo%%, %%item_childRule%%, %%item_adaPhones%%, %%item_adaCustomCopy%%, %%item_adaHours%%, %%item_seatmap_image_url%%, %%item_promoter%%, %%item_venues%%, %%item_attractions%% %%item_event_type%%, %%item_currency%%, %%item_min_price%%, %%item_max_price%%, %%item_sales_start%%, %%item_sales_end%%, %%item_presales_start%%, %%item_presales_end%%, %%item_locale%%, %%item_classification%%, %%item_classification_genre%%, %%item_classification_subgenre%%, %%item_cat%%, %%item_tags%%", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Post Custom Fields:", 'tmomatic-ticketmaster-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="tmomatic_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, %%item_title%%; tags_taxonomy_field => manualtax2, %%item_title%%'. You can use the following shortcodes: %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_read_more_button%%, %%item_url%%, %%item_show_image%%, %%item_image_URL%%, %%item_date%%, %%item_title%%, %%item_start_date_local%%, %%item_please_note%%, %%venue_city%%, %%venue_country%%,, %%item_venue_address%%, %%item_venue_latitude%%, %%item_venue_longitude%%, %%item_openHoursDetail%%, %%item_willCallDetail%%, %%item_parkingDetail%%, %%item_accessibleSeatingDetail%%, %%item_generalInfo%%, %%item_childRule%%, %%item_adaPhones%%, %%item_adaCustomCopy%%, %%item_adaHours%%, %%item_seatmap_image_url%%, %%item_promoter%%, %%item_venues%%, %%item_attractions%% %%item_event_type%%, %%item_currency%%, %%item_min_price%%, %%item_max_price%%, %%item_sales_start%%, %%item_sales_end%%, %%item_presales_start%%, %%item_presales_end%%, %%item_locale%%, %%item_classification%%, %%item_classification_genre%%, %%item_classification_subgenre%%, %%item_cat%%, %%item_tags%%", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Post Custom Taxonomies:", 'tmomatic-ticketmaster-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="tmomatic_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)? If you don't check the 'Get Image From Pixabay' checkbox, this will work only when 'Get Full Content' is also checked.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Auto Get Featured Image:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input type="checkbox" id="featured_image" name="tmomatic_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.", 'tmomatic-ticketmaster-post-generator'); ?> </div> </div> <b><?php echo esc_html__("Default Featured Image List:", 'tmomatic-ticketmaster-post-generator');?></b> </td> <td> <input class="cr_width_60p" type="text" name="tmomatic_rules_list[image_url][]" placeholder="Please insert the link to a valid image" id="cr_input_box" value=""/> <input class="cr_width_33p tmomatic_image_button" type="button" value=">>>"/> </td> </tr> </table> </div> </div> <div class="codemodalfzr-footer"> <br/> <h3 class="cr_inline">Tmomatic Automatic Post Generator</h3> <span id="tmomatic_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="tmomatic_rules_list[active][]" value="1" checked /> <input type="hidden" name="tmomatic_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.", 'tmomatic-ticketmaster-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", 'tmomatic-ticketmaster-post-generator');?></option> <option value="run" onclick=""><?php echo esc_html__("Run This Rule Now", 'tmomatic-ticketmaster-post-generator');?></option> <option value="trash" onclick=""><?php echo esc_html__("Move All Posts To Trash", 'tmomatic-ticketmaster-post-generator');?></option> <option value="duplicate" onclick=""><?php echo esc_html__("Duplicate This Rule", 'tmomatic-ticketmaster-post-generator');?></option> <option value="delete" onclick=""><?php echo esc_html__("Permanently Delete All Posts", 'tmomatic-ticketmaster-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", 'tmomatic-ticketmaster-post-generator');?>"/></p> </div> <div> <?php echo esc_html__("New! AI generated shortcodes supported, click for details:", 'tmomatic-ticketmaster-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!", 'tmomatic-ticketmaster-post-generator');?></a><br/><?php echo esc_html__("Confused about rule running status icons?", 'tmomatic-ticketmaster-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", 'tmomatic-ticketmaster-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", 'tmomatic-ticketmaster-post-generator');?> - <b><?php echo esc_html__("Importing is Running", 'tmomatic-ticketmaster-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", 'tmomatic-ticketmaster-post-generator');?> - <b><?php echo esc_html__("New Posts Created", 'tmomatic-ticketmaster-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", 'tmomatic-ticketmaster-post-generator');?> - <b><?php echo esc_html__("An Error Occurred.", 'tmomatic-ticketmaster-post-generator');?> <b><?php echo esc_html__("Please check 'Activity and Logging' plugin menu for details.", 'tmomatic-ticketmaster-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", 'tmomatic-ticketmaster-post-generator');?> - <b><?php echo esc_html__("Possible reasons:", 'tmomatic-ticketmaster-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", 'tmomatic-ticketmaster-post-generator');?></li> <li>► <?php echo esc_html__("Some restrictions you defined in the plugin's 'Main Settings'", 'tmomatic-ticketmaster-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'", 'tmomatic-ticketmaster-post-generator');?>)</i> <?php echo esc_html__("prevent posting of new posts.", 'tmomatic-ticketmaster-post-generator');?></li> </ul> </td> </tr> </table> </div> </div> </form> </div> </div> <?php } if (isset($_POST['tmomatic_rules_list'])) { add_action('admin_init', 'tmomatic_save_rules_manual'); } function tmomatic_save_rules_manual($data2) { check_admin_referer('tmomatic_save_rules', '_tmomaticr_nonce'); $data2 = $_POST['tmomatic_rules_list']; $rules = array(); $cont = 0; if (isset($data2['date'][0])) { for ($i = 0; $i < sizeof($data2['date']); ++$i) { $bundle = array(); if (isset($data2['schedule'][$i]) && $data2['schedule'][$i] != '' && $data2['date'][$i] != '') { $bundle[] = trim(sanitize_text_field($data2['limit_title_word_count'][$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])); $bundle[] = trim(sanitize_text_field($data2['default_category'][$i])); $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['date'][$i])); $bundle[] = trim(sanitize_text_field($data2['strip_images'][$i])); $bundle[] = trim(sanitize_text_field($data2['stateCode'][$i])); $bundle[] = trim(sanitize_text_field($data2['address'][$i])); $bundle[] = trim(sanitize_text_field($data2['locale'][$i])); $bundle[] = trim($data2['custom_fields'][$i]); $bundle[] = trim(sanitize_text_field($data2['continue_search'][$i])); $bundle[] = trim(sanitize_text_field($data2['pcountry'][$i])); $bundle[] = trim(sanitize_text_field($data2['sort'][$i])); $bundle[] = trim(sanitize_text_field($data2['start_date'][$i])); $bundle[] = trim(sanitize_text_field($data2['end_date'][$i])); $bundle[] = trim(sanitize_text_field($data2['sale_start_date'][$i])); $bundle[] = trim(sanitize_text_field($data2['sale_end_date'][$i])); $bundle[] = trim(sanitize_text_field($data2['city'][$i])); $bundle[] = trim(sanitize_text_field($data2['countryCode'][$i])); $bundle[] = trim(sanitize_text_field($data2['classification'][$i])); $bundle[] = trim(sanitize_text_field($data2['source'][$i])); $bundle[] = trim(sanitize_text_field($data2['venue_id'][$i])); $bundle[] = trim(sanitize_text_field($data2['remove_default'][$i])); $bundle[] = trim($data2['custom_tax'][$i]); $bundle[] = trim($data2['parent_id'][$i]); $rules[$cont] = $bundle; $cont++; } } } update_option('tmomatic_rules_list', $rules, false); } function tmomatic_expand_rules_manual() { if (!get_option('tmomatic_running_list')) { $running = array(); } else { $running = get_option('tmomatic_running_list'); } $GLOBALS['wp_object_cache']->delete('tmomatic_rules_list', 'options'); $rules = get_option('tmomatic_rules_list'); if(!is_array($rules)) { $rules = array(); } $output = ''; $cont = 0; if (!empty($rules)) { $posted_items = array(); $post_list = array(); $postsPerPage = 50000; $paged = 0; do { $postOffset = $paged * $postsPerPage; $query = array( 'post_status' => array( 'publish', 'draft', 'pending', 'trash', 'private', 'future' ), 'post_type' => array( 'any' ), 'numberposts' => $postsPerPage, 'meta_key' => 'tmomatic_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, 'tmomatic_parent_rule', true); $exp = explode('-', $rule_id); if(isset($exp[0]) && isset($exp[1]) && $exp[0] == '0') { $posted_items[] = $exp[1]; } } wp_suspend_cache_addition(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]);}} $limit_title_word_count = $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]; $date = $array_my_values[19]; $strip_images = $array_my_values[20]; $stateCode = $array_my_values[21]; $address = $array_my_values[22]; $locale = $array_my_values[23]; $custom_fields = $array_my_values[24]; $continue_search = $array_my_values[25]; $pcountry = $array_my_values[26]; $sort = $array_my_values[27]; $start_date = $array_my_values[28]; $end_date = $array_my_values[29]; $sale_start_date = $array_my_values[30]; $sale_end_date = $array_my_values[31]; $city = $array_my_values[32]; $countryCode = $array_my_values[33]; $classification = $array_my_values[34]; $source = $array_my_values[35]; $venue_id = $array_my_values[36]; $remove_default = $array_my_values[37]; $custom_tax = $array_my_values[38]; $parent_id = $array_my_values[39]; wp_add_inline_script('tmomatic-footer-script', 'createAdmin(' . esc_html($cont) . ');', 'after'); $output .= '<tr> <td class="cr_short_td">' . esc_html($cont) . '</td> <td class="cr_70_150"><input type="text" name="tmomatic_rules_list[date][]" class="cr_width_full" placeholder="Select your query" value="' . esc_attr($date) . '" class="cr_width_full"/></td> <td class="cr_comm_td"><input type="number" step="1" min="1" placeholder="# h" name="tmomatic_rules_list[schedule][]" max="8765812" value="' . esc_attr($schedule) . '" class="cr_width_60" required></td> <td class="cr_author"><input type="number" min="0" step="1" max="50" name="tmomatic_rules_list[max][]" value="' . esc_attr($max) . '" class="cr_width_full"/></td> <td class="cr_status"><select id="submit_status" name="tmomatic_rules_list[submit_status][]" class="cr_width_70"> <option value="pending"'; if ($status == 'pending') { $output .= ' selected'; } $output .= '>' . esc_html__("Pending -> Moderate", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="draft"'; if ($status == 'draft') { $output .= ' selected'; } $output .= '>' . esc_html__("Draft -> Moderate", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="publish"'; if ($status == 'publish') { $output .= ' selected'; } $output .= '>' . esc_html__("Published", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="private"'; if ($status == 'private') { $output .= ' selected'; } $output .= '>' . esc_html__("Private", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="trash"'; if ($status == 'trash') { $output .= ' selected'; } $output .= '>' . esc_html__("Trash", 'tmomatic-ticketmaster-post-generator') . '</option> </select> </td> <td class="cr_comm_td"><select id="default_type" name="tmomatic_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> </td> <td class="cr_author"><select id="post_author" name="tmomatic_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> </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="tmomatic_close' . esc_html($cont) . '" class="codeclosefzr">×</span> <h2>' . esc_html__('Rule', 'tmomatic-ticketmaster-post-generator') . ' <span class="cr_color_white">ID ' . esc_html($cont) . '</span> ' . esc_html__('Advanced Settings', 'tmomatic-ticketmaster-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: %%start_date%%, %%start_time%%, %%end_date%%, %%city%%, %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_description%%, %%item_title%%, %%item_url%%", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Generated Post Title", 'tmomatic-ticketmaster-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="tmomatic_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: %%start_date%%, %%start_time%%, %%end_date%%, %%city%%, %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_read_more_button%%, %%item_url%%, %%item_show_image%%, %%item_image_URL%%, %%item_date%%, %%item_title%%, %%item_start_date_local%%, %%item_please_note%%, %%venue_city%%, %%venue_country%%,, %%item_venue_address%%, %%item_venue_latitude%%, %%item_venue_longitude%%, %%item_openHoursDetail%%, %%item_willCallDetail%%, %%item_parkingDetail%%, %%item_accessibleSeatingDetail%%, %%item_generalInfo%%, %%item_childRule%%, %%item_adaPhones%%, %%item_adaCustomCopy%%, %%item_adaHours%%, %%item_seatmap_image_url%%, %%item_promoter%%, %%item_venues%%, %%item_attractions%% %%item_event_type%%, %%item_currency%%, %%item_min_price%%, %%item_max_price%%, %%item_sales_start%%, %%item_sales_end%%, %%item_presales_start%%, %%item_presales_end%%, %%item_locale%%, %%item_classification%%, %%item_classification_genre%%, %%item_classification_subgenre%%, %%item_cat%%, %%item_tags%%", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Generated Post Content", 'tmomatic-ticketmaster-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="tmomatic_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 sort resulting events?", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Sort Results By", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <select id="sort" name="tmomatic_rules_list[sort][]" class="cr_width_full"> <option value="any"'; if($sort == 'any') { $output .= ' selected'; } $output .= '>' . esc_html__("No Sort", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="name,asc"'; if($sort == 'name,asc') { $output .= ' selected'; } $output .= '>' . esc_html__("Name - Ascending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="name,desc"'; if($sort == 'name,desc') { $output .= ' selected'; } $output .= '>' . esc_html__("Name - Descending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="date,asc"'; if($sort == 'date,asc') { $output .= ' selected'; } $output .= '>' . esc_html__("Date - Ascending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="date,desc"'; if($sort == 'date,desc') { $output .= ' selected'; } $output .= '>' . esc_html__("Date - Descending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="relevance,asc"'; if($sort == 'relevance,asc') { $output .= ' selected'; } $output .= '>' . esc_html__("Relevance - Ascending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="relevance,desc"'; if($sort == 'relevance,desc') { $output .= ' selected'; } $output .= '>' . esc_html__("Relevance - Descending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="distance,asc"'; if($sort == 'distance,asc') { $output .= ' selected'; } $output .= '>' . esc_html__("Distance - Ascending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="name,date,asc"'; if($sort == 'name,date,asc') { $output .= ' selected'; } $output .= '>' . esc_html__("Name & Date - Ascending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="name,date,desc"'; if($sort == 'name,date,desc') { $output .= ' selected'; } $output .= '>' . esc_html__("Name & Date - Descending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="date,name,asc"'; if($sort == 'date,name,asc') { $output .= ' selected'; } $output .= '>' . esc_html__("Date & Name - Ascending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="date,name,desc"'; if($sort == 'date,name,desc') { $output .= ' selected'; } $output .= '>' . esc_html__("Date & Name - Descending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="onsaleStartDate,asc"'; if($sort == 'onsaleStartDate,asc') { $output .= ' selected'; } $output .= '>' . esc_html__("Sale Start Date - Ascending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="id,asc"'; if($sort == 'id,asc') { $output .= ' selected'; } $output .= '>' . esc_html__("ID - Ascending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="venueName,asc"'; if($sort == 'venueName,asc') { $output .= ' selected'; } $output .= '>' . esc_html__("Venue Name - Ascending", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="venueName,desc"'; if($sort == 'venueName,desc') { $output .= ' selected'; } $output .= '>' . esc_html__("Venue Name - Descending", 'tmomatic-ticketmaster-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 select a source for events?", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Events Source", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <select id="source" name="tmomatic_rules_list[source][]" class="cr_width_full"> <option value="any"'; if($source == 'any') { $output .= ' selected'; } $output .= '>' . esc_html__("Any", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="ticketmaster"'; if($source == 'ticketmaster') { $output .= ' selected'; } $output .= '>' . esc_html__("TicketMaster", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="universe"'; if($source == 'universe') { $output .= ' selected'; } $output .= '>' . esc_html__("Universe", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="frontgate"'; if($source == 'frontgate') { $output .= ' selected'; } $output .= '>' . esc_html__("Frontgate", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="tmr"'; if($source == 'tmr') { $output .= ' selected'; } $output .= '>' . esc_html__("TMR", 'tmomatic-ticketmaster-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 remember last posted item and continue search from it the next time the importing rule runs?", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Cache Items For Continuous Posting (disable to get latest posts only)", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="checkbox" id="continue_search" name="tmomatic_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 postal code of the location where you want to search for events.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Event Location Postal Code", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="text" id="address" name="tmomatic_rules_list[address][]" value="' . esc_attr($address) . '" placeholder="Please insert a postal code" 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__("Select the venue ID where you want to search for events", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Filter Events By Venue ID", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="text" id="venue_id" name="tmomatic_rules_list[venue_id][]" value="' . esc_attr($venue_id) . '" placeholder="Please insert a venue 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__("Select the locale of the results. The locale in ISO code format. Multiple comma-separated values can be provided. When omitting the country part of the code (e.g. only \'en\' or \'fr\') then the first matching locale is used. When using a \'*\' it matches all locales. \'*\' can only be used at the end (e.g. \'en-us,en,*\'). Default value is: en", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Event Locale", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="text" id="locale" name="tmomatic_rules_list[locale][]" value="' . esc_attr($locale) . '" placeholder="Please insert a locale" 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__("Filter with a start date after this date.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Event Start Date", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="text" id="start_date" name="tmomatic_rules_list[start_date][]" value="' . esc_attr($start_date) . '" placeholder="Please insert a start date" 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__("Filter with a start date before this date.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Event End Date", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="text" id="end_date" name="tmomatic_rules_list[end_date][]" value="' . esc_attr($end_date) . '" placeholder="Please insert a end date" 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__("Filter with onsale start date after this date.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Event Sale Start Date", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="text" id="sale_start_date" name="tmomatic_rules_list[sale_start_date][]" value="' . esc_attr($sale_start_date) . '" placeholder="Please insert a sale start date" 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__("Filter with onsale end date before this date.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Event Sale End Date", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="text" id="sale_end_date" name="tmomatic_rules_list[sale_end_date][]" value="' . esc_attr($sale_end_date) . '" placeholder="Please insert a sale end date" 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__("Please input the event\' city.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Event City", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="text" id="city" name="tmomatic_rules_list[city][]" value="' . esc_attr($city) . '" placeholder="Please insert a city" 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__("The country code of the event. This should be a 2 letter notation of the respective country.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Event Country Code", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="text" id="countryCode" name="tmomatic_rules_list[countryCode][]" value="' . esc_attr($countryCode) . '" placeholder="Please insert a country code" 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__("Filter results by event state code.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Event State Code", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="text" id="stateCode" name="tmomatic_rules_list[stateCode][]" value="' . esc_attr($stateCode) . '" placeholder="Please insert an event state code" 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__("Filter by classification name: name of any segment, genre, sub-genre, type, sub-type. Negative filtering is supported by using the following format \'-\'. Be aware that negative filters may cause decreased performance.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Event Classification Name", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="text" id="classification" name="tmomatic_rules_list[classification][]" value="' . esc_attr($classification) . '" placeholder="Please insert a classification name" 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__("Popularity boost by country, default is us.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Preffered Country", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <select id="pcountry" name="tmomatic_rules_list[pcountry][]" class="cr_width_full"> <option value="us"'; if ($pcountry == 'us') { $output .= ' selected'; } $output .= '>' . esc_html__("US", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="ca"'; if ($pcountry == 'ca') { $output .= ' selected'; } $output .= '>' . esc_html__("Canada", 'tmomatic-ticketmaster-post-generator') . '</option> </select> </div> </td></tr><tr><td colspan="2"><hr/> </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?", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Strip Images From Content", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="checkbox" id="strip_images" name="tmomatic_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 limit the title\'s length to a specific word count? To disable this feature, leave this field blank.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Limit Title Word Count", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="number" min="1" step="1" id="limit_title_word_count" name="tmomatic_rules_list[limit_title_word_count][]" value="' . esc_attr($limit_title_word_count) . '" placeholder="Please insert a title limit count" 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__('If your template supports "Post Formats", than you can select one here. If not, leave this at it\'s default value.', 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Generated Post Format", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <select id="post_format" name="tmomatic_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", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="post-format-aside"'; if ($post_format == 'post-format-aside') { $output .= ' selected'; } $output .= '>' . esc_html__("Aside", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="post-format-gallery"'; if ($post_format == 'post-format-gallery') { $output .= ' selected'; } $output .= '>' . esc_html__("Gallery", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="post-format-link"'; if ($post_format == 'post-format-link') { $output .= ' selected'; } $output .= '>' . esc_html__("Link", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="post-format-image"'; if ($post_format == 'post-format-image') { $output .= ' selected'; } $output .= '>' . esc_html__("Image", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="post-format-quote"'; if ($post_format == 'post-format-quote') { $output .= ' selected'; } $output .= '>' . esc_html__("Quote", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="post-format-status"'; if ($post_format == 'post-format-status') { $output .= ' selected'; } $output .= '>' . esc_html__("Status", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="post-format-video"'; if ($post_format == 'post-format-video') { $output .= ' selected'; } $output .= '>' . esc_html__("Video", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="post-format-audio"'; if ($post_format == 'post-format-audio') { $output .= ' selected'; } $output .= '>' . esc_html__("Audio", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="post-format-chat"'; if ($post_format == 'post-format-chat') { $output .= ' selected'; } $output .= '>' . esc_html__("Chat", 'tmomatic-ticketmaster-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__("Set the ID of the parent of created posts. This is useful for BBPress integration, to assign forum IDs for created topics or for other similar functionalities.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Post Parent ID", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="text" class="cr_width_full" name="tmomatic_rules_list[parent_id][]" value="' . esc_attr($parent_id) . '" placeholder="Post parent ID" 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__("Select the post category that you want for the automatically generated posts to have.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Additional Post Category", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <select class="cr_width_full" id="default_category" name="tmomatic_rules_list[default_category][]"> <option value="tmomatic_no_category_12345678">' . esc_html__("Do Not Add a Category", 'tmomatic-ticketmaster-post-generator') . '</option>'; $cat_args = array( "orderby" => "name", "hide_empty" => 0, "order" => "ASC" ); $categories = get_categories($cat_args); foreach ($categories as $category) { $output .= '<option value="' . esc_attr($category->term_id) . '"'; if ($category->term_id == $default_category) { $output .= ' selected'; } $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?", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Auto Add Categories", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <select id="auto_categories" name="tmomatic_rules_list[auto_categories][]" class="cr_width_full"> <option value="disabled"'; if ($auto_categories == 'disabled') { $output .= ' selected'; } $output .= '>' . esc_html__("Disabled", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="title"'; if ($auto_categories == 'title') { $output .= ' selected'; } $output .= '>' . esc_html__("Title", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="classification"'; if ($auto_categories == 'classification') { $output .= ' selected'; } $output .= '>' . esc_html__("Classification - Segment", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="classification-genre"'; if ($auto_categories == 'classification-genre') { $output .= ' selected'; } $output .= '>' . esc_html__("Classification - Genre", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="classification-subgenre"'; if ($auto_categories == 'classification-subgenre') { $output .= ' selected'; } $output .= '>' . esc_html__("Classification - SubGenre", 'tmomatic-ticketmaster-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__("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.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Remove WP Default Post Category", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="checkbox" id="remove_default" name="tmomatic_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__("Do you want to automatically add post tags from the feed items?", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Auto Add Tags", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <select id="auto_tags" name="tmomatic_rules_list[auto_tags][]" class="cr_width_full"> <option value="disabled"'; if ($auto_tags == 'disabled') { $output .= ' selected'; } $output .= '>' . esc_html__("Disabled", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="title"'; if ($auto_tags == 'title') { $output .= ' selected'; } $output .= '>' . esc_html__("Title", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="classification"'; if ($auto_tags == 'classification') { $output .= ' selected'; } $output .= '>' . esc_html__("Classification - Segment", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="classification-genre"'; if ($auto_tags == 'classification-genre') { $output .= ' selected'; } $output .= '>' . esc_html__("Classification - Genre", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="classification-subgenre"'; if ($auto_tags == 'classification-subgenre') { $output .= ' selected'; } $output .= '>' . esc_html__("Classification - SubGenre", 'tmomatic-ticketmaster-post-generator') . '</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 post tags that you want for the automatically generated posts to have.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Additional Post Tags", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input class="cr_width_full" type="text" name="tmomatic_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?", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Enable Comments For Posts", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="checkbox" id="enable_comments" name="tmomatic_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?", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Enable Pingback/Trackback", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="checkbox" id="enable_pingback" name="tmomatic_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: %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_read_more_button%%, %%item_url%%, %%item_show_image%%, %%item_image_URL%%, %%item_date%%, %%item_title%%, %%item_start_date_local%%, %%item_please_note%%, %%venue_city%%, %%venue_country%%,, %%item_venue_address%%, %%item_venue_latitude%%, %%item_venue_longitude%%, %%item_openHoursDetail%%, %%item_willCallDetail%%, %%item_parkingDetail%%, %%item_accessibleSeatingDetail%%, %%item_generalInfo%%, %%item_childRule%%, %%item_adaPhones%%, %%item_adaCustomCopy%%, %%item_adaHours%%, %%item_seatmap_image_url%%, %%item_promoter%%, %%item_venues%%, %%item_attractions%% %%item_event_type%%, %%item_currency%%, %%item_min_price%%, %%item_max_price%%, %%item_sales_start%%, %%item_sales_end%%, %%item_presales_start%%, %%item_presales_end%%, %%item_locale%%, %%item_classification%%, %%item_classification_genre%%, %%item_classification_subgenre%%, %%item_cat%%, %%item_tags%%", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Post Custom Fields", 'tmomatic-ticketmaster-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="tmomatic_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, %%item_title%%; tags_taxonomy_field => manualtax2, %%item_title%%\'. You can use the following shortcodes: %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%item_description%%, %%item_content%%, %%item_content_plain_text%%, %%item_read_more_button%%, %%item_url%%, %%item_show_image%%, %%item_image_URL%%, %%item_date%%, %%item_title%%, %%item_start_date_local%%, %%item_please_note%%, %%venue_city%%, %%venue_country%%,, %%item_venue_address%%, %%item_venue_latitude%%, %%item_venue_longitude%%, %%item_openHoursDetail%%, %%item_willCallDetail%%, %%item_parkingDetail%%, %%item_accessibleSeatingDetail%%, %%item_generalInfo%%, %%item_childRule%%, %%item_adaPhones%%, %%item_adaCustomCopy%%, %%item_adaHours%%, %%item_seatmap_image_url%%, %%item_promoter%%, %%item_venues%%, %%item_attractions%% %%item_event_type%%, %%item_currency%%, %%item_min_price%%, %%item_max_price%%, %%item_sales_start%%, %%item_sales_end%%, %%item_presales_start%%, %%item_presales_end%%, %%item_locale%%, %%item_classification%%, %%item_classification_genre%%, %%item_classification_subgenre%%, %%item_cat%%, %%item_tags%%", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Post Custom Taxonomies", 'tmomatic-ticketmaster-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="tmomatic_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)? This works only when \'Get Full Content\' is also checked.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Auto Get Featured Image", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input type="checkbox" id="featured_image" name="tmomatic_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.", 'tmomatic-ticketmaster-post-generator') . ' </div> </div> <b>' . esc_html__("Default Featured Image List", 'tmomatic-ticketmaster-post-generator') . ':</b> </td><td> <input class="cr_width_full" type="text" name="tmomatic_rules_list[image_url][]" placeholder="Please insert the link to a valid image" value="' . esc_attr($image_url) . '"/> </td></tr></table></div> </div> <div class="codemodalfzr-footer"> <br/> <h3 class="cr_inline">Tmomatic Automatic Post Generator</h3><span id="tmomatic_ok' . esc_html($cont) . '" class="codeokfzr cr_inline">OK </span> <br/><br/> </div> </div> </div> </td> <td class="cr_shrt_td2"><span class="wptmomatic-delete">X</span></td> <td class="cr_short_td"><input type="checkbox" name="tmomatic_rules_list[active][]" class="activateDeactivateClass" value="1"'; if (isset($active) && $active === '1') { $output .= ' checked'; } $output .= '/> <input type="hidden" name="tmomatic_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):', 'tmomatic-ticketmaster-post-generator'), array( 'br' => array( ) ) ) ) . '<br/><b>%%tmomatic_0_' . esc_html($cont) . '%% and %%tmomatic_title_0_' . esc_html($cont) . '%%</b><br/>' . esc_html__('Posts Generated:', 'tmomatic-ticketmaster-post-generator') . ' ' . esc_html($generated_posts) . '<br/>'; if ($generated_posts != 0) { $output .= '<a href="' . get_admin_url() . 'edit.php?coderevolution_post_source=Tmomatic_0_' . esc_html($cont) . '&post_type=' . esc_html($def_type) . '" target="_blank">' . esc_html__('View Generated Posts', 'tmomatic-ticketmaster-post-generator') . '</a><br/>'; } $output .= esc_html__('Last Run: ', 'tmomatic-ticketmaster-post-generator'); if ($last_run == '1988-01-27 00:00:00') { $output .= 'Never'; } else { $output .= $last_run; } $output .= '<br/>' . esc_html__('Next Run: ', 'tmomatic-ticketmaster-post-generator'); $nextrun = tmomatic_add_hour($last_run, $schedule); $now = tmomatic_get_date_now(); if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) { $output .= esc_html__('WP-CRON Disabled. Rules will not automatically run!', 'tmomatic-ticketmaster-post-generator'); } else { if (isset($active) && $active === '1') { $tmomatic_hour_diff = (int) tmomatic_hour_diff($now, $nextrun); if ($tmomatic_hour_diff >= 0) { $append = 'Now.'; $cron = _get_cron_array(); if ($cron != FALSE) { $date_format = _x('Y-m-d H:i:s', 'Date Time Format1', 'tmomatic-ticketmaster-post-generator'); foreach ($cron as $timestamp => $cronhooks) { foreach ((array) $cronhooks as $hook => $events) { if ($hook == 'tmomaticaction') { foreach ((array) $events as $key => $event) { $append = date_i18n($date_format, $timestamp); } } } } } $output .= $append; } else { $output .= $nextrun; } } else { $output .= esc_html__('Rule Disabled', 'tmomatic-ticketmaster-post-generator'); } } $output .= '<br/>' . esc_html__('Local Time: ', 'tmomatic-ticketmaster-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(array($cont => 0), $running)) { $output .= ' cr_hidden'; } else { $f = fopen(get_temp_dir() . 'tmomatic_0_' . $cont, 'w'); if($f !== false) { if (!flock($f, LOCK_EX | LOCK_NB)) { } else { $output .= ' cr_hidden'; flock($f, LOCK_UN); if (($xxkey = array_search(array($cont => 0), $running)) !== false) { unset($running[$xxkey]); update_option('tmomatic_running_list', $running); } } } } } else { $output .= ' cr_hidden'; } $output .= '" title="status"> <div class="codemainfzr"> <select id="actions" class="actions" name="actions" onchange="actionsChangedManual(' . esc_html($cont) . ', this.value, 0);" onfocus="this.selectedIndex = 0;"> <option value="select" disabled selected>' . esc_html__("Select an Action", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="run">' . esc_html__("Run This Rule Now", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="trash">' . esc_html__("Move All Posts To Trash", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="duplicate">' . esc_html__("Duplicate This Rule", 'tmomatic-ticketmaster-post-generator') . '</option> <option value="delete">' . esc_html__("Permanently Delete All Posts", 'tmomatic-ticketmaster-post-generator') . '</option> </select> </div> </div> </td> </tr> '; $cont = $cont + 1; } } return $output; } ?>
Save File
Cancel