| 1 |
<?php |
| 2 |
require_once(dirname(__FILE__) . '/admin-ui.php'); |
| 3 |
|
| 4 |
function fwp_syndication_options_page () { |
| 5 |
global $wpdb, $wp_db_version; |
| 6 |
|
| 7 |
if (FeedWordPress::needs_upgrade()) : |
| 8 |
fwp_upgrade_page(); |
| 9 |
return; |
| 10 |
endif; |
| 11 |
|
| 12 |
if (isset($_POST['create_index'])) : |
| 13 |
check_admin_referer(); |
| 14 |
if (!current_user_can('manage_options')) : |
| 15 |
die (__("Cheatin' uh ?")); |
| 16 |
else : |
| 17 |
FeedWordPress::create_guid_index(); |
| 18 |
?> |
| 19 |
<div class="updated"> |
| 20 |
<p><?php _e('Index created on database table.')?></p> |
| 21 |
</div> |
| 22 |
<?php |
| 23 |
endif; |
| 24 |
endif; |
| 25 |
|
| 26 |
if (isset($_POST['submit']) or isset($_POST['create_index'])) : |
| 27 |
check_admin_referer(); |
| 28 |
|
| 29 |
if (!current_user_can('manage_options')): |
| 30 |
die (__("Cheatin' uh ?")); |
| 31 |
else: |
| 32 |
update_option('feedwordpress_cat_id', $_REQUEST['syndication_category']); |
| 33 |
update_option('feedwordpress_munge_permalink', $_REQUEST['munge_permalink']); |
| 34 |
update_option('feedwordpress_use_aggregator_source_data', $_REQUEST['use_aggregator_source_data']); |
| 35 |
update_option('feedwordpress_formatting_filters', $_REQUEST['formatting_filters']); |
| 36 |
update_option('feedwordpress_update_logging', $_REQUEST['update_logging']); |
| 37 |
|
| 38 |
if ('newuser'==$_REQUEST['unfamiliar_author']) : |
| 39 |
$newuser_name = trim($_REQUEST['unfamiliar_author_newuser']); |
| 40 |
if (strlen($newuser_name) > 0) : |
| 41 |
$userdata = array(); |
| 42 |
$userdata['ID'] = NULL; |
| 43 |
|
| 44 |
$userdata['user_login'] = sanitize_user($newuser_name); |
| 45 |
$userdata['user_login'] = apply_filters('pre_user_login', $userdata['user_login']); |
| 46 |
|
| 47 |
$userdata['user_nicename'] = sanitize_title($newuser_name); |
| 48 |
$userdata['user_nicename'] = apply_filters('pre_user_nicename', $userdata['user_nicename']); |
| 49 |
|
| 50 |
$userdata['display_name'] = $wpdb->escape($newuser_name); |
| 51 |
|
| 52 |
$newuser_id = wp_insert_user($userdata); |
| 53 |
if (is_numeric($newuser_id)) : |
| 54 |
update_option('feedwordpress_unfamiliar_author', $newuser_id); |
| 55 |
else : |
| 56 |
// TODO: Add some error detection and reporting |
| 57 |
endif; |
| 58 |
else : |
| 59 |
// TODO: Add some error reporting |
| 60 |
endif; |
| 61 |
else : |
| 62 |
update_option('feedwordpress_unfamiliar_author', $_REQUEST['unfamiliar_author']); |
| 63 |
endif; |
| 64 |
|
| 65 |
if (isset($_REQUEST['match_author_by_email']) and $_REQUEST['match_author_by_email']=='yes') : |
| 66 |
update_option('feedwordpress_do_not_match_author_by_email', 'no'); |
| 67 |
else : |
| 68 |
update_option('feedwordpress_do_not_match_author_by_email', 'yes'); |
| 69 |
endif; |
| 70 |
|
| 71 |
if (isset($_REQUEST['null_emails'])) : |
| 72 |
update_option('feedwordpress_null_email_set', $_REQUEST['null_emails']); |
| 73 |
endif; |
| 74 |
|
| 75 |
update_option('feedwordpress_unfamiliar_category', $_REQUEST['unfamiliar_category']); |
| 76 |
update_option('feedwordpress_syndicated_post_status', $_REQUEST['post_status']); |
| 77 |
update_option('feedwordpress_automatic_updates', ($_POST['automatic_updates']=='yes')); |
| 78 |
update_option('feedwordpress_update_time_limit', ($_POST['update_time_limit']=='yes')?(int) $_POST['time_limit_seconds']:0); |
| 79 |
update_option('feedwordpress_freshness', ($_POST['freshness_interval']*60)); |
| 80 |
|
| 81 |
// Categories |
| 82 |
$cats = array(); |
| 83 |
if (isset($_POST['post_category'])) : |
| 84 |
$cats = array(); |
| 85 |
foreach ($_POST['post_category'] as $cat_id) : |
| 86 |
$cats[] = '{#'.$cat_id.'}'; |
| 87 |
endforeach; |
| 88 |
endif; |
| 89 |
|
| 90 |
if (!empty($cats)) : |
| 91 |
update_option('feedwordpress_syndication_cats', implode(FEEDWORDPRESS_CAT_SEPARATOR, $cats)); |
| 92 |
else : |
| 93 |
delete_option('feedwordpress_syndication_cats'); |
| 94 |
endif; |
| 95 |
|
| 96 |
// Tags |
| 97 |
if (isset($_REQUEST['tags_input'])) : |
| 98 |
$tags = explode(",", $_REQUEST['tags_input']); |
| 99 |
else : |
| 100 |
$tags = array(); |
| 101 |
endif; |
| 102 |
|
| 103 |
if (!empty($tags)) : |
| 104 |
update_option('feedwordpress_syndication_tags', implode(FEEDWORDPRESS_CAT_SEPARATOR, $tags)); |
| 105 |
else : |
| 106 |
delete_option('feedwordpress_syndication_tags'); |
| 107 |
endif; |
| 108 |
|
| 109 |
if (isset($_REQUEST['comment_status']) and ($_REQUEST['comment_status'] == 'open')) : |
| 110 |
update_option('feedwordpress_syndicated_comment_status', 'open'); |
| 111 |
else : |
| 112 |
update_option('feedwordpress_syndicated_comment_status', 'closed'); |
| 113 |
endif; |
| 114 |
|
| 115 |
if (isset($_REQUEST['ping_status']) and ($_REQUEST['ping_status'] == 'open')) : |
| 116 |
update_option('feedwordpress_syndicated_ping_status', 'open'); |
| 117 |
else : |
| 118 |
update_option('feedwordpress_syndicated_ping_status', 'closed'); |
| 119 |
endif; |
| 120 |
|
| 121 |
if (isset($_REQUEST['hardcode_name']) and ($_REQUEST['hardcode_name'] == 'no')) : |
| 122 |
update_option('feedwordpress_hardcode_name', 'no'); |
| 123 |
else : |
| 124 |
update_option('feedwordpress_hardcode_name', 'yes'); |
| 125 |
endif; |
| 126 |
|
| 127 |
if (isset($_REQUEST['hardcode_description']) and ($_REQUEST['hardcode_description'] == 'no')) : |
| 128 |
update_option('feedwordpress_hardcode_description', 'no'); |
| 129 |
else : |
| 130 |
update_option('feedwordpress_hardcode_description', 'yes'); |
| 131 |
endif; |
| 132 |
|
| 133 |
if (isset($_REQUEST['hardcode_url']) and ($_REQUEST['hardcode_url'] == 'no')) : |
| 134 |
update_option('feedwordpress_hardcode_url', 'no'); |
| 135 |
else : |
| 136 |
update_option('feedwordpress_hardcode_url', 'yes'); |
| 137 |
endif; |
| 138 |
?> |
| 139 |
<div class="updated"> |
| 140 |
<p><?php _e('Options saved.')?></p> |
| 141 |
</div> |
| 142 |
<?php |
| 143 |
endif; |
| 144 |
endif; |
| 145 |
|
| 146 |
$cat_id = FeedWordPress::link_category_id(); |
| 147 |
$munge_permalink = get_option('feedwordpress_munge_permalink'); |
| 148 |
$use_aggregator_source_data = get_option('feedwordpress_use_aggregator_source_data'); |
| 149 |
$formatting_filters = get_option('feedwordpress_formatting_filters'); |
| 150 |
$update_logging = get_option('feedwordpress_update_logging'); |
| 151 |
|
| 152 |
$update_time_limit = (int) get_option('feedwordpress_update_time_limit'); |
| 153 |
|
| 154 |
$automatic_updates = get_option('feedwordpress_automatic_updates'); |
| 155 |
|
| 156 |
$freshness_interval = get_option('feedwordpress_freshness'); |
| 157 |
if (false === $freshness_interval) : |
| 158 |
$freshness_interval = FEEDWORDPRESS_FRESHNESS_INTERVAL; |
| 159 |
endif; |
| 160 |
$freshness_interval = $freshness_interval / 60; // convert to minutes |
| 161 |
|
| 162 |
$hardcode_name = get_option('feedwordpress_hardcode_name'); |
| 163 |
$hardcode_description = get_option('feedwordpress_hardcode_description'); |
| 164 |
$hardcode_url = get_option('feedwordpress_hardcode_url'); |
| 165 |
|
| 166 |
$post_status = get_option("feedwordpress_syndicated_post_status"); // default="publish" |
| 167 |
$comment_status = get_option("feedwordpress_syndicated_comment_status"); // default="closed" |
| 168 |
$ping_status = get_option("feedwordpress_syndicated_ping_status"); // default="closed" |
| 169 |
|
| 170 |
$unfamiliar_author = array ('create' => '','default' => '','filter' => ''); |
| 171 |
$ua = FeedWordPress::on_unfamiliar('author'); |
| 172 |
if (is_string($ua) and array_key_exists($ua, $unfamiliar_author)) : |
| 173 |
$unfamiliar_author[$ua] = ' checked="checked"'; |
| 174 |
endif; |
| 175 |
|
| 176 |
$match_author_by_email = !('yes' == get_option("feedwordpress_do_not_match_author_by_email")); |
| 177 |
$null_emails = FeedWordPress::null_email_set(); |
| 178 |
|
| 179 |
$unfamiliar_category = array ('create'=>'','default'=>'','filter'=>'', 'tag'=>''); |
| 180 |
$uc = FeedWordPress::on_unfamiliar('category'); |
| 181 |
if (is_string($uc) and array_key_exists($uc, $unfamiliar_category)) : |
| 182 |
$unfamiliar_category[$uc] = ' checked="checked"'; |
| 183 |
endif; |
| 184 |
|
| 185 |
if (isset($wp_db_version) and $wp_db_version >= 4772) : |
| 186 |
$results = get_categories('type=link'); |
| 187 |
|
| 188 |
// Guarantee that the Contributors category will be in the drop-down chooser, even if it is empty. |
| 189 |
$found_link_category_id = false; |
| 190 |
foreach ($results as $row) : |
| 191 |
if ($row->cat_id == $cat_id) : $found_link_category_id = true; endif; |
| 192 |
endforeach; |
| 193 |
|
| 194 |
if (!$found_link_category_id) : $results[] = get_category($cat_id); endif; |
| 195 |
else : |
| 196 |
$results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $wpdb->linkcategories ORDER BY cat_id"); |
| 197 |
endif; |
| 198 |
|
| 199 |
$cats = array_map('trim', |
| 200 |
preg_split(FEEDWORDPRESS_CAT_SEPARATOR_PATTERN, get_option('feedwordpress_syndication_cats')) |
| 201 |
); |
| 202 |
$dogs = SyndicatedPost::category_ids($cats, /*unfamiliar=*/ NULL); |
| 203 |
|
| 204 |
$tags = array_map('trim', |
| 205 |
preg_split(FEEDWORDPRESS_CAT_SEPARATOR_PATTERN, get_option('feedwordpress_syndication_tags')) |
| 206 |
); |
| 207 |
?> |
| 208 |
<script type="text/javascript"> |
| 209 |
function contextual_appearance (item, appear, disappear, value, checkbox) { |
| 210 |
var rollup=document.getElementById(item); |
| 211 |
var newuser=document.getElementById(appear); |
| 212 |
var sitewide=document.getElementById(disappear); |
| 213 |
if (rollup) { |
| 214 |
if ((checkbox && rollup.checked) || (!checkbox && value==rollup.value)) { |
| 215 |
if (newuser) newuser.style.display='block'; |
| 216 |
if (sitewide) sitewide.style.display='none'; |
| 217 |
} else { |
| 218 |
if (newuser) newuser.style.display='none'; |
| 219 |
if (sitewide) sitewide.style.display='block'; |
| 220 |
} |
| 221 |
} |
| 222 |
} |
| 223 |
</script> |
| 224 |
|
| 225 |
<div class="wrap"> |
| 226 |
<h2>Syndication Options</h2> |
| 227 |
<div id="poststuff"> |
| 228 |
<form action="" method="post"> |
| 229 |
<?php fwp_linkedit_single_submit(); ?> |
| 230 |
<div id="post-body"> |
| 231 |
<?php fwp_option_box_opener('Syndicated Feeds', 'syndicatedfeedsdiv'); ?> |
| 232 |
<table class="editform" width="100%" cellspacing="2" cellpadding="5"> |
| 233 |
<tr> |
| 234 |
<th width="33%" scope="row">Syndicated Link category:</th> |
| 235 |
<td width="67%"><?php |
| 236 |
echo "\n<select name=\"syndication_category\" size=\"1\">"; |
| 237 |
foreach ($results as $row) { |
| 238 |
if (!isset($row->cat_id)) { $row->cat_id = $row->cat_ID; } |
| 239 |
|
| 240 |
echo "\n\t<option value=\"$row->cat_id\""; |
| 241 |
if ($row->cat_id == $cat_id) |
| 242 |
echo " selected='selected'"; |
| 243 |
echo ">$row->cat_id: ".wp_specialchars($row->cat_name); |
| 244 |
if ('Y' == $row->auto_toggle) |
| 245 |
echo ' (auto toggle)'; |
| 246 |
echo "</option>\n"; |
| 247 |
} |
| 248 |
echo "\n</select>\n"; |
| 249 |
?></td> |
| 250 |
</tr> |
| 251 |
|
| 252 |
<tr style="vertical-align: top"> |
| 253 |
<th width="33%" scope="row">Check for feeds ready to be polled for updates:</th> |
| 254 |
<td width="67%"><select name="automatic_updates" size="1" onchange="if (this.value=='yes') { disp = 'inline'; } else { disp = 'none'; }; el=document.getElementById('automatic-update-interval-span'); if (el) el.style.display=disp;"> |
| 255 |
<option value="yes"<?php echo ($automatic_updates)?' selected="selected"':''; ?>>automatically</option> |
| 256 |
<option value="no"<?php echo (!$automatic_updates)?' selected="selected"':''; ?>>only when I request</option> |
| 257 |
</select> |
| 258 |
<span id="automatic-update-interval-span" style="display: <?php echo $automatic_updates?'inline':'none';?>"><label for="automatic-update-interval">every</label> <input id="automatic-update-interval" name="freshness_interval" value="<?php echo $freshness_interval; ?>" size="4" /> minutes.</span> |
| 259 |
</td> |
| 260 |
</tr> |
| 261 |
|
| 262 |
<tr style="vertical-align: top"> |
| 263 |
<th width="33%" scope="row"><?php print __('Time limit on updates'); ?>:</th> |
| 264 |
<td width="67%"><select id="time-limit" name="update_time_limit" size="1" onchange="contextual_appearance('time-limit', 'time-limit-box', null, 'yes');"> |
| 265 |
<option value="no"<?php echo ($update_time_limit>0)?'':' selected="selected"'; ?>>no time limit on updates</option> |
| 266 |
<option value="yes"<?php echo ($update_time_limit>0)?' selected="selected"':''; ?>>limit updates to no more than...</option> |
| 267 |
</select> |
| 268 |
<span id="time-limit-box"><label><input type="text" name="time_limit_seconds" value="<?php print $update_time_limit; ?>" size="5" /> seconds</label></span> |
| 269 |
</tr> |
| 270 |
|
| 271 |
<script type="text/javascript"> |
| 272 |
contextual_appearance('time-limit', 'time-limit-box', null, 'yes'); |
| 273 |
</script> |
| 274 |
|
| 275 |
<tr><th width="33%" scope="row" style="vertical-align:top">Feed information:</th> |
| 276 |
<td width="67%"><ul style="margin:0;padding:0;list-style:none"> |
| 277 |
<li><input type="checkbox" name="hardcode_name" value="no"<?php echo (($hardcode_name=='yes')?'':' checked="checked"');?>/> Update the contributor title when the feed title changes</li> |
| 278 |
<li><input type="checkbox" name="hardcode_description" value="no"<?php echo (($hardcode_description=='yes')?'':' checked="checked"');?>/> Update when contributor description if the feed tagline changes</li> |
| 279 |
<li><input type="checkbox" name="hardcode_url" value="no"<?php echo (($hardcode_url=='yes')?'':' checked="checked"');?>/> Update the contributor homepage when the feed link changes</li> |
| 280 |
</ul></td></tr> |
| 281 |
</table> |
| 282 |
<?php fwp_linkedit_periodic_submit(); ?> |
| 283 |
<?php fwp_option_box_closer(); ?> |
| 284 |
|
| 285 |
<?php |
| 286 |
fwp_option_box_opener(__('Syndicated Posts'), 'syndicatedpostsdiv'); |
| 287 |
?> |
| 288 |
<table class="editform" width="75%" cellspacing="2" cellpadding="5"> |
| 289 |
<tr style="vertical-align: top"><th width="44%" scope="row">Publication:</th> |
| 290 |
<td width="56%"><ul style="margin: 0; padding: 0; list-style:none"> |
| 291 |
<li><label><input type="radio" name="post_status" value="publish"<?php echo (!$post_status or $post_status=='publish')?' checked="checked"':''; ?> /> Publish syndicated posts immediately</label></li> |
| 292 |
<?php if (SyndicatedPost::use_api('post_status_pending')) : ?> |
| 293 |
<li><label><input type="radio" name="post_status" value="pending"<?php echo ($post_status=='pending')?' checked="checked"':''; ?> /> Hold syndicated posts for review; mark as Pending</label></li> |
| 294 |
<?php endif; ?> |
| 295 |
<li><label><input type="radio" name="post_status" value="draft"<?php echo ($post_status=='draft')?' checked="checked"':''; ?> /> Save syndicated posts as drafts</label></li> |
| 296 |
<li><label><input type="radio" name="post_status" value="private"<?php echo ($post_status=='private')?' checked="checked"':''; ?> /> Save syndicated posts as private posts</label></li> |
| 297 |
</ul></td></tr> |
| 298 |
|
| 299 |
<tr style="vertical-align: top"><th width="44%" scope="row">Permalinks point to:</th> |
| 300 |
<td width="56%"><select name="munge_permalink" size="1"> |
| 301 |
<option value="yes"<?php echo ($munge_permalink=='yes')?' selected="selected"':''; ?>>original website</option> |
| 302 |
<option value="no"<?php echo ($munge_permalink=='no')?' selected="selected"':''; ?>>this website</option> |
| 303 |
</select></td></tr> |
| 304 |
|
| 305 |
<tr style="vertical-align: top"><th width="44%" scope="row">Posts from aggregator feeds:</th> |
| 306 |
<td width="56%"><ul style="margin: 0; padding: 0; list-style: none;"> |
| 307 |
<li><label><input type="radio" name="use_aggregator_source_data" value="no"<?php echo ($use_aggregator_source_data!="yes")?' checked="checked"':''; ?>> Give the aggregator itself as the source of posts from an aggregator feed.</label></li> |
| 308 |
<li><label><input type="radio" name="use_aggregator_source_data" value="yes"<?php echo ($use_aggregator_source_data=="yes")?' checked="checked"':''; ?>> Give the original source of the post as the source, not the aggregator.</label></li> |
| 309 |
</ul> |
| 310 |
<p>Some feeds (for example, those produced by FeedWordPress) aggregate content from several different sources, and include information about the original source of the post. |
| 311 |
This setting controls what FeedWordPress will give as the source of posts from |
| 312 |
such an aggregator feed.</p> |
| 313 |
</td></tr> |
| 314 |
|
| 315 |
<tr style="vertical-align:top"><th width="44%" scope="row">Formatting filters:</th> |
| 316 |
<td width="56%"> |
| 317 |
<select name="formatting_filters" size="1"> |
| 318 |
<option value="no"<?php echo ($formatting_filters!='yes')?' selected="selected"':''; ?>>Protect syndicated posts from formatting filters</option> |
| 319 |
<option value="yes"<?php echo ($formatting_filters=='yes')?' selected="selected"':''; ?>>Expose syndicated posts to formatting filters</option> |
| 320 |
</select> |
| 321 |
<p>If you have trouble getting plugins to work that are supposed to insert |
| 322 |
elements after posts (like relevant links or a social networking |
| 323 |
<q>Share This</q> button), try changing this option to see if it fixes your |
| 324 |
problem.</p> |
| 325 |
</td></tr> |
| 326 |
</table> |
| 327 |
<?php |
| 328 |
fwp_option_box_closer(); |
| 329 |
fwp_linkedit_periodic_submit(); |
| 330 |
|
| 331 |
fwp_option_box_opener(__('Categories for syndicated posts'), 'categorydiv', 'postbox'); |
| 332 |
fwp_category_box($dogs, '<em>all syndicated posts</em>'); |
| 333 |
?> |
| 334 |
<table class="editform" width="75%" cellspacing="2" cellpadding="5"> |
| 335 |
<tr style="vertical-align: top"><th width="27%" scope="row" style="vertical-align:top">Unfamiliar categories:</th> |
| 336 |
<td><p>When one of the categories on a syndicated post is a category that FeedWordPress has not encountered before ...</p> |
| 337 |
<ul style="margin: 0; padding:0; list-style:none"> |
| 338 |
<li><label><input type="radio" name="unfamiliar_category" value="create"<?php echo $unfamiliar_category['create']; ?>/> create a new category</label></li> |
| 339 |
<li><label><input type="radio" name="unfamiliar_category" value="tag"<?php echo $unfamiliar_category['tag']; ?>/> create a new tag</label></li> |
| 340 |
<li><label><input type="radio" name="unfamiliar_category" value="default"<?php echo $unfamiliar_category['default']; ?>/> don't create new categories or tags</li> |
| 341 |
<li><label><input type="radio" name="unfamiliar_category" value="filter"<?php echo $unfamiliar_category['filter']; ?>/> don't create new categories or tags and don't syndicate posts unless they match at least one familiar category</label></li> |
| 342 |
</ul></td></tr> |
| 343 |
</table> |
| 344 |
<?php |
| 345 |
fwp_option_box_closer(); |
| 346 |
fwp_linkedit_periodic_submit(); |
| 347 |
|
| 348 |
if (isset($wp_db_version) and $wp_db_version >= FWP_SCHEMA_25) : |
| 349 |
fwp_tags_box($tags); |
| 350 |
fwp_linkedit_periodic_submit(); |
| 351 |
endif; |
| 352 |
|
| 353 |
fwp_option_box_opener(__('Comments & Pings'), 'commentstatus', 'postbox'); |
| 354 |
?> |
| 355 |
<table class="editform" width="75%" cellspacing="2" cellpadding="5"> |
| 356 |
<tr style="vertical-align: top"><th width="44%" scope="row"><?php print __('Comments') ?>:</th> |
| 357 |
<td width="56%"><ul style="margin: 0; padding: 0; list-style:none"> |
| 358 |
<li><label><input type="radio" name="comment_status" value="open"<?php echo ($comment_status=='open')?' checked="checked"':''; ?> /> Allow comments on syndicated posts</label></li> |
| 359 |
<li><label><input type="radio" name="comment_status" value="closed"<?php echo ($comment_status!='open')?' checked="checked"':''; ?> /> Don't allow comments on syndicated posts</label></li> |
| 360 |
</ul></td></tr> |
| 361 |
|
| 362 |
<tr style="vertical-align: top"><th width="44%" scope="row"><?php print __('Pings') ?>:</th> |
| 363 |
<td width="56%"><ul style="margin:0; padding: 0; list-style:none"> |
| 364 |
<li><label><input type="radio" name="ping_status" value="open"<?php echo ($ping_status=='open')?' checked="checked"':''; ?> /> Accept pings on syndicated posts</label></li> |
| 365 |
<li><label><input type="radio" name="ping_status" value="closed"<?php echo ($ping_status!='open')?' checked="checked"':''; ?> /> Don't accept pings on syndicated posts</label></li> |
| 366 |
</ul></td></tr> |
| 367 |
</table> |
| 368 |
<?php |
| 369 |
fwp_option_box_closer(); |
| 370 |
fwp_linkedit_periodic_submit(); |
| 371 |
|
| 372 |
fwp_option_box_opener('Syndicated Authors', 'authordiv', 'postbox'); |
| 373 |
|
| 374 |
$unfamiliar_author = FeedWordPress::on_unfamiliar('author'); |
| 375 |
$authorlist = fwp_author_list(); |
| 376 |
?> |
| 377 |
<table> |
| 378 |
<tr><th colspan="3" style="text-align: left; padding-top: 1.0em; border-bottom: 1px dotted black;">For posts by authors that haven't been syndicated before:</th></tr> |
| 379 |
<tr style="vertical-align: top"> |
| 380 |
<th style="text-align: left">Posts by new authors</th> |
| 381 |
<td> |
| 382 |
<select style="max-width: 16.0em;" id="unfamiliar-author" name="unfamiliar_author" onchange="contextual_appearance('unfamiliar-author', 'unfamiliar-author-newuser', 'unfamiliar-author-default', 'newuser');"> |
| 383 |
<option value="create"<?php if ('create'==$unfamiliar_author) : ?>selected="selected"<?php endif; ?>>create a new author account</option> |
| 384 |
<?php foreach ($authorlist as $author_id => $author_name) : ?> |
| 385 |
<option value="<?php echo $author_id; ?>"<?php if ($author_id==$unfamiliar_author) : ?>selected="selected"<?php endif; ?>>are assigned to <?php echo $author_name; ?></option> |
| 386 |
<?php endforeach; ?> |
| 387 |
<option value="newuser">will be assigned to a user named...</option> |
| 388 |
<option value="filter"<?php if ('filter'==$unfamiliar_author) : ?>selected="selected"<?php endif; ?>>get filtered out</option> |
| 389 |
</select> |
| 390 |
</td> |
| 391 |
<td> |
| 392 |
<div id="unfamiliar-author-newuser"><input type="text" name="unfamiliar_author_newuser" value="" /></div> |
| 393 |
</td> |
| 394 |
</tr> |
| 395 |
<tr><td></td> |
| 396 |
<td colspan="2"> |
| 397 |
<p>This is a default setting. You can override it for one or more particular feeds using the Edit link in <a href="admin.php?page=<?php print $GLOBALS['fwp_path']; ?>/syndication.php">Syndicated Sites</a></p> |
| 398 |
</td> |
| 399 |
</table> |
| 400 |
|
| 401 |
<script type="text/javascript"> |
| 402 |
contextual_appearance('unfamiliar-author', 'unfamiliar-author-newuser', 'unfamiliar-author-default', 'newuser'); |
| 403 |
</script> |
| 404 |
|
| 405 |
<h4>Matching Authors</h4> |
| 406 |
<ul style="list-style: none; margin: 0; padding: 0;"> |
| 407 |
<li><div><label><input id="match-author-by-email" type="checkbox" name="match_author_by_email" value="yes" <?php if ($match_author_by_email) : ?>checked="checked" <?php endif; ?>onchange="contextual_appearance('match-author-by-email', 'unless-null-email', null, 'yes', /*checkbox=*/ true);" /> Treat syndicated authors with the same e-mail address as the same author.</label></div> |
| 408 |
<div id="unless-null-email"> |
| 409 |
<p>Unless the e-mail address is one of the following anonymous e-mail addresses:</p> |
| 410 |
<textarea name="null_emails" rows="3" style="width: 100%"> |
| 411 |
<?php print implode("\n", $null_emails); ?> |
| 412 |
</textarea> |
| 413 |
</div></li> |
| 414 |
</ul> |
| 415 |
|
| 416 |
<script type="text/javascript"> |
| 417 |
contextual_appearance('match-author-by-email', 'unless-null-email', null, 'yes', /*checkbox=*/ true); |
| 418 |
</script> |
| 419 |
|
| 420 |
<?php |
| 421 |
fwp_option_box_closer(); |
| 422 |
fwp_linkedit_periodic_submit(); |
| 423 |
|
| 424 |
fwp_option_box_opener('Back End', 'backenddiv', 'postbox'); |
| 425 |
?> |
| 426 |
<table class="editform" width="100%" cellspacing="2" cellpadding="5"> |
| 427 |
<tr style="vertical-align: top"> |
| 428 |
<th width="33%" scope="row">Update notices:</th> |
| 429 |
<td width="67%"><select name="update_logging" size="1"> |
| 430 |
<option value="yes"<?php echo (($update_logging=='yes')?' selected="selected"':''); ?>>write to PHP logs</option> |
| 431 |
<option value="no"<?php echo (($update_logging!='yes')?' selected="selected"':''); ?>>don't write to PHP logs</option> |
| 432 |
</select></td> |
| 433 |
</tr> |
| 434 |
<tr style="vertical-align: top"> |
| 435 |
<th width="33%" scope="row">Guid index:</th> |
| 436 |
<td width="67%"><input class="button" type="submit" name="create_index" value="Create index on guid column in posts database table" /> |
| 437 |
<p>Creating this index may significantly improve performance on some large |
| 438 |
FeedWordPress installations.</p></td> |
| 439 |
</tr> |
| 440 |
</table> |
| 441 |
<?php |
| 442 |
fwp_option_box_closer(); |
| 443 |
fwp_linkedit_periodic_submit(); |
| 444 |
?> |
| 445 |
</div> |
| 446 |
</form> |
| 447 |
|
| 448 |
</div> <!-- id="poststuff" --> |
| 449 |
</div> <!-- class="wrap" --> |
| 450 |
<?php |
| 451 |
} |
| 452 |
|
| 453 |
fwp_syndication_options_page(); |
| 454 |
|
| 455 |
|