Changeset 5077
- Timestamp:
- 02/11/2006 07:00:09 PM (21 years ago)
- Location:
- blackwater-album-manager/trunk
- Files:
-
- 3 edited
-
display.php (modified) (3 diffs)
-
main.php (modified) (3 diffs)
-
styles/display.css (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
blackwater-album-manager/trunk/display.php
r4949 r5077 3 3 $balbum = get_query_var('balbum'); 4 4 if (empty($balbum)) $balbum = '/'; 5 get_header();6 5 7 6 $bam_album = @new blackwater_album($balbum); 8 7 8 function bam_up_path ($path) { 9 if ('/' == substr($path, strlen($path)-1)) $path = substr_replace($path, '', strlen($path)-1); // strip trailing slash 10 if ('/' == substr($path, 0, 1)) $path = substr_replace($path, '', 0, 1); // strip leading slash 11 $path = explode('/', $path); 12 array_pop($path); 13 $path = '/'.implode('/', $path).'/'; 14 if ('//' == $path) $path = '/'; 15 return $path; 16 } 17 18 function bam_albums_root () { 19 global $wp_rewrite; 20 if ($wp_rewrite->using_permalinks()) { 21 if ($wp_rewrite->using_index_permalinks()) { 22 return get_settings('home').'/index.php/albums'; 23 } else { 24 return get_settings('home').'/albums'; 25 } 26 } else { 27 return get_settings('home').'?balbum='; 28 } 29 } 30 9 31 ?> 32 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 10 33 34 <html xmlns="http://www.w3.org/1999/xhtml"> 35 36 <head profile="http://gmpg.org/xfn/11"> 37 <title><?php echo get_bloginfo('wp_title') ?></title> 38 <?php echo '<link rel="stylesheet" href="'.get_settings('siteurl').'/wp-content/plugins/'.$bam_settings->plugin_folder().'/styles/display.css" type="text/css" media="screen" />'; ?> 39 </head> 40 41 <body> 11 42 <div id="content" class="widecolumn"> 43 <p><a href="<?php echo get_settings('siteurl') ?>">(«Back to Main Site)</a> 44 <a href="<?php echo bam_albums_root().bam_up_path($bam_album->path) ?>">(Up a Folder)</a></p> 45 46 <?php if (null !== $bam_album->path) : ?> 47 48 <div class="bam-album"> 49 <div class="bam-album-name"><?php echo $bam_album->foldername() ?></div> 12 50 13 <?php if (null !== $bam_album->path) : ?> 51 <?php $bam_meta_names = bam_album_meta_names($bam_album->path); ?> 52 <?php if (!empty($bam_meta_names)): ?> 53 <div class="bam-album-meta"> 54 <table> 55 <?php foreach ($bam_meta_names as $bam_meta_name) : ?> 56 <?php $bam_meta_value = $bam_album->get_meta($bam_meta_name) ?> 57 <tr> 58 <th scope="row" class="bam-meta-name"><?php echo bam_picture_meta_displayname($bam_meta_name); ?></th> 59 <td class="bam-meta-value"><?php if (!empty($bam_meta_value)) echo $bam_meta_value; else echo '-----------'; ?></td> 60 </tr> 61 <?php endforeach; ?> 62 </table> 63 </div> 64 </div> 65 <?php endif; ?> 66 67 68 <?php if ($bam_album->have_album()) : ?> 69 <div class="bam-child-albums"> 70 <?php while ($bam_this_album = $bam_album->next_album()) : ?> 71 <?php echo '<div class="bam-child-album"><a href="'.bam_albums_root().$bam_this_album->path.'">'.$bam_this_album->foldername().'</a></div>'."\n"; ?> 72 <?php endwhile; ?> 73 </div> 74 <?php endif; ?> 75 14 76 15 77 <?php if ($bam_album->have_picture()) : ?> … … 28 90 </a> 29 91 </div> 92 93 <?php if (!empty($bam_meta_names)): ?> 30 94 <div class="bam-picture-meta"> 31 <h3>Meta</h3>32 95 <table> 33 96 <?php foreach ($bam_meta_names as $bam_meta_name) : ?> 34 <?php if ('' != $bam_meta_value = $bam_picture->get_meta($bam_meta_name)) :?>97 <?php $bam_meta_value = $bam_picture->get_meta($bam_meta_name) ?> 35 98 <tr> 36 99 <th scope="row" class="bam-meta-name"><?php echo bam_picture_meta_displayname($bam_meta_name); ?></th> 37 <td class="bam-meta-value"><?php echo $bam_meta_value; ?></td>100 <td class="bam-meta-value"><?php if (!empty($bam_meta_value)) echo $bam_meta_value; else echo '-----------'; ?></td> 38 101 </tr> 39 <?php endif; ?>40 102 <?php endforeach; ?> 41 103 </table> 42 104 </div> 105 <?php endif; ?> 106 43 107 </div> 44 108 … … 60 124 61 125 </div> 62 63 64 <?php 65 get_footer(); 126 </body> 127 </html> -
blackwater-album-manager/trunk/main.php
r5045 r5077 123 123 } 124 124 } 125 function display_styles () {126 global $bam_settings;127 echo '<link rel="stylesheet" href="'.get_settings('siteurl').'/wp-content/plugins/'.$bam_settings->plugin_folder().'/styles/display.css" type="text/css" media="screen" />';128 }129 125 function wp_rewrite ($rewrite_rules) { 130 126 global $wp_rewrite, $bam_settings; … … 142 138 global $wp_rewrite, $bam_settings; 143 139 if (get_query_var('balbum')) { 144 add_action('wp_head', array('blackwater_hooks', 'display_styles'));145 140 include 'display.php'; 146 141 exit; … … 154 149 $request = strrev($request); 155 150 if (!strncasecmp($request, strrev($bam_settings->permalink_struct), strlen($bam_settings->permalink_struct))) { 156 add_action('wp_head', array('blackwater_hooks', 'display_styles'));157 151 include 'display.php'; 158 152 exit; -
blackwater-album-manager/trunk/styles/display.css
r5046 r5077 4 4 width: 90%; 5 5 float: none; 6 color: #000000; 7 font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; 8 font-size: 14px; 6 9 } 10 11 .bam-album { 12 margin-bottom: 10px; 13 } 14 .bam-album-name { 15 background-color: #e6e6e6; 16 padding: 8px; 17 font-size: 18px; 18 font-weight: bold; 19 } 20 .bam-album-meta { 21 margin-top: 1px; 22 background-color: #e6e6e6; 23 } 24 25 .bam-child-albums { 26 margin-bottom: 9px; 27 } 28 .bam-child-album { 29 background-color: #e6e6e6; 30 margin-bottom: 1px; 31 } 32 .bam-child-album a { 33 padding: 5px 15px; 34 } 35 .bam-child-album a:link { 36 display: block; 37 color: #000000; 38 background-color: transparent; 39 text-decoration: none; 40 } 41 .bam-child-album a:visited { 42 display: block; 43 color: #000000; 44 background-color: transparent; 45 text-decoration: none; 46 } 47 .bam-child-album a:hover { 48 display: block; 49 color: #000000; 50 background-color: #CCCCCC; 51 text-decoration: none; 52 } 53 .bam-child-album a:active { 54 display: block; 55 color: #000000; 56 background-color: transparent; 57 text-decoration: none; 58 } 59 60 7 61 .bam-picture-list { 8 62 background-color: #e6e6e6; … … 17 71 padding: 5px 30px; 18 72 text-align: left; 19 background-color: # 4281B7;73 background-color: #000000; 20 74 } 21 75 .bam-picture { … … 31 85 padding: 2px 20px; 32 86 text-align: left; 33 background-color: # 4281B7;87 background-color: #000000; 34 88 } 35 89 .bam-picture img { 36 90 border: 1px solid #000000; 37 margin-bottom: 5px;38 91 } 39 92 .bam-picture .bam-img a:link { … … 74 127 background-color: #4281B7; 75 128 } 129 76 130 .bam-meta-name { 77 131 color: #333333; … … 86 140 font-weight: normal; 87 141 font-style: none; 88 padding: 8px;142 padding: 5px 10px; 89 143 }
Note:
See TracChangeset
for help on using the changeset viewer.