Changeset 566

Show
Ignore:
Timestamp:
07/23/08 22:32:08 (4 months ago)
Author:
mike
Message:

adding theme preview thumbnail rendering to theme management page

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/plog-admin/plog-themes.php

    r555 r566  
    6161$output .= "\n\n\t\t" . '<table id="theme-table" cellpadding="5" width="100%"> 
    6262                        <tr class="header"> 
    63                                 <th class="table-header-left">Theme</th> 
     63                                <th class="table-header-left">&nbsp;</th> 
     64                                <th class="table-header-middle">Theme</th> 
    6465                                <th class="table-header-middle">Description</th> 
    6566                                <th class="table-header-middle">Author</th> 
     
    8182                if ($counter%2 == 0) $table_row_color = "color-1"; 
    8283                else $table_row_color = "color-2"; 
    83  
     84                 
     85                // generate preview 
     86                $preview_thumb = generate_thumb($theme_folder_name . "preview.png", $theme_name, THUMB_THEME); 
     87                $preview_thumb_large = generate_thumb($theme_folder_name . "preview.png", $theme_name, THUMB_LARGE); 
     88                 
    8489                // start a new table row (alternating colors) 
    8590                if ($config["theme_dir"] == $theme_folder_basename) 
    86                 $output .= "\t\t\t<tr class=\"activated\">\n"; 
     91                        $output .= "\t\t\t<tr class=\"activated\">\n"; 
     92                else 
     93                        $output .= "\t\t\t<tr class=\"$table_row_color\">\n"; 
    8794 
    88                 else 
    89                 $output .= "\t\t\t<tr class=\"$table_row_color\">\n"; 
    90  
    91                 $output .= "\t\t\t\t<td><strong>$theme_name</strong><br /> Version $version</td> 
     95                $output .= "\t\t\t\t<td>"; 
     96                 
     97                if ($preview_thumb) 
     98                        $output .= "<div class=\"img-shadow\"><a rel=\"lightbox\" href=\"$preview_thumb_large\"><img src=\"$preview_thumb\"/></a></div>"; 
     99                 
     100                $output .= "</td><td><strong>$theme_name</strong><br /> Version $version</td> 
    92101                                <td>$description</td> 
    93102                                <td><a href=\"$url\">$author</a></td>\n"; 
  • trunk/plog-globals.php

    r560 r566  
    1818define('THUMB_RSS',3); 
    1919define('THUMB_NAV',4); 
     20define('THUMB_THEME',5); 
    2021 
    2122if (!headers_sent() && !session_id()) { 
  • trunk/plog-includes/plog-functions.php

    r563 r566  
    586586        $thumb_config = $thumbnail_config[$type]; 
    587587 
    588         if (1 == $thumb_config['disabled']) { 
     588        if ($thumb_config['disabled']) { 
    589589                return $config['gallery_url'] . 'plog-content/images/' . $path; 
    590590        } 
     
    649649                $phpThumb->h = $thumb_config['size']; 
    650650                $phpThumb->w = $thumb_config['size']; 
     651        } 
     652         
     653        if($type == THUMB_THEME) { 
     654                $phpThumb->w = 150; 
    651655        } 
    652656