diff --git a/admin/admin.php b/admin/admin.php index bdc45dd..78f6e9b 100644 --- a/admin/admin.php +++ b/admin/admin.php @@ -47,6 +47,7 @@ function superdesk_admin() { 'convert-slugline' => $_POST['convert-slugline'], 'slugline-separator' => $_POST['slugline-separator'], 'slugline-ignored' => $_POST['slugline-ignored'], + 'priority_threshhold' => $_POST['priority_threshhold'], ); update_option('superdesk_settings', $settings); } else if (get_option('superdesk_settings')) { @@ -74,6 +75,7 @@ function superdesk_admin() { 'convert-slugline' => '', 'slugline-separator' => '', 'slugline-ignored' => '', + 'priority_threshhold' => '', ); } $statuses = array( @@ -441,6 +443,27 @@ function superdesk_admin() { + + + + + + + +

diff --git a/autoload.php b/autoload.php index 4a3cb84..a1d3154 100644 --- a/autoload.php +++ b/autoload.php @@ -22,9 +22,9 @@ if ($obj['type'] == 'text') { $content = '

' . wp_strip_all_tags($obj['located']) . $settings['separator-located'] . $content; } - /*if ($settings['display-copyright'] == "on" && isset($obj['associations']['featuremedia']['copyrightnotice'])) { + /* if ($settings['display-copyright'] == "on" && isset($obj['associations']['featuremedia']['copyrightnotice'])) { $content.= "

" . wp_strip_all_tags($obj['associations']['featuremedia']['copyrightnotice']) . "

"; - }*/ + } */ if (!empty($obj['ednote'])) { $content.= "

Editors Note: " . wp_strip_all_tags($obj['ednote']) . "

"; @@ -154,6 +154,12 @@ if ($obj['type'] == 'text') { 'time' => current_time('mysql') ) ); + + if ($settings['priority_threshhold'] && $settings['priority_threshhold'] >= $obj['priority']) { + stick_post($post_ID); + } else { + unstick_post($post_ID); + } } else { $postarr = array( 'post_title' => wp_strip_all_tags($obj['headline']), @@ -180,6 +186,10 @@ if ($obj['type'] == 'text') { 'time' => current_time('mysql') ) ); + + if ($settings['priority_threshhold'] && $settings['priority_threshhold'] >= $obj['priority']) { + stick_post($post_ID); + } } /* save featured media */