" . __('The date format changed in Simple Yearly Archive 1.2.6! Please save the options once to assign the new date format to the system! Don\'t forget to change the date format string!', 'simple-yearly-archive') . "
"; } if( !get_option('sya_dateformatchanged2012') || get_option('sya_dateformatchanged2012') == 0 ) { add_action('admin_notices', 'sya_dateformat_changed_message'); } /** * Notify users that date format string is deprecated * * @since 1.2.7 * @author scripts@schloebe.de */ function sya_dateformat_deprecated_message() { echo "" . __('You still seem to use the old date format string in Simple Yearly Archive! Please change the date format string to assign the new date format to the system! An example would be " %d/%m "!', 'simple-yearly-archive') . "
" . implode( ' • ', sya_yearoverview( $yeararray ) ) . "
"; } if (($format == 'yearly') || ($format == 'yearly_act') || ($format == 'yearly_past') || ($format == '') || (preg_match("/^[0-9]{4}$/", $format))) { $before = get_option('sya_prepend'); $after = get_option('sya_append'); ((get_option('sya_excerpt_indent')=='') ? $indent = '0' : $indent = get_option('sya_excerpt_indent')); ((get_option('sya_excerpt_maxchars')=='') ? $maxzeichen = '0' : $maxzeichen = get_option('sya_excerpt_maxchars')); (($dateformat=='') ? $outputdateformat = get_option('sya_dateformat') : $outputdateformat = $dateformat); if ($jahreMitBeitrag) { if ($excludeCat != '' || $includeCat != '') { // there are excluded or included categories $excludeCats = explode( ",", trim($excludeCat) ); if( trim($includeCat) == '' ) $includeCats = array_diff( $allcatids, $excludeCats ); else $includeCats = explode( ",", trim( $includeCat ) ); $syaargs_includecats = implode(",", $includeCats); foreach($jahreMitBeitrag as $aktuellesJahr) { $aktuellerMonat = 1; while ($aktuellerMonat >= 1) { if(get_option('sya_linkyears')==TRUE) { $linkyears_prepend = ''; $linkyears_append = ''; } else { $linkyears_prepend = ''; $linkyears_append = ''; } if ($monateMitBeitrag[$aktuellesJahr->year][$aktuellerMonat]) { $listitems = $listyears; $syaargs_status = ( current_user_can('read_private_posts') ) ? "publish,private" : "publish"; if( version_compare($GLOBALS['wp_version'], '2.5.99', '>') ) { $syaargs = array( 'post_type' => 'post', 'numberposts' => -1, 'post_status' => $syaargs_status, 'category' => $syaargs_includecats, 'year' => $aktuellesJahr->year ); } else { $syaargs = array( 'post_type' => 'post', 'numberposts' => -1, 'post_status' => $syaargs_status, 'category' => $syaargs_includecats ); } $syaposts = get_posts( $syaargs ); $wp_dateformat = get_option('date_format'); if( $syaposts ) { foreach( $syaposts as $post ) { setup_postdata( $post ); $post->filter = 'sample'; if ( date(('Y'), strtotime($post->post_date)) == $aktuellesJahr->year ) { $langtitle = $post->post_title; $langtitle = apply_filters("the_title", $post->post_title); if( $post->post_status == 'private' ) { $isprivate = ' class="sya_private"'; $langtitle = sprintf(__('Private: %s'), $langtitle); } else { $isprivate = ''; } $listitems .= '
' . ' ';
}
$menutitle .= __('Simple Yearly Archive', 'simple-yearly-archive');
add_submenu_page('options-general.php', __('Simple Yearly Archive', 'simple-yearly-archive'), $menutitle, 9, __FILE__, 'sya_options_page');
}
}
/**
* Adds the plugin's options page
*
* @since 0.7
* @author scripts@schloebe.de
* @deprecated Deprecated since version 1.1.7
* @see sya_add_option_menu()
*/
function sya_add_optionpages() {
set_default_options();
add_options_page(__('Simple Yearly Archive Options', 'simple-yearly-archive'), __('Simple Yearly Archive', 'simple-yearly-archive'), 8, __FILE__, 'sya_options_page');
}
/**
* Filters the shortcode from the post content and returns the filtered content
*
* @since 0.7
* @author scripts@schloebe.de
*
* @param string
* @return string
*/
function sya_inline($post) {
if (substr_count($post, '') > 0) {
$sya_archives = get_simpleYearlyArchive($format, $excludeCat);
$post = str_replace('', $sya_archives, $post);
}
return $post;
}
add_action('the_content', 'sya_inline', 1);
if( version_compare($wp_version, '2.4.999', '>') ) {
/**
* Setups the plugin's shortcode
*
* @since 1.1.0
* @author scripts@schloebe.de
*
* @param mixed
* @return string
*/
function syatag_func( $atts ) {
extract(shortcode_atts(array(
'type' => 'yearly',
'exclude' => '',
'include' => '',
'dateformat' => ''
), $atts));
return get_simpleYearlyArchive($type, $exclude, $include, $dateformat);
}
if( function_exists('add_shortcode') ) {
add_shortcode('SimpleYearlyArchive', 'syatag_func');
}
}
/**
* Fills the options page with content
*
* @since 0.7
* @author scripts@schloebe.de
*/
function sya_options_page() {
global $wp_version;
if (isset($_POST['action']) === true) {
update_option("sya_dateformat", (string)$_POST['sya_dateformat']);
update_option("sya_datetitleseperator", (string)$_POST['sya_datetitleseperator']);
update_option("sya_linkyears", (bool)$_POST['sya_linkyears']);
update_option("sya_postcount", (bool)$_POST['sya_postcount']);
update_option("sya_commentcount", (bool)$_POST['sya_commentcount']);
update_option("sya_linktoauthor", (bool)$_POST['sya_linktoauthor']);
update_option("sya_prepend", (string)$_POST['sya_prepend']);
update_option("sya_append", (string)$_POST['sya_append']);
update_option("sya_excerpt", (bool)$_POST['sya_excerpt']);
update_option("sya_excerpt_indent", (string)$_POST['sya_excerpt_indent']);
update_option("sya_excerpt_maxchars", (string)$_POST['sya_excerpt_maxchars']);
update_option("sya_show_categories", (bool)$_POST['sya_show_categories']);
update_option("sya_showauthor", (bool)$_POST['sya_showauthor']);
update_option("sya_showyearoverview", (bool)$_POST['sya_showyearoverview']);
update_option("sya_dateformatchanged2012", 1);
$successmessage = __('Settings successfully updated!', 'simple-yearly-archive');
echo '' . $successmessage . '
| www.schloebe.de', 'simple-yearly-archive'); ?> |
| http://www.schloebe.de/wordpress/simple-yearly-archive-plugin/', 'simple-yearly-archive'); ?> |