'ffffff',
'text' => '666666',
'link' => '333333',
'border' => 'ffcc00',
'url' => '6688ff',
);
$content_width = 460;
function regulus_body_class( $classes, $class ) {
return array_map( 'esc_attr', $classes );
}
add_filter( 'body_class', 'regulus_body_class', 1, 2 );
add_theme_support( 'automatic-feed-links' );
// Custom background
add_custom_background();
add_theme_support( 'print-style' );
function regulus_custom_background() {
if ( '' != get_background_color() && '' == get_background_image() ) { ?>
__( 'Primary Navigation' ),
) );
function regulus_page_menu() { // fallback for primary navigation ?>
\n" ) {
echo "\t";
echo "\t\tAbout...
\n";
echo "\t\t" . $tempVar . "\n";
echo "\t\n";
}
}
function bm_getProperty( $property ) {
$value = get_option( "regulus_" . $property );
if( $value == "1" ) {
return 1;
} else {
return 0;
}
}
/*
function bm_calendar() {
echo "";
echo "";
get_calendar( 3 );
echo "
";
echo "";
}
*/
function bm_calendar() {
$options = get_option('widget_calendar');
$title = isset( $options['title'] ) ? '' . $options['title'] . '
' : '';
echo '' . $title;
echo '';
get_calendar( 3 );
echo '
';
echo '';
}
// -------------------------------------
// format html for display in a web page
// -------------------------------------
function bm_tidy_html( $data ) {
//remove dodgy characters
$data = htmlspecialchars( $data );
//remove carriage returns
$data = str_replace( "\r", "", $data );
//swap newlines for line breaks
$data = str_replace( "\n", "
", $data );
//replace
$data = str_replace( "
", "
", $data );
//add paragraph tags
$data = "" . str_replace( "
", "
\n", $data ) . '
';
//remove newline at the end of paragraphs
$data = str_replace( "
", "", $data);
//remove empty paragraphs
$data = str_replace( "", "", $data);
$data = str_replace( "
", "", $data );
$data = stripslashes( $data );
return $data;
}
/*
Plugin Name: WP Admin Bar 2
Version: 2.2
Plugin URI: http://mattread.com/archives/2005/03/wp-admin-bar-20/
Description: Adds a small admin bar to the top of every page.
Author: Matt Read
Author URI: http://www.mattread.com/
modified by Ben Gillbanks for use in Regulus theme
url :http://www.binarymoon.co.uk
*/
function bm_admin_bar()
{
global $user_level, $user_ID, $user_nickname, $posts, $author;
$_authordata = get_userdata( $posts[0]->post_author ?? null );
get_currentuserinfo();
if ( isset($user_level) ) {
?>
Admin Controls
Write';
$write_array = array( 'Write', $write_level, 'post-new.php' );
// END
// START Special case for edit.
// if (single OR page) AND (user level greater than author level OR is author OR is admin).
$edit_level = ( ( is_single() OR is_page() ) AND ( $user_level > $_authordata->user_level OR $_authordata->ID == $user_ID OR $user_level == 10 ) ) ? 0 : 11;
$edit_array = array('Edit',$edit_level,'post.php?action=edit&post=' . ( $posts[0]->ID ?? '' ) );
// END
$menu = array(
array('Dashboard',8,'index.php','dashboard'),
$write_array,
$edit_array,
);
$menu = apply_filters( 'wp_admin_bard', $menu ); // user level 11 to skip
foreach ( $menu as $item ) {
if ($user_level >= $item[1]) {
echo "\n\t- {$item[0]}
";
}
}
// Login and logout link.
echo "\n\t- "; wp_loginout(); echo "
";
echo "\n
";
echo "";
}
}
/*
Plugin Name: Author Highlight
Plugin URI: http://dev.wp-plugins.org/wiki/AuthorHighlight
Description: Author Highlight is a plugin that prints out a user-specified class attribute if the comment is made by the specified author. It is useful if you would like to apply a different style to comments made by yourself.
Version: 1.0
Author: Jonathan Leighton
Author URI: http://turnipspatch.com/
Licence: This WordPress plugin is licenced under the GNU General Public Licence. For more information see: http://www.gnu.org/copyleft/gpl.html
For documentation, please visit http://dev.wp-plugins.org/wiki/AuthorHighlight
modified by Ben Gillbanks for use in Regulus theme
url :http://www.binarymoon.co.uk
*/
$bm_author_highlight = array(
"class_name_highlight" => "highlighted",
"class_name_else" => "",
"email" => get_option( 'regulus_email' ),
"author" => get_option( 'regulus_name' )
);
function bm_author_highlight() {
global $comment;
global $bm_author_highlight;
if ( empty( $bm_author_highlight["author"] ) || empty( $bm_author_highlight["email"] ) || empty( $bm_author_highlight["class_name_highlight"] ) )
return;
$author = $comment -> comment_author;
$email = $comment -> comment_author_email;
if ( strcasecmp( $author, $bm_author_highlight[ "author" ] ) == 0 && strcasecmp( $email, $bm_author_highlight["email"]) == 0 ) {
return $bm_author_highlight[ "class_name_highlight" ];
} else {
return $bm_author_highlight[ "class_name_else" ];
}
}
/*
Plugin Name: the_excerpt Reloaded
Plugin URI: http://guff.szub.net/the-excerpt-reloaded
Description: This mod of WordPress' template function the_excerpt() knows there is no spoon.
Version: 0.2
Author: Kaf Oseo
Author URI: http://szub.net
~Changelog:
0.2 (16-Dec-2004)
Plugin now attempts to correct *broken* HTML tags (those allowed
through 'allowedtags') by using WP's balanceTags function. This
is controlled through the 'fix_tags' parameter.
Copyright (c) 2004
Released under the GPL license
http://www.gnu.org/licenses/gpl.txt
This is a WordPress plugin (http://wordpress.org).
WordPress is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
For a copy of the GNU General Public License, write to:
Free Software Foundation, Inc.
59 Temple Place, Suite 330
Boston, MA 02111-1307
USA
You can also view a copy of the HTML version of the GNU General
Public License at http://www.gnu.org/copyleft/gpl.html
modified by Ben Gillbanks for use in Regulus theme
url :http://www.binarymoon.co.uk
*/
function bm_the_excerpt_reloaded($excerpt_length=100, $allowedtags=',,- ,
', $filter_type='excerpt', $use_more_link=false, $more_link_text="(more...)", $force_more_link=false, $fakeit=1, $fix_tags=true) {
if (preg_match('%^content($|_rss)|^excerpt($|_rss)%', $filter_type)) {
$filter_type = 'the_' . $filter_type;
}
$text = apply_filters($filter_type, bm_get_the_excerpt_reloaded($excerpt_length, $allowedtags, $use_more_link, $more_link_text, $force_more_link, $fakeit));
$text = ($fix_tags) ? balanceTags($text) : $text;
echo $text;
}
function bm_get_the_excerpt_reloaded($excerpt_length, $allowedtags, $use_more_link, $more_link_text, $force_more_link, $fakeit) {
global $id, $post;
$output = '';
$output = get_the_excerpt();
if ( post_password_required() ) { // if there's a password
$output = __( 'There is no excerpt because this is a protected post.' );
return $output;
}
// If we haven't got an excerpt, make one.
if ((($output == '') && ($fakeit == 1)) || ($fakeit == 2)) {
$output = $post->post_content;
$output = strip_tags($output, $allowedtags);
$blah = explode(' ', $output);
if (count($blah) > $excerpt_length) {
$k = $excerpt_length;
$use_dotdotdot = 1;
} else {
$k = count($blah);
$use_dotdotdot = 0;
}
$excerpt = '';
for ($i=0; $i<$k; $i++) {
$excerpt .= $blah[$i] . ' ';
}
// Display "more" link (use css class 'more-link' to set layout).
if (($use_more_link && $use_dotdotdot) || $force_more_link) {
$excerpt .= "";
} else {
$excerpt .= ($use_dotdotdot) ? '...' : '';
}
$output = $excerpt;
} // end if no excerpt
return $output;
}
// Comment Template functions
function regulus_comment_fields($fields) {
$comment_field = '';
array_unshift( $fields, $comment_field );
return $fields;
}
add_filter( 'comment_form_default_fields', 'regulus_comment_fields' );
function regulus_comment_form_defaults($defaults) {
if ( ! is_user_logged_in() )
$defaults['comment_field'] = '';
return $defaults;
}
add_filter( 'comment_form_defaults', 'regulus_comment_form_defaults' );
function regulus_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
global $commentCount;
extract($args, EXTR_SKIP);
$class = bm_author_highlight();
?>
- >
tag based on what is being viewed.
*
* @since Regulus 2.1.3
*/
function regulus_wp_title( $title, $sep ) {
global $page, $paged;
if ( is_feed() )
return $title;
// Add the blog name
$title .= get_bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title .= " $sep $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
$title .= " $sep " . sprintf( __( 'Page %s', 'regulus' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'regulus_wp_title', 10, 2 );
/**
* Load theme options file.
*/
require( dirname( __FILE__ ) . '/inc/theme-options.php' );