Changeset 568


Ignore:
Timestamp:
07/25/08 08:31:16 (2 years ago)
Author:
kimparsell
Message:

+ Fix added to resolve ticket #124 (404 error) - proper 404 errors are now generated with both default and cruft-free URLs (joint effort between sidtheduck and kimparsell)
+ Themes updated to include 404.php and stylesheet change for new page
+ Minor markup change to plog-themes.php to provide alt text for theme thumbnails
+ Added dropdown menu to plog-manage.php for selection entries/page
+ Minor changes to admin.css
+ Misc. cleanup

Location:
trunk
Files:
3 added
36 edited

Legend:

Unmodified
Added
Removed
  • trunk/plog-admin/css/admin.css

    r555 r568  
    1111 
    1212#theme-table td { 
    13         padding: 15px; 
    14 } 
    15  
    16 #theme-table tr.header td { 
     13        padding: 8px; 
     14} 
     15 
     16#theme-table tr.header th { 
    1717        padding: 8px; 
    1818} 
     
    305305        border-top: 2px solid #ccc; 
    306306        border-bottom: 2px solid #ccc; 
    307         width: 100%; 
     307        width: 98%; 
    308308} 
    309309 
     
    404404 
    405405#contentList #breadcrumb_links { 
    406         font-size: 1.1em; 
    407         padding: 5px 3px 5px 0; 
     406        font-size: 1.0em; 
     407        padding: 3px; 
    408408} 
    409409 
    410410#contentList .pagination { 
    411         font-size: 1.3em; 
    412         padding: 5px 3px 5px 0; 
    413         font-weight: bold; 
     411        font-size: 1.0em; 
     412        margin-right: 5px; 
     413        padding: 3px; 
     414        font-weight: bold; 
     415        text-align: right; 
     416} 
     417 
     418#contentList label, select, option { 
     419        font-weight: normal; 
     420} 
     421 
     422#contentList .entries-page { 
     423        text-align: right; 
     424} 
     425 
     426#contentList .entries-page label, select { 
     427        display: block inline; 
     428        margin-bottom: auto; 
     429} 
     430 
     431#contentList .move-del-manage input, select { 
     432        display: block inline; 
     433        margin-bottom: auto; 
    414434} 
    415435 
  • trunk/plog-admin/plog-admin-functions.php

    r561 r568  
    10011001} 
    10021002 
    1003 //  
     1003// 
    10041004function configure_htaccess_fullpic($allow = false) { 
    10051005        $cfg = ""; 
     
    10721072                $cfg .= "RewriteEngine on\n"; 
    10731073                $cfg .= "RewriteBase ".$rewritebase."\n"; 
    1074     $cfg .= "RewriteCond %{REQUEST_URI} !(\.|/\$)\n"; 
     1074                $cfg .= "RewriteCond %{REQUEST_URI} !(\.|/\$)\n"; 
    10751075                $cfg .= "RewriteRule ^.*\$ http://".parse_url($config['gallery_url'], PHP_URL_HOST)."%{REQUEST_URI}/ [R=301,L]\n"; 
    1076     /*$cfg .= "RewriteCond %{HTTP_HOST} !^www [NC]\n"; 
     1076                /*$cfg .= "RewriteCond %{HTTP_HOST} !^www [NC]\n"; 
    10771077                $cfg .= "RewriteRule ^(.*)\$ ".$config['gallery_url']."\$1 [R=301,L]\n";*/ 
    10781078                $cfg .= "RewriteCond %{REQUEST_FILENAME} -d [OR]\n"; 
  • trunk/plog-admin/plog-feedback.php

    r563 r568  
    1414 
    1515        $possible_values = array("5"=>5, "10"=>10, "20"=>20, "50"=>50); 
    16         $output = plog_tr('Entries per page') . '  
    17                                         <select onchange="'.$java.'" name="entries_per_page">'; 
     16        $output = "\n\t\t\t\t\t" . '<label accesskey="e" for="entries_on_page">' .plog_tr('<em>E</em>ntries per page') . '</label> 
     17                                        <select class="entries-page" onchange="'.$java.'" name="entries_per_page" style="width: 60px;">'; 
    1818        foreach ($possible_values as $key => $value) 
    1919                if ($_SESSION['entries_per_page'] == $key) 
     
    283283} 
    284284 
    285 $output .= "\n\n\t\t" . '</form>'. "\n"; 
     285$output .= "\n\t\t" . '</form>'. "\n"; 
    286286 
    287287display($output, "feedback"); 
  • trunk/plog-admin/plog-manage.php

    r563 r568  
    1111function generate_pagination_view_menu() { 
    1212 
    13         $java = 'document.location.href = \''.$_SERVER["PHP_SELF"].'?level='.$_REQUEST["level"]. 
    14         '&amp;id='.$_REQUEST["id"].'&amp;entries_per_page=\'+this.options[this.selectedIndex].value'; 
     13        $java = 'document.location.href = \''.$_SERVER["PHP_SELF"].'?level='.$_REQUEST["level"].'&amp;id='.$_REQUEST["id"].'&amp;entries_per_page=\'+this.options[this.selectedIndex].value'; 
    1514 
    1615        $possible_values = array("5"=>5, "10"=>10, "20"=>20, "50"=>50); 
    17         $output= '<label accesskey="e" for="entries_on_page"><em>E</em>ntries per page</label> 
    18         <select onchange="'.$java.'" name="entries_per_page">'; 
     16        $output= "\n\t\t\t" . '<label accesskey="e" for="entries_on_page">' .plog_tr('<em>E</em>ntries per page') . '</label> 
     17                        <select class="entries-page" onchange="'.$java.'" name="entries_per_page" style="width: 60px;">'; 
    1918        foreach ($possible_values as $key => $value) 
    2019        if ($_SESSION['entries_per_page'] == $key) 
    21         $output .= "<option value=\"$value\" selected>$key</option>"; 
     20        $output .= "\n\t\t\t\t<option value=\"$value\" selected=\"selected\">$key</option>"; 
    2221        else 
    23         $output .= "<option value=\"$value\">$key</option>"; 
    24         $output.= '</select>'; 
     22        $output .= "\n\t\t\t\t<option value=\"$value\">$key</option>"; 
     23        $output.= "\n\t\t\t</select>"; 
    2524        return $output; 
    2625} 
     
    2928        if ($level == "albums") $parent = "collections"; 
    3029        if ($level == "pictures") $parent = "albums"; 
    31         $output = "\n\t\t" . '<input class="submit" type="submit" name="move_checked" value="' . plog_tr("Move Checked To") . '" />'; 
     30        $output = "\n\t\t\t" . '<input class="submit" type="submit" name="move_checked" value="' . plog_tr("Move Checked To") . '" />'; 
    3231 
    3332        if ($level == "pictures") { 
     
    3534                $output .= generate_albums_menu($albums); 
    3635        } else { 
    37                 $output .= "\n\t\t\t" . '<select id="group_id" name="group_id">'; 
     36                $output .= "\n\t\t\t\t" . '<select class="move-del-manage" id="group_id" name="group_id">'; 
    3837                $collections = get_collections(); 
    3938                foreach($collections as $collection) { 
    40                         $output .= "\n\t\t\t\t" . '<option value="'.$collection["id"].'">'.SmartStripSlashes($collection["name"]); 
     39                        $output .= "\n\t\t\t\t\t" . '<option value="'.$collection["id"].'">'.SmartStripSlashes($collection["name"]); 
    4140                        $output .= '</option>'; 
    4241                } 
    43                 $output .= "\n\t\t\t" . '</select>'; 
     42                $output .= "\n\t\t\t\t" . '</select>'; 
    4443        } 
    4544 
     
    5453                if (isset($_REQUEST["albums_menu"]) && isset($_REQUEST["new_album_name"])){ 
    5554                        if ($albums_menu == $album_id || $new_album_name == $album['album_name']){ 
    56                                 $selected = " selected"; 
     55                                $selected = " selected=\"selected\""; 
    5756                        } 
    5857                } 
     
    125124$output = "\n\t" . '<h1>' . plog_tr('Manage Content') . '</h1>' . "\n"; 
    126125 
    127 /* if ($level == "collections") { // display some high level statistics on the main page. 
    128 $output .= '<p class="highlight">You have a total of <strong>'. count_pictures().'</strong> images within <strong>'.count_albums() .'</strong> album(s).  Users have posted <strong>'. count_comments().'</strong> comment(s) to your gallery</p>'; } */ 
     126/*if ($level == "collections") { // display some high level statistics on the main page. 
     127$output .= "\n\t" . '<p class="highlight">You have a total of <strong>'. count_pictures().'</strong> images within <strong>'.count_albums() .'</strong> album(s).  Users have posted <strong>'. count_comments().'</strong> comment(s) to your gallery</p>' . "\n"; } */ 
    129128 
    130129global $config; 
     
    329328        $totalRows = mysql_result($totalRowsResult,'num_items'); 
    330329 
    331         $pagination_menu = "\n\t\t" . '<div class="pagination">'.generate_pagination("admin", "manage", $plog_page, $totalRows, $_SESSION['entries_per_page'], array("level" => $level, "id" => $id, "entries_per_page" => $_SESSION['entries_per_page'])).'</div>'; 
     330        $pagination_menu = "\n\t\t" . '<div class="entries-page">'.generate_pagination_view_menu().'</div> 
     331                        <div class="pagination">'.generate_pagination("admin", "manage", $plog_page, $totalRows, $_SESSION['entries_per_page'], array("level" => $level, "id" => $id, "entries_per_page" => $_SESSION['entries_per_page'])).' 
     332                </div>'; 
    332333 
    333334        $output .= "\n\t\t" . '<form id="contentList" action="'.$_SERVER["PHP_SELF"].'" method="get">'; 
     
    336337 
    337338        if (empty($level) || $level == "collections") { 
    338                 $output .= generate_breadcrumb_admin("").$pagination_menu; 
     339                $output .= $pagination_menu.generate_breadcrumb_admin(""); 
    339340                $output .= plog_collection_manager($first_item,$_SESSION['entries_per_page']); 
    340341        } 
    341342 
    342343        if ($level == "albums") { 
    343                 $output .= generate_breadcrumb_admin("albums", $id).$pagination_menu; 
     344                $output .= $pagination_menu.generate_breadcrumb_admin("albums", $id); 
    344345                $output .= plog_album_manager($id,$first_item,$_SESSION['entries_per_page']); 
    345346        }; 
    346347 
    347348        if ($level == "pictures") { 
    348                 $output .= generate_breadcrumb_admin("pictures", $id).$pagination_menu; 
     349                $output .= $pagination_menu.generate_breadcrumb_admin("pictures", $id); 
    349350                $output .= plog_picture_manager($id,$first_item,$_SESSION['entries_per_page']); 
    350351 
     
    352353 
    353354        if ($level == "comments") { 
    354                 $output .= generate_breadcrumb_admin("comments", $id).$pagination_menu; 
     355                $output .= $pagination_menu.generate_breadcrumb_admin("comments", $id); 
    355356                $output .= plog_comment_manager($id,$first_item,$_SESSION['entries_per_page']); 
    356357        }; 
    357358 
    358359        $output .= "\n\t\t" . '<div><a href="#" onclick="checkAll(document.getElementById(\'contentList\')); return false; ">' . plog_tr('Invert Checkbox Selection') . '</a></div> 
    359                 '.$pagination_menu.' 
    360                 <div><input type="hidden" name="level" value="'.$level.'" /> 
    361                 <input type="hidden" name="id" value="'.$id.'" /> 
    362                 <input type="hidden" name="action" value="1" /> 
    363                 <input class="submit" type="submit" name="delete_checked" onclick="return confirm(\'' . plog_tr('Are you sure you want to delete selected items?') . '\');" value="' . plog_tr('Delete Checked') . '" />'; 
     360                <div class="pagination">'.generate_pagination("admin", "manage", $plog_page, $totalRows, $_SESSION['entries_per_page'], array("level" => $level, "id" => $id, "entries_per_page" => $_SESSION['entries_per_page'])).'</div> 
     361                <div class="move-del-manage"> 
     362                        <input type="hidden" name="level" value="'.$level.'" /> 
     363                        <input type="hidden" name="id" value="'.$id.'" /> 
     364                        <input type="hidden" name="action" value="1" /> 
     365                        <input class="submit" type="submit" name="delete_checked" onclick="return confirm(\'' . plog_tr('Are you sure you want to delete selected items?') . '\');" value="' . plog_tr('Delete Checked') . '" />'; 
    364366        if (!empty($level) && $level != "collections" && $level != "comments"){ 
    365367                $output .= generate_move_menu($level); 
  • trunk/plog-admin/plog-themes.php

    r567 r568  
    5858 
    5959// Output table header 
    60 $output .= "\n\n\t\t" . '<table id="theme-table" cellpadding="5" width="100%"> 
     60$output .= "\n\n\t\t" . '<table id="theme-table" cellpadding="1" width="100%"> 
    6161                        <tr class="header"> 
    6262                                <th class="table-header-left">&nbsp;</th> 
     
    9898 
    9999                $output .= "\t\t\t\t<td>"; 
    100                  
     100 
    101101                if ($preview_thumb) 
    102                         $output .= "<div class=\"img-shadow\"><a rel=\"lightbox\" href=\"$preview_thumb_large\"><img src=\"$preview_thumb\"/></a></div>"; 
    103                  
    104                 $output .= "</td><td><strong>$theme_name</strong><br /> Version $version</td> 
     102                        $output .= "<div class=\"img-shadow\"><a rel=\"lightbox\" href=\"$preview_thumb_large\"><img src=\"$preview_thumb\" alt=\"$theme_name\" /></a></div>"; 
     103 
     104                $output .= "</td> 
     105                                <td><strong>$theme_name</strong><br /> Version $version</td> 
    105106                                <td>$description</td> 
    106107                                <td><a href=\"$url\">$author</a></td>\n"; 
  • trunk/plog-content/themes/air/album.php

    r557 r568  
    2222                </ul><!-- /slides --> 
    2323<?php else : ?> 
    24                 <p id="no-pictures-msg"><?php echo plog_tr('There are no pictures in this album')?>.</p> 
     24                <div id="error-404"> 
     25                        <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     26                        <p><?php echo plog_tr('We are sorry, but the image that you requested does not exist. You might try using the <strong>Search</strong> feature to locate the image you are looking for.')?></p> 
     27                </div> 
    2528<?php endif; ?> 
    2629 
  • trunk/plog-content/themes/air/collection.php

    r557 r568  
    2424 
    2525<?php else : ?> 
    26                 <p id="no-pictures-msg"><?php echo plog_tr('No albums yet')?>.</p> 
     26                <div id="error-404"> 
     27                        <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     28                        <p><?php echo plog_tr('We are sorry, but the collection that you requested does not exist.')?></p> 
     29                </div> 
    2730<?php endif; ?> 
    2831        </div><!-- /thumbnail-container --> 
  • trunk/plog-content/themes/air/collections.php

    r557 r568  
    2323 
    2424        <?php else : ?> 
    25                 <p id="no-pictures-msg"><?php echo plog_tr('No collections yet')?>.</p> 
     25                <div id="error-404"> 
     26                        <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     27                        <p><?php echo plog_tr('We are sorry, but the collection that you requested does not exist.')?></p> 
     28                </div> 
    2629        <?php endif; ?> 
    2730</div><!-- /thumbnail-container --> 
  • trunk/plog-content/themes/air/gallery.css

    r557 r568  
    135135        font-size: 1.4em; 
    136136        text-align: center; 
     137} 
     138 
     139#error-404 { 
     140        /* error-404 controls the "not found" message received when going to a non-existent URL */ 
     141        margin: 50px; 
     142        text-align: justify; 
    137143} 
    138144 
  • trunk/plog-content/themes/air/header.php

    r557 r568  
    1 <?php plogger_init(); ?> 
    21<div id="wrapper"> 
    32 
  • trunk/plog-content/themes/air/picture.php

    r557 r568  
    4545<?php endwhile; ?> 
    4646<?php else : ?> 
    47                 <p id="no-pictures-msg"><?php echo plog_tr('No such image')?>.</p> 
     47                <div id="error-404"> 
     48                        <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     49                        <p><?php echo plog_tr('We are sorry, but the image that you requested does not exist. You might try using the <strong>Search</strong> feature to locate the image you are looking for.')?></p> 
     50                </div> 
    4851        <?php endif; ?> 
    4952        </div><!-- /big-picture-container --> 
  • trunk/plog-content/themes/air/search.php

    r557 r568  
    2222                </ul><!-- /slides --> 
    2323<?php else : ?> 
    24                 <p id="no-pictures-msg"><?php echo plog_tr('There are no pictures that match this search')?>.</p> 
     24                <div id="error-404"> 
     25                        <h2><?php echo plog_tr('Search Results')?></h2> 
     26                        <p><?php echo plog_tr('We are sorry, but there are no pictures that matched your search.')?></p> 
     27                </div> 
    2528<?php endif; ?> 
    2629 
  • trunk/plog-content/themes/air/slideshow.php

    r561 r568  
    2525<?php echo generate_slideshow_interface(); ?> 
    2626<?php else : ?> 
    27                 <p id="no-pictures-msg"><?php echo plog_tr('There are no pictures to show')?>.</p> 
     27                <div id="error-404"> 
     28                        <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     29                        <p><?php echo plog_tr('We are sorry, but there are no images in this album to create a slideshow with.')?></p> 
     30                </div> 
    2831 
    2932<?php endif; ?> 
  • trunk/plog-content/themes/default/album.php

    r557 r568  
    2929                        </ul><!-- /slides --> 
    3030<?php else : ?> 
    31                         <p id="no-pictures-msg"><?php echo plog_tr('There are no pictures in this album')?>.</p> 
     31                        <div id="error-404"> 
     32                                <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     33                                <p><?php echo plog_tr('We are sorry, but the image that you requested does not exist. You might try using the <strong>Search</strong> feature to locate the image you are looking for.')?></p> 
     34                        </div> 
    3235 
    3336<?php endif; ?> 
  • trunk/plog-content/themes/default/collection.php

    r557 r568  
    2323                        </ul><!-- /slides --> 
    2424<?php else : ?> 
    25                         <p id="no-pictures-msg"><?php echo plog_tr('No albums yet')?>.</p> 
     25                        <div id="error-404"> 
     26                                <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     27                                <p><?php echo plog_tr('We are sorry, but the collection that you requested does not exist.')?></p> 
     28                        </div> 
    2629 
    2730<?php endif; ?> 
  • trunk/plog-content/themes/default/collections.php

    r557 r568  
    2222                        </ul><!-- /slides --> 
    2323<?php else : ?> 
    24                         <p id="no-pictures-msg"><?php echo plog_tr('No collections yet')?>.</p> 
     24                        <div id="error-404"> 
     25                                <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     26                                <p><?php echo plog_tr('We are sorry, but the collection that you requested does not exist.')?></p> 
     27                        </div> 
    2528 
    2629<?php endif; ?> 
  • trunk/plog-content/themes/default/gallery.css

    r557 r568  
    252252} 
    253253 
     254#error-404 { 
     255        margin: 50px 75px; 
     256        text-align: justify; 
     257} 
     258 
    254259/* Form Structure/Elements */ 
    255260 
    256261#jump_menu { 
    257         float: right; 
     262        text-align: right; 
    258263} 
    259264 
     
    264269 
    265270#search_box { 
    266         margin-left: 5px; 
    267         float: right; 
     271        text-align: right; 
    268272} 
    269273 
  • trunk/plog-content/themes/default/header.php

    r557 r568  
    1 <?php plogger_init(); ?> 
    21<!--Output highest level container division--> 
    32<div id="wrapper"> 
     
    76                        <td id="jump-search-container"> 
    87                                <?php echo generate_jump_menu(); ?> 
    9                                 <br /><br /> 
     8                                <br /> 
    109                                <?php echo generate_search_box(); ?> 
    1110                        </td> 
  • trunk/plog-content/themes/default/picture.php

    r557 r568  
    4949<?php endwhile; ?> 
    5050<?php else : ?> 
    51                         <p id="no-pictures-msg"><?php echo plog_tr('No such image')?>.</p> 
     51                        <div id="error-404"> 
     52                                <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     53                                <p><?php echo plog_tr('We are sorry, but the image that you requested does not exist. You might try using the <strong>Search</strong> feature to locate the image you are looking for.')?></p> 
     54                        </div> 
    5255<?php endif; ?> 
    5356                </div><!-- /inner_wrapper --> 
  • trunk/plog-content/themes/default/search.php

    r557 r568  
    2626                        </ul><!-- /slides --> 
    2727<?php else : ?> 
    28                         <p id="no-pictures-msg"><?php echo plog_tr('There are no pictures that matched your search')?>.</p> 
    29  
     28                        <div id="error-404"> 
     29                                <h2><?php echo plog_tr('Search Results')?></h2> 
     30                                <p><?php echo plog_tr('We are sorry, but there are no pictures that matched your search.')?></p> 
     31                        </div> 
    3032<?php endif; ?> 
    3133                </div><!-- /thumbnail container --> 
  • trunk/plog-content/themes/default/slideshow.php

    r561 r568  
    3333<?php echo generate_slideshow_interface(); ?> 
    3434<?php else : ?> 
    35                         <p id="no-pictures-msg"><?php echo plog_tr('There are no pictures to show')?>.</p> 
     35                        <div id="error-404"> 
     36                                <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     37                                <p><?php echo plog_tr('We are sorry, but there are no images in this album to create a slideshow with.')?></p> 
     38                        </div> 
    3639 
    3740<?php endif; ?> 
  • trunk/plog-content/themes/lucid/album.php

    r557 r568  
    2727                        </ul><!-- /slides --> 
    2828<?php else : ?> 
    29                         <p id="no-pictures-msg"><?php echo plog_tr('There are no pictures in this album')?>.</p> 
     29                        <div id="error-404"> 
     30                                <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     31                                <p><?php echo plog_tr('We are sorry, but the image that you requested does not exist. You might try using the <strong>Search</strong> feature to locate the image you are looking for.')?></p> 
     32                        </div> 
    3033 
    3134<?php endif; ?> 
  • trunk/plog-content/themes/lucid/collection.php

    r557 r568  
    2424                        </div><!-- /collections --> 
    2525<?php else : ?> 
    26                         <p id="no-pictures-msg"><?php echo plog_tr('No albums yet')?>.</p> 
     26                        <div id="error-404"> 
     27                                <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     28                                <p><?php echo plog_tr('We are sorry, but the collection that you requested does not exist.')?></p> 
     29                        </div> 
    2730<?php endif; ?> 
    2831                </div><!-- /thumbnail container --> 
  • trunk/plog-content/themes/lucid/collections.php

    r557 r568  
    2323                        </div><!-- /collections --> 
    2424<?php else : ?> 
    25                         <p id="no-pictures-msg"><?php echo plog_tr('No collections yet')?>.</p> 
     25                        <div id="error-404"> 
     26                                <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     27                                <p><?php echo plog_tr('We are sorry, but the collection that you requested does not exist.')?></p> 
     28                        </div> 
    2629<?php endif; ?> 
    2730                </div><!-- /thumbnail container --> 
  • trunk/plog-content/themes/lucid/gallery.css

    r557 r568  
    106106        text-align: center; 
    107107        padding: 15px 0; 
     108} 
     109 
     110#error-404 { 
     111        margin: 50px; 
     112        text-align: justify; 
    108113} 
    109114 
  • trunk/plog-content/themes/lucid/header.php

    r557 r568  
    1 <?php plogger_init(); ?> 
    21<!--Output highest level container division--> 
    32<div id="wrapper"> 
  • trunk/plog-content/themes/lucid/picture.php

    r557 r568  
    3636<?php endwhile; ?> 
    3737<?php else : ?> 
    38                         <p id="no-pictures-msg"><?php echo plog_tr('No such image')?>.</p> 
     38                        <div id="error-404"> 
     39                                <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     40                                <p><?php echo plog_tr('We are sorry, but the image that you requested does not exist. You might try using the <strong>Search</strong> feature to locate the image you are looking for.')?></p> 
     41                        </div> 
    3942<?php endif; ?> 
    4043                </div><!-- /inner_wrapper --> 
  • trunk/plog-content/themes/lucid/search.php

    r557 r568  
    2626                        </ul><!-- /slides --> 
    2727<?php else : ?> 
    28                         <p id="no-pictures-msg"><?php echo plog_tr('There are no pictures that matched your search')?>.</p> 
     28                        <div id="error-404"> 
     29                                <h2><?php echo plog_tr('Search Results')?></h2> 
     30                                <p><?php echo plog_tr('We are sorry, but there are no pictures that matched your search.')?></p> 
     31                        </div> 
    2932 
    3033<?php endif; ?> 
  • trunk/plog-content/themes/lucid/slideshow.php

    r561 r568  
    3333<?php echo generate_slideshow_interface(); ?> 
    3434<?php else : ?> 
    35                         <div id="no-pictures-msg">No pictures to show.</div> 
     35                        <div id="error-404"> 
     36                                <h2><?php echo plog_tr('404 - Not Found')?></h2> 
     37                                <p><?php echo plog_tr('We are sorry, but there are no images in this album to create a slideshow with.')?></p> 
     38                        </div> 
    3639<?php endif; ?> 
    3740 
  • trunk/plog-download.php

    r550 r568  
    102102                $this -> ctrl_dir[] = $cdrec; 
    103103 
    104  
    105         } 
    106  
     104        } 
    107105 
    108106        function add_file($data, $name) 
     
    283281                                } 
    284282 
    285  
    286283                                // $zipfile -> add_dir($dir . $newdir); 
    287284 
  • trunk/plog-globals.php

    r566 r568  
    6060} 
    6161 
    62  
    6362?> 
  • trunk/plog-includes/plog-functions.php

    r567 r568  
    6969                        } 
    7070 
    71                         // Does this ever happen?  Picture level + slideshow adds 'Slideshow' to breadcrumbs only 
    72                         //if ($GLOBALS['plogger_mode'] == "slideshow") $breadcrumbs .= $sep . '<strong>' . plog_tr('Slideshow'); 
     71                        // Does this ever happen? Picture level + slideshow adds 'Slideshow' to breadcrumbs only 
     72                        //if ($GLOBALS['plogger_mode'] == "slideshow") $breadcrumbs .= $sep . '<strong>' . plog_tr('Slideshow') . '</strong>'; 
    7373 
    7474                        break; 
     
    8686                        } 
    8787                        break; 
     88                case '404': 
     89                        $breadcrumbs = $collections_link . $sep . '<strong>'.plog_tr("404 Error - Not Found").'</strong>'; 
     90                        break; 
    8891                default: 
    8992                        $breadcrumbs = $collections_name; 
     
    132135                        if ($GLOBALS['plogger_mode'] == "slideshow") $breadcrumbs .= ' &raquo; ' . plog_tr('Slideshow'); 
    133136 
     137                        break; 
     138                case '404': 
     139                        $breadcrumbs = ' ' . plog_tr('404 Error - Not Found'); 
    134140                        break; 
    135141                default: 
     
    10391045                $result = run_query($sql); 
    10401046 
    1041                 // No such collection, fall back to main page 
     1047                // no such collection 
    10421048                if (mysql_num_rows($result) == 0){ 
    1043                         return $rv; 
     1049                        // check if it's an RSS feed 
     1050                        if ($names['collection'] == "feed") { 
     1051                                return array("level" => "collections", "id" => 0); 
     1052                        // else throw a 404 error 
     1053                        } else { 
     1054                                return array("level" => "404"); 
     1055                        } 
    10441056                } 
    10451057 
     
    10621074                $result = run_query($sql); 
    10631075 
    1064                 // no such album, fall back to collection 
     1076                // no such album 
    10651077                if (mysql_num_rows($result) == 0){ 
    1066                         return $rv; 
     1078                        // check if it's an RSS feed 
     1079                        if ($names['album'] == "feed") { 
     1080                                return array("level" => "collection", "id" => $collection['id']); 
     1081                        // else throw a 404 error 
     1082                        } else { 
     1083                                return array("level" => "404"); 
     1084                        } 
    10671085                } 
    10681086 
     
    11171135                } 
    11181136 
    1119                 // no such picture, fall back to album 
     1137                // no such picture 
    11201138                if (!$picture) { 
    1121                         return $rv; 
     1139                        // check if it's an RSS feed 
     1140                        if ($names['picture'] == "feed") { 
     1141                                return array("level" => "album", "id" => $album['id']); 
     1142                        // else throw a 404 error 
     1143                        } else { 
     1144                                return array("level" => "404"); 
     1145                        } 
    11221146                } 
    11231147 
     
    14651489 
    14661490        if (!$row) { 
     1491                $GLOBALS['plogger_level'] = "404"; 
    14671492                return false; 
    14681493        } 
     
    15741599                case 'collection': 
    15751600                        $sql .= " WHERE `p`.`parent_collection` = ".$value; 
    1576                 break; 
     1601                        break; 
    15771602                case 'album': 
    15781603                        $sql .= " WHERE `p`.`parent_album` = ".$value; 
    1579                 break; 
     1604                        break; 
    15801605                case 'id': 
    15811606                        $sql .= " WHERE `p`.`id` = ".$value; 
    1582                 break; 
     1607                        break; 
    15831608                case 'latest': 
    1584                 break; 
     1609                        break; 
    15851610                default: 
    1586                 return 0; 
     1611                        return 0; 
    15871612        } 
    15881613 
     
    16531678        UNIX_TIMESTAMP(`date_submitted`) AS `unix_date_submitted`, 
    16541679        UNIX_TIMESTAMP(`EXIF_date_taken`) AS `unix_exif_date_taken` " . $sql); 
    1655  
     1680        if (!mysql_num_rows($result)){ 
     1681                $GLOBALS['plogger_level'] = "404"; 
     1682                return false; 
     1683        } 
    16561684        $GLOBALS["available_pictures"] = mysql_num_rows($result); 
    16571685        $GLOBALS["picture_counter"] = 0; 
     
    17991827        $cond $ordering LIMIT $from,$lim"; 
    18001828        $result = run_query($sql); 
    1801  
     1829        if (!mysql_num_rows($result)){ 
     1830                $GLOBALS['plogger_level'] = "404"; 
     1831                return false; 
     1832        } 
    18021833        $GLOBALS["available_collections"] = mysql_num_rows($result); 
    18031834        $GLOBALS["collection_counter"] = 0; 
     
    18451876 
    18461877        $result = run_query($sql); 
     1878        if (!mysql_num_rows($result)){ 
     1879                $GLOBALS['plogger_level'] = "404"; 
     1880                return false; 
     1881        } 
    18471882        $GLOBALS["available_albums"] = mysql_num_rows($result); 
    18481883        $GLOBALS["album_counter"] = 0; 
     
    18721907        global $config; 
    18731908 
    1874         if ($GLOBALS['plogger_level'] != "picture" && $GLOBALS['plogger_mode'] != "slideshow" && $config["allow_dl"]) { 
     1909        if ($GLOBALS['plogger_level'] != "picture" && $GLOBALS['plogger_mode'] != "slideshow" && $GLOBALS['plogger_level'] !="404" && $config["allow_dl"]) { 
    18751910                return '<input id="download_selected_button" class="submit" type="submit" name="download_selected" value="' . plog_tr('Download Selected') . '" />'; 
    18761911        } 
     
    18801915        global $config; 
    18811916 
    1882         if ($GLOBALS['plogger_level'] != "picture" && $GLOBALS['plogger_mode'] != "slideshow" && $config["allow_dl"]) { 
     1917        if ($GLOBALS['plogger_level'] != "picture" && $GLOBALS['plogger_mode'] != "slideshow" && $GLOBALS['plogger_level'] !="404" && $config["allow_dl"]) { 
    18831918                return "\n\t" . '<form action="'.$config['gallery_url'].'plog-download.php" method="post"> 
    18841919        <p><input type="hidden" name="dl_type" value="'.$GLOBALS['plogger_level'].'" /></p>' . "\n"; 
     
    18901925        global $config; 
    18911926 
    1892         if ($GLOBALS['plogger_level'] != "picture" && $GLOBALS['plogger_mode'] != "slideshow" && $config["allow_dl"]) { 
     1927        if ($GLOBALS['plogger_level'] != "picture" && $GLOBALS['plogger_mode'] != "slideshow" && $GLOBALS['plogger_level'] !="404" && $config["allow_dl"]) { 
    18931928                return "\n\t" . '</form><!-- /download form -->' . "\n"; 
    18941929        } 
     
    19371972        global $config; 
    19381973 
    1939         if ($GLOBALS['plogger_mode'] != "slideshow" && $GLOBALS['plogger_level'] != "picture") { 
     1974        if ($GLOBALS['plogger_mode'] != "slideshow" && $GLOBALS['plogger_level'] != "picture" && $GLOBALS['plogger_level'] != "404") { 
    19401975                $rss_link = ""; 
    19411976                // change the tooltip message to reflect the nature of the RSS aggregate link. 
     
    19591994        $id = $GLOBALS["plogger_id"]; 
    19601995        $ss_tag = ""; 
    1961         if ($GLOBALS['plogger_mode'] != "slideshow") { 
     1996        if ($GLOBALS['plogger_mode'] != "slideshow" && $GLOBALS['plogger_level'] != "404") { 
    19621997                if ($GLOBALS['plogger_level'] == "album") { 
    19631998                        $ss_url = generate_url('album',$GLOBALS['plogger_id'],array('mode' => 'slideshow')); 
     
    19852020        global $config; 
    19862021 
    1987         if ($GLOBALS['plogger_mode'] != 'slideshow') { 
     2022        if ($GLOBALS['plogger_mode'] != 'slideshow' && $GLOBALS['plogger_level'] != '404') { 
    19882023                $page = isset($_GET['plog_page']) ? intval($_GET['plog_page']) : 1; 
    19892024                $level = $GLOBALS['plogger_level']; 
     
    20592094/*** The following functions can only be used inside the Picture loop ***/ 
    20602095function plogger_has_pictures() { 
    2061         return $GLOBALS["picture_counter"] < $GLOBALS["available_pictures"]; 
     2096        if (isset($GLOBALS['picture_counter']) && isset($GLOBALS['available_pictures'])) { 
     2097                return $GLOBALS['picture_counter'] < $GLOBALS['available_pictures']; 
     2098        } 
     2099        return false; 
    20622100} 
    20632101 
     
    23762414 
    23772415function plogger_has_collections() { 
    2378         return $GLOBALS["collection_counter"] < $GLOBALS["available_collections"]; 
     2416        if (isset($GLOBALS['collection_counter']) && isset($GLOBALS['available_collections'])) { 
     2417                return $GLOBALS['collection_counter'] < $GLOBALS['available_collections']; 
     2418        } 
     2419        return false; 
    23792420} 
    23802421 
     
    24422483 
    24432484function plogger_has_albums() { 
    2444         return $GLOBALS["album_counter"] < $GLOBALS["available_albums"]; 
     2485        if (isset($GLOBALS['album_counter']) && isset($GLOBALS['available_albums'])) { 
     2486                return $GLOBALS['album_counter'] < $GLOBALS['available_albums']; 
     2487        } 
     2488        return false; 
    24452489} 
    24462490 
  • trunk/plog-print.php

    r550 r568  
    1111<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    1212        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
    13  
    1413<html xml:lang="<?php echo $language ?>" lang="<?php echo $language ?>" xmlns="http://www.w3.org/1999/xhtml">  
    15  
    1614<head> 
    17         <title><?php echo get_head_title() ?></title> 
     15<title><?php echo get_head_title() ?></title> 
    1816</head> 
    1917 
    20         <body onload="window.print();"> 
    21                 <div><img src="<?php echo $picture['url']; ?>" alt="<?php echo $picture['caption']; ?>" /></div> 
    22         </body> 
     18<body onload="window.print();"> 
    2319 
     20<div><img src="<?php echo $picture['url']; ?>" alt="<?php echo $picture['caption']; ?>" /></div> 
     21 
     22</body> 
    2423</html> 
  • trunk/plog-rss.php

    r550 r568  
    8181                //$pagelink = $config["address"] . plogger_get_picture_url(); 
    8282                // XXX: Below won't look nice with mod_rewrite, but plogger_get_picture_url 
    83                 // returns wrong filename, needs to be fixed 
    84                 $pagelink = $config["gallery_url"] . "?level=picture&amp;id=" . plogger_get_picture_id(); 
     83                // returns wrong filename, needs to be fixed - still needs to be fixed as this does not always work as wanted either 
     84                $pagelink = $config['gallery_url'] . "?level=picture&amp;id=" . plogger_get_picture_id(); 
    8585 
    8686                if ($caption == "" || $caption == "&nbsp;") $caption = plog_tr("New Image (no caption)"); 
     
    124124        // there is no meaningful RSS feed for images 
    125125        if (is_array($resolved_path) && isset($resolved_path['level']) && $resolved_path['level'] != "picture") { 
    126                 $level = $resolved_path['level']; 
    127                 $id = $resolved_path['id']; 
     126                $level = (isset($resolved_path['level'])) ? $resolved_path['level'] : "collections"; 
     127                $id = (isset($resolved_path['id'])) ? $resolved_path['id'] : 0; 
    128128        } 
    129129} 
  • trunk/plog-xml.php

    r550 r568  
    3131        unset($config["admin_email"]); 
    3232        unset($config["basedir"]); 
    33  
    3433 
    3534        foreach ($config as $var => $val){ 
  • trunk/plogger.php

    r563 r568  
    7878if (count($active['albums']) == 1) { 
    7979        $config['truncate_breadcrumb'] = 'album'; 
    80         if ($GLOBALS['plogger_level']!="picture") { 
     80        if ($GLOBALS['plogger_level']!="picture" && $GLOBALS['plogger_level']!="404") { 
    8181                if ($GLOBALS['plogger_level']!="search") { 
    8282                        $GLOBALS['plogger_level'] = "album"; 
     
    8787} else if (count($active['collections']) == 1) { 
    8888        $config['truncate_breadcrumb'] = 'collection'; 
    89         if ($GLOBALS['plogger_level']!="album" && $GLOBALS['plogger_level']!='picture') { 
     89        if ($GLOBALS['plogger_level']!="album" && $GLOBALS['plogger_level']!='picture' && $GLOBALS['plogger_level']!="404") { 
    9090                if ($GLOBALS['plogger_level']!="search") { 
    9191                        $GLOBALS['plogger_level'] = "collection"; 
     
    9797} 
    9898 
    99 $allowed_levels = array('collections','collection','album','picture','search'); 
     99$allowed_levels = array('collections','collection','album','picture','search','404'); 
    100100if (!in_array($GLOBALS['plogger_level'],$allowed_levels)) { 
    101101        $GLOBALS['plogger_level'] = 'collections'; 
     
    106106define('THEME_DIR', PLOGGER_DIR.'plog-content/themes/'.$config['theme_dir']); 
    107107define('THEME_URL', $config['theme_url']); 
     108 
     109// initialize plogger 
     110plogger_init(); 
     111 
     112// throw 404 headers if a 404 error has occurred 
     113if ($GLOBALS['plogger_level'] == "404" && !headers_sent()) { 
     114        header( "Status: 404 Not Found" ); 
     115        header($_SERVER['SERVER_PROTOCOL']." 404 Not Found"); 
     116} 
    108117 
    109118function the_plogger_gallery_head() { 
     
    124133        if ($GLOBALS['plogger_level'] == "picture"){ 
    125134                $use_file = 'picture.php'; 
    126         } 
    127         elseif ($GLOBALS['plogger_level'] == "search"){ 
     135        } elseif ($GLOBALS['plogger_level'] == "search"){ 
    128136                if ($GLOBALS['plogger_mode'] == "slideshow") { 
    129137                        $use_file = 'slideshow.php'; 
     
    131139                        $use_file = 'search.php'; 
    132140                } 
    133         } 
    134         elseif ($GLOBALS['plogger_level'] == "album") { 
     141        } elseif ($GLOBALS['plogger_level'] == "album") { 
    135142                // Album level display mode (display all pictures within album) 
    136143                if ($GLOBALS['plogger_mode'] == "slideshow") { 
     
    139146                        $use_file = 'album.php'; 
    140147                } 
    141         } 
    142         else if ($GLOBALS['plogger_level'] == "collection") { 
     148        } else if ($GLOBALS['plogger_level'] == "collection") { 
    143149                $use_file = 'collection.php'; 
     150        } else if ($GLOBALS['plogger_level'] == "404") { 
     151                $use_file = '404.php'; 
    144152        } 
    145153 
Note: See TracChangeset for help on using the changeset viewer.