Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/aimogen-pro/res/aiomatic-reply-list.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 + function aiomatic_reply_panel()
3 + {
4 + $aiomatic_language_names = array(
5 + esc_html__("English", 'aiomatic-automatic-ai-content-writer'),
6 + esc_html__("Spanish", 'aiomatic-automatic-ai-content-writer'),
7 + esc_html__("French", 'aiomatic-automatic-ai-content-writer'),
8 + esc_html__("Italian", 'aiomatic-automatic-ai-content-writer'),
9 + esc_html__("Afrikaans", 'aiomatic-automatic-ai-content-writer'),
10 + esc_html__("Albanian", 'aiomatic-automatic-ai-content-writer'),
11 + esc_html__("Arabic", 'aiomatic-automatic-ai-content-writer'),
12 + esc_html__("Amharic", 'aiomatic-automatic-ai-content-writer'),
13 + esc_html__("Armenian", 'aiomatic-automatic-ai-content-writer'),
14 + esc_html__("Belarusian", 'aiomatic-automatic-ai-content-writer'),
15 + esc_html__("Bulgarian", 'aiomatic-automatic-ai-content-writer'),
16 + esc_html__("Catalan", 'aiomatic-automatic-ai-content-writer'),
17 + esc_html__("Chinese Simplified", 'aiomatic-automatic-ai-content-writer'),
18 + esc_html__("Croatian", 'aiomatic-automatic-ai-content-writer'),
19 + esc_html__("Czech", 'aiomatic-automatic-ai-content-writer'),
20 + esc_html__("Danish", 'aiomatic-automatic-ai-content-writer'),
21 + esc_html__("Dutch", 'aiomatic-automatic-ai-content-writer'),
22 + esc_html__("Estonian", 'aiomatic-automatic-ai-content-writer'),
23 + esc_html__("Filipino", 'aiomatic-automatic-ai-content-writer'),
24 + esc_html__("Finnish", 'aiomatic-automatic-ai-content-writer'),
25 + esc_html__("Galician", 'aiomatic-automatic-ai-content-writer'),
26 + esc_html__("German", 'aiomatic-automatic-ai-content-writer'),
27 + esc_html__("Greek", 'aiomatic-automatic-ai-content-writer'),
28 + esc_html__("Hebrew", 'aiomatic-automatic-ai-content-writer'),
29 + esc_html__("Hindi", 'aiomatic-automatic-ai-content-writer'),
30 + esc_html__("Hungarian", 'aiomatic-automatic-ai-content-writer'),
31 + esc_html__("Icelandic", 'aiomatic-automatic-ai-content-writer'),
32 + esc_html__("Indonesian", 'aiomatic-automatic-ai-content-writer'),
33 + esc_html__("Irish", 'aiomatic-automatic-ai-content-writer'),
34 + esc_html__("Japanese", 'aiomatic-automatic-ai-content-writer'),
35 + esc_html__("Korean", 'aiomatic-automatic-ai-content-writer'),
36 + esc_html__("Latvian", 'aiomatic-automatic-ai-content-writer'),
37 + esc_html__("Lithuanian", 'aiomatic-automatic-ai-content-writer'),
38 + esc_html__("Norwegian", 'aiomatic-automatic-ai-content-writer'),
39 + esc_html__("Macedonian", 'aiomatic-automatic-ai-content-writer'),
40 + esc_html__("Malay", 'aiomatic-automatic-ai-content-writer'),
41 + esc_html__("Maltese", 'aiomatic-automatic-ai-content-writer'),
42 + esc_html__("Persian", 'aiomatic-automatic-ai-content-writer'),
43 + esc_html__("Polish", 'aiomatic-automatic-ai-content-writer'),
44 + esc_html__("Portuguese", 'aiomatic-automatic-ai-content-writer'),
45 + esc_html__("Romanian", 'aiomatic-automatic-ai-content-writer'),
46 + esc_html__("Russian", 'aiomatic-automatic-ai-content-writer'),
47 + esc_html__("Serbian", 'aiomatic-automatic-ai-content-writer'),
48 + esc_html__("Slovak", 'aiomatic-automatic-ai-content-writer'),
49 + esc_html__("Slovenian", 'aiomatic-automatic-ai-content-writer'),
50 + esc_html__("Swahili", 'aiomatic-automatic-ai-content-writer'),
51 + esc_html__("Swedish", 'aiomatic-automatic-ai-content-writer'),
52 + esc_html__("Thai", 'aiomatic-automatic-ai-content-writer'),
53 + esc_html__("Turkish", 'aiomatic-automatic-ai-content-writer'),
54 + esc_html__("Ukrainian", 'aiomatic-automatic-ai-content-writer'),
55 + esc_html__("Vietnamese", 'aiomatic-automatic-ai-content-writer'),
56 + esc_html__("Welsh", 'aiomatic-automatic-ai-content-writer'),
57 + esc_html__("Yiddish", 'aiomatic-automatic-ai-content-writer'),
58 + esc_html__("Tamil", 'aiomatic-automatic-ai-content-writer'),
59 + esc_html__("Azerbaijani", 'aiomatic-automatic-ai-content-writer'),
60 + esc_html__("Kannada", 'aiomatic-automatic-ai-content-writer'),
61 + esc_html__("Basque", 'aiomatic-automatic-ai-content-writer'),
62 + esc_html__("Bengali", 'aiomatic-automatic-ai-content-writer'),
63 + esc_html__("Latin", 'aiomatic-automatic-ai-content-writer'),
64 + esc_html__("Chinese Traditional", 'aiomatic-automatic-ai-content-writer'),
65 + esc_html__("Esperanto", 'aiomatic-automatic-ai-content-writer'),
66 + esc_html__("Georgian", 'aiomatic-automatic-ai-content-writer'),
67 + esc_html__("Telugu", 'aiomatic-automatic-ai-content-writer'),
68 + esc_html__("Gujarati", 'aiomatic-automatic-ai-content-writer'),
69 + esc_html__("Haitian Creole", 'aiomatic-automatic-ai-content-writer'),
70 + esc_html__("Urdu", 'aiomatic-automatic-ai-content-writer'),
71 + esc_html__("Burmese", 'aiomatic-automatic-ai-content-writer'),
72 + esc_html__("Bosnian", 'aiomatic-automatic-ai-content-writer'),
73 + esc_html__("Cebuano", 'aiomatic-automatic-ai-content-writer'),
74 + esc_html__("Chichewa", 'aiomatic-automatic-ai-content-writer'),
75 + esc_html__("Corsican", 'aiomatic-automatic-ai-content-writer'),
76 + esc_html__("Frisian", 'aiomatic-automatic-ai-content-writer'),
77 + esc_html__("Scottish Gaelic", 'aiomatic-automatic-ai-content-writer'),
78 + esc_html__("Hausa", 'aiomatic-automatic-ai-content-writer'),
79 + esc_html__("Hawaian", 'aiomatic-automatic-ai-content-writer'),
80 + esc_html__("Hmong", 'aiomatic-automatic-ai-content-writer'),
81 + esc_html__("Igbo", 'aiomatic-automatic-ai-content-writer'),
82 + esc_html__("Javanese", 'aiomatic-automatic-ai-content-writer'),
83 + esc_html__("Kazakh", 'aiomatic-automatic-ai-content-writer'),
84 + esc_html__("Khmer", 'aiomatic-automatic-ai-content-writer'),
85 + esc_html__("Kurdish", 'aiomatic-automatic-ai-content-writer'),
86 + esc_html__("Kyrgyz", 'aiomatic-automatic-ai-content-writer'),
87 + esc_html__("Lao", 'aiomatic-automatic-ai-content-writer'),
88 + esc_html__("Luxembourgish", 'aiomatic-automatic-ai-content-writer'),
89 + esc_html__("Malagasy", 'aiomatic-automatic-ai-content-writer'),
90 + esc_html__("Malayalam", 'aiomatic-automatic-ai-content-writer'),
91 + esc_html__("Maori", 'aiomatic-automatic-ai-content-writer'),
92 + esc_html__("Marathi", 'aiomatic-automatic-ai-content-writer'),
93 + esc_html__("Mongolian", 'aiomatic-automatic-ai-content-writer'),
94 + esc_html__("Nepali", 'aiomatic-automatic-ai-content-writer'),
95 + esc_html__("Pashto", 'aiomatic-automatic-ai-content-writer'),
96 + esc_html__("Punjabi", 'aiomatic-automatic-ai-content-writer'),
97 + esc_html__("Samoan", 'aiomatic-automatic-ai-content-writer'),
98 + esc_html__("Sesotho", 'aiomatic-automatic-ai-content-writer'),
99 + esc_html__("Shona", 'aiomatic-automatic-ai-content-writer'),
100 + esc_html__("Sindhi", 'aiomatic-automatic-ai-content-writer'),
101 + esc_html__("Sinhala", 'aiomatic-automatic-ai-content-writer'),
102 + esc_html__("Somali", 'aiomatic-automatic-ai-content-writer'),
103 + esc_html__("Sundanese", 'aiomatic-automatic-ai-content-writer'),
104 + esc_html__("Swahili", 'aiomatic-automatic-ai-content-writer'),
105 + esc_html__("Tajik", 'aiomatic-automatic-ai-content-writer'),
106 + esc_html__("Uzbek", 'aiomatic-automatic-ai-content-writer'),
107 + esc_html__("Xhosa", 'aiomatic-automatic-ai-content-writer'),
108 + esc_html__("Yoruba", 'aiomatic-automatic-ai-content-writer'),
109 + esc_html__("Zulu", 'aiomatic-automatic-ai-content-writer'),
110 + esc_html__("Assammese", 'aiomatic-automatic-ai-content-writer'),
111 + esc_html__("Aymara", 'aiomatic-automatic-ai-content-writer'),
112 + esc_html__("Bambara", 'aiomatic-automatic-ai-content-writer'),
113 + esc_html__("Bhojpuri", 'aiomatic-automatic-ai-content-writer'),
114 + esc_html__("Dhivehi", 'aiomatic-automatic-ai-content-writer'),
115 + esc_html__("Dogri", 'aiomatic-automatic-ai-content-writer'),
116 + esc_html__("Ewe", 'aiomatic-automatic-ai-content-writer'),
117 + esc_html__("Guarani", 'aiomatic-automatic-ai-content-writer'),
118 + esc_html__("Ilocano", 'aiomatic-automatic-ai-content-writer'),
119 + esc_html__("Kinyarwanda", 'aiomatic-automatic-ai-content-writer'),
120 + esc_html__("Konkani", 'aiomatic-automatic-ai-content-writer'),
121 + esc_html__("Krio", 'aiomatic-automatic-ai-content-writer'),
122 + esc_html__("Kurdish - Sorani", 'aiomatic-automatic-ai-content-writer'),
123 + esc_html__("Lingala", 'aiomatic-automatic-ai-content-writer'),
124 + esc_html__("Luganda", 'aiomatic-automatic-ai-content-writer'),
125 + esc_html__("Maithili", 'aiomatic-automatic-ai-content-writer'),
126 + esc_html__("Meiteilon", 'aiomatic-automatic-ai-content-writer'),
127 + esc_html__("Mizo", 'aiomatic-automatic-ai-content-writer'),
128 + esc_html__("Odia", 'aiomatic-automatic-ai-content-writer'),
129 + esc_html__("Oromo", 'aiomatic-automatic-ai-content-writer'),
130 + esc_html__("Quechua", 'aiomatic-automatic-ai-content-writer'),
131 + esc_html__("Sanskrit", 'aiomatic-automatic-ai-content-writer'),
132 + esc_html__("Sepedi", 'aiomatic-automatic-ai-content-writer'),
133 + esc_html__("Tatar", 'aiomatic-automatic-ai-content-writer'),
134 + esc_html__("Tigrinya", 'aiomatic-automatic-ai-content-writer'),
135 + esc_html__("Tsonga", 'aiomatic-automatic-ai-content-writer'),
136 + esc_html__("Turkmen", 'aiomatic-automatic-ai-content-writer'),
137 + esc_html__("Twi", 'aiomatic-automatic-ai-content-writer'),
138 + esc_html__("Uyghur", 'aiomatic-automatic-ai-content-writer')
139 + );
140 + $all_models = aiomatic_get_all_models(true);
141 + $all_assistants = aiomatic_get_all_assistants(true);
142 + $all_rules = get_option('aiomatic_reply_list', array());
143 + if($all_rules === false)
144 + {
145 + $all_rules = array();
146 + }
147 + $rules_count = count($all_rules);
148 + $rules_per_page = get_option('aiomatic_posts_per_page', 12);
149 + $max_pages = ceil($rules_count/$rules_per_page);
150 + if($max_pages == 0)
151 + {
152 + $max_pages = 1;
153 + }
154 + $aiomatic_Main_Settings = get_option('aiomatic_Main_Settings', false);
155 + if (!isset($aiomatic_Main_Settings['app_id']) || trim($aiomatic_Main_Settings['app_id']) == '')
156 + {
157 + ?>
158 + <h1><?php echo esc_html__("You must add an OpenAI/AiomaticAPI API Key into the plugin's 'Settings' menu before you can use this feature!", 'aiomatic-automatic-ai-content-writer');?></h1>
159 + <?php
160 + return;
161 + }
162 + if ( ! function_exists( 'is_plugin_active' ) ) {
163 + include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
164 + }
165 + if ( !is_plugin_active( 'wpforo/wpforo.php' ) )
166 + {
167 + ?><div style="padding:20px; border-radius:12px; background:#f9f9f9; border:1px solid #ddd; text-align:center; max-width:600px; margin:20px auto;">
168 + <h2 style="margin-bottom:10px; color:#333;">
169 + <?php echo esc_html__('wpForo Plugin Required', 'aiomatic-automatic-ai-content-writer'); ?>
170 + </h2>
171 + <p style="margin-bottom:15px; color:#555; font-size:15px;">
172 + <?php echo esc_html__('This functionality is only available if the wpForo plugin is active.', 'aiomatic-automatic-ai-content-writer'); ?>
173 + </p>
174 + <a href="https://wordpress.org/plugins/wpforo/" target="_blank"
175 + style="display:inline-block; padding:10px 20px; background:#0073aa; color:#fff; text-decoration:none; border-radius:6px; font-weight:bold;">
176 + <?php echo esc_html__('Download Plugin', 'aiomatic-automatic-ai-content-writer'); ?>
177 + </a>
178 + </div>
179 + <?php
180 + return;
181 + }
182 + if ( !is_plugin_active( 'aiomatic-extension-wpforo/aiomatic-extension-wpforo.php' ) )
183 + {
184 + ?><div style="padding:20px; border-radius:12px; background:#f9f9f9; border:1px solid #ddd; text-align:center; max-width:600px; margin:20px auto;">
185 + <h2 style="margin-bottom:10px; color:#333;">
186 + <?php echo esc_html__('AI Forum Creator Extension Required', 'aiomatic-automatic-ai-content-writer'); ?>
187 + </h2>
188 + <p style="margin-bottom:15px; color:#555; font-size:15px;">
189 + <?php echo esc_html__('This functionality is only available if the Aimogen AI Forum Creator Extension plugin is active.', 'aiomatic-automatic-ai-content-writer'); ?>
190 + </p>
191 + <a href="https://wpbay.com/product/aiomatic-extension-wpforo-integration/" target="_blank"
192 + style="display:inline-block; padding:10px 20px; background:#0073aa; color:#fff; text-decoration:none; border-radius:6px; font-weight:bold;">
193 + <?php echo esc_html__('Purchase Plugin', 'aiomatic-automatic-ai-content-writer'); ?>
194 + </a>
195 + </div>
196 + <?php
197 + return;
198 + }
199 + $forums = WPF()->forum->get_forums();
200 + $forum_hierarchy = [];
201 + foreach ($forums as $forum) {
202 + $forum_id = intval($forum['forumid']);
203 + $parent_id = intval($forum['parentid']);
204 + $forum_hierarchy[$parent_id][] = $forum;
205 + }
206 +
207 + function aiomatic_render_forum_options($forums, $hierarchy, $selected_forum = '', $parent_id = 0, $prefix = '') {
208 + $retval = '';
209 + if (!isset($hierarchy[$parent_id])) {
210 + return $retval;
211 + }
212 + foreach ($hierarchy[$parent_id] as $forum) {
213 + $forum_id = intval($forum['forumid']);
214 + $forum_title = esc_html($forum['title']);
215 + $display_title = $prefix . $forum_title;
216 + $selected = $selected_forum == $forum_id ? 'selected' : '';
217 + $retval .= "<option value='" . esc_attr($forum_id) . "' " . esc_html($selected) . ">" . esc_html($display_title) . "</option>";
218 + $retval .= aiomatic_render_forum_options($forums, $hierarchy, $selected_forum, $forum_id, $prefix . '&nbsp;&nbsp;-> ');
219 + }
220 + return $retval;
221 + }
222 + ?>
223 + <div class="wp-header-end"></div>
224 + <div class="wrap">
225 + <h1><?php echo esc_html__("Keywords/Titles To Forum Topics", 'aiomatic-automatic-ai-content-writer');?></h1>
226 + </div>
227 + <?php
228 + $max_execution = ini_get('max_execution_time');
229 + if($max_execution != 0 && $max_execution < 1000)
230 + {
231 + ?>
232 + <div class="notice notice-error">
233 + <p class="cr_red">
234 + <?php echo sprintf( wp_kses( __( "Warning! Your PHP INI max_execution_time is less than 1000 seconds (%s). This means that the plugin's execution will be forcefully stopped by your server after this amount of seconds. Please increase it to ensure that the plugin functions properly. Please check details on server settings, <a href='%s' target='_blank'>here</a>.", 'aiomatic-automatic-ai-content-writer'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_html($max_execution), esc_url_raw( get_admin_url() . 'admin.php?page=aiomatic_logs#tab-2' ) );?>
235 + </p>
236 + </div>
237 + <?php
238 + }
239 + ?>
240 + <div class="wrap gs_popuptype_holder seo_pops">
241 + <div>
242 + <form id="myForm" method="post" action="<?php echo esc_url((aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");?>">
243 + <?php
244 + wp_nonce_field('aiomatic_save_rules', '_aiomaticr_nonce');
245 +
246 + if (isset($_GET['settings-updated'])) {
247 + ?>
248 + <div>
249 + <p class="cr_saved_notif"><strong><?php echo esc_html__("Settings saved.", 'aiomatic-automatic-ai-content-writer');?></strong></p>
250 + </div>
251 + <?php
252 + }
253 + ?>
254 + <div>
255 + <div class="hideMain">
256 + <hr/>
257 + <div class="table-responsive">
258 + <table id="mainRules" class="responsive table cr_main_table">
259 + <thead>
260 + <tr>
261 + <th class="cr_width_160">
262 + <?php echo esc_html__("ID", 'aiomatic-automatic-ai-content-writer');?>
263 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
264 + <div class="bws_hidden_help_text cr_min_260px">
265 + <?php
266 + echo esc_html__("This is the ID of the rule.", 'aiomatic-automatic-ai-content-writer');
267 + ?>
268 + </div>
269 + </div>
270 + </th>
271 + <th>
272 + <span id="aiomatic_mode_sel"><?php echo esc_html__("Forum Selector", 'aiomatic-automatic-ai-content-writer');?>*</span>
273 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
274 + <div class="bws_hidden_help_text cr_min_260px">
275 + <?php
276 + echo esc_html__("Select the forum for which you want to create the content.", 'aiomatic-automatic-ai-content-writer');
277 + ?>
278 + </div>
279 + </div>
280 + </th>
281 + <th>
282 + <span id="aiomatic_mode_title"><?php echo esc_html__("Reply Strategy", 'aiomatic-automatic-ai-content-writer');?>*</span>
283 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
284 + <div class="bws_hidden_help_text cr_min_260px">
285 + <?php
286 + echo esc_html__("Select the reply creations trategy you want to use for this rule.", 'aiomatic-automatic-ai-content-writer');
287 + ?>
288 + </div>
289 + </div>
290 + </th>
291 + <th>
292 + <?php echo esc_html__("Schedule", 'aiomatic-automatic-ai-content-writer');?>*
293 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
294 + <div class="bws_hidden_help_text cr_min_260px">
295 + <?php
296 + $unlocker = get_option('aiomatic_minute_running_unlocked', false);
297 + if($unlocker == '1')
298 + {
299 + echo esc_html__("Select the interval in minutes after which you want this rule to run. Defined in minutes.", 'aiomatic-automatic-ai-content-writer');
300 + }
301 + else
302 + {
303 + echo esc_html__("Select the interval in hours after which you want this rule to run. Defined in hours.", 'aiomatic-automatic-ai-content-writer');
304 + }
305 + ?>
306 + </div>
307 + </div>
308 + </th>
309 + <th>
310 + <?php echo esc_html__("# Of Topics To Process", 'aiomatic-automatic-ai-content-writer');?>*
311 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
312 + <div class="bws_hidden_help_text cr_min_260px">
313 + <?php
314 + echo esc_html__("Select the maximum number of topica that this rule can create at once.", 'aiomatic-automatic-ai-content-writer');
315 + ?>
316 + </div>
317 + </div>
318 + </th>
319 + <th>
320 + <?php echo esc_html__("Options", 'aiomatic-automatic-ai-content-writer');?>
321 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
322 + <div class="bws_hidden_help_text cr_min_260px">
323 + <?php
324 + echo esc_html__("Shows advanced settings for this rule.", 'aiomatic-automatic-ai-content-writer');
325 + ?>
326 + </div>
327 + </div>
328 + </th>
329 + <th class="cr_width_60">
330 + <?php echo esc_html__("Delete", 'aiomatic-automatic-ai-content-writer');?>
331 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
332 + <div class="bws_hidden_help_text cr_min_260px">
333 + <?php
334 + echo esc_html__("Do you want to delete this rule?", 'aiomatic-automatic-ai-content-writer');
335 + ?>
336 + </div>
337 + </div>
338 + </th>
339 + <th class="cr_width_60">
340 + <?php echo esc_html__("Active", 'aiomatic-automatic-ai-content-writer');?>
341 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
342 + <div class="bws_hidden_help_text cr_min_260px">
343 + <?php
344 + 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).", 'aiomatic-automatic-ai-content-writer');
345 + ?>
346 + </div>
347 + </div>
348 + <br/>
349 + <input type="checkbox" onchange="thisonChangeHandler(this)" id="exclusion">
350 + </th>
351 + <th class="cr_width_160">
352 + <?php echo esc_html__("Info", 'aiomatic-automatic-ai-content-writer');?>
353 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
354 + <div class="bws_hidden_help_text cr_min_260px">
355 + <?php
356 + echo esc_html__("The number of items (posts, pages) this rule has generated so far.", 'aiomatic-automatic-ai-content-writer');
357 + ?>
358 + </div>
359 + </div>
360 + </th>
361 + <th class="cr_actions">
362 + <?php echo esc_html__("Actions", 'aiomatic-automatic-ai-content-writer');?>
363 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
364 + <div class="bws_hidden_help_text cr_min_260px">
365 + <?php
366 + echo esc_html__("Do you want to run this rule now? Note that only one instance of a rule is allowed at once.", 'aiomatic-automatic-ai-content-writer');
367 + ?>
368 + </div>
369 + </div>
370 + </th>
371 + </tr>
372 +
373 + </thead>
374 + <tbody>
375 + <?php
376 + echo aiomatic_expand_reply_manual($aiomatic_Main_Settings, $forums, $forum_hierarchy);
377 + if(isset($_GET['aiomatic_page']))
378 + {
379 + $current_page = $_GET['aiomatic_page'];
380 + }
381 + else
382 + {
383 + $current_page = '';
384 + }
385 + if($current_page == '' || (is_numeric($current_page) && $current_page == $max_pages))
386 + {
387 + ?>
388 +
389 + <tr>
390 + <td class="cr_short_td"><input type="text" name="aiomatic_reply_list[rule_description][]" id="rule_description" class="cr_center" placeholder="Rule ID" value="" class="cr_width_full"/></td>
391 + <td class="cr_width_80 cr_center">
392 + <select autocomplete="off" id="selected_forum" name="aiomatic_reply_list[selected_forum][]" class="cr_width_full">
393 + <?php
394 + if (!empty($forums)) {
395 + echo '<option value="">' . esc_html__("Select a Forum", 'aiomatic-automatic-ai-content-writer') . '</option>';
396 + echo aiomatic_render_forum_options($forums, $forum_hierarchy);
397 + } else {
398 + echo '<option value="">' . esc_html__("No forums available", 'aiomatic-automatic-ai-content-writer') . '</option>';
399 + }
400 + ?>
401 + </select>
402 + </td>
403 + <td class="cr_loi">
404 + <select autocomplete="off" id="post_title" name="aiomatic_reply_list[post_title][]" class="cr_width_full">
405 + <option value="" disabled selected><?php echo esc_html__("Select Reply Strategy", 'aiomatic-automatic-ai-content-writer');?></option>
406 + <option value="auto_grow"><?php echo esc_html__("Auto Grow (Spawns new replies in quiet topics)", 'aiomatic-automatic-ai-content-writer');?></option>
407 + <option value="auto_unaswered"><?php echo esc_html__("Auto Unanswered (Replies to unanswered topics)", 'aiomatic-automatic-ai-content-writer');?></option>
408 + <option value="auto_random"><?php echo esc_html__("Auto Random (Replies to random topics)", 'aiomatic-automatic-ai-content-writer');?></option>
409 + <option value="auto_latest"><?php echo esc_html__("Auto Latest (Replies to latest topics)", 'aiomatic-automatic-ai-content-writer');?></option>
410 + <option value="auto_oldest"><?php echo esc_html__("Auto Oldest (Replies to oldest topics)", 'aiomatic-automatic-ai-content-writer');?></option>
411 + <option value="auto_popular"><?php echo esc_html__("Auto Most Popular (Replies to most popular topics)", 'aiomatic-automatic-ai-content-writer');?></option>
412 + <option value="auto_least_popular"><?php echo esc_html__("Auto Least Popular (Replies to least popular topics)", 'aiomatic-automatic-ai-content-writer');?></option>
413 + <option value="auto_most_replied"><?php echo esc_html__("Auto Most Replied (Replies to most replied topics)", 'aiomatic-automatic-ai-content-writer');?></option>
414 + <option value="auto_least_replied"><?php echo esc_html__("Auto Least Replied (Replies to least replied topics)", 'aiomatic-automatic-ai-content-writer');?></option>
415 + <option value="auto_oldest_no_replies"><?php echo esc_html__("Auto Oldest No Replies (Replies to oldest topics with no replies)", 'aiomatic-automatic-ai-content-writer');?></option>
416 + <option value="auto_latest_no_replies"><?php echo esc_html__("Auto Latest No Replies (Replies to latest topics with no replies)", 'aiomatic-automatic-ai-content-writer');?></option>
417 + </select>
418 + </td>
419 + <td class="cr_comm_td"><input type="number" step="1" min="1" name="aiomatic_reply_list[schedule][]" max="8765812" class="cr_width_60" placeholder="Select the rule schedule interval" value="24"/></td>
420 + <td class="cr_comm_td"><input type="number" step="1" min="0" name="aiomatic_reply_list[max][]" class="cr_width_60" placeholder="Select the # of generated posts" value="1" /></td>
421 + <td class="cr_width_70 cr_center">
422 + <input type="button" id="mybtnfzr" value="Settings">
423 + <div id="mymodalfzr" class="codemodalfzr">
424 + <div class="codemodalfzr-content">
425 + <div class="codemodalfzr-header">
426 + <span id="aiomatic_close" class="codeclosefzr">&times;</span>
427 + <h2><span class="cr_color_white"><?php echo esc_html__("New Rule", 'aiomatic-automatic-ai-content-writer');?></span> <?php echo esc_html__("Advanced Settings", 'aiomatic-automatic-ai-content-writer');?></h2>
428 + </div>
429 + <div class="codemodalfzr-body">
430 + <div class="table-responsive">
431 + <table class="responsive table cr_main_table_nowr">
432 + <tr><td colspan="2">
433 + <h3><?php echo esc_html__("AI Assistant Options", 'aiomatic-automatic-ai-content-writer');?>:</h3>
434 + </td></tr>
435 + <tr>
436 + <td class="cr_min_width_200">
437 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
438 + <div class="bws_hidden_help_text cr_min_260px">
439 + <?php
440 + echo esc_html__("Select the AI Assistant to use for content creation. This will disable the ability to select AI models, as the models assisgned to the assistant will be used for content creation.", 'aiomatic-automatic-ai-content-writer');
441 + ?>
442 + </div>
443 + </div>
444 + <b><?php echo esc_html__("AI Assistant Name:", 'aiomatic-automatic-ai-content-writer');?></b>
445 + </td>
446 + <td><select id="assistant_id" name="aiomatic_reply_list[assistant_id][]" class="cr_width_full" onchange="assistantSelected('');">
447 + <?php
448 + if($all_assistants === false)
449 + {
450 + echo '<option val="" selected disabled>' . esc_html__("Only OpenAI API is supported for Assistants API", 'aiomatic-automatic-ai-content-writer') . '</option>';
451 + }
452 + else
453 + {
454 + if(count($all_assistants) == 0)
455 + {
456 + echo '<option val="" selected disabled>' . esc_html__("No Assistans added, go to the plugin's 'AI Assistans' menu to add new assistants!", 'aiomatic-automatic-ai-content-writer') . '</option>';
457 + }
458 + else
459 + {
460 + echo '<option value="" selected';
461 + echo '>' . esc_html__("Don't use assistants, use AI models instead", 'aiomatic-automatic-ai-content-writer') . '</option>';
462 + foreach($all_assistants as $myassistant)
463 + {
464 + echo '<option value="' . esc_html($myassistant->ID) .'"';
465 + echo '>' . esc_html($myassistant->post_title);
466 + echo '</option>';
467 + }
468 + }
469 + }
470 + ?>
471 + </select>
472 + </td>
473 + </tr>
474 + <tr><td colspan="2">
475 + <h3><?php echo esc_html__("Reply Options", 'aiomatic-automatic-ai-content-writer');?>:</h3>
476 + </td></tr>
477 + <tr>
478 + <td class="cr_min_width_200">
479 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
480 + <div class="bws_hidden_help_text cr_min_260px">
481 + <?php
482 + echo esc_html__("Set the number of automatic replies to add to created topics. You can also define custom ranges, like: 3-5. To disable this feature, leave it blank.", 'aiomatic-automatic-ai-content-writer');
483 + ?>
484 + </div>
485 + </div>
486 + <b><?php echo esc_html__("Reply Count To Add To The Topic:", 'aiomatic-automatic-ai-content-writer');?></b>
487 + </td>
488 + <td>
489 + <input type="text" name="aiomatic_reply_list[reply_count][]" placeholder="Reply number to add to the topic" class="cr_width_full" value="1">
490 + </td>
491 + </tr>
492 + <tr>
493 + <td class="cr_min_width_200">
494 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
495 + <div class="bws_hidden_help_text cr_min_260px">
496 + <?php
497 + echo esc_html__("Set the maximum number of replies a topic can have, when it will still be processed.", 'aiomatic-automatic-ai-content-writer');
498 + ?>
499 + </div>
500 + </div>
501 + <b><?php echo esc_html__("Maximum Reply Count For Topics:", 'aiomatic-automatic-ai-content-writer');?></b>
502 + </td>
503 + <td>
504 + <input type="text" name="aiomatic_reply_list[more_replies][]" placeholder="Don't process if it has more replies than" class="cr_width_full" value="">
505 + </td>
506 + </tr><tr>
507 + <td>
508 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
509 + <div class="bws_hidden_help_text cr_min_260px">
510 + <?php
511 + echo esc_html__("Select the AI Model to be used for the reply generator.", 'aiomatic-automatic-ai-content-writer');
512 + ?>
513 + </div>
514 + </div>
515 + <b><?php echo esc_html__("AI Model For The AI Reply Generator:", 'aiomatic-automatic-ai-content-writer');?></b>
516 + </td>
517 + <td class="cr_min_width_200">
518 + <select autocomplete="off" id="reply_model" name="aiomatic_reply_list[reply_model][]" class="hideAssistant cr_width_full">
519 + <?php
520 + foreach($all_models as $modelx)
521 + {
522 + echo '<option value="' . esc_html($modelx) .'"';
523 + echo '>' . esc_html($modelx) . esc_html(aiomatic_get_model_provider($modelx)) . '</option>';
524 + }
525 + ?>
526 + </select>
527 + </td>
528 + </tr>
529 + <tr>
530 + <td class="cr_min_width_200">
531 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
532 + <div class="bws_hidden_help_text cr_min_260px">
533 + <?php
534 + echo esc_html__("Set the command based on which, the reply users will be selected. This command can be any given task or order, based on which, it will generate content for posts. You can use the following shortcodes here: %%participant_list%%, %%conversation%%, %%post_title%%, %%random_sentence%%, %%post_original_title%%, %%random_sentence2%%, %%blog_title%%. You can also add a link to a TXT file, containing keywords (one per line), or to an RSS feed. The length of this command should not be greater than the max token count set in the settings for the prompt command - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins). You can also add here a link to a .txt file, where you can add multiple prompts (one per line) and the plugin will select a random one at each run. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer');
535 + echo '&nbsp;' . sprintf( wp_kses( __( "Please check some tips and tricks about writing prompt commands, <a href='%s' target='_blank'>here</a>.", 'aiomatic-automatic-ai-content-writer'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), 'https://coderevolution.ro/knowledge-base/faq/how-to-create-a-good-seed-prompt-command-for-aiomatic-for-openai-gpt-3-api/' );
536 + ?>
537 + </div>
538 + </div>
539 + <b><?php echo esc_html__("Prompt For The AI Topic Reply User Selector:", 'aiomatic-automatic-ai-content-writer');?></b>&nbsp;<b><a href="https://coderevolution.ro/knowledge-base/faq/how-to-create-a-good-seed-prompt-command-for-aiomatic-for-openai-gpt-3-api/" target="_blank">&#9432;</a></b>
540 + </td>
541 + <td>
542 + <textarea rows="4" cols="70" name="aiomatic_reply_list[choose_prompt][]" placeholder="Please insert a command for the AI" class="cr_width_full">The following is a discussion between forum users. The participants are: %%participant_list%%.\n\n
543 + Based on the tone, flow, and topic, choose which participant should naturally post the next reply. Answer ONLY with the participant's display name, nothing else. If you want to bring in a new user into the conversation, reply exactly with this text: NEW. If there is only one person in the conversation so far, in most cases reply with NEW, so a new user will be selected. Here is the latest part of the discussion:\n\n
544 + %%conversation%%
545 + \n\n</textarea>
546 + </td>
547 + </tr>
548 + <tr>
549 + <td class="cr_min_width_200">
550 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
551 + <div class="bws_hidden_help_text cr_min_260px">
552 + <?php
553 + echo esc_html__("Set the prompt command you want to use to create the reply content. This command can be any given task or order, based on which, it will generate content for posts. You can use the following shortcodes here: %%reply_user_name%%, %%participant_list%%, %%conversation%%, %%post_title%%, %%random_sentence%%, %%post_original_title%%, %%random_sentence2%%, %%blog_title%%. You can also add a link to a TXT file, containing keywords (one per line), or to an RSS feed. The length of this command should not be greater than the max token count set in the settings for the prompt command - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins). You can also add here a link to a .txt file, where you can add multiple prompts (one per line) and the plugin will select a random one at each run. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer');
554 + echo '&nbsp;' . sprintf( wp_kses( __( "Please check some tips and tricks about writing prompt commands, <a href='%s' target='_blank'>here</a>.", 'aiomatic-automatic-ai-content-writer'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), 'https://coderevolution.ro/knowledge-base/faq/how-to-create-a-good-seed-prompt-command-for-aiomatic-for-openai-gpt-3-api/' );
555 + ?>
556 + </div>
557 + </div>
558 + <b><?php echo esc_html__("Prompt For The AI Topic Reply Generator:", 'aiomatic-automatic-ai-content-writer');?></b>&nbsp;<b><a href="https://coderevolution.ro/knowledge-base/faq/how-to-create-a-good-seed-prompt-command-for-aiomatic-for-openai-gpt-3-api/" target="_blank">&#9432;</a></b>
559 + </td>
560 + <td>
561 + <textarea rows="4" cols="70" name="aiomatic_reply_list[reply_prompt][]" placeholder="Please insert a command for the AI" class="cr_width_full">Continue the following forum discussion naturally. You are %%reply_user_name%%.\n
562 + Write in %%language%% language. Writing Style: %%writing_style%%. Tone: %%writing_tone%%. Stay consistent with their voice and previous tone.\n\n
563 + === Conversation so far ===\n
564 + %%conversation%%\n
565 + === %%reply_user_name%%'s reply ===</textarea>
566 + </td>
567 + </tr>
568 + <tr>
569 + <td>
570 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
571 + <div class="bws_hidden_help_text cr_min_260px">
572 + <?php
573 + echo esc_html__("Select the user role from where random users will be selected.", 'aiomatic-automatic-ai-content-writer');
574 + ?>
575 + </div>
576 + </div>
577 + <b><?php echo esc_html__("User Role For Random User Selection:", 'aiomatic-automatic-ai-content-writer');?></b>
578 + </td>
579 + <td class="cr_min_width_200">
580 + <select autocomplete="off" id="user_role" name="aiomatic_reply_list[user_role][]" class="cr_width_full">
581 + <option value="any"><?php echo esc_html__("Any", 'aiomatic-automatic-ai-content-writer');?></option>
582 + <?php
583 + global $wp_roles;
584 + $roles = $wp_roles->roles;
585 +
586 + foreach ($roles as $role_key => $role) {
587 + echo '<option value="' . esc_attr($role_key) . '">' . esc_html($role['name']) . '</option>';
588 + }
589 + ?>
590 + </select>
591 + </td>
592 + </tr>
593 + <tr><td colspan="2">
594 + <h2><?php echo esc_html__("Content Parameters", 'aiomatic-automatic-ai-content-writer');?>:</h2>
595 + </td></tr>
596 + <tr>
597 + <td class="cr_min_width_200">
598 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
599 + <div class="bws_hidden_help_text cr_min_260px">
600 + <?php
601 + echo esc_html__("Set the language of the created content. This will set the value of the %%language%% shortcode, which can be used in prompts below. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer');
602 + ?>
603 + </div>
604 + </div>
605 + <b><?php echo esc_html__("Content Language:", 'aiomatic-automatic-ai-content-writer');?></b>
606 + </td>
607 + <td>
608 + <input id="content_language" name="aiomatic_reply_list[content_language][]" type="text" list="languages" placeholder="Created content language" class="coderevolution_gutenberg_input" value="English"/>
609 + <datalist id="languages">
610 + <?php
611 + foreach($aiomatic_language_names as $ln)
612 + {
613 + echo '<option>' . esc_html($ln) . '</option>';
614 + }
615 + ?>
616 + </datalist>
617 + </td>
618 + </tr>
619 + <tr>
620 + <td class="cr_min_width_200">
621 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
622 + <div class="bws_hidden_help_text cr_min_260px">
623 + <?php
624 + echo esc_html__("Set the writing style of the created content. This will set the value of the %%writing_style%% shortcode, which can be used in prompts below. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer');
625 + ?>
626 + </div>
627 + </div>
628 + <b><?php echo esc_html__("Writing Style:", 'aiomatic-automatic-ai-content-writer');?></b>
629 + </td>
630 + <td>
631 + <input id="writing_style" name="aiomatic_reply_list[writing_style][]" type="text" placeholder="Created content writing style" list="writing_styles" class="coderevolution_gutenberg_input" value="Creative"/>
632 + <datalist id="writing_styles">
633 + <option>Informative</option>
634 + <option>Academic</option>
635 + <option>Descriptive</option>
636 + <option>Detailed</option>
637 + <option>Dramative</option>
638 + <option>Fiction</option>
639 + <option>Expository</option>
640 + <option>Historical</option>
641 + <option>Dialogue</option>
642 + <option>Creative</option>
643 + <option>Critical</option>
644 + <option>Narrative</option>
645 + <option>Persuasive</option>
646 + <option>Reflective</option>
647 + <option>Argumentative</option>
648 + <option>Analytical</option>
649 + <option>Blog</option>
650 + <option>News</option>
651 + <option>Casual</option>
652 + <option>Pastoral</option>
653 + <option>Personal</option>
654 + <option>Poetic</option>
655 + <option>Satirical</option>
656 + <option>Sensory</option>
657 + <option>Articulate</option>
658 + <option>Monologue</option>
659 + <option>Colloquial</option>
660 + <option>Comparative</option>
661 + <option>Concise</option>
662 + <option>Biographical</option>
663 + <option>Anecdotal</option>
664 + <option>Evaluative</option>
665 + <option>Letter</option>
666 + <option>Lyrical</option>
667 + <option>Simple</option>
668 + <option>Vivid</option>
669 + <option>Journalistic</option>
670 + <option>Technical</option>
671 + <option>Direct</option>
672 + <option>Emotional</option>
673 + <option>Metaphorical</option>
674 + <option>Objective</option>
675 + <option>Rhetorical</option>
676 + <option>Theoretical</option>
677 + <option>Business</option>
678 + <option>Report</option>
679 + <option>Research</option>
680 + </datalist>
681 + </td>
682 + </tr>
683 + <tr>
684 + <td class="cr_min_width_200">
685 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
686 + <div class="bws_hidden_help_text cr_min_260px">
687 + <?php
688 + echo esc_html__("Set the writing tone of the created content. This will set the value of the %%writing_tone%% shortcode, which can be used in prompts below. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer');
689 + ?>
690 + </div>
691 + </div>
692 + <b><?php echo esc_html__("Writing Tone:", 'aiomatic-automatic-ai-content-writer');?></b>
693 + </td>
694 + <td>
695 + <input id="writing_tone" name="aiomatic_reply_list[writing_tone][]" type="text" list="writing_tones" placeholder="Created content writing tone" class="coderevolution_gutenberg_input" value="Neutral"/>
696 + <datalist id="writing_tones">
697 + <option>Neutral</option>
698 + <option>Formal</option>
699 + <option>Assertive</option>
700 + <option>Cheerful</option>
701 + <option>Humorous</option>
702 + <option>Informal</option>
703 + <option>Inspirational</option>
704 + <option>Professional</option>
705 + <option>Emotional</option>
706 + <option>Persuasive</option>
707 + <option>Supportive</option>
708 + <option>Sarcastic</option>
709 + <option>Condescending</option>
710 + <option>Skeptical</option>
711 + <option>Narrative</option>
712 + <option>Journalistic</option>
713 + <option>Conversational</option>
714 + <option>Factual</option>
715 + <option>Friendly</option>
716 + <option>Polite</option>
717 + <option>Scientific</option>
718 + <option>Sensitive</option>
719 + <option>Sincere</option>
720 + <option>Curious</option>
721 + <option>Dissapointed</option>
722 + <option>Encouraging</option>
723 + <option>Optimistic</option>
724 + <option>Surprised</option>
725 + <option>Worried</option>
726 + <option>Confident</option>
727 + <option>Authoritative</option>
728 + <option>Nostalgic</option>
729 + <option>Sympathetic</option>
730 + <option>Suspenseful</option>
731 + <option>Romantic</option>
732 + <option>Serious</option>
733 + </datalist>
734 + </td>
735 + </tr>
736 + <tr><td colspan="2">
737 + <h3><?php echo esc_html__("Global Prompt Options", 'aiomatic-automatic-ai-content-writer');?>:</h3>
738 + </td></tr>
739 + <tr>
740 + <td class="cr_min_width_200">
741 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
742 + <div class="bws_hidden_help_text cr_min_260px">
743 + <?php
744 + echo esc_html__("This will be prepended to each prompt sent by the plugin to the AI writer. You can use the following shortcodes: %%topic%%, %%language%%, %%writing_style%%, %%writing_tone%%, %%title%%, %%random_sentence%%, %%random_sentence2%%, %%post_original_title%%, %%blog_title%%, %%royalty_free_image_attribution%% - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins). You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer');
745 + ?>
746 + </div>
747 + </div>
748 + <b><?php echo esc_html__("Prepend Text To All Textual AI Prompts:", 'aiomatic-automatic-ai-content-writer');?></b>
749 + </td>
750 + <td>
751 + <textarea rows="2" cols="70" name="aiomatic_reply_list[global_prepend][]" placeholder="Global prompt prepend text" class="cr_width_full"></textarea>
752 + </td>
753 + </tr>
754 + <tr>
755 + <td class="cr_min_width_200">
756 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
757 + <div class="bws_hidden_help_text cr_min_260px">
758 + <?php
759 + echo esc_html__("This will be appended to each prompt sent by the plugin to the AI writer. You can use the following shortcodes: %%topic%%, %%language%%, %%writing_style%%, %%writing_tone%%, %%title%%, %%random_sentence%%, %%random_sentence2%%, %%post_original_title%%, %%blog_title%%, %%royalty_free_image_attribution%% - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins). You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer');
760 + ?>
761 + </div>
762 + </div>
763 + <b><?php echo esc_html__("Append Text To All Textual AI Prompts:", 'aiomatic-automatic-ai-content-writer');?></b>
764 + </td>
765 + <td>
766 + <textarea rows="2" cols="70" name="aiomatic_reply_list[global_append][]" placeholder="Global prompt append text" class="cr_width_full"></textarea>
767 + </td>
768 + </tr>
769 + <tr><td colspan="2">
770 + <h3><?php echo esc_html__("Advanced AI Text Generator Options", 'aiomatic-automatic-ai-content-writer');?>:</h3>
771 + </td></tr>
772 + <tr>
773 + <td class="cr_min_width_200">
774 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
775 + <div class="bws_hidden_help_text cr_min_260px">
776 + <?php
777 + echo esc_html__("Set the maximum number of API tokens to use with each request. This will define the length of the resulting API response. Each token usually consists of approximately 4 characters. Note that in this value the number of tokens sent to the API as an article prompt will also be counted. The maximum amount which can be set is 4000. For other models, the maximum is 2048.", 'aiomatic-automatic-ai-content-writer');
778 + ?>
779 + </div>
780 + </div>
781 + <b><?php echo esc_html__("Maximum Total Token Count To Use Per API Request:", 'aiomatic-automatic-ai-content-writer');?></b>
782 + </td>
783 + <td>
784 + <input type="number" min="1" name="aiomatic_reply_list[max_tokens][]" value="" placeholder="32768" class="cr_width_full">
785 + </td>
786 + </tr>
787 + <tr>
788 + <td class="cr_min_width_200">
789 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
790 + <div class="bws_hidden_help_text cr_min_260px">
791 + <?php
792 + echo esc_html__("Set the maximum number of prompt API tokens to use with each request. This will define the length of the resulting API response. Each token usually consists of approximately 4 characters. This defines how much content does the API receive each time you call it. If the API gets more initial data, better quality results will be expected. The maximum amount which can be set is 1000.", 'aiomatic-automatic-ai-content-writer');
793 + ?>
794 + </div>
795 + </div>
796 + <b><?php echo esc_html__("Maximum Prompt Token Count To Use Per API Request:", 'aiomatic-automatic-ai-content-writer');?></b>
797 + </td>
798 + <td>
799 + <input type="number" min="1" name="aiomatic_reply_list[max_seed_tokens][]" value="" placeholder="1000" class="cr_width_full">
800 + </td>
801 + </tr>
802 + <tr>
803 + <td class="cr_min_width_200">
804 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
805 + <div class="bws_hidden_help_text cr_min_260px">
806 + <?php
807 + echo esc_html__("What sampling temperature to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. We generally recommend altering this or top_p but not both.", 'aiomatic-automatic-ai-content-writer');
808 + ?>
809 + </div>
810 + </div>
811 + <b><?php echo esc_html__("AI Temperature:", 'aiomatic-automatic-ai-content-writer');?></b>
812 + </td>
813 + <td>
814 + <input type="number" min="0" step="0.01" max="2" name="aiomatic_reply_list[temperature][]" value="" placeholder="1" class="cr_width_full">
815 + </td>
816 + </tr><tr>
817 + <td class="cr_min_width_200">
818 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
819 + <div class="bws_hidden_help_text cr_min_260px">
820 + <?php
821 + echo esc_html__("An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.", 'aiomatic-automatic-ai-content-writer');
822 + ?>
823 + </div>
824 + </div>
825 + <b><?php echo esc_html__("AI Top_p:", 'aiomatic-automatic-ai-content-writer');?></b>
826 + </td>
827 + <td>
828 + <input type="number" min="0" max="1" step="0.01" name="aiomatic_reply_list[top_p][]" value="" placeholder="1" class="cr_width_full">
829 + </td>
830 + </tr><tr>
831 + <td class="cr_min_width_200">
832 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
833 + <div class="bws_hidden_help_text cr_min_260px">
834 + <?php
835 + echo esc_html__("Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.", 'aiomatic-automatic-ai-content-writer');
836 + ?>
837 + </div>
838 + </div>
839 + <b><?php echo esc_html__("AI Presence Penalty:", 'aiomatic-automatic-ai-content-writer');?></b>
840 + </td>
841 + <td>
842 + <input type="number" min="-2" step="0.01" max="2" name="aiomatic_reply_list[presence_penalty][]" value="" placeholder="0" class="cr_width_full">
843 + </td>
844 + </tr><tr>
845 + <td class="cr_min_width_200">
846 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
847 + <div class="bws_hidden_help_text cr_min_260px">
848 + <?php
849 + echo esc_html__("Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.", 'aiomatic-automatic-ai-content-writer');
850 + ?>
851 + </div>
852 + </div>
853 + <b><?php echo esc_html__("AI Frequency Penalty:", 'aiomatic-automatic-ai-content-writer');?></b>
854 + </td>
855 + <td>
856 + <input type="number" min="0" max="2" step="0.01" name="aiomatic_reply_list[frequency_penalty][]" value="" placeholder="0" class="cr_width_full">
857 + </td>
858 + </tr>
859 + <tr><td colspan="2">
860 + <h3><?php echo esc_html__("Posting Options", 'aiomatic-automatic-ai-content-writer');?>:</h3>
861 + </td></tr>
862 + <tr>
863 + <td class="cr_min_width_200">
864 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
865 + <div class="bws_hidden_help_text cr_min_260px">
866 + <?php
867 + echo esc_html__("Enter a HTML text that should be prepended to the AI generated content in each created post. You can use the following shortcodes: %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%random_image[keyword]%%, %%random_image_url[keyword]%%, %%random_video[keyword]%%, %%royalty_free_image_attribution%% - you can also use an optional parameter in the random_image and random_video shortcodes, which will add a percentage chance for the media to appear or not - example: %%random_video[keyword][60]%% - a video will appear in 60% of cases, in the rest of 40%, nothing will be returned by the shortcode - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins). You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer');
868 + ?>
869 + </div>
870 + </div>
871 + <b><?php echo esc_html__("HTML Text To Prepend To AI Created Content:", 'aiomatic-automatic-ai-content-writer');?></b>&nbsp;<b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">&#9432;</a></b>
872 + </td>
873 + <td>
874 + <textarea rows="2" cols="70" name="aiomatic_reply_list[post_prepend][]" placeholder="HTML content to prepend to the AI generated content" class="cr_width_full"></textarea>
875 + </td>
876 + </tr>
877 + <tr>
878 + <td class="cr_min_width_200">
879 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
880 + <div class="bws_hidden_help_text cr_min_260px">
881 + <?php
882 + echo esc_html__("Enter a HTML text that should be appended to the AI generated content in each created post. You can use the following shortcodes: %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%random_image[keyword]%%, %%random_image_url[keyword]%%, %%random_video[keyword]%%, %%royalty_free_image_attribution%% - you can also use an optional parameter in the random_image and random_video shortcodes, which will add a percentage chance for the media to appear or not - example: %%random_video[keyword][60]%% - a video will appear in 60% of cases, in the rest of 40%, nothing will be returned by the shortcode - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins). You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer');
883 + ?>
884 + </div>
885 + </div>
886 + <b><?php echo esc_html__("HTML Text To Append To AI Created Content:", 'aiomatic-automatic-ai-content-writer');?></b>&nbsp;<b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">&#9432;</a></b>
887 + </td>
888 + <td>
889 + <textarea rows="2" cols="70" name="aiomatic_reply_list[post_append][]" placeholder="HTML content to append to the AI generated content" class="cr_width_full"></textarea>
890 + </td>
891 + </tr>
892 + <tr>
893 + <td class="cr_min_width_200">
894 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
895 + <div class="bws_hidden_help_text cr_min_260px">
896 + <?php
897 + echo esc_html__("Custom AI generated content shortcode creator. If you wish to create content from multiple AI prompts, and use them in post content/post custom fields/taxonomies, you can configure this from here. Also, these shortcodes will be able to be used in custom fields or custom taxonomies which the plugin will create. Syntax for this field: shortcode_name => AI_MODEL_TO_USE @@ TEXTUAL_PROMPT_TO_USE (to specify multiple shortcodes and crawling values, separate them by a new line. Example: my_custom_shortcode => gpt-4.1-mini @@ Write a short poem. Afterwards, you can use shortcodes in any settings field that supports shortcodes (ex: 'HTML Text To Append To AI Created Content' settings field), like this: %%my_custom_shortcode%%. Official format is %%name_of_custom_shortcode%%", 'aiomatic-automatic-ai-content-writer');
898 + ?>
899 + </div>
900 + </div>
901 + <b><?php echo esc_html__("Custom Shortcode Creator (Optional):", 'aiomatic-automatic-ai-content-writer');?></b><span class="tool" data-tip="Supported models: <?php echo esc_html(implode(',', aiomatic_get_all_models()));?>">&nbsp;&#9432;</span>
902 + </td>
903 + <td>
904 + <textarea rows="2" cols="70" name="aiomatic_reply_list[custom_shortcodes][]" placeholder="shortcode_name => AI_MODEL @@ AI_PROMPT" class="cr_width_full"></textarea>
905 + </td>
906 + </tr>
907 + <tr>
908 + <td>
909 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
910 + <div class="bws_hidden_help_text cr_min_260px"><?php echo esc_html__("Do you want to skip spinning of posts generated by this rule?", 'aiomatic-automatic-ai-content-writer');?>
911 + </div>
912 + </div>
913 + <b><?php echo esc_html__("Do Not Spin Topics Generated By This Rule:", 'aiomatic-automatic-ai-content-writer');?></b>
914 + </td>
915 + <td>
916 + <input type="checkbox" id="skip_spin" name="aiomatic_reply_list[skip_spin][]">
917 + </td>
918 + </tr>
919 + <tr>
920 + <td>
921 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
922 + <div class="bws_hidden_help_text cr_min_260px"><?php echo esc_html__("Do you want to skip translating of posts generated by this rule?", 'aiomatic-automatic-ai-content-writer');?>
923 + </div>
924 + </div>
925 + <b><?php echo esc_html__("Do Not Translate Topics Generated By This Rule:", 'aiomatic-automatic-ai-content-writer');?></b>
926 + </td>
927 + <td>
928 + <input type="checkbox" id="skip_translate" name="aiomatic_reply_list[skip_translate][]">
929 + </td>
930 + </tr>
931 + <tr>
932 + <td>
933 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
934 + <div class="bws_hidden_help_text cr_min_260px">
935 + <?php
936 + echo esc_html__("Run regex on post content. To disable this feature, leave this field blank. No Regex separators are required here. You can add multiple Regex expressions, each on a different line.", 'aiomatic-automatic-ai-content-writer');
937 + ?>
938 + </div>
939 + </div>
940 + <b><?php echo esc_html__("Run Regex On Content:", 'aiomatic-automatic-ai-content-writer');?></b>
941 + </td>
942 + <td>
943 + <textarea rows="1" class="cr_width_full" name="aiomatic_reply_list[strip_by_regex][]" placeholder="regex expression"></textarea>
944 + </td>
945 + </tr>
946 + <tr>
947 + <td>
948 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
949 + <div class="bws_hidden_help_text cr_min_260px">
950 + <?php
951 + echo esc_html__("Replace the above regex matches with this regex expression. If you want to strip matched content, leave this field blank. No Regex separators are required here. You can add multiple replacement expressions, each on a different line.", 'aiomatic-automatic-ai-content-writer');
952 + ?>
953 + </div>
954 + </div>
955 + <b><?php echo esc_html__("Replace Matches From Regex (Content):", 'aiomatic-automatic-ai-content-writer');?></b>
956 + </td>
957 + <td>
958 + <textarea rows="1" class="cr_width_full" name="aiomatic_reply_list[replace_regex][]" placeholder="regex replacement"></textarea>
959 + </td>
960 + </tr>
961 + </table>
962 + </div>
963 + </div>
964 + <div class="codemodalfzr-footer">
965 + <br/>
966 + <h3 class="cr_inline">Aimogen Automatic Post Generator</h3>
967 + <span id="aiomatic_ok" class="codeokfzr cr_inline">OK&nbsp;</span>
968 + <br/><br/>
969 + </div>
970 + </div>
971 + </div>
972 + </td>
973 + <td class="cr_shrt_td2"><span class="cr_gray20">X</span></td>
974 + <td class="cr_short_td"><input type="checkbox" name="aiomatic_reply_list[active][]" value="1" checked />
975 + <input type="hidden" name="aiomatic_reply_list[last_run][]" value="1988-01-27 00:00:00"/>
976 + <input type="hidden" name="aiomatic_reply_list[rule_unique_id][]" value="<?php echo esc_html(uniqid('', true));?>"/>
977 + </td>
978 + <td class="cr_short_td">
979 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
980 + <div class="bws_hidden_help_text cr_min_260px">
981 + <?php
982 + echo esc_html__("No info.", 'aiomatic-automatic-ai-content-writer');
983 + ?>
984 + </div>
985 + </div>
986 + </td>
987 + <td class="cr_center">
988 + <div>
989 + <img src="<?php
990 + echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/running.gif');
991 + ?>" alt="Running" class="cr_running">
992 + <div class="codemainfzr cr_gray_back cr_width_80p">
993 + <select autocomplete="off" class="codemainfzr" id="actions" class="actions" name="actions" disabled>
994 + <option value="select" disabled selected><?php echo esc_html__("Select an Action", 'aiomatic-automatic-ai-content-writer');?></option>
995 + <option value="run" onclick=""><?php echo esc_html__("Run This Rule Now", 'aiomatic-automatic-ai-content-writer');?></option>
996 + <option value="duplicate" onclick=""><?php echo esc_html__("Duplicate This Rule", 'aiomatic-automatic-ai-content-writer');?></option>
997 + <option value="up" onclick=""><?php echo esc_html__("Move This Rule Up", 'aiomatic-automatic-ai-content-writer');?></option>
998 + <option value="down" onclick=""><?php echo esc_html__("Move This Rule Down", 'aiomatic-automatic-ai-content-writer');?></option>
999 + </select>
1000 + </div>
1001 + </div>
1002 + </td>
1003 + </tr>
1004 + <?php
1005 + }
1006 + ?>
1007 + </tbody>
1008 + </table>
1009 + </div>
1010 + </div>
1011 + </div>
1012 + <hr/>
1013 +
1014 + <div>
1015 + <?php
1016 + $next_url = (aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
1017 + if(stristr($next_url, 'aiomatic_page=') === false)
1018 + {
1019 + if(stristr($next_url, '?') === false)
1020 + {
1021 + if($max_pages == 1)
1022 + {
1023 + $next_url .= '?aiomatic_page=1';
1024 + }
1025 + else
1026 + {
1027 + $next_url .= '?aiomatic_page=2';
1028 + }
1029 + }
1030 + else
1031 + {
1032 + if($max_pages == 1)
1033 + {
1034 + $next_url .= '&aiomatic_page=1';
1035 + }
1036 + else
1037 + {
1038 + $next_url .= '&aiomatic_page=2';
1039 + }
1040 + }
1041 + }
1042 + else
1043 + {
1044 + if(isset($_GET['aiomatic_page']))
1045 + {
1046 + $curent_page = $_GET["aiomatic_page"];
1047 + }
1048 + else
1049 + {
1050 + $curent_page = '';
1051 + }
1052 + if(is_numeric($curent_page))
1053 + {
1054 + $next_page = $curent_page + 1;
1055 + if($next_page > $max_pages)
1056 + {
1057 + $next_page = $max_pages;
1058 + }
1059 + if($next_page <= 0)
1060 + {
1061 + $next_page = 1;
1062 + }
1063 + $next_url = str_replace('aiomatic_page=' . $curent_page, 'aiomatic_page=' . $next_page, $next_url);
1064 + }
1065 + else
1066 + {
1067 + if(stristr($next_url, '?') === false)
1068 + {
1069 + if($max_pages == 1)
1070 + {
1071 + $next_url .= '?aiomatic_page=1';
1072 + }
1073 + else
1074 + {
1075 + $next_url .= '?aiomatic_page=2';
1076 + }
1077 + }
1078 + else
1079 + {
1080 + if($max_pages == 1)
1081 + {
1082 + $next_url .= '&aiomatic_page=1';
1083 + }
1084 + else
1085 + {
1086 + $next_url .= '&aiomatic_page=2';
1087 + }
1088 + }
1089 + }
1090 + }
1091 + $prev_url = (aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
1092 + if(stristr($prev_url, 'aiomatic_page=') === false)
1093 + {
1094 + if(stristr($prev_url, '?') === false)
1095 + {
1096 + $prev_url .= '?aiomatic_page=1';
1097 + }
1098 + else
1099 + {
1100 + $prev_url .= '&aiomatic_page=1';
1101 + }
1102 + }
1103 + else
1104 + {
1105 + if(isset($_GET['aiomatic_page']))
1106 + {
1107 + $curent_page = $_GET["aiomatic_page"];
1108 + }
1109 + else
1110 + {
1111 + $curent_page = '';
1112 + }
1113 + if(is_numeric($curent_page))
1114 + {
1115 + $go_to = $curent_page - 1;
1116 + if($go_to <= 0)
1117 + {
1118 + $go_to = 1;
1119 + }
1120 + if($go_to > $max_pages)
1121 + {
1122 + $go_to = $max_pages;
1123 + }
1124 + $prev_url = str_replace('aiomatic_page=' . $curent_page, 'aiomatic_page=' . $go_to, $prev_url);
1125 + }
1126 + else
1127 + {
1128 + if(stristr($prev_url, '?') === false)
1129 + {
1130 + $prev_url .= '?aiomatic_page=1';
1131 + }
1132 + else
1133 + {
1134 + $prev_url .= '&aiomatic_page=1';
1135 + }
1136 + }
1137 + }
1138 + $first_url = (aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
1139 + if(stristr($first_url, 'aiomatic_page=') === false)
1140 + {
1141 + if(stristr($first_url, '?') === false)
1142 + {
1143 + $first_url .= '?aiomatic_page=1';
1144 + }
1145 + else
1146 + {
1147 + $first_url .= '&aiomatic_page=1';
1148 + }
1149 + }
1150 + else
1151 + {
1152 + if(isset($_GET['aiomatic_page']))
1153 + {
1154 + $curent_page = $_GET["aiomatic_page"];
1155 + }
1156 + else
1157 + {
1158 + $curent_page = '';
1159 + }
1160 + if(is_numeric($curent_page))
1161 + {
1162 + $first_url = str_replace('aiomatic_page=' . $curent_page, 'aiomatic_page=1', $first_url);
1163 + }
1164 + else
1165 + {
1166 + if(stristr($first_url, '?') === false)
1167 + {
1168 + $first_url .= '?aiomatic_page=1';
1169 + }
1170 + else
1171 + {
1172 + $first_url .= '&aiomatic_page=1';
1173 + }
1174 + }
1175 + }
1176 + $last_url = (aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
1177 + if(stristr($last_url, 'aiomatic_page=') === false)
1178 + {
1179 + if(stristr($last_url, '?') === false)
1180 + {
1181 + $last_url .= '?aiomatic_page=' . $max_pages;
1182 + }
1183 + else
1184 + {
1185 + $last_url .= '&aiomatic_page=' . $max_pages;
1186 + }
1187 + }
1188 + else
1189 + {
1190 + if(isset($_GET['aiomatic_page']))
1191 + {
1192 + $curent_page = $_GET["aiomatic_page"];
1193 + }
1194 + else
1195 + {
1196 + $curent_page = '';
1197 + }
1198 + if(is_numeric($curent_page))
1199 + {
1200 + $last_url = str_replace('aiomatic_page=' . $curent_page, 'aiomatic_page=' . $max_pages, $last_url);
1201 + }
1202 + else
1203 + {
1204 + if(stristr($last_url, '?') === false)
1205 + {
1206 + $last_url .= '?aiomatic_page=' . $max_pages;
1207 + }
1208 + else
1209 + {
1210 + $last_url .= '&aiomatic_page=' . $max_pages;
1211 + }
1212 + }
1213 + }
1214 + if(isset($_GET['aiomatic_page']))
1215 + {
1216 + $this_page = $_GET["aiomatic_page"];
1217 + }
1218 + else
1219 + {
1220 + $this_page = '1';
1221 + }
1222 + echo '<center><a href="' . esc_url_raw($first_url) . '">' . esc_html__('First Page', 'aiomatic-automatic-ai-content-writer') . '</a>&nbsp;&nbsp;&nbsp;<a href="' . esc_url_raw($prev_url) . '">' . esc_html__('Previous Page', 'aiomatic-automatic-ai-content-writer') . '</a>&nbsp;&nbsp;' . esc_html__('Page', 'aiomatic-automatic-ai-content-writer') . ' ' . esc_html($this_page) . ' ' . esc_html__('of', 'aiomatic-automatic-ai-content-writer') . ' ' . esc_html($max_pages) . '&nbsp;-&nbsp;' . esc_html__("Rules Per Page:", 'aiomatic-automatic-ai-content-writer') . '&nbsp;&nbsp;<input class="cr_50" type="number" min="2" step="1" max="999" name="posts_per_page" value="' . esc_attr($rules_per_page). '" required/>&nbsp;&nbsp;&nbsp;<a href="' . esc_url_raw($next_url) . '">' . esc_html__('Next Page', 'aiomatic-automatic-ai-content-writer') . '</a>&nbsp;&nbsp;&nbsp;<a href="' . esc_url_raw($last_url) . '">' . esc_html__('Last Page', 'aiomatic-automatic-ai-content-writer') . '</a></center>
1223 + <center></center>
1224 + <center>Info: You can add new rules only on the last page.</center>';
1225 + ?>
1226 + <div>
1227 + <p class="crsubmit"><input type="submit" name="btnSubmit" id="btnSubmit" class="button button-primary" onclick="unsaved = false;" value="<?php echo esc_html__("Save Settings", 'aiomatic-automatic-ai-content-writer');?>"/></p>
1228 + </div>
1229 + <div>
1230 + <div><?php echo esc_html__("* = required", 'aiomatic-automatic-ai-content-writer');?></div><br/><?php echo sprintf( wp_kses( __( "Check more settings which apply to rule running, over at the plugin's 'Settings' menu, <a href='%s' target='_blank'>here</a>.", 'aiomatic-automatic-ai-content-writer'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url_raw( get_admin_url() . 'admin.php?page=aiomatic_admin_settings#tab-17' ) );?>
1231 + <br/><?php echo esc_html__("New! You can use the [aicontent]Your Prompt[/aicontent] shortcode in this or other", 'aiomatic-automatic-ai-content-writer') . " <a href='https://wpbay.com/store/coderevolution/' target='_blank'>" . esc_html__("'omatic plugins created by CodeRevolution", 'aiomatic-automatic-ai-content-writer') . "</a>" . esc_html__(", click for details:", 'aiomatic-automatic-ai-content-writer');?>&nbsp;<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 Aimogen plugin"></a><br/><br/><a href="https://www.youtube.com/watch?v=5rbnu_uis7Y" target="_blank"><?php echo esc_html__("Nested Shortcodes also supported!", 'aiomatic-automatic-ai-content-writer');?></a><br/><br/><?php echo esc_html__("Confused about rule running status icons?", 'aiomatic-automatic-ai-content-writer');?> <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", 'aiomatic-automatic-ai-content-writer');?></a><br/>
1232 + <div class="cr_none" id="midas_icons">
1233 + <table>
1234 + <tr>
1235 + <td><img id="run_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/running.gif');?>" alt="Running" title="status"></td>
1236 + <td><?php echo esc_html__("In Progress", 'aiomatic-automatic-ai-content-writer');?> - <b><?php echo esc_html__("Importing is Running", 'aiomatic-automatic-ai-content-writer');?></b></td>
1237 + </tr>
1238 + <tr>
1239 + <td><img id="ok_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/ok.gif');?>" alt="OK" title="status"></td>
1240 + <td><?php echo esc_html__("Success", 'aiomatic-automatic-ai-content-writer');?> - <b><?php echo esc_html__("New Topics Created", 'aiomatic-automatic-ai-content-writer');?></b></td>
1241 + </tr>
1242 + <tr>
1243 + <td><img id="fail_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/failed.gif');?>" alt="Faield" title="status"></td>
1244 + <td><?php echo esc_html__("Failed", 'aiomatic-automatic-ai-content-writer');?> - <b><?php echo esc_html__("An Error Occurred.", 'aiomatic-automatic-ai-content-writer');?> <b><?php echo esc_html__("Please check 'Activity and Logging' plugin menu for details.", 'aiomatic-automatic-ai-content-writer');?></b></td>
1245 + </tr>
1246 + <tr>
1247 + <td><img id="nochange_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/nochange.gif');?>" alt="NoChange" title="status"></td>
1248 + <td><?php echo esc_html__("No Change - No New Topics Created", 'aiomatic-automatic-ai-content-writer');?> - <b><?php echo esc_html__("Possible reasons:", 'aiomatic-automatic-ai-content-writer');?></b></td>
1249 + </tr>
1250 + <tr>
1251 + <td></td>
1252 + <td>
1253 + <ul>
1254 + <li>&#9658; <?php echo esc_html__("Please change rule settings, as your titles are all posted.", 'aiomatic-automatic-ai-content-writer');?></li>
1255 + </ul>
1256 + </td>
1257 + </tr>
1258 + </table>
1259 + </div>
1260 + </div>
1261 + </form>
1262 + </div>
1263 + <div id="running_status_ai"></div>
1264 + </div>
1265 + <?php if(!isset($aiomatic_Main_Settings['hide_videos']) || trim($aiomatic_Main_Settings['hide_videos']) != 'on'){
1266 + ?>
1267 + <div class="wrap">
1268 + <h3><?php echo esc_html__("Keywords/Titles To Forum Topics Tutorial Video", 'aiomatic-automatic-ai-content-writer');?></h3>
1269 + <div id="ai-video-container"><br/>
1270 + <iframe class="ai-video" width="560" height="315" src="https://www.youtube.com/embed/OEz9FSWSONQ" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
1271 + </div>
1272 + </div>
1273 + <?php
1274 + }
1275 + }
1276 + if (isset($_POST['aiomatic_reply_list'])) {
1277 + add_action('admin_init', 'aiomatic_save_rules_reply');
1278 + }
1279 +
1280 + function aiomatic_save_rules_reply($data2)
1281 + {
1282 + $init_rules_per_page = get_option('aiomatic_posts_per_page', 12);
1283 + $rules_per_page = get_option('aiomatic_posts_per_page', 12);
1284 + if(isset($_POST['posts_per_page']))
1285 + {
1286 + aiomatic_update_option('aiomatic_posts_per_page', $_POST['posts_per_page']);
1287 + }
1288 + check_admin_referer('aiomatic_save_rules', '_aiomaticr_nonce');
1289 +
1290 + $data2 = $_POST['aiomatic_reply_list'];
1291 + $rules = get_option('aiomatic_reply_list', array());
1292 + if(!is_array($rules))
1293 + {
1294 + $rules = array();
1295 + }
1296 + $initial_count = count($rules);
1297 + $add = false;
1298 + $scad = false;
1299 + if(isset($_GET["aiomatic_page"]) && is_numeric($_GET["aiomatic_page"]))
1300 + {
1301 + $curent_page = $_GET["aiomatic_page"];
1302 + }
1303 + else
1304 + {
1305 + $curent_page = 1;
1306 + }
1307 + $offset = ($curent_page - 1) * $rules_per_page;
1308 + $cat_cont = $offset;
1309 + $cont = 0;
1310 + if (isset($data2['post_title'][0])) {
1311 + for ($i = 0; $i < sizeof($data2['post_title']); ++$i)
1312 + {
1313 + $bundle = array();
1314 + if (isset($data2['schedule'][$i]) && $data2['schedule'][$i] != '' && $data2['post_title'][$i] != '' && $data2['selected_forum'][$i] != '') {
1315 + $bundle[] = trim(sanitize_text_field($data2['schedule'][$i]));
1316 + if (isset($data2['active'][$i])) {
1317 + $bundle[] = trim(sanitize_text_field($data2['active'][$i]));
1318 + } else {
1319 + $bundle[] = '0';
1320 + }
1321 + $bundle[] = trim(sanitize_text_field($data2['last_run'][$i]));
1322 + $bundle[] = trim(sanitize_text_field($data2['max'][$i]));
1323 + $bundle[] = $data2['post_title'][$i];
1324 + $bundle[] = trim($data2['temperature'][$i]);
1325 + $bundle[] = trim($data2['top_p'][$i]);
1326 + $bundle[] = trim($data2['presence_penalty'][$i]);
1327 + $bundle[] = trim($data2['frequency_penalty'][$i]);
1328 + $bundle[] = trim($data2['max_tokens'][$i]);
1329 + $bundle[] = trim($data2['max_seed_tokens'][$i]);
1330 + $bundle[] = trim($data2['post_prepend'][$i]);
1331 + $bundle[] = trim($data2['post_append'][$i]);
1332 + $bundle[] = trim($data2['skip_spin'][$i]);
1333 + $bundle[] = trim($data2['skip_translate'][$i]);
1334 + $bundle[] = trim($data2['selected_forum'][$i]);
1335 + $bundle[] = trim($data2['rule_description'][$i]);
1336 + $bundle[] = trim($data2['custom_shortcodes'][$i]);
1337 + $bundle[] = trim($data2['strip_by_regex'][$i]);
1338 + $bundle[] = trim($data2['replace_regex'][$i]);
1339 + $bundle[] = trim($data2['global_prepend'][$i]);
1340 + $bundle[] = trim($data2['global_append'][$i]);
1341 + $bundle[] = trim($data2['rule_unique_id'][$i]);
1342 + $bundle[] = isset($data2['assistant_id'][$i]) ? trim($data2['assistant_id'][$i]) : '';
1343 + $bundle[] = trim($data2['reply_count'][$i]);
1344 + $bundle[] = trim($data2['reply_model'][$i]);
1345 + $bundle[] = trim($data2['choose_prompt'][$i]);
1346 + $bundle[] = trim($data2['reply_prompt'][$i]);
1347 + $bundle[] = trim($data2['content_language'][$i]);
1348 + $bundle[] = trim($data2['writing_style'][$i]);
1349 + $bundle[] = trim($data2['writing_tone'][$i]);
1350 + $bundle[] = trim($data2['more_replies'][$i]);
1351 + $bundle[] = trim($data2['user_role'][$i]);
1352 + $rules[$offset + $cont] = $bundle;
1353 + $cont++;
1354 + $cat_cont++;
1355 + }
1356 + }
1357 + while($cont < $init_rules_per_page)
1358 + {
1359 + if(isset($rules[$offset + $cont]))
1360 + {
1361 + $rules[$offset + $cont] = false;
1362 + }
1363 + $cont = $cont + 1;
1364 + $cat_cont++;
1365 + }
1366 + $rules = array_values(array_filter($rules));
1367 + }
1368 + else
1369 + {
1370 + $rules = array();
1371 + }
1372 + $final_count = count($rules);
1373 + if($final_count > $initial_count)
1374 + {
1375 + $add = true;
1376 + }
1377 + elseif($final_count < $initial_count)
1378 + {
1379 + $scad = true;
1380 + }
1381 + aiomatic_update_option('aiomatic_reply_list', $rules, false);
1382 + if(count($rules) % $rules_per_page === 1 && $add === true)
1383 + {
1384 + $rules_count = count($rules);
1385 + $max_pages = ceil($rules_count/$rules_per_page);
1386 + if($max_pages == 0)
1387 + {
1388 + $max_pages = 1;
1389 + }
1390 + $last_url = (aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
1391 + if(stristr($last_url, 'aiomatic_page=') === false)
1392 + {
1393 + if(stristr($last_url, '?') === false)
1394 + {
1395 + $last_url .= '?aiomatic_page=' . $max_pages;
1396 + }
1397 + else
1398 + {
1399 + $last_url .= '&aiomatic_page=' . $max_pages;
1400 + }
1401 + }
1402 + else
1403 + {
1404 + if(isset($_GET['aiomatic_page']))
1405 + {
1406 + $curent_page = $_GET["aiomatic_page"];
1407 + }
1408 + else
1409 + {
1410 + $curent_page = '';
1411 + }
1412 + if(is_numeric($curent_page))
1413 + {
1414 + $last_url = str_replace('aiomatic_page=' . $curent_page, 'aiomatic_page=' . $max_pages, $last_url);
1415 + }
1416 + else
1417 + {
1418 + if(stristr($last_url, '?') === false)
1419 + {
1420 + $last_url .= '?aiomatic_page=' . $max_pages;
1421 + }
1422 + else
1423 + {
1424 + $last_url .= '&aiomatic_page=' . $max_pages;
1425 + }
1426 + }
1427 + }
1428 + aiomatic_redirect($last_url);
1429 + }
1430 + elseif(count($rules) != 0 && count($rules) % $rules_per_page === 0 && $scad === true)
1431 + {
1432 + $rules_count = count($rules);
1433 + $max_pages = ceil($rules_count/$rules_per_page);
1434 + if($max_pages == 0)
1435 + {
1436 + $max_pages = 1;
1437 + }
1438 + $last_url = (aiomatic_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
1439 + if(stristr($last_url, 'aiomatic_page=') === false)
1440 + {
1441 + if(stristr($last_url, '?') === false)
1442 + {
1443 + $last_url .= '?aiomatic_page=' . $max_pages;
1444 + }
1445 + else
1446 + {
1447 + $last_url .= '&aiomatic_page=' . $max_pages;
1448 + }
1449 + }
1450 + else
1451 + {
1452 + if(isset($_GET['aiomatic_page']))
1453 + {
1454 + $curent_page = $_GET["aiomatic_page"];
1455 + }
1456 + else
1457 + {
1458 + $curent_page = '';
1459 + }
1460 + if(is_numeric($curent_page))
1461 + {
1462 + $last_url = str_replace('aiomatic_page=' . $curent_page, 'aiomatic_page=' . $max_pages, $last_url);
1463 + }
1464 + else
1465 + {
1466 + if(stristr($last_url, '?') === false)
1467 + {
1468 + $last_url .= '?aiomatic_page=' . $max_pages;
1469 + }
1470 + else
1471 + {
1472 + $last_url .= '&aiomatic_page=' . $max_pages;
1473 + }
1474 + }
1475 + }
1476 + aiomatic_redirect($last_url);
1477 + }
1478 + }
1479 + function aiomatic_expand_reply_manual($aiomatic_Main_Settings, $forums, $forum_hierarchy)
1480 + {
1481 + $all_models = aiomatic_get_all_models(true);
1482 + $all_assistants = aiomatic_get_all_assistants(true);
1483 + if (!get_option('aiomatic_running_list')) {
1484 + $running = array();
1485 + } else {
1486 + $running = get_option('aiomatic_running_list');
1487 + }
1488 + $GLOBALS['wp_object_cache']->delete('aiomatic_reply_list', 'options');
1489 + $rules = get_option('aiomatic_reply_list');
1490 + if(!is_array($rules))
1491 + {
1492 + $rules = array();
1493 + }
1494 + $output = '';
1495 + $cont = 0;
1496 + if (!empty($rules)) {
1497 + if(isset($_GET["aiomatic_page"]) && is_numeric($_GET["aiomatic_page"]))
1498 + {
1499 + $curent_page = $_GET["aiomatic_page"];
1500 + }
1501 + else
1502 + {
1503 + $curent_page = 1;
1504 + }
1505 + $unlocker = get_option('aiomatic_minute_running_unlocked', false);
1506 + $rules_per_page = get_option('aiomatic_posts_per_page', 12);
1507 + foreach ($rules as $request => $bundle[]) {
1508 + if(($cont < ($curent_page - 1) * $rules_per_page) || ($cont >= $curent_page * $rules_per_page))
1509 + {
1510 + $cont++;
1511 + continue;
1512 + }
1513 + $bundle_values = array_values($bundle);
1514 + $myValues = $bundle_values[$cont];
1515 + $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]);}}
1516 + $schedule = $array_my_values[0];
1517 + $active = $array_my_values[1];
1518 + $last_run = $array_my_values[2];
1519 + $max = $array_my_values[3];
1520 + $post_title = $array_my_values[4];
1521 + $temperature = $array_my_values[5];
1522 + $top_p = $array_my_values[6];
1523 + $presence_penalty = $array_my_values[7];
1524 + $frequency_penalty = $array_my_values[8];
1525 + $max_tokens = $array_my_values[9];
1526 + $max_seed_tokens = $array_my_values[10];
1527 + $post_prepend = $array_my_values[11];
1528 + $post_append = $array_my_values[12];
1529 + $skip_spin = $array_my_values[13];
1530 + $skip_translate = $array_my_values[14];
1531 + $selected_forum = $array_my_values[15];
1532 + $rule_description = $array_my_values[16];
1533 + $custom_shortcodes = $array_my_values[17];
1534 + $strip_by_regex = $array_my_values[18];
1535 + $replace_regex = $array_my_values[19];
1536 + $global_prepend = $array_my_values[20];
1537 + $global_append = $array_my_values[21];
1538 + $rule_unique_id = $array_my_values[22];
1539 + $assistant_id = $array_my_values[23];
1540 + $reply_count = $array_my_values[24];
1541 + $reply_model = $array_my_values[25];
1542 + $choose_prompt = $array_my_values[26];
1543 + $reply_prompt = $array_my_values[27];
1544 + $content_language = $array_my_values[28];
1545 + $writing_style = $array_my_values[29];
1546 + $writing_tone = $array_my_values[30];
1547 + $more_replies = $array_my_values[31];
1548 + $user_role = $array_my_values[32];
1549 + if(empty($rule_unique_id))
1550 + {
1551 + $rule_unique_id = $cont;
1552 + }
1553 + if($rule_description == '')
1554 + {
1555 + $rule_description = $cont;
1556 + }
1557 + $name = md5(get_bloginfo());
1558 + wp_add_inline_script($name . '-footer-script', 'createAdmin(' . esc_html($cont) . ');createModeSelect(' . esc_html($cont) . ');hideLinks(' . esc_html($cont) . ');', 'after');
1559 + $output .= '<tr>
1560 + <td class="cr_short_td"><input type="text" name="aiomatic_reply_list[rule_description][]" id="rule_description' . esc_html($cont) . '" class="cr_center" placeholder="Rule ID" value="' . esc_html($rule_description) . '" class="cr_width_full"/></td>
1561 + <td class="cr_width_80 cr_center">
1562 + <select autocomplete="off" id="selected_forum' . esc_html($cont) . '" name="aiomatic_reply_list[selected_forum][]" class="cr_width_full">';
1563 + if (!empty($forums)) {
1564 + $output .= '<option value="" disabled>' . esc_html__("Select a Forum", 'aiomatic-automatic-ai-content-writer') . '</option>';
1565 + $output .= aiomatic_render_forum_options($forums, $forum_hierarchy, $selected_forum);
1566 + } else {
1567 + $output .= '<option value="">' . esc_html__("No forums available", 'aiomatic-automatic-ai-content-writer') . '</option>';
1568 + }
1569 +
1570 + $output .= '</select>
1571 + </td>
1572 + <td class="cr_loi">
1573 + <select autocomplete="off" id="post_title" name="aiomatic_reply_list[post_title][]" class="cr_width_full">
1574 + <option value="auto_grow"'; if($post_title == 'auto_grow'){$output .= ' selected';} $output .= '>' . esc_html__("Auto Grow (Spawns new replies in quiet topics)", 'aiomatic-automatic-ai-content-writer') . '</option>
1575 + <option value="auto_unaswered"'; if($post_title == 'auto_unaswered'){$output .= ' selected';} $output .= '>' . esc_html__("Auto Unanswered (Replies to unanswered topics)", 'aiomatic-automatic-ai-content-writer') . '</option>
1576 + <option value="auto_random"'; if($post_title == 'auto_random'){$output .= ' selected';} $output .= '>' . esc_html__("Auto Random (Replies to random topics)", 'aiomatic-automatic-ai-content-writer') . '</option>
1577 + <option value="auto_latest"'; if($post_title == 'auto_latest'){$output .= ' selected';} $output .= '>' . esc_html__("Auto Latest (Replies to latest topics)", 'aiomatic-automatic-ai-content-writer') . '</option>
1578 + <option value="auto_oldest"'; if($post_title == 'auto_oldest'){$output .= ' selected';} $output .= '>' . esc_html__("Auto Oldest (Replies to oldest topics)", 'aiomatic-automatic-ai-content-writer') . '</option>
1579 + <option value="auto_popular"'; if($post_title == 'auto_popular'){$output .= ' selected';} $output .= '>' . esc_html__("Auto Most Popular (Replies to most popular topics)", 'aiomatic-automatic-ai-content-writer') . '</option>
1580 + <option value="auto_least_popular"'; if($post_title == 'auto_least_popular'){$output .= ' selected';} $output .= '>' . esc_html__("Auto Least Popular (Replies to least popular topics)", 'aiomatic-automatic-ai-content-writer') . '</option>
1581 + <option value="auto_most_replied"'; if($post_title == 'auto_most_replied'){$output .= ' selected';} $output .= '>' . esc_html__("Auto Most Replied (Replies to most replied topics)", 'aiomatic-automatic-ai-content-writer') . '</option>
1582 + <option value="auto_least_replied"'; if($post_title == 'auto_least_replied'){$output .= ' selected';} $output .= '>' . esc_html__("Auto Least Replied (Replies to least replied topics)", 'aiomatic-automatic-ai-content-writer') . '</option>
1583 + <option value="auto_oldest_no_replies"'; if($post_title == 'auto_oldest_no_replies'){$output .= ' selected';} $output .= '>' . esc_html__("Auto Oldest No Replies (Replies to oldest topics with no replies)", 'aiomatic-automatic-ai-content-writer') . '</option>
1584 + <option value="auto_latest_no_replies"'; if($post_title == 'auto_latest_no_replies'){$output .= ' selected';} $output .= '>' . esc_html__("Auto Latest No Replies (Replies to latest topics with no replies)", 'aiomatic-automatic-ai-content-writer') . '</option>
1585 + </select>
1586 + </td>
1587 + <td class="cr_comm_td"><input type="number" step="1" min="1" placeholder="# h" name="aiomatic_reply_list[schedule][]" max="8765812" value="' . esc_attr($schedule) . '" class="cr_width_60" required></td>
1588 + <td class="cr_comm_td"><input type="number" step="1" min="0" placeholder="#" name="aiomatic_reply_list[max][]" value="' . esc_attr($max) . '" class="cr_width_60" required></td>
1589 + <td class="cr_width_70 cr_center">
1590 + <input type="button" id="mybtnfzr' . esc_html($cont) . '" value="Settings">
1591 + <div id="mymodalfzr' . esc_html($cont) . '" class="codemodalfzr">
1592 + <div class="codemodalfzr-content">
1593 + <div class="codemodalfzr-header">
1594 + <span id="aiomatic_close' . esc_html($cont) . '" class="codeclosefzr">&times;</span>
1595 + <h2>' . esc_html__('Rule', 'aiomatic-automatic-ai-content-writer') . ' <span class="cr_color_white">ID ' . esc_html($cont) . '</span> ' . esc_html__('Advanced Settings', 'aiomatic-automatic-ai-content-writer') . '</h2>
1596 + </div>
1597 + <div class="codemodalfzr-body">
1598 + <div class="table-responsive">
1599 + <table class="responsive table cr_main_table_nowr"><tr><td colspan="2"><h3>' . esc_html__("AI Assistant Options", 'aiomatic-automatic-ai-content-writer') . ':</h3>
1600 + </td></tr><tr>
1601 + <td class="cr_min_width_200">
1602 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1603 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select the AI Assistant to use for content creation. This will disable the ability to select AI models, as the models assisgned to the assistant will be used for content creation.", 'aiomatic-automatic-ai-content-writer') . '</div>
1604 + </div>
1605 + <b>' . esc_html__("AI Assistant Name:", 'aiomatic-automatic-ai-content-writer') . '</b>
1606 + </td>
1607 + <td><select id="assistant_id' . esc_html($cont) . '" name="aiomatic_reply_list[assistant_id][]" class="cr_width_full" onchange="assistantSelected(\'' . esc_html($cont) . '\');">';
1608 + if($all_assistants === false)
1609 + {
1610 + $output .= '<option val="" selected disabled>' . esc_html__("Only OpenAI API is supported for Assistants API", 'aiomatic-automatic-ai-content-writer') . '</option>';
1611 + }
1612 + else
1613 + {
1614 + if(count($all_assistants) == 0)
1615 + {
1616 + $output .= '<option val="" selected disabled>' . esc_html__("No Assistans added, go to the plugin's 'AI Assistans' menu to add new assistants!", 'aiomatic-automatic-ai-content-writer') . '</option>';
1617 + }
1618 + else
1619 + {
1620 + $output .= '<option value=""';
1621 + if($assistant_id == ''){$output .= ' selected';}
1622 + $output .= '>' . esc_html__("Don't use assistants, use AI models instead", 'aiomatic-automatic-ai-content-writer') . '</option>';
1623 + foreach($all_assistants as $myassistant)
1624 + {
1625 + $output .= '<option value="' . esc_html($myassistant->ID) .'"';
1626 + if($assistant_id == $myassistant->ID){$output .= ' selected';}
1627 + $output .= '>' . esc_html($myassistant->post_title);
1628 + $output .= '</option>';
1629 + }
1630 + }
1631 + }
1632 + $output .= '</select>
1633 + </td>
1634 + </tr>
1635 + <tr><td colspan="2"><h3>' . esc_html__('Reply Options', 'aiomatic-automatic-ai-content-writer') . ':</h3></td></tr>
1636 + <tr><td class="cr_min_width_200">
1637 + <div>
1638 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1639 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the number of automatic replies to add to created topics. You can also define custom ranges, like: 3-5. To disable this feature, leave it blank.", 'aiomatic-automatic-ai-content-writer') . '
1640 + </div>
1641 + </div>
1642 + <b>' . esc_html__("Reply Count To Add To The Topic", 'aiomatic-automatic-ai-content-writer') . ':</b>
1643 + </td><td>
1644 + <input type="text" name="aiomatic_reply_list[reply_count][]" placeholder="Add the number of replies to create" class="cr_width_full" value="' . esc_attr($reply_count) . '">
1645 + </div>
1646 + </td></tr><tr><td class="cr_min_width_200">
1647 + <div>
1648 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1649 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the maximum number of replies a topic can have, when it will still be processed.", 'aiomatic-automatic-ai-content-writer') . '
1650 + </div>
1651 + </div>
1652 + <b>' . esc_html__("Maximum Reply Count For Topics", 'aiomatic-automatic-ai-content-writer') . ':</b>
1653 + </td><td>
1654 + <input type="text" name="aiomatic_reply_list[more_replies][]" placeholder="Don\'t process if it has more replies than" class="cr_width_full" value="' . esc_attr($more_replies) . '">
1655 + </div>
1656 + </td></tr>
1657 + <tr><td>
1658 + <div>
1659 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1660 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select the AI Model to be used for the reply generator.", 'aiomatic-automatic-ai-content-writer') . '
1661 + </div>
1662 + </div>
1663 + <b>' . esc_html__("AI Model For The AI Reply Generator", 'aiomatic-automatic-ai-content-writer') . ':</b>
1664 + </td><td class="cr_min_width_200">
1665 + <select autocomplete="off" name="aiomatic_reply_list[reply_model][]" class="hideAssistant' . esc_html($cont) . ' cr_width_full">';
1666 + if(empty($reply_model))
1667 + {
1668 + $reply_model = AIMOGEN_DEFAULT_MODEL;
1669 + }
1670 + foreach($all_models as $modelx)
1671 + {
1672 + $output .= '<option value="' . esc_html($modelx) .'"';
1673 + if ($reply_model == $modelx)
1674 + {
1675 + $output .= " selected";
1676 + }
1677 + else
1678 + {
1679 + $output .= (($assistant_id != '') ? ' disabled ' : '');
1680 + }
1681 + $output .= '>' . esc_html($modelx) . esc_html(aiomatic_get_model_provider($modelx)) . '</option>';
1682 + }
1683 + $output .= '</select>
1684 + </div>
1685 + </td></tr>
1686 + <tr><td class="cr_min_width_200">
1687 + <div>
1688 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1689 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the prompt to use for the user selector for the replies. This command can be any given task or order, based on which, it will generate content for posts. You can use the following shortcodes here: %%participant_list%%, %%conversation%%, %%post_title%%, %%random_sentence%%, %%post_original_title%%, %%random_sentence2%%, %%blog_title%%. You can also add a link to a TXT file, containing keywords (one per line), or to an RSS feed. The length of this command should not be greater than the max token count set in the settings for the prompt command - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins). You can also add here a link to a .txt file, where you can add multiple prompts (one per line) and the plugin will select a random one at each run. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer') . '&nbsp;' . sprintf( wp_kses( __( "Please check some tips and tricks about writing prompt commands, <a href='%s' target='_blank'>here</a>.", 'aiomatic-automatic-ai-content-writer'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), 'https://coderevolution.ro/knowledge-base/faq/how-to-create-a-good-seed-prompt-command-for-aiomatic-for-openai-gpt-3-api/' ) . '
1690 + </div>
1691 + </div>
1692 + <b>' . esc_html__("Prompt For The AI Topic Reply User Selector", 'aiomatic-automatic-ai-content-writer') . ':</b>&nbsp;<b><a href="https://coderevolution.ro/knowledge-base/faq/how-to-create-a-good-seed-prompt-command-for-aiomatic-for-openai-gpt-3-api/" target="_blank">&#9432;</a></b>
1693 +
1694 + </td><td>
1695 + <textarea rows="4" cols="70" name="aiomatic_reply_list[choose_prompt][]" placeholder="Please insert a command for the AI" class="cr_width_full">' . esc_textarea($choose_prompt) . '</textarea>
1696 +
1697 + </div>
1698 + </td></tr>
1699 + <tr><td class="cr_min_width_200">
1700 + <div>
1701 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1702 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the prompt to use for the reply content generator. This command can be any given task or order, based on which, it will generate content for posts. You can use the following shortcodes here: %%reply_user_name%%, %%participant_list%%, %%conversation%%, %%post_title%%, %%random_sentence%%, %%post_original_title%%, %%random_sentence2%%, %%blog_title%%. You can also add a link to a TXT file, containing keywords (one per line), or to an RSS feed. The length of this command should not be greater than the max token count set in the settings for the prompt command - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins). You can also add here a link to a .txt file, where you can add multiple prompts (one per line) and the plugin will select a random one at each run. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer') . '&nbsp;' . sprintf( wp_kses( __( "Please check some tips and tricks about writing prompt commands, <a href='%s' target='_blank'>here</a>.", 'aiomatic-automatic-ai-content-writer'), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), 'https://coderevolution.ro/knowledge-base/faq/how-to-create-a-good-seed-prompt-command-for-aiomatic-for-openai-gpt-3-api/' ) . '
1703 + </div>
1704 + </div>
1705 + <b>' . esc_html__("Prompt For The AI Topic Reply Generator", 'aiomatic-automatic-ai-content-writer') . ':</b>&nbsp;<b><a href="https://coderevolution.ro/knowledge-base/faq/how-to-create-a-good-seed-prompt-command-for-aiomatic-for-openai-gpt-3-api/" target="_blank">&#9432;</a></b>
1706 +
1707 + </td><td>
1708 + <textarea rows="4" cols="70" name="aiomatic_reply_list[reply_prompt][]" placeholder="Please insert a command for the AI" class="cr_width_full">' . esc_textarea($reply_prompt) . '</textarea>
1709 +
1710 + </div>
1711 + </td></tr><tr><td>
1712 + <div>
1713 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1714 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select the user role from where random users will be selected.", 'aiomatic-automatic-ai-content-writer') . '
1715 + </div>
1716 + </div>
1717 + <b>' . esc_html__("User Role For Random User Selection", 'aiomatic-automatic-ai-content-writer') . ':</b>
1718 + </td><td class="cr_min_width_200">
1719 + <select autocomplete="off" id="user_role' . esc_html($cont) . '" name="aiomatic_reply_list[user_role][]" class="cr_width_full">';
1720 + $output .= '<option value="any"';
1721 + if ($user_role == "any") {
1722 + $output .= " selected";
1723 + }
1724 + $output .= '>' . esc_html__("Any", 'aiomatic-automatic-ai-content-writer') . '</option>';
1725 + global $wp_roles;
1726 + $roles = $wp_roles->roles;
1727 + foreach ($roles as $role_key => $role) {
1728 + $output .= '<option value="' . esc_attr($role_key) . '"';
1729 + if ($user_role == $role_key) {
1730 + $output .= " selected";
1731 + }
1732 + $output .= '>' . esc_html($role['name']) . '</option>';
1733 + }
1734 + $output .= '</select>
1735 + </div>
1736 + </td></tr>
1737 + <tr><td colspan="2"><h2>' . esc_html__('Content Parameters', 'aiomatic-automatic-ai-content-writer') . ':</h2></td></tr>
1738 + <tr><td class="cr_min_width_200">
1739 + <div>
1740 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1741 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the language of the created content. This will set the value of the %%language%% shortcode, which can be used in prompts below. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer') . '
1742 + </div>
1743 + </div>
1744 + <b>' . esc_html__("Content Language", 'aiomatic-automatic-ai-content-writer') . ':</b>
1745 +
1746 + </td><td>
1747 + <input id="content_language' . esc_html($cont) . '" name="aiomatic_reply_list[content_language][]" type="text" list="languages" placeholder="Created content language" class="coderevolution_gutenberg_input" value="' . esc_attr($content_language) . '"/>
1748 + </div>
1749 + </td></tr>
1750 + <tr><td class="cr_min_width_200">
1751 + <div>
1752 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1753 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the writing style of the created content. This will set the value of the %%writing_style%% shortcode, which can be used in prompts below. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer') . '
1754 + </div>
1755 + </div>
1756 + <b>' . esc_html__("Writing Style", 'aiomatic-automatic-ai-content-writer') . ':</b>
1757 +
1758 + </td><td>
1759 + <input id="writing_style' . esc_html($cont) . '" name="aiomatic_reply_list[writing_style][]" type="text" list="writing_styles" placeholder="Created content writing style" class="coderevolution_gutenberg_input" value="' . esc_attr($writing_style) . '"/>
1760 + </div>
1761 + </td></tr>
1762 + <tr><td class="cr_min_width_200">
1763 + <div>
1764 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1765 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the writing tone of the created content. This will set the value of the %%writing_tone%% shortcode, which can be used in prompts below. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer') . '
1766 + </div>
1767 + </div>
1768 + <b>' . esc_html__("Writing Tone", 'aiomatic-automatic-ai-content-writer') . ':</b>
1769 +
1770 + </td><td>
1771 + <input id="writing_tone' . esc_html($cont) . '" name="aiomatic_reply_list[writing_tone][]" type="text" list="writing_tones" placeholder="Created content writing tone" class="coderevolution_gutenberg_input" value="' . esc_attr($writing_tone) . '"/>
1772 + </div>
1773 + </td></tr>
1774 + <tr><td colspan="2"><h3>' . esc_html__('Global Prompt Options', 'aiomatic-automatic-ai-content-writer') . ':</h3></td></tr>
1775 + <tr><td class="cr_min_width_200">
1776 + <div>
1777 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1778 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("This will be prepended to each prompt sent by the plugin to the AI writer. You can use the following shortcodes: %%topic%%, %%language%%, %%writing_style%%, %%writing_tone%%, %%title%%, %%random_sentence%%, %%random_sentence2%%, %%post_original_title%%, %%blog_title%%, %%royalty_free_image_attribution%% - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins). You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer') . '
1779 + </div>
1780 + </div>
1781 + <b>' . esc_html__("Prepend Text To All Textual AI Prompts", 'aiomatic-automatic-ai-content-writer') . ':</b>
1782 +
1783 + </td><td>
1784 + <textarea rows="2" cols="70" name="aiomatic_reply_list[global_prepend][]" placeholder="Global prompt prepend text" class="cr_width_full">' . esc_textarea($global_prepend) . '</textarea>
1785 +
1786 + </div>
1787 + </td></tr>
1788 + <tr><td class="cr_min_width_200">
1789 + <div>
1790 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1791 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("This will be appended to each prompt sent by the plugin to the AI writer. You can use the following shortcodes: %%topic%%, %%language%%, %%writing_style%%, %%writing_tone%%, %%title%%, %%random_sentence%%, %%random_sentence2%%, %%post_original_title%%, %%blog_title%%, %%royalty_free_image_attribution%% - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins). You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators. You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer') . '
1792 + </div>
1793 + </div>
1794 + <b>' . esc_html__("Append Text To All Textual AI Prompts", 'aiomatic-automatic-ai-content-writer') . ':</b>
1795 +
1796 + </td><td>
1797 + <textarea rows="2" cols="70" name="aiomatic_reply_list[global_append][]" placeholder="Global prompt append text" class="cr_width_full">' . esc_textarea($global_append) . '</textarea>
1798 +
1799 + </div>
1800 + </td></tr>
1801 + <tr><td colspan="2"><h3>' . esc_html__('Advanced AI Text Generator Options', 'aiomatic-automatic-ai-content-writer') . ':</h3></td></tr>
1802 + <tr><td class="cr_min_width_200">
1803 + <div>
1804 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1805 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the maximum number of API tokens to use with each request. This will define the length of the resulting API response. Each token usually consists of approximately 4 characters. Note that in this value the number of tokens sent to the API as an article prompt will also be counted. The maximum amount which can be set is 4000. For other models, the maximum is 2048.", 'aiomatic-automatic-ai-content-writer') . '
1806 + </div>
1807 + </div>
1808 + <b>' . esc_html__("Maximum Total Token Count To Use Per API Request", 'aiomatic-automatic-ai-content-writer') . ':</b>
1809 + </td><td>
1810 + <input type="number" min="1" name="aiomatic_reply_list[max_tokens][]" value="' . esc_attr($max_tokens) . '" placeholder="32768" class="cr_width_full">
1811 +
1812 + </div>
1813 + </td></tr><tr><td class="cr_min_width_200">
1814 + <div>
1815 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1816 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the maximum number of prompt API tokens to use with each request. This will define the length of the resulting API response. Each token usually consists of approximately 4 characters. This defines how much content does the API receive each time you call it. If the API gets more initial data, better quality results will be expected. The maximum amount which can be set is 1000.", 'aiomatic-automatic-ai-content-writer') . '
1817 + </div>
1818 + </div>
1819 + <b>' . esc_html__("Maximum Prompt Token Count To Use Per API Request", 'aiomatic-automatic-ai-content-writer') . ':</b>
1820 + </td><td>
1821 + <input type="number" min="1" name="aiomatic_reply_list[max_seed_tokens][]" value="' . esc_attr($max_seed_tokens) . '" placeholder="1000" class="cr_width_full">
1822 +
1823 + </div>
1824 + </td></tr><tr><td class="cr_min_width_200">
1825 + <div>
1826 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1827 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("What sampling temperature to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. We generally recommend altering this or top_p but not both.", 'aiomatic-automatic-ai-content-writer') . '
1828 + </div>
1829 + </div>
1830 + <b>' . esc_html__("AI Temperature", 'aiomatic-automatic-ai-content-writer') . ':</b>
1831 + </td><td>
1832 + <input type="number" min="0" step="0.01" max="2" name="aiomatic_reply_list[temperature][]" value="' . esc_attr($temperature) . '" placeholder="1" class="cr_width_full">
1833 +
1834 + </div>
1835 + </td></tr>
1836 + <tr><td class="cr_min_width_200">
1837 + <div>
1838 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1839 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.", 'aiomatic-automatic-ai-content-writer') . '
1840 + </div>
1841 + </div>
1842 + <b>' . esc_html__("AI Top_p", 'aiomatic-automatic-ai-content-writer') . ':</b>
1843 + </td><td>
1844 + <input type="number" min="0" step="0.01" max="1" name="aiomatic_reply_list[top_p][]" value="' . esc_attr($top_p) . '" placeholder="1" class="cr_width_full">
1845 +
1846 + </div>
1847 + </td></tr>
1848 + <tr><td class="cr_min_width_200">
1849 + <div>
1850 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1851 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.", 'aiomatic-automatic-ai-content-writer') . '
1852 + </div>
1853 + </div>
1854 + <b>' . esc_html__("AI Presence Penalty", 'aiomatic-automatic-ai-content-writer') . ':</b>
1855 + </td><td>
1856 + <input type="number" min="-2" max="2" step="0.01" name="aiomatic_reply_list[presence_penalty][]" value="' . esc_attr($presence_penalty) . '" placeholder="0" class="cr_width_full">
1857 +
1858 + </div>
1859 + </td></tr>
1860 + <tr><td class="cr_min_width_200">
1861 + <div>
1862 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1863 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.", 'aiomatic-automatic-ai-content-writer') . '
1864 + </div>
1865 + </div>
1866 + <b>' . esc_html__("AI Frequency Penalty", 'aiomatic-automatic-ai-content-writer') . ':</b>
1867 + </td><td>
1868 + <input type="number" min="-2" step="0.01" max="2" name="aiomatic_reply_list[frequency_penalty][]" value="' . esc_attr($frequency_penalty) . '" placeholder="0" class="cr_width_full">
1869 +
1870 + </div>
1871 + </td></tr>
1872 + <tr><td colspan="2"><h3>' . esc_html__('Posting Options', 'aiomatic-automatic-ai-content-writer') . ':</h3></td></tr>
1873 + <tr><td class="cr_min_width_200">
1874 + <div>
1875 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1876 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Enter a HTML text that should be prepended to the AI generated content in each created post. You can use the following shortcodes: %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%random_image[keyword]%%, %%random_image_url[keyword]%%, %%random_video[keyword]%%, %%royalty_free_image_attribution%% - you can also use an optional parameter in the random_image and random_video shortcodes, which will add a percentage chance for the media to appear or not - example: %%random_video[keyword][60]%% - a video will appear in 60% of cases, in the rest of 40%, nothing will be returned by the shortcode - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins). You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer') . '
1877 + </div>
1878 + </div>
1879 + <b>' . esc_html__("HTML Text To Prepend To AI Created Content", 'aiomatic-automatic-ai-content-writer') . ':</b>&nbsp;<b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">&#9432;</a></b>
1880 + </td><td>
1881 + <textarea rows="2" cols="70" name="aiomatic_reply_list[post_prepend][]" placeholder="HTML content to prepend to the AI generated content" class="cr_width_full">' . esc_textarea($post_prepend) . '</textarea>
1882 + </div>
1883 + </td></tr><tr><td class="cr_min_width_200">
1884 + <div>
1885 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1886 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Enter a HTML text that should be append to the AI generated content in each created post. You can use the following shortcodes: %%custom_html%%, %%custom_html2%%, %%random_sentence%%, %%random_sentence2%%, %%random_image[keyword]%%, %%random_image_url[keyword]%%, %%random_video[keyword]%%, %%royalty_free_image_attribution%% - you can also use an optional parameter in the random_image and random_video shortcodes, which will add a percentage chance for the media to appear or not - example: %%random_video[keyword][60]%% - a video will appear in 60% of cases, in the rest of 40%, nothing will be returned by the shortcode - Update: %%related_questions_KEYWORD%% is also supported, to get a list of PAA questions for the KEYWORD you want to use. Update: nested shortcodes also supported (shortcodes generated by rules from other plugins). You will also be able to use the custom shortcodes defined in the 'Custom Shortcode Creator' feature from the rule settings - this will allow you to create partially or fully AI generated prompts which will be used for the content generators.", 'aiomatic-automatic-ai-content-writer') . '
1887 + </div>
1888 + </div>
1889 + <b>' . esc_html__("HTML Text To Append To AI Created Content", 'aiomatic-automatic-ai-content-writer') . ':</b>&nbsp;<b><a href="https://coderevolution.ro/knowledge-base/faq/post-template-reference-advanced-usage/" target="_blank">&#9432;</a></b>
1890 + </td><td>
1891 + <textarea rows="2" cols="70" name="aiomatic_reply_list[post_append][]" placeholder="HTML content to append to the AI generated content" class="cr_width_full">' . esc_textarea($post_append) . '</textarea>
1892 + </div>
1893 + </td></tr><tr><td class="cr_min_width_200">
1894 + <div>
1895 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1896 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Custom AI generated content shortcode creator. If you wish to create content from multiple AI prompts, and use them in post content/post custom fields/taxonomies, you can configure this from here. Also, these shortcodes will be able to be used in custom fields or custom taxonomies which the plugin will create. Syntax for this field: shortcode_name => AI_MODEL_TO_USE @@ TEXTUAL_PROMPT_TO_USE (to specify multiple shortcodes and crawling values, separate them by a new line. Example: my_custom_shortcode => gpt-4.1-mini @@ Write a short poem. Afterwards, you can use shortcodes in any settings field that supports shortcodes (ex: 'HTML Text To Append To AI Created Content' settings field), like this: %%my_custom_shortcode%%. Official format is %%name_of_custom_shortcode%%", 'aiomatic-automatic-ai-content-writer') . '
1897 + </div>
1898 + </div>
1899 + <b>' . esc_html__("Custom Shortcode Creator (Optional)", 'aiomatic-automatic-ai-content-writer') . ':</b><span class="tool" data-tip="Supported models: ' . implode(',', aiomatic_get_all_models()) . '">&nbsp;&#9432;</span>
1900 + </td><td>
1901 + <textarea rows="2" cols="70" name="aiomatic_reply_list[custom_shortcodes][]" placeholder="shortcode_name => AI_MODEL @@ AI_PROMPT" class="cr_width_full">' . esc_textarea($custom_shortcodes) . '</textarea>
1902 + </div>
1903 + </td></tr><tr><td>
1904 + <div>
1905 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1906 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to skip spinning of posts generated by this rule?", 'aiomatic-automatic-ai-content-writer') . '
1907 + </div>
1908 + </div>
1909 + <b>' . esc_html__("Do Not Spin Topics Generated By This Rule", 'aiomatic-automatic-ai-content-writer') . ':</b>
1910 +
1911 + </td><td>
1912 + <input type="checkbox" id="skip_spin' . esc_html($cont) . '" name="aiomatic_reply_list[skip_spin][]"';
1913 + if($skip_spin == '1')
1914 + {
1915 + $output .= ' checked';
1916 + }
1917 + $output .= '>
1918 + </div>
1919 + </td></tr><tr><td>
1920 + <div>
1921 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1922 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to skip translating of posts generated by this rule?", 'aiomatic-automatic-ai-content-writer') . '
1923 + </div>
1924 + </div>
1925 + <b>' . esc_html__("Do Not Translate Topics Generated By This Rule", 'aiomatic-automatic-ai-content-writer') . ':</b>
1926 +
1927 + </td><td>
1928 + <input type="checkbox" id="skip_translate' . esc_html($cont) . '" name="aiomatic_reply_list[skip_translate][]"';
1929 + if($skip_translate == '1')
1930 + {
1931 + $output .= ' checked';
1932 + }
1933 + $output .= '>
1934 + </div>
1935 + </td></tr><tr><td>
1936 + <div>
1937 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1938 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Run regex on post content. To disable this feature, leave this field blank. No Regex separators are required here. You can add multiple Regex expressions, each on a different line.", 'aiomatic-automatic-ai-content-writer') . '
1939 + </div>
1940 + </div>
1941 + <b>' . esc_html__("Run Regex On Content", 'aiomatic-automatic-ai-content-writer') . ':</b>
1942 +
1943 + </td><td>
1944 + <textarea rows="1" class="cr_width_full" name="aiomatic_reply_list[strip_by_regex][]" placeholder="regex" class="cr_width_full">' . esc_textarea($strip_by_regex) . '</textarea>
1945 +
1946 + </div>
1947 + </td></tr><tr><td>
1948 + <div>
1949 + <div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1950 + <div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Replace the above regex matches with this regex expression. If you want to strip matched content, leave this field blank. No Regex separators are required here. You can add multiple replacement expressions, each on a different line.", 'aiomatic-automatic-ai-content-writer') . '
1951 + </div>
1952 + </div>
1953 + <b>' . esc_html__("Replace Matches From Regex (Content)", 'aiomatic-automatic-ai-content-writer') . ':</b>
1954 +
1955 + </td><td>
1956 + <textarea rows="1" class="cr_width_full" name="aiomatic_reply_list[replace_regex][]" placeholder="regex replacement" class="cr_width_full">' . esc_textarea($replace_regex) . '</textarea>
1957 +
1958 + </div>
1959 + </td></tr>
1960 + </table></div>
1961 + </div>
1962 + <div class="codemodalfzr-footer">
1963 + <br/>
1964 + <h3 class="cr_inline">Aimogen Automatic Post Generator</h3><span id="aiomatic_ok' . esc_html($cont) . '" class="codeokfzr cr_inline">OK&nbsp;</span>
1965 + <br/><br/>
1966 + </div>
1967 + </div>
1968 +
1969 + </div>
1970 + </td>
1971 + <td class="cr_shrt_td2"><span class="wpaiomatic-delete">X</span></td>
1972 + <td class="cr_short_td"><input type="checkbox" name="aiomatic_reply_list[active][]" class="activateDeactivateClass" value="1"';
1973 + if (isset($active) && $active === '1') {
1974 + $output .= ' checked';
1975 + }
1976 + $output .= '/>
1977 + <input type="hidden" name="aiomatic_reply_list[last_run][]" value="' . esc_attr($last_run) . '"/>
1978 + <input type="hidden" name="aiomatic_reply_list[rule_unique_id][]" value="' . esc_attr($rule_unique_id) . '"/></td>
1979 + <td class="cr_shrt_td2"><div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
1980 + <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):', 'aiomatic-automatic-ai-content-writer'), array( 'br' => array( ) ) ) ) . '<br/><b>%%aiomatic_7_' . esc_html($cont) . '%% and %%aiomatic_title_7_' . esc_html($cont) . '%%</b><br/>';
1981 + $output .= esc_html__('Last Run: ', 'aiomatic-automatic-ai-content-writer');
1982 + if ($last_run == '1988-01-27 00:00:00') {
1983 + $output .= 'Never';
1984 + } else {
1985 + $output .= $last_run;
1986 + }
1987 + $output .= '<br/>' . esc_html__('Next Run: ', 'aiomatic-automatic-ai-content-writer');
1988 + if($unlocker == '1')
1989 + {
1990 + $nextrun = aiomatic_add_minute($last_run, $schedule);
1991 + }
1992 + else
1993 + {
1994 + $nextrun = aiomatic_add_hour($last_run, $schedule);
1995 + }
1996 + $now = aiomatic_get_date_now();
1997 + if (isset($active) && $active === '1') {
1998 + if($unlocker == '1')
1999 + {
2000 + $aiomatic_hour_diff = (int)aiomatic_minute_diff($now, $nextrun);
2001 + }
2002 + else
2003 + {
2004 + $aiomatic_hour_diff = (int)aiomatic_hour_diff($now, $nextrun);
2005 + }
2006 + if ($aiomatic_hour_diff >= 0) {
2007 + if($unlocker == '1')
2008 + {
2009 + $append = 'Now.';
2010 + }
2011 + else
2012 + {
2013 + $append = 'Now.';
2014 + }
2015 + $cron = _get_cron_array();
2016 + if ($cron != FALSE) {
2017 + $date_format = _x('Y-m-d H:i:s', 'Date Time Format1', 'aiomatic-automatic-ai-content-writer');
2018 + foreach ($cron as $timestamp => $cronhooks) {
2019 + foreach ((array) $cronhooks as $hook => $events) {
2020 + if ($hook == 'aiomaticaction') {
2021 + foreach ((array) $events as $key => $event) {
2022 + $append = date_i18n($date_format, $timestamp);
2023 + }
2024 + }
2025 + }
2026 + }
2027 + }
2028 + $output .= $append;
2029 + } else {
2030 + $output .= $nextrun;
2031 + }
2032 + } else {
2033 + $output .= esc_html__('Rule Disabled', 'aiomatic-automatic-ai-content-writer');
2034 + }
2035 + $output .= '<br/>' . esc_html__('Local Time: ', 'aiomatic-automatic-ai-content-writer') . $now;
2036 + if(isset($aiomatic_Main_Settings['rule_webhook']) && $aiomatic_Main_Settings['rule_webhook'] == 'on')
2037 + {
2038 + $attsx = array();
2039 + $attsx['secret'] = aiomatic_generate_site_secret();
2040 + $attsx['ruleid'] = $cont;
2041 + $attsx['ruletype'] = '8';
2042 + $queryParams = http_build_query($attsx);
2043 + $webhookUrl = esc_url(get_site_url() . '/wp-json/aiomatic/v1/rules?' . $queryParams);
2044 + $webhookUrl = '<a href="' . $webhookUrl . '" target="_blank">' . $webhookUrl . '</a>';
2045 + $output .= '<br/>' . esc_html__('Webhook To Run Rule: ', 'aiomatic-automatic-ai-content-writer') . '<br/>' . $webhookUrl;
2046 + }
2047 + $output .= '</div>
2048 + </div></td>
2049 + <td class="cr_center">
2050 + <div>
2051 + <img id="run_img' . esc_html($cont) . '" src="' . plugin_dir_url(dirname(__FILE__)) . 'images/running.gif' . '" alt="Running" class="cr_status_icon';
2052 + if (!empty($running)) {
2053 + if (!in_array(array($cont => 8), $running)) {
2054 + $f = fopen(get_temp_dir() . 'aiomatic_8_' . $cont, 'w');
2055 + if($f !== false)
2056 + {
2057 + flock($f, LOCK_UN);
2058 + fclose($f);
2059 + global $wp_filesystem;
2060 + if ( ! is_a( $wp_filesystem, 'WP_Filesystem_Base') ){
2061 + include_once(ABSPATH . 'wp-admin/includes/file.php');$creds = request_filesystem_credentials( site_url() );
2062 + wp_filesystem($creds);
2063 + }
2064 + $wp_filesystem->delete(get_temp_dir() . 'aiomatic_8_' . $cont);
2065 + }
2066 + $output .= ' cr_hidden';
2067 + }
2068 + else
2069 + {
2070 + $f = fopen(get_temp_dir() . 'aiomatic_8_' . $cont, 'w');
2071 + if($f !== false)
2072 + {
2073 + if (!flock($f, LOCK_EX | LOCK_NB)) {
2074 + }
2075 + else
2076 + {
2077 + $output .= ' cr_hidden';
2078 + flock($f, LOCK_UN);
2079 + if (($xxkey = array_search(array($cont => 8), $running)) !== false) {
2080 + unset($running[$xxkey]);
2081 + aiomatic_update_option('aiomatic_running_list', $running);
2082 + }
2083 + }
2084 + }
2085 + }
2086 + }
2087 + else
2088 + {
2089 + $f = fopen(get_temp_dir() . 'aiomatic_8_' . $cont, 'w');
2090 + if($f !== false)
2091 + {
2092 + flock($f, LOCK_UN);
2093 + fclose($f);
2094 + global $wp_filesystem;
2095 + if ( ! is_a( $wp_filesystem, 'WP_Filesystem_Base') ){
2096 + include_once(ABSPATH . 'wp-admin/includes/file.php');$creds = request_filesystem_credentials( site_url() );
2097 + wp_filesystem($creds);
2098 + }
2099 + $wp_filesystem->delete(get_temp_dir() . 'aiomatic_8_' . $cont);
2100 + }
2101 + $output .= ' cr_hidden';
2102 + }
2103 + $output .= '" title="status">
2104 + <div class="codemainfzr cr_width_80p">
2105 + <select autocomplete="off" class="codemainfzr" id="actions' . esc_html($cont) . '" class="actions" name="actions" onchange="actionsChangedManual(' . esc_html($cont) . ', this.value, 8, \'' . esc_html($rule_unique_id) . '\');" onfocus="this.selectedIndex = 0;">
2106 + <option value="select" disabled selected>' . esc_html__("Select an Action", 'aiomatic-automatic-ai-content-writer') . '</option>
2107 + <option value="run">' . esc_html__("Run This Rule Now", 'aiomatic-automatic-ai-content-writer') . '</option>
2108 + <option value="duplicate">' . esc_html__("Duplicate This Rule", 'aiomatic-automatic-ai-content-writer') . '</option>
2109 + <option value="up">' . esc_html__("Move This Rule Up", 'aiomatic-automatic-ai-content-writer') . '</option>
2110 + <option value="down">' . esc_html__("Move This Rule Down", 'aiomatic-automatic-ai-content-writer') . '</option>
2111 + </select>
2112 + </div>
2113 + </div>
2114 + </td>
2115 + </tr>
2116 + ';
2117 + $cont = $cont + 1;
2118 + }
2119 + }
2120 + return $output;
2121 + }
2122 + ?>