style and functions updates

This commit is contained in:
John Bintz 2009-07-16 21:54:55 -04:00
parent c4fc0e08bf
commit 877f588c07
3 changed files with 832 additions and 775 deletions

View File

@ -1,19 +1,19 @@
<?php <?php
//COMIC CATEGORY -the WordPress ID of your comic category (default "3"). //COMIC CATEGORY -the WordPress ID of your comic category (default "3").
$comiccat = "3"; $comiccat = "4";
//BLOG CATEGORY - the WordPress ID of your blog category (default "1"). //BLOG CATEGORY - the WordPress ID of your blog category (default "1").
$blogcat = "1"; $blogcat = "3";
//COMIC FOLDER - the folder your comics files are located in (default "comics") //COMIC FOLDER - the folder your comics files are located in (default "comics")
$comic_folder = "comics"; $comic_folder = "comics";
//RSS COMIC FOLDER - the folder your comic files are in for the RSS feed (default "comics"). //RSS COMIC FOLDER - the folder your comic files are in for the RSS feed (default "comics").
$rss_comic_folder = "comics"; $rss_comic_folder = "comics-rss";
//ARCHIVE COMIC FOLDER - the folder your comic files are in for your archive pages (default "comics"). //ARCHIVE COMIC FOLDER - the folder your comic files are in for your archive pages (default "comics").
$archive_comic_folder = "comics"; $archive_comic_folder = "comics-archive";
//ARCHIVE COMIC WIDTH - the width your comics will appear on archive or search results (default "380"). //ARCHIVE COMIC WIDTH - the width your comics will appear on archive or search results (default "380").
$archive_comic_width = "380"; $archive_comic_width = "380";

View File

@ -1,6 +1,8 @@
<?php <?php
include(TEMPLATEPATH . '/comicpress-config.php'); include(get_template_directory() . '/comicpress-config.php');
include(get_template_directory() . '/comment-functions.php');
include(get_template_directory() . '/custom-image-header.php');
// If any errors occur while searching for a comic file, the error messages will be pushed into here. // If any errors occur while searching for a comic file, the error messages will be pushed into here.
$comic_pathfinding_errors = array(); $comic_pathfinding_errors = array();
@ -32,15 +34,6 @@ $comic_filename_filters['default'] = "{date}*.*";
// load all of the comic & non-comic category information // load all of the comic & non-comic category information
add_action('init', 'get_all_comic_categories'); add_action('init', 'get_all_comic_categories');
add_action('init', 'comicpress_handle_options_changes');
add_action('admin_menu', 'comicpress_add_options_menu');
add_action('admin_notices', 'comicpress_admin_notices');
$__comicpress_notices = array();
function comicpress_add_options_menu() {
add_theme_page(__("ComicPress Config", 'comicpress'), __('ComicPress Config', 'comicpress'), 'edit_themes', basename(__FILE__), 'comicpress_options_menu');
}
function get_first_comic() { function get_first_comic() {
return get_terminal_post_in_category(get_all_comic_categories_as_cat_string()); return get_terminal_post_in_category(get_all_comic_categories_as_cat_string());
@ -50,117 +43,6 @@ function get_last_comic() {
return get_terminal_post_in_category(get_all_comic_categories_as_cat_string(), false); return get_terminal_post_in_category(get_all_comic_categories_as_cat_string(), false);
} }
function comicpress_admin_notices() {
global $__comicpress_notices;
if (!empty($__comicpress_notices) && is_array($__comicpress_notices)) {
echo '<div class="updated fade">';
foreach ($__comicpress_notices as $notice) { echo '<p>' . $notice . '</p>'; }
echo '</div>';
}
}
function comicpress_handle_options_changes() {
global $__comicpress_notices;
include(get_template_directory() . '/comicpress-config.php');
if (isset($_POST['cp'])) {
if (wp_verify_nonce($_POST['cp']['_nonce'], 'comicpress')) {
foreach ($_POST['cp'] as $field => $value) {
${$field} = $value;
}
$lines = file(get_template_directory() . '/comicpress-config.php', FILE_IGNORE_NEW_LINES);
for ($i = 0, $il = count($lines); $i < $il; ++$i) {
if (preg_match('#\$([^\ ]+)#', $lines[$i], $matches) > 0) {
if (!empty(${$matches[1]})) {
$lines[$i] = "\${$matches[1]} = \"" . ${$matches[1]} . "\";";
}
}
}
if (($fh = fopen(get_template_directory() . '/comicpress-config.php', "w")) !== false) {
foreach ($lines as $line) { fwrite($fh, $line . "\n"); }
fclose($fh);
$__comicpress_notices[] = __('ComicPress options updated.', 'comicpress');
} else {
$__comicpress_notices[] = __("Unable to write file. Check your theme directory's permissions.", 'comicpress');
}
}
}
}
function comicpress_options_menu() {
include(get_template_directory() . '/comicpress-config.php');
$categories = get_all_category_ids();
echo '<div class="wrap">';
_e('<h2>ComicPress Config</h2>', 'comicpress');
echo '<form method="post">';
echo '<input type="hidden" name="cp[_nonce]" value="' . wp_create_nonce('comicpress') . '" />';
echo '<table>';
foreach (array(
'blogcat' => array(
'type' => 'category',
'label' => __('Blog category', 'comicpress')
),
'comiccat' => array(
'type' => 'category',
'label' => __('Comic category', 'comicpress')
),
'comic_folder' => array(
'type' => 'text',
'label' => __('Comic folder', 'comicpress')
),
'rss_comic_folder' => array(
'type' => 'text',
'label' => __('RSS comic folder', 'comicpress')
),
'archive_comic_folder' => array(
'type' => 'text',
'label' => __('Archive comic folder', 'comicpress')
),
'archive_comic_width' => array(
'type' => 'text',
'label' => __('Archive comic width', 'comicpress')
),
'rss_comic_width' => array(
'type' => 'text',
'label' => __('RSS comic width', 'comicpress')
),
'blog_postcount' => array(
'type' => 'text',
'label' => __('Blog postcount', 'comicpress')
)
) as $field => $parameters) {
echo '<tr>';
echo '<th scope="row">' . $parameters['label'] . '</th>';
echo '<td>';
switch ($parameters['type']) {
case "category":
echo '<select name="cp[' . $field . ']">';
foreach ($categories as $category_id) {
echo '<option value="' . $category_id . '"' . ((${$field} == $category_id) ? 'selected="selected"' : "") . '>' . get_cat_name($category_id) . '</option>';
}
echo '</select>';
break;
case "text":
echo '<input type="text" name="cp[' . $field . ']" value="' . ${$field} . '" />';
break;
}
echo '</td>';
echo '</tr>';
}
echo '<tr><td></td><td><input type="submit" /></td></tr>';
echo '</table>';
echo '</form>';
echo '</div>';
}
/** /**
* Get the hyperlink to the first comic post in the database. * Get the hyperlink to the first comic post in the database.
* @return string The hyperlink to the first comic post, or false. * @return string The hyperlink to the first comic post, or false.
@ -755,4 +637,42 @@ function szub_is_search_key($key='') {
return false; return false;
} }
function comic_navigation() {
global $post;
echo '<div id="comic_navi_wrapper">';
echo ' <div id="comic_navi_prev">';
$at_first = false;
$first = get_first_comic();
if (!empty($first)) { $at_first = ($post->ID == $first->ID); }
if (!$at_first) {
echo ' <a href="'.get_permalink($at_first).'" class="rollfirst">&nbsp;</a>';
} else {
echo ' <img src="'.get_bloginfo('stylesheet_directory').'/images/disabled_firstroll.png" alt="At First" class="disabled_navi" />';
}
$prev_comic = get_permalink(get_previous_comic()->ID);
if (!empty($prev_comic)) {
echo ' <a href="'.$prev_comic.'" class="rollprev">&nbsp;</a>';
} else {
echo ' <img src="'.get_bloginfo('stylesheet_directory').'/images/disabled_prevroll.png" alt="No Previous" class="disabled_navi" />';
}
echo ' </div>';
echo ' <div id="comic_navi_next">';
$next = get_permalink(get_next_comic()->ID);
if (!empty($next)) {
echo ' <a href="'.get_permalink($next).'" class="rollnext">&nbsp;</a>';
} else {
echo ' <img src="'.get_bloginfo('stylesheet_directory').'/images/disabled_nextroll.png" alt="No Next" class="disabled_navi" />';
}
$at_last = false;
$last = get_last_comic();
if (!empty($last)) { $at_last = ($post->idate == $last->idate); }
if (!$at_last) {
echo ' <a href="'.get_permalink($at_last).'" class="rollnext">&nbsp;</a>';
} else {
echo ' <img src="'.get_bloginfo('stylesheet_directory').'/images/disabled_lastroll.png" alt="No Last" class="disabled_navi" />';
}
echo ' </div>';
echo ' <div class="clear"></div>';
echo '</div>';
}
?> ?>

161
style.css
View File

@ -11,8 +11,6 @@ http://www.opensource.org/licenses/gpl-3.0.html
. .
*/ */
/* STANDARD TAGS */ /* STANDARD TAGS */
body { body {
@ -170,13 +168,20 @@ h3, h3 a, h3 a:hover {
letter-spacing: 2px; letter-spacing: 2px;
} }
.headerad
{
float: right;
height: 70px;
width: 470px;
margin: 5px 5px 0 0;
}
/* THE MENU */ /* THE MENU */
#menubar { #menubar {
background: #000;
zoom: 1; /* IE fix, allows for variable height menu */ zoom: 1; /* IE fix, allows for variable height menu */
background: #000 url('images/menubarbgdark.jpg') repeat-x;
border: 1px solid #050505;
} }
#menunav { #menunav {
@ -191,9 +196,10 @@ h3, h3 a, h3 a:hover {
color: #fff; color: #fff;
font-size: 19px; font-size: 19px;
font-weight: bold; font-weight: bold;
line-height: 25px; line-height: 22px;
text-align: center; text-align: center;
border-left: 1px solid #fff; border-left: 1px solid #353535;
border-right: 1px solid #454545;
} }
#menunav a:hover { #menunav a:hover {
@ -211,13 +217,19 @@ h3, h3 a, h3 a:hover {
} }
#menu a { #menu a {
padding: 0px 5px; padding: 0px 10px 0 10px;
display: block; display: block;
color: #fff; color: #fff;
text-decoration: none; text-decoration: none;
border-right: 1px solid #fff; border-left: 1px solid #353535;
border-right: 1px solid #454545;
} }
#menu li .rss {
padding: 5px 0 5px 0;
}
#menu li { #menu li {
float: left; float: left;
} }
@ -240,13 +252,13 @@ h3, h3 a, h3 a:hover {
left: -9999px; left: -9999px;
width: 151px; width: 151px;
line-height: 1; line-height: 1;
border-top: 1px solid #fff; border-top: 1px solid #353535;
} }
#menu li li { #menu li li {
width: 150px; width: 150px;
margin: 0 0 0 -1px; margin: 0 0 0 -1px;
border-width: 0 1px 1px 1px; border-width: 0 1px 1px 1px;
border-color: #fff; border-color: #454545;
border-style: solid; border-style: solid;
} }
#menu li li a { #menu li li a {
@ -272,7 +284,8 @@ h3, h3 a, h3 a:hover {
} }
#menu li:hover ul, #menu li li:hover ul, #menu li li li:hover ul, #menu li li li li:hover ul, #menu li.sfhover ul, #menu li li.sfhover ul, #menu li li li.sfhover ul, #menu li li li li.sfhover ul { #menu li:hover ul, #menu li li:hover ul, #menu li li li:hover ul, #menu li li li li:hover ul, #menu li.sfhover ul, #menu li li.sfhover ul, #menu li li li.sfhover ul, #menu li li li li.sfhover ul {
left: auto; left: auto;
background: #222; /*Submenu background color */ background: #646464;
/* background: #222; Submenu background color */
text-transform: none; text-transform: none;
} }
@ -407,6 +420,49 @@ h3, h3 a, h3 a:hover {
overflow: hidden; overflow: hidden;
} }
.comicdate {
color: #777;
font-family: 'Georgia' , serif;
font-size: 15px;
font-weight: bold;
}
.comicdate .date {
height: 50px;
width: 45px;
background: url(images/calendar.png) no-repeat;
font: normal 22px Verdana, Arial, Helvetica, sans-serif;
color: #666666;
text-align: center;
padding: 0px 2px 0 0;
line-height: 100%;
float: left;
margin: 0 2px 0 4px;
}
.comicdate .date span {
height: 16px;
display: block;
font: normal 11px Verdana, Arial, Helvetica, sans-serif;
color: #ffffff;
text-align: center;
padding-top: 5px;
}
.post h2, .post h2 a, .post-comic h2, .post-comic h2 a {
display: block;
height: 24px;
background: #eee;
border: solid 1px #cdcdcd;
font-size: 20px;
padding-left: 5px;
clear: none;
}
.post h2 a:hover, .post-comic h2 a:hover, .post-page h2 a:hover {
color: #ff0000;
}
.comicdate { .comicdate {
font-size: 14px; font-size: 14px;
} }
@ -471,7 +527,11 @@ h3, h3 a, h3 a:hover {
} }
.comment .comment { .comment .comment {
border: 1px dotted #000; border: 1px dotted #000;
}
.bypostauthor {
background: #fffbdc;
} }
.comment-author { .comment-author {
@ -544,6 +604,7 @@ ul.children {
background: #fff; background: #fff;
opacity: 0.99; opacity: 0.99;
filter: alpha(opacity=99); filter: alpha(opacity=99);
margin: 0 auto;
} }
.comicarchiveframe:hover { .comicarchiveframe:hover {
@ -913,3 +974,79 @@ li.pingback div p, li.trackback div p {
line-height: 0; line-height: 0;
font-size: 0; font-size: 0;
} }
.button
{
color: #000;
height: 22px;
width: 20px;
background: #c5c5c5;
border: 1px solid #000;
padding: 0 0 3px 0;
font-weight: 700;
}
/* COMIC NAVIGATION */
a.rollnext
{
display: inline-block;
height: 50px;
width: 125px;
float: right;
text-decoration: none;
background: url('images/nextroll.png') no-repeat;
}
a.rolllast
{
display: inline-block;
height: 50px;
width: 125px;
float: right;
text-decoration: none;
background: url('images/lastroll.png') no-repeat;
}
a.rollprev
{
display: inline-block;
height: 50px;
width: 125px;
float: left;
text-decoration: none;
background: url('images/prevroll.png') no-repeat;
}
a.rollfirst
{
display: inline-block;
height: 50px;
width: 125px;
float: left;
text-decoration: none;
background: url('images/firstroll.png') no-repeat;
}
a.rollfirst:hover, a.rollprev:hover, a.rollnext:hover, a.rolllast:hover
{
background-position: -125px 0;
}
#comic_navi_wrapper
{
width: 100%;
height: 50px;
}
#comic_navi_prev
{
width: 260px;
float: left;
}
#comic_navi_next
{
width: 260px;
float: right;
}