Changeset 557 for trunk

Show
Ignore:
Timestamp:
07/14/08 22:15:37 (4 months ago)
Author:
kimparsell
Message:

All themes:
+ All pages validate XHTML Strict (ticket #166 - http://dev.plogger.org/ticket/166)
+ Stylesheet validates to CSS level 2.1
+ Changed code for action= in comments form tag (original code would not validate due to the ampersand (&) in the url not being shown as & in the code)
+ Added alt tag for large image in picture.php per ticket #171 (http://dev.plogger.org/ticket/171)
+ Added actions class to stylesheets for moderation message
+ Removed generate_slideshow_interface function from slideshow.php (now in plog-functions.php)
+ Reworked markup to conform to new theme code requirements
+ Cleaned up markup
Air theme - Added function to comments.php, if comments are moderated, to show moderation message
Lucid theme:
+ Added function to comments.php, if comments are moderated, to show moderation message
+ Cleaned up markup
+ Hyperlinked collection and album names per ticket #172 (http://dev.plogger.org/ticket/172)
Default theme:
+ Confirmed fix in place to resolve ticket #163 (http://dev.plogger.org/ticket/163)
+ Reorganized/commented gallery.css
+ Cleaned up markup
plog-functions.php:
+ Function added to provide meta-tags with keywords and descriptions using collection name/description, album name/description, image caption/description (default keyword is gallery name, default description is "This is my Plogger gallery" and can be changed by end user) (original code by sidetheduck in http://plogger.org/forum/discussion/1954/how-to-get-dynamic-contents/#Item_9) (requested in per ticket #172 (http://dev.plogger.org/ticket/172)
+ Added generate_slideshow_interface function (previously in slideshow.php in each theme)

Location:
trunk
Files:
3 added
43 modified

Legend:

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

    r556 r557  
    150150        $result['output'] .= sprintf(plog_tr('Your photo (%s) was uploaded successfully.'),$filename); 
    151151        $result['picture_id'] = mysql_insert_id(); 
    152          
     152 
    153153        // let's generate the thumbnail and the large thumbnail right away. 
    154154        // this way, the user won't see any latency from the thumbnail generation 
     
    156156        // this also helps with the image pre-loading problem introduced 
    157157        // by a javascript slideshow. 
    158          
     158 
    159159        $thumbpath = generate_thumb($picture_path, $result['picture_id'],THUMB_SMALL); 
    160160        #$thumbpath = generate_thumb($picture_path, $result['picture_id'],THUMB_LARGE); 
    161          
     161 
    162162        return $result; 
    163163}; 
     
    187187 
    188188        $errors = $output = ""; 
    189          
     189 
    190190        $picture_id = intval($picture_id); 
    191191        $value = mysql_real_escape_string(trim($value)); 
    192192 
    193193        $query = "UPDATE ".TABLE_PREFIX."pictures SET $field = '$value' WHERE id='$picture_id'"; 
    194          
     194 
    195195        $result = mysql_query($query); 
    196196        if ($result) { 
     
    199199                return array('errors' => plog_tr('Could not modify selected picture')); 
    200200        }; 
    201          
     201 
    202202} 
    203203 
     
    215215                return array('errors' => sprintf(plog_tr('There is no album with id %d'),$to_album)); 
    216216        }; 
    217                  
     217 
    218218        $new_collection = $row['parent_id']; 
    219219         
     
    234234 
    235235        $new_path = mysql_real_escape_string($new_path); 
    236          
     236 
    237237        // update database 
    238238        $sql = "UPDATE ".TABLE_PREFIX."pictures SET 
     
    480480                        return array('errors' => plog_tr('Collection directory still contains files after all albums have been deleted.')); 
    481481                } 
    482                  
     482 
    483483        } else { 
    484484                return array('errors' => plog_tr('Collection has invalid path, not deleting directory')); 
     
    546546        $name = mysql_real_escape_string(SmartStripSlashes($name)); 
    547547        $description = mysql_real_escape_string(SmartStripSlashes($description)); 
    548          
    549548 
    550549         // first, get the album name and collection name of our source album 
     
    826825} 
    827826 
    828 function edit_comment_form($comment_id) 
    829 { 
     827function edit_comment_form($comment_id) { 
    830828        $output = ''; 
    831829        $comment_id = intval($comment_id); 
     
    12671265                </table>' . "\n"; 
    12681266        } else { 
    1269                 $output .= "\n\n\t\t" . '<p class="actions">' . sprintf(plog_tr('Sadly, there are no pictures yet.  Why don\'t you <a href="%s">upload some?</a>'),'plog-upload.php') . '</p>' . "\n"; 
     1267                $output .= "\n\n\t\t" . '<p class="actions">' . sprintf(plog_tr('Sadly, there are no pictures yet. Why don\'t you <a href="%s">upload some?</a>'),'plog-upload.php') . '</p>' . "\n"; 
    12701268        }; 
    12711269        return $output; 
     
    14921490 
    14931491function generate_ajax_picture_editing_init() { 
    1494          
     1492 
    14951493        $output = '<script type="text/javascript">'; 
    14961494} 
  • trunk/plog-admin/plog-options.php

    r555 r557  
    125125        configure_mod_rewrite($config["use_mod_rewrite"]); 
    126126 
    127         if (!isset($error_flag)) $output .= '<p class="actions">' . plog_tr("You have updated your settings successfully.") . '</p>'; 
     127        if (!isset($error_flag)) $output .= "\n\t" . '<p class="actions">' . plog_tr("You have updated your settings successfully.") . '</p>' . "\n"; 
    128128 
    129129        $_SESSION["msg"] = $output; 
     
    151151        ); 
    152152 
    153 $output .= ' 
    154         <h1>' . plog_tr("System Options") . '</h1> 
     153$output .= "\n\t" . '<h1>' . plog_tr("System Options") . '</h1> 
    155154 
    156155                <form action="'.$_SERVER["PHP_SELF"].'" method="post"> 
     
    158157                                <table class="option-table"> 
    159158                                        <tr class="alt"> 
    160                                                 <td><label for="gallery_name">' . plog_tr("Gallery Name:") . '</label> ' . plog_tr("(optional)") . '</td> 
     159                                                <td><label for="gallery_name">' . plog_tr("Gallery Name:") . '</label><br /> ' . plog_tr("(optional)") . '</td> 
    161160                                                <td><input size="45" type="text" id="gallery_name" name="gallery_name" value="'.stripslashes($config['gallery_name']).'" /></td> 
    162161                                        </tr> 
    163162                                        <tr> 
    164                                                 <td><label for="gallery_url">' . plog_tr('Gallery URL:') . '</label> </td> 
     163                                                <td><label for="gallery_url">' . plog_tr('Gallery URL:') . '</label></td> 
    165164                                                <td><input size="45" type="text" id="gallery_url" name="gallery_url" value="'.stripslashes($config['gallery_url']).'" /></td> 
    166165                                        </tr> 
     
    206205                                        </tr> 
    207206                                        <tr> 
    208                                                 <td><label for="generate_intermediate">' . plog_tr('Generate Intermediate Pictures?') . '</label>:</td> 
     207                                                <td><label for="generate_intermediate">' . plog_tr('Generate Intermediate Pictures?') . '</label></td> 
    209208                                                <td><input type="checkbox" id="generate_intermediate" name="generate_intermediate" value="1" '.$generate_intermediate.' /></td> 
    210209                                        </tr> 
     
    218217                                        </tr> 
    219218                                        <tr class="alt"> 
    220                                                 <td><label for="image_quality">' . plog_tr('JPEG Image Quality') . '</label><br /> ' . plog_tr("(1=worst, 95=best, 75=default):") . '</label></td> 
     219                                                <td><label for="image_quality">' . plog_tr('JPEG Image Quality:') . '</label><br /> ' . plog_tr("(1=worst, 95=best, 75=default)") . '</label></td> 
    221220                                                <td><input size="5" type="text" id="image_quality" name="image_quality" value="'.$config['compression'].'" /></td> 
    222221                                        </tr> 
     
    293292                                        </tr> 
    294293                                        <tr class="alt"> 
    295                                                 <td><label for="square_thumbs">' . plog_tr('Use Cropped Square Thumbnails?:') .'</label></td> 
     294                                                <td><label for="square_thumbs">' . plog_tr('Use Cropped Square Thumbnails?') .'</label></td> 
    296295                                                <td>'; 
    297296                                                if ($config['square_thumbs'] == 1) $checked = "checked='checked'"; else $checked = ""; 
     
    305304                                        </tr> 
    306305                                        <tr class="alt"> 
    307                                                 <td><label for="thumb_nav_range">' . plog_tr('Thumbnail Navigation Range') . '</label><br /> ' . plog_tr('(0 for whole album):') . '</td> 
     306                                                <td><label for="thumb_nav_range">' . plog_tr('Thumbnail Navigation Range:') . '</label><br /> ' . plog_tr('(0 for whole album)') . '</td> 
    308307                                                <td><input size="5" type="text" id="thumb_nav_range" name="thumb_nav_range" value="'.$config['thumb_nav_range'].'" /></td> 
    309308                                        </tr> 
     
    324323                                <table class="option-table"> 
    325324                                        <tr> 
    326                                                 <td><label for="date_format">' . plog_tr('Date Format') . '</label>:</td> 
     325                                                <td><label for="date_format">' . plog_tr('Date Format:') . '</label></td> 
    327326                                                <td> 
    328327                                                        <select id="date_format" name="date_format">'; 
     
    336335                                        </tr> 
    337336                                        <tr class="alt"> 
    338                                                 <td><label for="allow_dl">' . plog_tr('Allow Compressed Recursive Downloads?') . '</label>:</td> 
     337                                                <td><label for="allow_dl" style="white-space: nowrap;">' . plog_tr('Allow Compressed Recursive Downloads?') . '</label></td> 
    339338                                                <td>'; 
    340339                                                if ($config['allow_dl'] == 1) $checked = "checked='checked'"; else $checked = ""; 
     
    358357                                        </tr> 
    359358                                        <tr class="alt"> 
    360                                                 <td><label for="use_mod_rewrite">' . plog_tr('Generate Cruft-Free URLs') . '</label><br /> ' . plog_tr('(requires mod_rewrite)') . '</td> 
     359                                                <td><label for="use_mod_rewrite">' . plog_tr('Generate Cruft-Free URLs:') . '</label><br /> ' . plog_tr('(requires mod_rewrite)') . '</td> 
    361360                                                <td>'; 
    362361                                                $htaccess_file = $config["basedir"] . ".htaccess"; 
  • trunk/plog-admin/plog-upload.php

    r555 r557  
    134134                                                <input accesskey="n" id="userfile" name="userfile" value="Vali fail" type="file" onchange="checkArchive(this)" /> 
    135135                                                <label accesskey="c" for="caption">' . plog_tr('Picture <em>C</em>aption (optional):') . '</label> 
    136                                                 <input style="width: 320px" name="caption" id="caption" /> 
     136                                                <input style="width: 320px;" name="caption" id="caption" /> 
    137137                                                <label accesskey="d" for="description">' . plog_tr('<em>D</em>escription (optional):') . '</label> 
    138                                                 <textarea name="description" id="description" cols="53" rows="8"></textarea> 
     138                                                <textarea name="description" id="description" cols="53" rows="7"></textarea> 
    139139                                                </p> 
    140140                                        </div> 
  • trunk/plog-content/themes/air/album.php

    r552 r557  
    11<?php plogger_get_header(); ?> 
    22 
    3 <div id="thumbnail-container" class="clearfix"> 
     3        <div id="thumbnail-container" class="clearfix"> 
    44 
    55<?php if (plogger_has_pictures()) : ?> 
    6  
    7         <ul class="slides clearfix"> 
    8  
    9         <?php while(plogger_has_pictures()) : ?> 
    10  
    11                 <?php plogger_load_picture(); 
     6                <ul class="slides clearfix"> 
     7<?php while(plogger_has_pictures()) : ?> 
     8<?php plogger_load_picture(); 
    129                // set variables for the album 
    1310                $picture_caption = plogger_get_picture_caption(); 
     
    1613                $thumb_width = $thumb_info[0]; // The width of the image. It is integer data type. 
    1714                $thumb_height = $thumb_info[1]; // The height of the image. It is an integer data type. 
    18                 ?> 
     15?> 
     16                        <li class="thumbnail"> 
     17                                <a href="<?php echo plogger_get_picture_url(); ?>"><img id="thumb-<?php echo plogger_get_picture_id(); ?>" class="photos" src="<?php echo plogger_get_picture_thumb(); ?>" width="<?php echo $thumb_width; ?>px" height="<?php echo $thumb_height; ?>px" title="<?php echo $picture_caption; ?>" alt="<?php echo $picture_caption; ?>" /></a> 
     18                                <div class="checkbox"><?php echo plogger_download_checkbox(plogger_get_picture_id()); ?></div> 
     19                                <p style="width: <?php echo $thumb_width; ?>px;"><?php echo $picture_caption; ?></p> 
     20                        </li><!-- /thumbnail --> 
     21<?php endwhile; ?> 
     22                </ul><!-- /slides --> 
     23<?php else : ?> 
     24                <p id="no-pictures-msg"><?php echo plog_tr('There are no pictures in this album')?>.</p> 
     25<?php endif; ?> 
    1926 
    20                 <li class="thumbnail"> 
    21                         <a href="<?php echo plogger_get_picture_url(); ?>"> 
    22                                 <img id="thumb-<?php echo plogger_get_picture_id(); ?>" class="photos" src="<?php echo plogger_get_picture_thumb(); ?>" width="<?php echo $thumb_width; ?>px" height="<?php echo $thumb_height; ?>px" title="<?php echo $picture_caption; ?>" alt="<?php echo $picture_caption; ?>" /> 
    23                         </a> 
    24                         <div class="checkbox"><?php echo plogger_download_checkbox(plogger_get_picture_id()); ?></div> 
    25                         <p style="width:<?php echo $thumb_width; ?>px;"><?php echo $picture_caption; ?></p> 
    26                 </li> 
    27         <?php endwhile; ?> 
    28  
    29         </ul> 
    30  
    31         <?php else : ?> 
    32  
    33         <p id="no-pictures-msg"><?php echo plog_tr('There are no pictures in this album')?>.</p> 
    34  
    35         <?php endif; ?> 
    36  
    37 </div> 
    38  
     27        </div><!-- /thumbnail container --> 
    3928<?php plogger_get_footer(); ?> 
  • trunk/plog-content/themes/air/collection.php

    r552 r557  
    11<?php plogger_get_header(); ?> 
    22 
    3 <div id="thumbnail-container" class="clearfix"> 
     3        <div id="thumbnail-container" class="clearfix"> 
    44 
    55<?php if (plogger_has_albums()) : ?> 
    6  
    7         <div id="collections"> 
    8  
    9         <?php while(plogger_has_albums()) : ?> 
    10  
    11                 <?php plogger_load_album(); 
     6                <div id="collections"> 
     7<?php while(plogger_has_albums()) : ?> 
     8<?php plogger_load_album(); 
    129                // set variables for the album 
    1310                $desc = plogger_get_album_description(); 
    1411                $name = plogger_get_album_name(); 
    1512                $num_albums = plogger_album_picture_count(); 
    16                 ?> 
     13?> 
     14                        <div class="collection"> 
     15                                <a class="collection-image-link" href="<?php echo plogger_get_album_url(); ?>"><img class="photos" src="<?php echo plogger_get_album_thumb(); ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a> 
     16                                <h2><a href="<?php echo plogger_get_album_url(); ?>"><?php echo $name; ?></a></h2> 
     17                                <?php echo plogger_download_checkbox(plogger_get_album_id()); ?> 
    1718 
    18                 <div class="collection"> 
    19                         <a class="collection-image-link" href="<?php echo plogger_get_album_url(); ?>"><img class="photos" src="<?php echo plogger_get_album_thumb(); ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a> 
    20                         <h2><a href="<?php echo plogger_get_album_url(); ?>"><?php echo $name; ?></a></h2> 
    21                         <?php echo plogger_download_checkbox(plogger_get_album_id()); ?> 
    22                         <span class="meta-header"><?php echo plog_tr('Contains'); ?> <?php echo $num_albums . ' '; echo ($num_albums == 1) ? plog_tr("Picture") : plog_tr("Pictures"); ?></span> 
    23                         <p class="description"><?php echo $desc; ?></p> 
    24                 </div> 
     19                                <span class="meta-header"><?php echo plog_tr('Contains'); ?> <?php echo $num_albums . ' '; echo ($num_albums == 1) ? plog_tr("Picture") : plog_tr("Pictures"); ?></span> 
     20                                <p class="description"><?php echo $desc; ?></p> 
     21                        </div><!-- /collection --> 
     22<?php endwhile; ?> 
     23                </div><!-- /collections --> 
    2524 
    26         <?php endwhile; ?> 
    27  
    28         </div> 
    29  
    30         <?php else : ?> 
    31  
    32         <p id="no-pictures-msg"><?php echo plog_tr('No albums yet')?>.</p> 
    33  
    34         <?php endif; ?> 
    35  
    36 </div> 
    37  
     25<?php else : ?> 
     26                <p id="no-pictures-msg"><?php echo plog_tr('No albums yet')?>.</p> 
     27<?php endif; ?> 
     28        </div><!-- /thumbnail-container --> 
    3829<?php plogger_get_footer(); ?> 
  • trunk/plog-content/themes/air/collections.php

    r552 r557  
    11<?php plogger_get_header(); ?> 
    22 
    3 <div id="thumbnail-container" class="clearfix"> 
     3        <div id="thumbnail-container" class="clearfix"> 
    44 
    55<?php if (plogger_has_collections()) : ?> 
    6  
    7         <div id="collections"> 
    8  
    9         <?php while(plogger_has_collections()) : ?> 
    10  
    11                 <?php plogger_load_collection(); 
     6                <div id="collections"> 
     7<?php while(plogger_has_collections()) : ?> 
     8<?php plogger_load_collection(); 
    129                // set variables for the collection 
    1310                $desc = plogger_get_collection_description(); 
    1411                $name = plogger_get_collection_name(); 
    1512                $num_albums = plogger_collection_album_count(); 
    16                 ?> 
    17  
    18                 <div class="collection"> 
    19                         <a class="collection-image-link" href="<?php echo plogger_get_collection_url(); ?>"><img class="photos" src="<?php echo plogger_get_collection_thumb(); ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a> 
    20                         <h2><a href="<?php echo plogger_get_collection_url(); ?>"><?php echo $name; ?></a></h2> 
    21                         <?php echo plogger_download_checkbox(plogger_get_collection_id()); ?> 
    22                         <span class="meta-header"><?php echo plog_tr('Contains'); ?> <?php echo $num_albums . ' '; echo ($num_albums == 1) ? plog_tr("Album") : Plog_tr("Albums"); ?></span> 
    23                         <p class="description"><?php echo $desc; ?></p> 
    24                 </div> 
    25  
    26                 <?php endwhile; ?> 
    27  
    28         </div> 
     13?> 
     14                        <div class="collection"> 
     15                                <a class="collection-image-link" href="<?php echo plogger_get_collection_url(); ?>"><img class="photos" src="<?php echo plogger_get_collection_thumb(); ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a> 
     16                                <h2><a href="<?php echo plogger_get_collection_url(); ?>"><?php echo $name; ?></a></h2> 
     17                                <?php echo plogger_download_checkbox(plogger_get_collection_id()); ?> 
     18                                <span class="meta-header"><?php echo plog_tr('Contains'); ?> <?php echo $num_albums . ' '; echo ($num_albums == 1) ? plog_tr("Album") : Plog_tr("Albums"); ?></span> 
     19                                <p class="description"><?php echo $desc; ?></p> 
     20                        </div><!-- /collection --> 
     21<?php endwhile; ?> 
     22                </div><!-- /collections --> 
    2923 
    3024        <?php else : ?> 
    31  
    32         <p id="no-pictures-msg"><?php echo plog_tr('No collections yet')?>.</p> 
    33  
     25                <p id="no-pictures-msg"><?php echo plog_tr('No collections yet')?>.</p> 
    3426        <?php endif; ?> 
    35  
    36 </div> 
    37  
     27</div><!-- /thumbnail-container --> 
    3828<?php plogger_get_footer(); ?> 
  • trunk/plog-content/themes/air/comments.php

    r556 r557  
     1<?php if (plogger_comments_on()) { ?> 
     2                        <a name="comments"></a> 
     3                        <h2 class="comment-heading"><?php echo plog_tr('Comments'); ?>:</h2> 
    14 
    2 <?php if (plogger_comments_on()) { ?> 
    3                 <a name="comments"></a><h2 class="comment-heading"><?php echo plog_tr('Comments'); ?>:</h2> 
     5<? if (plogger_picture_has_comments()) { ?> 
     6                                <ol class="comments"> 
     7<? $counter = 0; 
     8                while(plogger_picture_has_comments()) { 
     9                        plogger_load_comment(); 
     10                        $url = plogger_get_comment_url(); 
     11                        $author = plogger_get_comment_author(); 
     12                        // this code alternates the background color every other comment 
     13                        $comment_class = ($counter % 2) ? "comment_alt" : "comment"; 
     14?> 
     15                                        <li class="<?php echo $comment_class; ?>"> 
     16                                                <p><?php echo plogger_get_comment_text(); ?></p> 
     17                                                <cite><?php echo plog_tr('Comment by'); ?> <?php echo (trim($url) != '') ? "<a href=\"$url\" rel=\"nofollow\">$author</a>" : "$author"; ?> - <?php echo plog_tr('posted on'); ?> <?php echo plogger_get_comment_date(); ?></cite> 
     18                                        </li> 
     19<?php $counter++; 
     20                        } ?> 
     21                                </ol> 
     22<?php } else { ?> 
     23                                <p><?php echo plog_tr('No comments yet'); ?></p> 
     24<?php } ?> 
    425 
    5                 <? if (plogger_picture_has_comments()) { ?> 
    6                 <ol class="comments"> 
    7                         <? $counter = 0; 
    8                         while(plogger_picture_has_comments()) { 
    9                                 plogger_load_comment(); 
    10  
    11                                 $url = plogger_get_comment_url(); 
    12                                 $author = plogger_get_comment_author(); 
    13  
    14                                 // this code alternates the background color every other comment 
    15                                 $comment_class = ($counter % 2) ? "comment_alt" : "comment"; 
    16                         ?> 
    17  
    18                         <li class="$comment_class"> 
    19                                 <p>"<?php echo plogger_get_comment_text(); ?>"</p> 
    20                                 <cite>Comment by "<?php echo (trim($url) != '') ? "<a href=\"$url\" rel=\"nofollow\">$author</a>" : "$author"; ?> - posted on "<?php echo plogger_get_comment_date(); ?></cite> 
    21                         </li> 
    22  
    23                         <?php $counter++; 
    24                         } ?> 
    25                 </ol> 
    26                 <?php } else { ?> 
    27                 <p>"<?php echo plog_tr('No comments yet'); ?>"</p> 
    28                 <?php } ?> 
    29  
    30         <?php if (plogger_picture_allows_comments()) { 
     26<?php if (plogger_picture_allows_comments()) { 
    3127                global $config; 
    3228                if (plogger_comment_post_error()) { ?> 
    33                 <p class='errors'>"<?php echo plog_tr('Comment did not post!  Please fill in required fields.'); ?>"</p> 
     29                                <p class="errors">"<?php echo plog_tr('Comment did not post! Please fill in required fields.'); ?>"</p>