sprint 5
This commit is contained in:
136
admin/admin.php
136
admin/admin.php
@@ -51,7 +51,6 @@ function superdesk_admin() {
|
|||||||
'author-byline' => $_POST['author-byline'],
|
'author-byline' => $_POST['author-byline'],
|
||||||
'byline-words' => $_POST['byline-words'],
|
'byline-words' => $_POST['byline-words'],
|
||||||
'display-copyright' => $_POST['display-copyright'],
|
'display-copyright' => $_POST['display-copyright'],
|
||||||
'convert-keywords' => $_POST['convert-keywords'],
|
|
||||||
'import-keywords' => $_POST['import-keywords'],
|
'import-keywords' => $_POST['import-keywords'],
|
||||||
'convert-services' => $_POST['convert-services'],
|
'convert-services' => $_POST['convert-services'],
|
||||||
'subject-type' => $_POST['subject-type'],
|
'subject-type' => $_POST['subject-type'],
|
||||||
@@ -67,6 +66,11 @@ function superdesk_admin() {
|
|||||||
'download-images' => $_POST['download-images'],
|
'download-images' => $_POST['download-images'],
|
||||||
'post-formats' => $_POST['download-images'],
|
'post-formats' => $_POST['download-images'],
|
||||||
'post-formats-table' => $resultArray,
|
'post-formats-table' => $resultArray,
|
||||||
|
'location-modifier' => $_POST['location-modifier'],
|
||||||
|
'update-log-option' => $_POST['update-log-option'],
|
||||||
|
'update-log-date-format' => $_POST['update-log-date-format'],
|
||||||
|
'update-log-text' => $_POST['update-log-text'],
|
||||||
|
'update-log-position' => $_POST['update-log-position'],
|
||||||
);
|
);
|
||||||
update_option('superdesk_settings', $settings);
|
update_option('superdesk_settings', $settings);
|
||||||
} else if (get_option('superdesk_settings')) {
|
} else if (get_option('superdesk_settings')) {
|
||||||
@@ -82,7 +86,6 @@ function superdesk_admin() {
|
|||||||
'author-byline' => '',
|
'author-byline' => '',
|
||||||
'byline-words' => '',
|
'byline-words' => '',
|
||||||
'display-copyright' => '',
|
'display-copyright' => '',
|
||||||
'convert-keywords' => '',
|
|
||||||
'import-keywords' => '',
|
'import-keywords' => '',
|
||||||
'convert-services' => '',
|
'convert-services' => '',
|
||||||
'subject-type' => '',
|
'subject-type' => '',
|
||||||
@@ -98,6 +101,11 @@ function superdesk_admin() {
|
|||||||
'download-images' => '',
|
'download-images' => '',
|
||||||
'post-formats' => '',
|
'post-formats' => '',
|
||||||
'post-formats-table' => array(),
|
'post-formats-table' => array(),
|
||||||
|
'location-modifier' => 'standard',
|
||||||
|
'update-log-option' => 'off',
|
||||||
|
'update-log-date-format' => 'Y-m-d H:i',
|
||||||
|
'update-log-text' => 'This article was updated at',
|
||||||
|
'update-log-position' => 'off'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$statuses = array(
|
$statuses = array(
|
||||||
@@ -175,7 +183,7 @@ function superdesk_admin() {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">
|
<th scope="row">
|
||||||
Status of the ingested articles/posts
|
Default status of ingested articles/posts
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
@@ -252,30 +260,6 @@ function superdesk_admin() {
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<th scope="row">
|
|
||||||
Convert slugline keywords into WP tags
|
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<fieldset>
|
|
||||||
<label for="off">
|
|
||||||
<input type="radio" name="convert-keywords" id="off" value="off"<?php
|
|
||||||
if ($settings['convert-keywords'] == 'off') {
|
|
||||||
echo(' checked');
|
|
||||||
}
|
|
||||||
?>> off
|
|
||||||
</label>
|
|
||||||
<br>
|
|
||||||
<label for="on">
|
|
||||||
<input type="radio" name="convert-keywords" id="on" value="on"<?php
|
|
||||||
if ($settings['convert-keywords'] == 'on') {
|
|
||||||
echo(' checked');
|
|
||||||
}
|
|
||||||
?>> on
|
|
||||||
</label>
|
|
||||||
</fieldset>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">
|
<th scope="row">
|
||||||
Import SD keywords as WP tags
|
Import SD keywords as WP tags
|
||||||
@@ -380,7 +364,7 @@ function superdesk_admin() {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">
|
<th scope="row">
|
||||||
Display the copyrightholder image
|
Display the image copyright holder in the caption
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
@@ -404,7 +388,7 @@ function superdesk_admin() {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">
|
<th scope="row">
|
||||||
Display the copyrightnotice image
|
Display the image copyright notice in the caption
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
@@ -434,6 +418,30 @@ function superdesk_admin() {
|
|||||||
<input type="text" name="separator-located" id="separator-located" class="regular-text" value="<?php echo($settings['separator-located']); ?>">
|
<input type="text" name="separator-located" id="separator-located" class="regular-text" value="<?php echo($settings['separator-located']); ?>">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
Display location as
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<fieldset>
|
||||||
|
<label for="location-modifier-all-caps">
|
||||||
|
<input type="radio" name="location-modifier" id="location-modifier-all-caps" value="all-caps"<?php
|
||||||
|
if ($settings['location-modifier'] == 'all-caps') {
|
||||||
|
echo(' checked');
|
||||||
|
}
|
||||||
|
?>> ALL CAPS
|
||||||
|
</label>
|
||||||
|
<br>
|
||||||
|
<label for="location-modifier-standard">
|
||||||
|
<input type="radio" name="location-modifier" id="location-modifier-standard" value="standard"<?php
|
||||||
|
if (!isset($settings['location-modifier']) || $settings['location-modifier'] != 'all-caps') {
|
||||||
|
echo(' checked');
|
||||||
|
}
|
||||||
|
?>> Standard case
|
||||||
|
</label>
|
||||||
|
</fieldset>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">
|
<th scope="row">
|
||||||
Convert slugline keywords into WP tags
|
Convert slugline keywords into WP tags
|
||||||
@@ -518,7 +526,75 @@ function superdesk_admin() {
|
|||||||
</label>
|
</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
Add update logs to articles
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<fieldset>
|
||||||
|
<label for="update-log-option-off">
|
||||||
|
<input type="radio" name="update-log-option" id="update-log-option-off" value="off"<?php
|
||||||
|
if (!isset($settings['update-log-option']) || $settings['update-log-option'] == 'off') {
|
||||||
|
echo(' checked');
|
||||||
|
}
|
||||||
|
?>> off
|
||||||
|
</label>
|
||||||
|
<br>
|
||||||
|
<label for="update-log-option-on">
|
||||||
|
<input type="radio" name="update-log-option" id="update-log-option-on" value="on"<?php
|
||||||
|
if ($settings['update-log-option'] == 'on') {
|
||||||
|
echo(' checked');
|
||||||
|
}
|
||||||
|
?>> on
|
||||||
|
</label>
|
||||||
|
</fieldset>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
Update log position in article
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<fieldset>
|
||||||
|
<label for="update-log-position-off">
|
||||||
|
<input type="radio" name="update-log-position" id="update-log-position-off" value="off"<?php
|
||||||
|
if (!isset($settings['update-log-position']) || $settings['update-log-position'] == 'off') {
|
||||||
|
echo(' checked');
|
||||||
|
}
|
||||||
|
?>> append
|
||||||
|
</label>
|
||||||
|
<br>
|
||||||
|
<label for="update-log-position-on">
|
||||||
|
<input type="radio" name="update-log-position" id="update-log-position-on" value="on"<?php
|
||||||
|
if ($settings['update-log-option'] == 'on') {
|
||||||
|
echo(' checked');
|
||||||
|
}
|
||||||
|
?>> prepend
|
||||||
|
</label>
|
||||||
|
</fieldset>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
<label for="update-log-date-format">Update log date format</label>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="update-log-date-format" id="update-log-date-format" class="regular-text" value="<?php echo($settings['update-log-date-format']); ?>">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
<label for="update-log-text">Update log date text</label>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="update-log-text" id="update-log-text" class="regular-text" value="<?php echo(!isset($settings['update-log-text']) ? 'This article was updated at' : $settings['update-log-text']); ?>">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
echo date(!empty($settings['update-log-date-format']) ? $settings['update-log-date-format'] : 'Y-m-d H:i'); ?>.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">
|
<th scope="row">
|
||||||
Match Superdesk Content Profiles with Wordpress Post Formats
|
Match Superdesk Content Profiles with Wordpress Post Formats
|
||||||
|
|||||||
44
autoload.php
44
autoload.php
@@ -14,12 +14,44 @@ if ($obj['type'] == 'text') {
|
|||||||
$settings = get_option('superdesk_settings');
|
$settings = get_option('superdesk_settings');
|
||||||
|
|
||||||
if ($obj['pubstatus'] == 'usable') {
|
if ($obj['pubstatus'] == 'usable') {
|
||||||
|
if (isset($obj['evolvedfrom'])) {
|
||||||
|
$guid = wp_strip_all_tags($obj['evolvedfrom']);
|
||||||
|
} else {
|
||||||
|
$guid = wp_strip_all_tags($obj['guid']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$sync = $wpdb->get_row("SELECT post_id FROM " . $wpdb->prefix . DB_TABLE_SYNC_POST . " WHERE guid = '" . $guid . "'");
|
||||||
|
|
||||||
|
$append = false;
|
||||||
|
$prepend = false;
|
||||||
|
$updateText = '';
|
||||||
|
if($sync && $settings['update-log-option'] == 'on'){
|
||||||
|
$updateText = $settings['update-log-text'] . ' '. date( $settings['update-log-date-format']). '.';
|
||||||
|
if($settings['update-log-position'] == 'on'){
|
||||||
|
$prepend = true;
|
||||||
|
}else{
|
||||||
|
$append = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($obj['located'])) {
|
if (!empty($obj['located'])) {
|
||||||
|
if($settings['location-modifier'] == 'all-caps'){
|
||||||
|
$obj['located'] = mb_strtoupper($obj['located']);
|
||||||
|
}
|
||||||
$content = $obj['description_html'] . "<!--more-->";
|
$content = $obj['description_html'] . "<!--more-->";
|
||||||
$content .= '<p>' . wp_strip_all_tags($obj['located']) . $settings['separator-located'];
|
$content .= '<p>';
|
||||||
|
if($prepend){
|
||||||
|
$content .= $updateText .'<br>';
|
||||||
|
}
|
||||||
|
$content .= wp_strip_all_tags($obj['located']) . $settings['separator-located'];
|
||||||
$content .= mb_substr($obj['body_html'], mb_strpos($obj['body_html'], '>') + 1, mb_strlen($obj['body_html']));
|
$content .= mb_substr($obj['body_html'], mb_strpos($obj['body_html'], '>') + 1, mb_strlen($obj['body_html']));
|
||||||
} else {
|
} else {
|
||||||
$content = $obj['description_html'] . "<!--more-->" . $obj['body_html'];
|
$content = $obj['description_html'] . "<!--more-->";
|
||||||
|
$content .= '<p>';
|
||||||
|
if($prepend){
|
||||||
|
$content .= $updateText .'<br>';
|
||||||
|
}
|
||||||
|
$content .= mb_substr($obj['body_html'], mb_strpos($obj['body_html'], '>') + 1, mb_strlen($obj['body_html']));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if ($settings['display-copyright'] == "on" && isset($obj['associations']['featuremedia']['copyrightnotice'])) {
|
/* if ($settings['display-copyright'] == "on" && isset($obj['associations']['featuremedia']['copyrightnotice'])) {
|
||||||
@@ -30,10 +62,8 @@ if ($obj['type'] == 'text') {
|
|||||||
$content .= "<p>Editors Note: " . wp_strip_all_tags($obj['ednote']) . "</p>";
|
$content .= "<p>Editors Note: " . wp_strip_all_tags($obj['ednote']) . "</p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($obj['evolvedfrom'])) {
|
if($append){
|
||||||
$guid = wp_strip_all_tags($obj['evolvedfrom']);
|
$content .= "<p>".$updateText."</p>";
|
||||||
} else {
|
|
||||||
$guid = wp_strip_all_tags($obj['guid']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($settings['import-keywords'] && $settings['import-keywords'] == 'on') {
|
if ($settings['import-keywords'] && $settings['import-keywords'] == 'on') {
|
||||||
@@ -126,7 +156,7 @@ if ($obj['type'] == 'text') {
|
|||||||
$content = embed_images($content, $image);
|
$content = embed_images($content, $image);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sync = $wpdb->get_row("SELECT post_id FROM " . $wpdb->prefix . DB_TABLE_SYNC_POST . " WHERE guid = '" . $guid . "'");
|
|
||||||
|
|
||||||
if ($sync) {
|
if ($sync) {
|
||||||
$post_ID = $sync->post_id;
|
$post_ID = $sync->post_id;
|
||||||
|
|||||||
Reference in New Issue
Block a user