gaer
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
parent
c293740098
commit
3cbddcfa02
|
@ -215,9 +215,9 @@ $options = array (
|
|||
"type" => "comicpress-themepack_directory"),
|
||||
|
||||
array(
|
||||
"id" => "comicpress-icon_directory",
|
||||
"id" => "comicpress-avatar_directory",
|
||||
"default" => "default",
|
||||
"type" => "comicpress-icon_directory"),
|
||||
"type" => "comicpress-avatar_directory"),
|
||||
|
||||
array("type" => "close")
|
||||
);
|
||||
|
|
|
@ -115,7 +115,7 @@ function comicpress_admin() {
|
|||
<td valign="bottom" colspan="2">
|
||||
<p><em>(Check the vaildity of your theme's HTML & CSS using the links below. Stock ComicPress is XHTML 1.0 and CSS 2 compliant.)</em></p>
|
||||
<a href="http://validator.w3.org/check?uri=referer"><img
|
||||
src="http://www.w3.org/Icons/valid-xhtml10"
|
||||
src="http://www.w3.org/avatars/valid-xhtml10"
|
||||
alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
|
||||
<a href="http://jigsaw.w3.org/css-validator/check/referer">
|
||||
<img style="border:0;width:88px;height:31px"
|
||||
|
@ -366,24 +366,24 @@ function comicpress_admin() {
|
|||
</tr>
|
||||
|
||||
<?php break;
|
||||
case "comicpress-icon_directory":
|
||||
$current_icon_directory = get_option($value['id']);
|
||||
if (empty($current_icon_directory)) $current_icon_directory = 'default';
|
||||
case "comicpress-avatar_directory":
|
||||
$current_avatar_directory = get_option($value['id']);
|
||||
if (empty($current_avatar_directory)) $current_avatar_directory = 'default';
|
||||
|
||||
$count = count($results = glob(get_template_directory() . '/images/icons/'.$current_icon_directory.'/*'));
|
||||
$icon_directories = glob(get_template_directory() . '/images/icons/*');
|
||||
$count = count($results = glob(get_template_directory() . '/images/avatars/'.$current_avatar_directory.'/*'));
|
||||
$avatar_directories = glob(get_template_directory() . '/images/avatars/*');
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"><strong>Icon (no Gravatar) Directory</strong><br /><br />Choose a directory to get the icons for default gravatars if someone doesnt have one.<br /></th>
|
||||
<th scope="row"><strong>Avatar (no Gravatar) Directory</strong><br /><br />Choose a directory to get the avatars for default gravatars if someone doesnt have one.<br /></th>
|
||||
<td valign="top">
|
||||
<label>
|
||||
<select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
|
||||
<?php
|
||||
foreach ($icon_directories as $icon_dirs) {
|
||||
if (is_dir($icon_dirs)) {
|
||||
$icon_dir_name = basename($icon_dirs); ?>
|
||||
<option class="level-0" value="<?php echo $icon_dir_name; ?>" <?php if ($current_icon_directory == $icon_dir_name) { ?>selected="selected"<?php } ?>><?php echo $icon_dir_name; ?></option>
|
||||
foreach ($avatar_directories as $avatar_dirs) {
|
||||
if (is_dir($avatar_dirs)) {
|
||||
$avatar_dir_name = basename($avatar_dirs); ?>
|
||||
<option class="level-0" value="<?php echo $avatar_dir_name; ?>" <?php if ($current_avatar_directory == $avatar_dir_name) { ?>selected="selected"<?php } ?>><?php echo $avatar_dir_name; ?></option>
|
||||
<?php }
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -85,14 +85,14 @@ if (get_option('upload_path') !== false) {
|
|||
'disable_dynamic_menubar_links' => 'disable_dynamic_menubar_links',
|
||||
'disable_footer_text' => 'disable_footer_text',
|
||||
'themepack_directory' => 'themepack_directory',
|
||||
'icon_directory' => 'icon_directory' ) as $options => $variable_name) {
|
||||
'avatar_directory' => 'avatar_directory' ) as $options => $variable_name) {
|
||||
$variables_to_extract[$variable_name] = get_option("comicpress-${options}");
|
||||
}
|
||||
|
||||
extract($variables_to_extract);
|
||||
}
|
||||
|
||||
if (empty($icon_directory)) $icon_directory = 'default';
|
||||
if (empty($avatar_directory)) $avatar_directory = 'default';
|
||||
if (empty($themepack_directory)) $themepack_directory = 'silver';
|
||||
if (empty($graphicnav_directory)) $graphicnav_directory = 'default';
|
||||
if (empty($moods_directory)) $moods_directory = 'default';
|
||||
|
|
|
@ -80,10 +80,10 @@ function comicpress_get_avatar( $id_or_email, $size = '64', $alt = false) {
|
|||
}
|
||||
|
||||
function comicpress_random_default_avatar($id_or_email = '') {
|
||||
$current_icon_directory = get_option('comicpress-icon_directory');
|
||||
if (empty($current_icon_directory)) $current_icon_directory = 'default';
|
||||
$current_avatar_directory = get_option('comicpress-avatar_directory');
|
||||
if (empty($current_avatar_directory)) $current_avatar_directory = 'default';
|
||||
|
||||
$count = count($results = glob(get_template_directory() . '/images/avatars/'.$current_icon_directory.'/*'));
|
||||
$count = count($results = glob(get_template_directory() . '/images/avatars/'.$current_avatar_directory.'/*'));
|
||||
$default = '';
|
||||
|
||||
$checknum = hexdec(substr(md5($id_or_email),0,5)) % $count;
|
||||
|
@ -92,7 +92,7 @@ function comicpress_random_default_avatar($id_or_email = '') {
|
|||
} else {
|
||||
return false;
|
||||
}
|
||||
return get_bloginfo('stylesheet_directory').'/images/avatars/'.$current_icon_directory.'/'.$default;
|
||||
return get_bloginfo('stylesheet_directory').'/images/avatars/'.$current_avatar_directory.'/'.$default;
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in New Issue