Plugin Directory

Changeset 5077


Ignore:
Timestamp:
02/11/2006 07:00:09 PM (21 years ago)
Author:
Canoeingkidd
Message:

First draft of display page.

Location:
blackwater-album-manager/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • blackwater-album-manager/trunk/display.php

    r4949 r5077  
    33$balbum = get_query_var('balbum');
    44if (empty($balbum)) $balbum = '/';
    5 get_header();
    65
    76$bam_album = @new blackwater_album($balbum);
    87
     8function 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
     18function 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
    931?>
     32<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    1033
     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>
    1142<div id="content" class="widecolumn">
     43        <p><a href="<?php echo get_settings('siteurl') ?>">(&laquo;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>
    1250
    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       
    1476       
    1577        <?php if ($bam_album->have_picture()) : ?>
    … …  
    2890                                </a>
    2991                                </div>
     92
     93                                <?php if (!empty($bam_meta_names)): ?>
    3094                                <div class="bam-picture-meta">
    31                                 <h3>Meta</h3>
    3295                                <table>
    3396                                <?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) ?>
    3598                                        <tr>
    3699                                        <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>
    38101                                        </tr>
    39                                 <?php endif; ?>
    40102                                <?php endforeach; ?>
    41103                                </table>
    42104                                </div>
     105                                <?php endif; ?>
     106
    43107                        </div>
    44108               
    … …  
    60124
    61125</div>
    62 
    63 
    64 <?php
    65 get_footer();
     126</body>
     127</html>
  • blackwater-album-manager/trunk/main.php

    r5045 r5077  
    123123                }
    124124        }
    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         }
    129125        function wp_rewrite ($rewrite_rules) {
    130126                global $wp_rewrite, $bam_settings;
    … …  
    142138                global $wp_rewrite, $bam_settings;
    143139                if (get_query_var('balbum')) {
    144                         add_action('wp_head', array('blackwater_hooks', 'display_styles'));
    145140                        include 'display.php';
    146141                        exit;
    … …  
    154149                        $request = strrev($request);
    155150                        if (!strncasecmp($request, strrev($bam_settings->permalink_struct), strlen($bam_settings->permalink_struct))) {
    156                                 add_action('wp_head', array('blackwater_hooks', 'display_styles'));
    157151                                include 'display.php';
    158152                                exit;
  • blackwater-album-manager/trunk/styles/display.css

    r5046 r5077  
    44        width: 90%;
    55        float: none;
     6        color: #000000;
     7        font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
     8        font-size: 14px;
    69}
     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
    761.bam-picture-list {
    862        background-color: #e6e6e6;
    … …  
    1771        padding: 5px 30px;
    1872        text-align: left;
    19         background-color: #4281B7;
     73        background-color: #000000;
    2074}
    2175.bam-picture {
    … …  
    3185        padding: 2px 20px;
    3286        text-align: left;
    33         background-color: #4281B7;
     87        background-color: #000000;
    3488}
    3589.bam-picture img {
    3690        border: 1px solid #000000;
    37         margin-bottom: 5px;
    3891}
    3992.bam-picture .bam-img a:link {
    … …  
    74127        background-color: #4281B7;
    75128}
     129
    76130.bam-meta-name {
    77131        color: #333333;
    … …  
    86140        font-weight: normal;
    87141        font-style: none;
    88         padding: 8px;
     142        padding: 5px 10px;
    89143}
Note: See TracChangeset for help on using the changeset viewer.