Changeset 550


Ignore:
Timestamp:
06/30/08 13:45:19 (4 years ago)
Author:
sidtheduck
Message:

+ BIG Plogger restructure
+ fixing miscellaneous small bug fixes (RSS validation, beginnings of $_GET switch script integration, etc.)

Location:
trunk
Files:
9 added
4 deleted
69 edited
60 copied
18 moved

Legend:

Unmodified
Added
Removed
  • trunk/gallery.php

    r546 r550  
    11<?php 
    2 #error_reporting(E_ALL); 
    3 include_once(dirname(__FILE__)."/plog-load_config.php"); 
    4 //include("plog-globals.php"); 
    5 //include_once("plog-functions.php"); 
    6  
    7 global $config; 
    8  
    9 // process path here - is set if mod_rewrite is in use 
    10 if (!empty($_REQUEST["path"])) { 
    11         // The following line calculates the path in the album and excludes any subdirectories if  
    12         // Plogger is installed in one 
    13         $path = join("/",array_diff(explode("/",$_SERVER["REQUEST_URI"]),explode("/",$_SERVER["PHP_SELF"]))); 
    14         $resolved_path = resolve_path($path); 
    15         if (is_array($resolved_path)) { 
    16                 $_GET["level"] = $resolved_path["level"]; 
    17                 $_GET["id"] = $resolved_path["id"]; 
    18                 if (isset($resolved_path['mode'])) { 
    19                         $_GET['mode'] = $resolved_path['mode']; 
    20                 } 
    21  
    22                 // get page number from url, if present 
    23                 $parts = parse_url($_SERVER["REQUEST_URI"]); 
    24                 if (isset($parts["query"])) { 
    25                         parse_str($parts["query"],$query_parts); 
    26                         if (!empty($query_parts["plog_page"])) $_GET["plog_page"] = $query_parts["plog_page"]; 
    27                 } 
    28                 $path = $parts["path"]; 
    29         } 
    30 } 
    31  
    32 // Set sorting session variables if they are passed 
    33 if (isset($_GET['sortby'])) { 
    34         $_SESSION['plogger_sortby'] = $_GET['sortby']; 
    35 } 
    36  
    37 if (isset($_GET['sortdir'])) { 
    38         $_SESSION['plogger_sortdir'] = $_GET['sortdir']; 
    39 } 
    40  
    41 // The three GET parameters that it accepts are 
    42 // $level = "collection", "album", or "picture" 
    43 // $id = id number of collection, album, or picture 
    44 // $n = starting element (for pagination) go from n to n + max_thumbs (in global config) 
    45  
    46 // use plogger specific variables to avoid name clashes if Plogger is embedded 
    47  
    48  
    49  
    50 $GLOBALS['plogger_level'] = isset($_GET["level"]) ? $_GET["level"] : ''; 
    51 $GLOBALS['plogger_id'] = isset($_GET["id"]) ? intval($_GET["id"]) : 0; 
    52 $GLOBALS['plogger_mode'] = isset($_GET["mode"]) ? $_GET["mode"] : ''; 
    53  
    54 $allowed_levels = array('collections','collection','album','picture','search'); 
    55 if (!in_array($GLOBALS['plogger_level'],$allowed_levels)) { 
    56         $GLOBALS['plogger_level'] = 'collections'; 
    57 } 
    58  
    59 // Some Estonian remarks was here ?!? 
    60  
    61 define('THEME_DIR', dirname(__FILE__) . '/themes/' . $config['theme_dir']); 
    62 define('THEME_URL', $config['theme_url']); 
     2/* This is a backwords compatible file to make old installations work correctly */ 
     3include_once(dirname(__FILE__)."/plogger.php"); 
    634 
    645function the_gallery_head() { 
    65         plogger_head(); 
    66  
    67         $use_file = 'head.php'; 
    68     if (file_exists(THEME_DIR . "/" . $use_file)) { 
    69                 include(THEME_DIR . "/" . $use_file); 
    70         } else { 
    71                 include(dirname(__FILE__).'/themes/default/'.$use_file); 
    72         } 
     6        return the_plogger_gallery_head(); 
    737} 
    748 
    759function the_gallery(){ 
    76         // collections mode (show all albums within a collection) 
    77         // it's the default 
    78         $use_file = "collections.php"; 
    79         if ($GLOBALS['plogger_level'] == "picture"){ 
    80                 $use_file = 'picture.php'; 
    81         } 
    82         elseif ($GLOBALS['plogger_level'] == "search"){ 
    83                 if ($GLOBALS['plogger_mode'] == "slideshow") { 
    84                         $use_file = 'slideshow.php'; 
    85                 } else { 
    86                         $use_file = 'search.php'; 
    87                 } 
    88         } 
    89         elseif ($GLOBALS['plogger_level'] == "album") { 
    90                 // Album level display mode (display all pictures within album) 
    91                 if ($GLOBALS['plogger_mode'] == "slideshow") { 
    92                         $use_file = 'slideshow.php'; 
    93                 } else { 
    94                         $use_file = 'album.php'; 
    95                 } 
    96         } 
    97         else if ($GLOBALS['plogger_level'] == "collection") { 
    98                 $use_file = 'collection.php'; 
    99         } 
    100  
    101         // if the theme does not have the requested file, then use the one from the default template 
    102         if (file_exists(THEME_DIR . "/" . $use_file)) { 
    103                 include(THEME_DIR . "/" . $use_file); 
    104         } else { 
    105                 include(dirname(__FILE__).'/themes/default/'.$use_file); 
    106         } 
    107 }  
     10        return the_plogger_gallery(); 
     11} 
    10812?> 
  • trunk/index.php

    r511 r550  
    33 * Plogger - A web based photo gallery 
    44 * Copyright (C) 2005 Mike Johnson 
    5  *  
     5 * 
    66 * This program is free software; you can redistribute it and/or modify 
    77 * it under the terms of the GNU General Public License as published by 
    88 * the Free Software Foundation; either version 2 of the License, or (at 
    99 * your option) any later version. 
    10  *  
     10 * 
    1111 * This program is distributed in the hope that it will be useful, but 
    1212 * WITHOUT ANY WARRANTY; without even the implied warranty of 
    1313 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
    1414 * General Public License for more details. 
    15  *  
     15 * 
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with this program; if not, write to the Free Software 
     
    2121<?php require("gallery.php"); ?> 
    2222<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    23  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
    24   
    25 <html xml:lang="<?php echo $language; ?>" lang="<?php echo $language; ?>" xmlns="http://www.w3.org/1999/xhtml">  
     23        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     24 
     25<html xml:lang="<?php echo $language; ?>" lang="<?php echo $language; ?>" xmlns="http://www.w3.org/1999/xhtml"> 
    2626 
    2727        <head> 
     
    3030        </head> 
    3131 
    32         <body>  
     32        <body> 
    3333                <?php the_gallery(); ?> 
    34          
     34 
    3535        </body> 
    3636 
  • trunk/plog-admin/_install.php

    r546 r550  
    11<?php 
    22error_reporting(E_ERROR); 
    3 require(dirname(__FILE__) . '/plog-globals.php'); 
    4 require(PLOGGER_DIR . 'plog-functions.php'); 
    5 require(PLOGGER_DIR . 'lib/plogger/install_functions.php'); 
     3require_once(dirname(dirname(__FILE__)).'/plog-globals.php'); 
     4require_once(PLOGGER_DIR.'plog-includes/plog-functions.php'); 
     5require_once(PLOGGER_DIR.'plog-admin/includes/install-functions.php'); 
    66 
    77// serve the config file 
    88if (!empty($_POST['dlconfig']) && !empty($_SESSION['plogger_config'])) { 
    9   header('Content-type: application/octet-stream'); 
    10   header('Content-Disposition: attachment; filename="plog-config.php"'); 
    11   print $_SESSION['plogger_config']; 
    12   die(); 
    13 }; 
     9        header('Content-type: application/octet-stream'); 
     10        header('Content-Disposition: attachment; filename="plog-config.php"'); 
     11        print $_SESSION['plogger_config']; 
     12        exit(); 
     13} 
    1414 
    1515// Create the SQL tables and try to proceed to the admin interface. 
     
    1919        if (empty($mysql)) { 
    2020                create_tables(); 
    21                 configure_plogger($_SESSION["install_values"]);   // undefined index install_values 
    22                 require(PLOGGER_DIR . "plog-load_config.php"); 
     21                configure_plogger($_SESSION['install_values']);   // undefined index install_values 
     22                require_once(PLOGGER_DIR."plog-load-config.php"); 
    2323                connect_db(); 
    2424                $col = add_collection(plog_tr("Plogger test collection"),plog_tr("Feel free to delete it")); 
     
    2727                        $alb = add_album(plog_tr("Plogger test album"),plog_tr("feel free to delete it"),$col['id']); 
    2828                } 
    29                 unset($_SESSION["plogger_config"]); 
    30                 unset($_SESSION["install_values"]); 
    31                 header("Location: admin/index.php"); 
     29                unset($_SESSION['plogger_config']); 
     30                unset($_SESSION['install_values']); 
     31                header("Location: index.php"); 
    3232                exit; 
    33         }; 
    34 }; 
     33        } 
     34} 
    3535?> 
    3636<html> 
     
    4040        </head> 
    4141        <body> 
    42                 <img src="graphics/plogger.gif" alt="Plogger"> 
     42                <img src="images/plogger.gif" alt="Plogger"> 
    4343<?php 
    4444if (empty($_POST['proceed'])) { 
    4545        do_install($_POST); 
    4646} else { 
    47         require(PLOGGER_DIR . 'lib/plogger/form_setup_complete.php'); 
    48 }; 
     47        require(PLOGGER_DIR.'plog-admin/includes/install-form-setup-complete.php'); 
     48} 
    4949?> 
    5050</body> 
  • trunk/plog-admin/_upgrade.php

    r509 r550  
    11<?php 
    2  
    32error_reporting(E_ERROR); 
    4  
    53echo ' 
    64        <html> 
    75                <head> 
    86                        <title>Upgrade Plogger</title> 
    9                         <link rel="stylesheet" type="text/css" href="admin/../css/admin.css"> 
     7                        <link rel="stylesheet" type="text/css" href="css/admin.css"> 
    108                </head> 
    119                <body> 
    12                 <img src="graphics/plogger.gif" alt="Plogger"> 
     10                <img src="images/plogger.gif" alt="Plogger"> 
    1311                <h1>Performing Upgrade...</h1>'; 
    1412         
    1513// This is the upgrade file for upgrading your Plogger gallery from Beta 1 
    16 $workdir = getcwd(); 
     14$workdir = dirname(dirname(__FILE__)); 
    1715if (file_exists($workdir.'/plog-connect.php')) 
    1816{ 
     
    2321                print $workdir . " is not writable, but I need to create a new file in it"; 
    2422                exit; 
    25         }; 
     23        } 
    2624 
    2725        // now parse DB connection parameters out of plog-connect 
     
    5048        if (!$fh) { 
    5149                die("Could not write plog-config.php, please make the file writable and then try running this script again"); 
    52         }; 
     50        } 
    5351        fwrite($fh,"<?php\n"); 
    5452        fwrite($fh,$cfg_file); 
     
    5755 
    5856        unlink($workdir.'/plog-connect.php'); 
    59         print "Done!<br/>"; 
    60  
    61 }; 
     57        print "Done!<br />"; 
     58 
     59} 
    6260 
    6361function makeDirs($strPath, $mode = 0777) //creates directory tree recursively 
     
    7270        while($row = mysql_fetch_array($res,MYSQL_NUM)) { 
    7371                if ($row[0] == $column) $found = true; 
    74         }; 
     72        } 
    7573        if (!$found) { 
    7674                print "<li>Adding new field $column to database."; 
     
    7876        } else { 
    7977                print "<li>$column already present in database."; 
    80         }; 
     78        } 
    8179} 
    8280 
     
    8785        while($row = mysql_fetch_array($res,MYSQL_NUM)) { 
    8886                if ($row[0] == $column) $found = true; 
    89         }; 
     87        } 
    9088        if ($found) { 
    9189                print "<li>dropping $column"; 
     
    9492        } else { 
    9593                //print "$column does not exist<br/>"; 
    96         }; 
     94        } 
    9795} 
    9896 
     
    106104} 
    107105 
    108 include("plog-functions.php"); 
    109 include("plog-globals.php"); 
    110 include("plog-config.php"); 
     106include($workdir."/plog-config.php"); 
     107include($workdir."/plog-globals.php"); 
     108include($workdir."/plog-includes/plog-functions.php"); 
     109 
    111110connect_db(); 
    112111$errors = ""; 
     
    195194        $sql = "UPDATE $config_table SET gallery_url = '" . $config['baseurl'] . "'"; 
    196195        mysql_query($sql); 
    197 }; 
     196} 
    198197 
    199198 
     
    255254 
    256255// insert default value (default theme directory) 
    257 $default_theme_dir = dirname(__FILE__)."/". 'themes/default/'; 
     256$default_theme_dir = dirname(__FILE__)."/plog-content/themes/default/""; 
    258257print "<li>Setting default theme directory to $default_theme_dir</li>"; 
    259258$sql = 'UPDATE '.TABLE_PREFIX.'config SET `theme_dir` = \''.$default_theme_dir.'\' WHERE 1'; 
     
    270269$sql = 'ALTER TABLE '.TABLE_PREFIX.'config 
    271270                ADD  (`small_lastmodified` datetime NOT NULL, 
    272                           `large_lastmodified` datetime NOT NULL, 
    273                           `rss_lastmodified` datetime NOT NULL)'; 
     271                `large_lastmodified` datetime NOT NULL, 
     272                `rss_lastmodified` datetime NOT NULL)'; 
    274273 
    275274if (mysql_query($sql)) 
     
    280279                         
    281280echo "</ul>"; 
    282 echo "<p>Reorganizing your images folder..."; 
     281echo "<p>Reorganizing your 'images/' folder..."; 
    283282 
    284283# strip images prefix from pictures table 
     
    324323        $filename = basename($row['path']); 
    325324        $directory = $row['collection_path']."/".$row['album_path']."/"; 
    326         $new_path = "images/".$directory.$filename; 
     325        $new_path = "plog-content/images/".$directory.$filename; 
    327326        if ($row['path'] == $new_path) continue; 
    328327        echo "<li>Moving $row[path] -> $new_path</li>"; 
    329328         
    330329        // move physical file, create directory if necessary and update path in database 
    331         if (!makeDirs("images/".$directory, 0755)) 
     330        if (!makeDirs("plog-content/images/".$directory, 0755)) 
    332331                        echo "<ul><li>Error: Could not create directory $directory!</li></ul>"; 
    333332         
     
    347346echo "</ul>"; 
    348347 
    349 if (!$errors) 
     348if (!$errors) { 
    350349        echo "Your files were successfully reorganized!"; 
    351 else 
     350} else { 
    352351        echo "There were $errors errors, check your permissions settings."; 
     352} 
    353353 
    354354 
     
    376376                        print "failed to convert $tablename to $charset<br/>"; 
    377377                        print mysql_error(); 
    378                 }; 
    379         } 
    380 }; 
    381  
    382 echo "<p>Upgrade has completed!" 
     378                } 
     379        } 
     380} 
     381 
     382echo "<p>Upgrade has completed!</p>" 
    383383?> 
    384  
    385                        
    386                    
  • trunk/plog-admin/css/admin.css

    r475 r550  
    1 html 
    2 { 
    3     padding: 15px; 
    4     border-bottom: 10px solid #336699; 
    5     border-top: 10px solid #336699; 
    6 } 
    7  
    8 html, body, p, form, table, td, tr 
    9 { 
    10     font-family: "Lucida Sans Unicode", "Lucida Sans", "Georgia", "Trebuchet MS", "Verdana", sans-serif; 
    11     font-size: 10pt 
     1html { 
     2        padding: 15px; 
     3        border-bottom: 10px solid #369; 
     4        border-top: 10px solid #369; 
     5} 
     6 
     7html, body, p, form, table, td, tr { 
     8        font-family: "Lucida Sans Unicode", "Lucida Sans", "Georgia", "Trebuchet MS", "Verdana", sans-serif; 
     9        font-size: 13px; 
    1210} 
    1311 
     
    1917        padding: 8px; 
    2018} 
    21  
    2219 
    2320.option-table td { 
     
    3330 
    3431tr.activated td { 
    35         background: #BEDEBE; 
    36         border-bottom: 1px solid #519E51; 
    37 } 
    38  
    39 input.submit 
    40 { 
    41         border: 3px double #999999; 
    42         border-top-color: #CCCCCC; 
    43         border-left-color: #CCCCCC; 
    44         background-color: #FFFFFF; 
    45         background-image: url('../graphics/button-bg.gif'); 
     32        background: #bedebe; 
     33        border-bottom: 1px solid #519e51; 
     34} 
     35 
     36input.submit { 
     37        border: 3px double #999; 
     38        border-top-color: #ccc; 
     39        border-left-color: #ccc; 
     40        background-color: #fff; 
     41        background-image: url("../images/button-bg.gif"); 
    4642        background-repeat: repeat-x; 
    47         color: #333333; 
     43        color: #333; 
    4844        font-size: 90%; 
    4945        font-weight: normal; 
     
    5248} 
    5349 
    54 h1 
    55 { 
    56     font-family: "Verdana", "Lucida Sans", "Lucida Grande", "Trebuchet MS", sans-serif; 
    57     font-size: 1.4em; 
    58     margin-top: 25px; 
    59     margin-bottom: 15px; 
    60     font-weight: bold; 
    61     color:     #264B71; 
    62 } 
    63  
    64 h2 
    65 { 
    66     font-family: "Verdana", "Lucida Sans", "Lucida Grande", "Trebuchet MS", sans-serif; 
    67     font-size: 1.0em; 
    68     margin-top: 20px; 
    69     margin-bottom: 15px; 
    70     text-decoration: underline; 
    71 } 
    72  
    73  
    74 a:link, a:active 
    75 { 
    76     color:           maroon; 
    77     text-decoration: none; 
    78 } 
    79  
    80 a:visited 
    81 { 
    82     color:           maroon; 
    83     text-decoration: none; 
    84 } 
    85  
    86 a:hover 
    87 { 
    88     color:           navy; 
    89     text-decoration: underline; 
    90 } 
    91  
    92 a:focus 
    93 { 
    94     outline: none; 
    95  
    96     -moz-outline:none; 
    97 } 
    98  
    99 .actions 
    100 { 
    101     background-image: url('../graphics/alert.gif'); 
    102     background-repeat: no-repeat; 
    103     background-position: 5px 8px; 
    104     margin-bottom:    15px; 
    105     margin-right:         15px;  
    106     border-top:                   2px solid #BBBB00; 
    107         border-bottom:                    2px solid #BBBB00; 
    108     padding:          8px; 
    109     background-color: #FFFFE0; 
    110     padding-left:     28px; 
    111     clear: both; 
    112 } 
    113  
    114 .errors 
    115 { 
    116     background-image: url('../graphics/x.gif'); 
    117     background-repeat: no-repeat; 
    118     background-position: 5px 8px; 
    119     margin-bottom:    15px; 
    120     margin-right:         15px; 
    121     border:                   1px solid maroon; 
    122     padding:          8px; 
    123     background-color: #FFCCCC; 
    124     padding-left:     28px; 
    125     clear: both; 
    126 } 
    127  
    128 .edit 
    129 { 
    130     background-image:  url('../graphics/edit.gif'); 
    131     background-repeat: no-repeat; 
    132     background-position: 5px 8px; 
    133     margin-bottom:     15px; 
    134     padding:           8px; 
    135     padding-left:      28px; 
    136     margin:            15px; 
    137     margin-left:           0; 
    138     border:                2px solid #CCCC66;  
    139     background-color:  #FFFFE0;  
    140     width:                         auto; 
    141     clear: both; 
    142 } 
    143  
    144 .edit img 
    145 { 
    146  
     50h1 { 
     51        font-family: "Verdana", "Lucida Sans", "Lucida Grande", "Trebuchet MS", sans-serif; 
     52        font-size: 1.4em; 
     53        margin-top: 25px; 
     54        margin-bottom: 15px; 
     55        font-weight: bold; 
     56        color: #264b71; 
     57} 
     58 
     59h2 { 
     60        font-family: "Verdana", "Lucida Sans", "Lucida Grande", "Trebuchet MS", sans-serif; 
     61        font-size: 1.0em; 
     62        margin-top: 20px; 
     63        margin-bottom: 15px; 
     64        text-decoration: underline; 
     65} 
     66 
     67a:link, a:active { 
     68        color: maroon; 
     69        text-decoration: none; 
     70} 
     71 
     72a:visited { 
     73        color: maroon; 
     74        text-decoration: none; 
     75} 
     76 
     77a:hover { 
     78        color: navy; 
     79        text-decoration: underline; 
     80} 
     81 
     82a:focus { 
     83        outline: none; 
     84        -moz-outline:none; 
     85} 
     86 
     87.actions { 
     88        background-image: url("../images/alert.gif"); 
     89        background-repeat: no-repeat; 
     90        background-position: 5px 8px; 
     91        margin-bottom: 15px; 
     92        margin-right: 15px; 
     93        border-top:     2px solid #bb0; 
     94        border-bottom: 2px solid #bb0; 
     95        padding: 8px; 
     96        background-color: #ffffe0; 
     97        padding-left: 28px; 
     98        clear: both; 
     99} 
     100 
     101.errors { 
     102        background-image: url("../images/x.gif"); 
     103        background-repeat: no-repeat; 
     104        background-position: 5px 8px; 
     105        margin-bottom: 15px; 
     106        margin-right: 15px; 
     107        border: 1px solid maroon; 
     108        padding:  8px; 
     109        background-color: #fcc; 
     110        padding-left: 28px; 
     111        clear: both; 
     112} 
     113 
     114.edit { 
     115        background-image: url("../images/edit.gif"); 
     116        background-repeat: no-repeat; 
     117        background-position: 5px 8px; 
     118        margin-bottom: 15px; 
     119        padding: 8px; 
     120        padding-left: 28px; 
     121        margin: 15px; 
     122        margin-left: 0; 
     123        border: 2px solid #cc6; 
     124        background-color: #ffffe0; 
     125        width: auto; 
     126        clear: both; 
     127} 
     128 
     129.edit img { 
    147130        border: 1px solid #000; 
    148131        padding: 3px; 
    149132        background-color: #fff; 
    150  
    151 } 
    152  
    153 img 
    154 { 
    155     border:  0; 
    156     display: inline; 
    157 } 
    158  
    159  
    160  
    161 tr.color-1 
    162 { 
    163     background-color: #ccc 
    164 } 
    165  
    166 tr.color-2 
    167 { 
    168     background-color: #efefef; 
    169 } 
    170  
    171 tr.header 
    172 { 
    173     color:            #FFF; 
    174     background-color: #264E75; 
    175     font-weight:      bold; 
     133} 
     134 
     135img { 
     136        border: 0; 
     137        display: inline; 
     138} 
     139 
     140tr.color-1 { 
     141        background-color: #ccc; 
     142} 
     143 
     144tr.color-2 { 
     145        background-color: #efefef; 
     146} 
     147 
     148tr.header { 
     149        color: #fff; 
     150        background-color: #264e75; 
     151        font-weight: bold; 
    176152} 
    177153 
     
    180156} 
    181157 
    182 tr.breadcrumb 
    183 { 
    184     background-color: #FFFFE0; 
    185     height: 16px; 
    186     vertical-align: middle; 
    187 } 
    188  
    189 label 
    190 { 
    191     padding: 8px; 
    192 } 
    193  
    194 input, select, textarea 
    195 { 
    196     margin: 5px; 
    197     font-family: "Lucida Sans Unicode", "Lucida Sans", "Georgia", "Trebuchet MS", "Verdana", sans-serif; 
    198     font-size: 10pt; 
    199 } 
    200  
    201 img 
    202 { 
    203     padding: 5px 
    204 } 
    205  
    206 #login 
    207 { 
    208     background-image: url('../graphics/login.gif'); 
    209     background-repeat: no-repeat; 
    210     width: 382px; 
    211     height: 327px; 
    212     padding: 187px 15px 10px 15px; 
    213     margin: auto; 
    214 } 
    215  
    216 #login-page 
    217 { 
    218     background: #336699; 
    219     text-align: center; 
    220     margin-top: 100px; 
    221 } 
    222  
    223 a.folder 
    224 { 
    225     background-image:  url("../graphics/folder_open.gif"); 
    226     background-repeat: no-repeat; 
    227     background-position: left 1px; 
    228     padding-left:      20px; 
    229 } 
    230  
    231 .box-1 
    232 { 
    233     margin: 15px; 
    234     border: 1px solid #264B71; 
    235     padding: 10px; 
    236     padding-left: 20px; 
    237     background-color: #C4DADB; 
    238     padding-top: 0; 
    239     margin-top: 5px; 
    240     width:  470px; 
    241     margin-left: 0; 
    242 } 
    243  
    244 .box-2 
    245 { 
    246     margin: 15px; 
    247     border: 1px solid #CCCC66; 
    248     padding: 10px; 
    249     padding-left: 20px; 
    250     background-color: #FFFFE0; 
    251     padding-top: 0; 
    252     margin-top: 5px; 
    253     width:  470px; 
    254     margin-left: 0; 
    255 } 
    256  
    257 .box-3 
    258 { 
    259     margin: 15px; 
    260     border: 1px solid #488F62; 
    261     padding: 10px; 
    262     padding-left: 20px; 
    263     padding-bottom: 18px; 
    264     margin-bottom: 10px; 
    265     background-color: #BEDEBE; 
    266     padding-top: 0; 
    267     margin-top: 5px; 
    268     width:  470px; 
    269     margin-left: 0; 
     158tr.breadcrumb { 
     159        background-color: #ffffe0; 
     160        height: 16px; 
     161        vertical-align: middle; 
     162} 
     163 
     164label { 
     165        padding: 8px; 
     166} 
     167 
     168input, select, textarea { 
     169        margin: 5px; 
     170        font-family: verdana, arial, sans-serif; 
     171        font-size: 12px; 
     172} 
     173 
     174img { 
     175        padding: 5px 
     176} 
     177 
     178#login { 
     179        background-image: url("../images/login.gif"); 
     180        background-repeat: no-repeat; 
     181        width: 382px; 
     182        height: 327px; 
     183        padding: 187px 15px 10px 15px; 
     184        margin: auto; 
     185} 
     186 
     187#login-page { 
     188        background: #369; 
     189        text-align: center; 
     190        margin-top: 100px; 
     191} 
     192 
     193a.folder { 
     194        background-image: url("../images/folder_open.gif"); 
     195        background-repeat: no-repeat; 
     196        background-position: left 1px; 
     197        padding-left: 20px; 
     198} 
     199 
     200.box-1 { 
     201        margin: 15px; 
     202        margin-top: 5px; 
     203        margin-left: 0; 
     204        border: 1px solid #264b71; 
     205        padding: 10px; 
     206        padding-top: 0; 
     207        padding-left: 20px; 
     208        background-color: #c4dadb; 
     209        width: 470px; 
     210} 
     211 
     212.box-2 { 
     213        margin: 15px; 
     214        margin-top: 5px; 
     215        margin-left: 0; 
     216        border: 1px solid #cc6; 
     217        padding: 10px; 
     218        padding-top: 0; 
     219        padding-left: 20px; 
     220        background-color: #ffffe0; 
     221        width: 470px; 
     222} 
     223 
     224.box-3 { 
     225        margin: 15px; 
     226        margin-top: 5px; 
     227        margin-bottom: 10px; 
     228        margin-left: 0; 
     229        border: 1px solid #488f62; 
     230        padding: 10px; 
     231        padding-top: 0; 
     232        padding-left: 20px; 
     233        padding-bottom: 18px; 
     234        background-color: #bedebe; 
     235        width: 470px; 
    270236} 
    271237 
    272238.add { 
    273         background-image: url(../graphics/new_file.gif);  
    274         background-repeat: no-repeat;  
    275         background-position: left center;   
     239        background-image: url("../images/new_file.gif"); 
     240        background-repeat: no-repeat; 
     241        background-position: left center; 
    276242        padding-left: 20px; 
    277243        margin-left: -12px; 
    278         text-decoration: underline;  
     244        text-decoration: underline; 
    279245} 
    280246 
    281247.breadcrumb-header { 
    282248        height: 16px; 
    283         vertical-align: middle; 
    284         background-color: #FFFFCC; 
     249        vertical-align: middle; 
     250        background-color: #ffc; 
    285251        padding: 3px; 
    286252} 
     
    299265 
    300266.thumbselect { 
    301   height: 80px; 
    302   padding-left: 90px; 
    303   background-repeat: no-repeat; 
    304   background-position: center left; 
     267        height: 80px; 
     268        padding-left: 90px; 
     269        background-repeat: no-repeat; 
     270        background-position: center left; 
    305271} 
    306272 
    307273.thumboption { 
    308  
    309   padding-left: 90px; 
    310   height: 40px; 
    311   margin-bottom: 2px; 
    312   background-position: center left; 
    313  
     274        padding-left: 90px; 
     275        height: 40px; 
     276        margin-bottom: 2px; 
     277        background-position: center left; 
    314278} 
    315279 
    316280.highlight { 
    317281        padding: 8px; 
    318         background: #FFFFE0; 
     282        background: #ffffe0; 
    319283        border-top: 2px solid #ccc; 
    320284        border-bottom: 2px solid #ccc; 
     
    323287 
    324288.highlight-row { 
    325         background: #FFFFE0; 
     289        background: #ffffe0; 
    326290} 
    327291 
     
    332296/* set the image to use and establish the lower-right position */ 
    333297.cssbox, .cssbox_body, .cssbox_head, .cssbox_head h2 { 
    334     background: transparent url(../graphics/plogger-box-add.png) no-repeat bottom right; 
    335     margin: 0; 
    336     padding: 0;  
     298        background: transparent url("../images/plogger-box-add.png") no-repeat bottom right; 
     299        margin: 0; 
     300        padding: 0;  
    337301} 
    338302 
    339303.cssbox label, .cssbox-green label { 
    340     padding:0; 
    341         margin:0; 
    342     font-weight:bold; 
    343         display:inline; 
     304        padding: 0; 
     305        margin: 0; 
     306        font-weight: bold; 
     307        display: inline; 
    344308} 
    345309 
    346310.cssbox-green, .cssbox_body-green, .cssbox_head-green, .cssbox_head-green h2 { 
    347     background: transparent url(../graphics/plogger-box-add-green.png) no-repeat bottom right; 
    348     margin: 0; 
    349     padding: 0;  
     311        background: transparent url("../images/plogger-box-add-green.png") no-repeat bottom right; 
     312        margin: 0; 
     313        padding: 0;  
    350314} 
    351315 
    352316.cssbox-green { 
    353         width: 320px !important;   /* intended total box width - padding-right(next) */ 
    354     width: 300px;              /* IE Win = width - padding */ 
    355     padding-right: 15px;      /* the gap on the right edge of the image (not content padding) */ 
    356     margin: 2px 0 20px 0;        /* use to position the box */ 
     317        width: 320px !important; /* intended total box width - padding-right(next) */ 
     318        width: 300px; /* IE Win = width - padding */ 
     319        padding-right: 15px; /* the gap on the right edge of the image (not content padding) */ 
     320        margin: 2px 0 20px 0; /* use to position the box */ 
    357321} 
    358322 
     
    363327 
    364328.cssbox { 
    365     width: 420px !important;  /* intended total box width - padding-right(next) */ 
    366     width: 405px;              /* IE Win = width - padding */ 
    367     padding-right: 15px;      /* the gap on the right edge of the image (not content padding) */ 
    368     margin: 2px 0 20px 0;        /* use to position the box */ 
     329        width: 420px !important; /* intended total box width - padding-right(next) */ 
     330        width: 405px; /* IE Win = width - padding */ 
     331        padding-right: 15px; /* the gap on the right edge of the image (not content padding) */ 
     332        margin: 2px 0 20px 0; /* use to position the box */ 
    369333} 
    370334 
    371335/* set the top-right image */ 
    372336.cssbox_head, .cssbox_head-green { 
    373     background-position: top right; 
    374     margin-right: -15px;      /* pull the right image over on top of border */ 
    375     padding-right: 40px;      /* right-image-gap + right-inside padding */ 
     337        background-position: top right; 
     338        margin-right: -15px; /* pull the right image over on top of border */ 
     339        padding-right: 40px; /* right-image-gap + right-inside padding */ 
    376340} 
    377341 
    378342/* set the top-left image */ 
    379343.cssbox_head h2, .cssbox_head-green h2 { 
    380     background-position: top left; 
    381     margin: 0;                /* reset */ 
    382     border: 0;                /* reset */ 
    383     padding: 7px 0 15px 20px; /* padding-left = image gap + interior padding ... no padding-right */ 
    384     height: auto !important;  
    385     height: 1%;                /* IE Holly Hack */ 
     344        background-position: top left; 
     345        margin: 0; /* reset */ 
     346        border: 0; /* reset */ 
     347        padding: 7px 0 15px 20px; /* padding-left = image gap + interior padding ... no padding-right */ 
     348        height: auto !important;  
     349        height: 1%; /* IE Holly Hack */ 
    386350} 
    387351 
    388352/* set the lower-left corner image */ 
    389353.cssbox_body, .cssbox_body-green { 
    390     background-position: bottom left; 
    391     margin-right: 25px;        /* interior-padding right */ 
    392     padding: 15px 0 15px 20px; /* mirror .cssbox_head right/left */ 
    393 } 
    394  
     354        background-position: bottom left; 
     355        margin-right: 25px; /* interior-padding right */ 
     356        padding: 15px 0 15px 20px; /* mirror .cssbox_head right/left */ 
     357} 
    395358 
    396359/* Misc Text formatting */ 
    397360.cssbox_head h2, .cssbox_head-green h2 { 
    398     color: white; 
    399     font-weight: bold; 
    400     font-size: 15px;      /* this is tricky if box width is in ems */ 
    401     text-align: center;  
    402     text-shadow: rgb(0,0,0) 0px 2px 5px; /* Safari-only, but I'm doing it just 'cause I can */ 
    403     text-decoration: none; 
    404 } 
     361        color: #fff; 
     362        font-weight: bold; 
     363        font-size: 15px; /* this is tricky if box width is in ems */ 
     364        text-align: center; 
     365        text-shadow: rgb(0,0,0) 0 2px 5px; /* Safari-only, but I'm doing it just 'cause I can */ 
     366        text-decoration: none; 
     367} 
     368 
    405369.cssbox_body p, .cssbox_body-green p { 
    406     margin: 0 0 20px; 
    407 } 
     370        margin: 0 0 20px; 
     371} 
     372 
    408373.cssbox_body a, .css_body a:hover { 
    409     margin: 0 !important; 
    410     padding: 0 !important; 
    411     border: 0 !important; 
    412     text-decoration: underline; 
     374        margin: 0 !important; 
     375        padding: 0 !important; 
     376        border: 0 !important; 
     377        text-decoration: underline; 
    413378} 
    414379 
     
    417382 
    418383#contentList #breadcrumb_links { 
    419         font-size:1.1em; 
    420         padding: 5px 3px 5px 0px; 
     384        font-size: 1.1em; 
     385        padding: 5px 3px 5px 0; 
    421386} 
    422387 
    423388#contentList #pagination { 
    424         font-size:1.3em; 
    425         padding: 5px 3px 5px 0px; 
    426         font-weight:bold; 
     389        font-size: 1.3em; 
     390        padding: 5px 3px 5px 0; 
     391        font-weight: bold; 
    427392} 
    428393 
    429394#uploadForm label { 
    430     display:block; 
    431         white-space:nowrap; 
     395        display: block; 
     396        white-space: nowrap; 
    432397} 
    433398 
    434399#options_section label { 
    435    font-weight:bold; 
     400        font-weight: bold; 
    436401} 
    437402 
    438403label em { 
    439    font-style:normal; 
    440    text-decoration:underline; 
     404        font-style: normal; 
     405        text-decoration: underline; 
    441406} 
    442407 
    443408.table-header-middle { 
    444         background: url('../graphics/table-middle.gif') repeat-x top left; 
     409        background: url("../images/table-middle.gif") repeat-x top left; 
    445410} 
    446411 
    447412.table-header-left { 
    448         background: url('../graphics/table-top-left.gif') no-repeat top left; 
     413        background: url("../images/table-top-left.gif") no-repeat top left; 
    449414} 
    450415 
    451416.table-header-right { 
    452         background: url('../graphics/table-top-right.gif') no-repeat top right; 
     417        background: url("../images/table-top-right.gif") no-repeat top right; 
    453418} 
    454419 
    455420a#show-collection, a#show-album { 
    456421        padding-left: 20px; 
    457         background: #ffffcc url('../graphics/new_file.gif') no-repeat left; 
     422        background: #ffc url("../images/new_file.gif") no-repeat left; 
    458423        font-size: 1.1em; 
    459424} 
     
    462427        text-decoration: none;  
    463428        color: white;  
    464         background: #99CC99 url('../graphics/new_file.gif') no-repeat left; 
    465 } 
    466  
     429        background: #9c9 url("../images/new_file.gif") no-repeat left; 
     430} 
    467431 
    468432.editable{ 
    469      color: #000; 
    470      background: #fff url(../graphics/diag-bg.gif) repeat top left; 
    471          padding:2px; 
    472          border:1px solid #efefef; 
    473          display: block; 
    474 } 
    475  
    476  
    477 p {  
     433        color: #000; 
     434        background: #fff url("../images/diag-bg.gif") repeat top left; 
     435        padding: 2px; 
     436        border: 1px solid #efefef; 
     437        display: block; 
     438} 
     439 
     440p { 
    478441        padding: 3px; 
    479442} 
    480443 
    481444.img-shadow { 
    482   float:left; 
    483   background: url(../graphics/shadowAlpha.png) no-repeat bottom right !important; 
    484   background: url(../graphics/shadow.gif) no-repeat bottom right; 
    485   margin: 10px 0 0 10px !important; 
    486   margin: 10px 0 0 5px; 
     445        float:left; 
     446        background: url("../images/shadowAlpha.png") no-repeat bottom right !important; 
     447        background: url("../images/shadow.gif") no-repeat bottom right; 
     448        margin: 10px 0 0 10px !important; 
     449        margin: 10px 0 0 5px; 
    487450} 
    488451 
    489452.img-shadow img { 
    490   display: block; 
    491   position: relative; 
    492   background-color: #fff; 
    493   border: 1px solid #a9a9a9; 
    494   margin: -6px 6px 6px -6px; 
    495   padding: 4px; 
    496 } 
     453        display: block; 
     454        position: relative; 
     455        background-color: #fff; 
     456        border: 1px solid #a9a9a9; 
     457        margin: -6px 6px 6px -6px; 
     458        padding: 4px; 
     459} 
  • trunk/plog-admin/css/greybox.css

    r348 r550  
    11#GB_overlay { 
    2   background-image: url('../graphics/overlay.png');  
    3   position: absolute; 
    4   margin: auto; 
    5   top: 0; 
    6   left: 0; 
    7   z-index: 100; 
     2        background-image: url("../images/overlay.png"); 
     3        position: absolute; 
     4        margin: auto; 
     5        top: 0; 
     6        left: 0; 
     7        z-index: 100; 
    88} 
    99 
    1010* html #GB_overlay { 
    11   background-color: #000; 
    12   background-color: transparent; 
    13   background-image: url(blank.gif); 
    14   filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../graphics/overlay.png", sizingMethod="scale"); 
     11        background-color: #000; 
     12        background-color: transparent; 
     13        background-image: url('blank.gif'); 
     14        filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../images/overlay.png", sizingMethod="scale"); 
    1515} 
    1616 
    1717#GB_window { 
    18   top: 22px; 
    19   left: 0; 
    20   position: absolute; 
    21   background-color: #fff; 
    22   border: 3px solid #336699; 
    23   border-top: 0; 
    24   overflow: visible; 
    25   z-index: 150; 
     18        top: 22px; 
     19        left: 0; 
     20        position: absolute; 
     21        background-color: #fff; 
     22        border: 3px solid #369; 
     23        border-top: 0; 
     24        overflow: visible; 
     25        z-index: 150; 
    2626} 
    2727 
    2828#GB_frame { 
    29   border: 0; 
    30   overflow: auto; 
     29        border: 0; 
     30        overflow: auto; 
    3131} 
    3232 
    3333#GB_header { 
    34   margin: 0; 
    35   top: 0; 
    36   border-left: 3px solid #336699; 
    37   border-right: 3px solid #336699; 
    38   height: 25px; 
    39   position: absolute; 
    40   background-color: #264B71; 
    41   z-index: 151; 
     34        margin: 0; 
     35        top: 0; 
     36        border-left: 3px solid #369; 
     37        border-right: 3px solid #369; 
     38        height: 25px; 
     39        position: absolute; 
     40        background-color: #264b71; 
     41        z-index: 151; 
    4242} 
    4343 
    4444#GB_caption { 
    45   font-family: helvetica, verdana, sans-serif; 
    46   font-size: 12px; 
    47   color: #fff; 
    48   font-weight: bold; 
    49   padding: 4px 0 0 5px; 
    50   margin: 0; 
    51   text-align: left; 
     45        font-family: helvetica, verdana, sans-serif; 
     46        font-size: 12px; 
     47        color: #fff; 
     48        font-weight: bold; 
     49        padding: 4px 0 0 5px; 
     50        margin: 0; 
     51        text-align: left; 
    5252} 
    5353 
    5454#GB_close { 
    55   padding: 2px 5px 0 0; 
    56   float: right; 
    57   cursor: pointer; 
     55        padding: 2px 5px 0 0; 
     56        float: right; 
     57        cursor: pointer; 
    5858} 
    59  
  • trunk/plog-admin/css/lightbox.css

    r345 r550  
    1 #lightbox{ 
     1#lightbox { 
    22        background-color:#eee; 
    33        padding: 10px; 
    44        border-bottom: 2px solid #666; 
    55        border-right: 2px solid #666; 
    6         } 
    7 #lightboxDetails{ 
     6} 
     7 
     8#lightboxDetails { 
    89        font-size: 0.8em; 
    910        padding-top: 0.4em; 
    10         }        
    11 #lightboxCaption{ float: left; } 
    12 #keyboardMsg{ float: right; } 
    13 #closeButton{ top: 5px; right: 5px; } 
     11} 
    1412 
    15 #lightbox img{ border: none; clear: both;}  
    16 #overlay img{ border: none; } 
     13#lightboxCaption { 
     14        float: left; 
     15} 
    1716 
    18 #overlay{ background-image: url(../graphics/overlay.png); } 
     17#keyboardMsg { 
     18        float: right; 
     19} 
    1920 
    20 * html #overlay{ 
     21#closeButton { 
     22        top: 5px; 
     23        right: 5px; 
     24} 
     25 
     26#lightbox img { 
     27        border: none; 
     28        clear: both; 
     29} 
     30 
     31#overlay img { 
     32        border: none; 
     33} 
     34 
     35#overlay { 
     36        background-image: url("../images/overlay.png"); 
     37} 
     38 
     39* html #overlay { 
    2140        background-color: #333; 
    2241        back\ground-color: transparent; 
    23         background-image: url(blank.gif); 
    24         filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../graphics/overlay.png", sizingMethod="scale"); 
    25         } 
    26          
     42        background-image: url("blank.gif"); 
     43        filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../images/overlay.png", sizingMethod="scale"); 
     44} 
  • trunk/plog-admin/css/tabs.css

    r440 r550  
    11#tab-nav { 
    2   float:left; 
    3   width:100%; 
    4   background:transparent url("../graphics/bg.gif") repeat-x bottom; 
    5   font-size:13px; 
    6   line-height:normal; 
    7   margin-bottom: 18px; 
    8   border-bottom: 2px solid #336699; 
    9   } 
     2        float: left; 
     3        width: 100%; 
     4        background: transparent url("../images/bg.gif") repeat-x bottom; 
     5        font-size: 13px; 
     6        line-height: normal; 
     7        margin-bottom: 18px; 
     8        border-bottom: 2px solid #369; 
     9} 
     10 
    1011#tab-nav ul { 
    11   margin:0; 
    12   padding:10px 10px 0; 
    13   list-style:none; 
    14   } 
     12        margin: 0; 
     13        padding: 10px 10px 0; 
     14        list-style: none; 
     15} 
     16 
    1517#tab-nav li { 
    16   float:left; 
    17   background:url("../graphics/left.gif") no-repeat left top; 
    18   margin:0; 
    19   padding:0 0 0 9px; 
    20   } 
     18        float: left; 
     19        background: url("../images/left.gif") no-repeat left top; 
     20        margin: 0; 
     21        padding: 0 0 0 9px; 
     22} 
     23 
    2124#tab-nav a { 
    22   float:left; 
    23   display:block; 
    24   background:url("../graphics/right.gif") no-repeat right top; 
    25   padding:5px 15px 4px 6px; 
    26   text-decoration:none; 
    27   font-weight:normal; 
    28   color:#765; 
    29   } 
    30 /* Commented Backslash Hack 
    31    hides rule from IE5-Mac \*/ 
    32 #tab-nav a {float:none;} 
     25        float: left; 
     26        display: block; 
     27        background: url("../images/right.gif") no-repeat right top; 
     28        padding: 5px 15px 4px 6px; 
     29        text-decoration: none; 
     30        font-weight: normal; 
     31        color: #765; 
     32} 
     33/* Commented Backslash Hack hides rule from IE5-Mac \*/ 
     34#tab-nav a { 
     35        float: none; 
     36} 
    3337/* End IE5-Mac hack */ 
     38 
    3439#tab-nav a:hover { 
    35   color:green; 
    36   } 
     40        color: green; 
     41} 
     42 
    3743#tab-nav #current { 
    38   background-image:url("../graphics/left_on.gif"); 
    39   } 
     44        background-image: url("../images/left_on.gif"); 
     45} 
     46 
    4047#tab-nav #current a { 
    41   background-image:url("../graphics/right_on.gif"); 
    42   color:#fff; 
    43   padding-bottom:5px; 
    44   font-weight:bold; 
    45   } 
    46    
     48        background-image: url("../images/right_on.gif"); 
     49        color: #fff; 
     50        padding-bottom: 5px; 
     51        font-weight: bold; 
     52} 
     53 
    4754#tab-nav a em { 
    4855        text-decoration: underline; 
     
    5158 
    5259#tab-subnav { 
    53         background: #336699; 
     60        background: #369; 
    5461        padding: 8px; 
    5562        clear: both; 
  • trunk/plog-admin/includes/install-form-setup-complete.php

    r546 r550  
    22if (!defined('PLOGGER_DIR')) { 
    33        return false; 
    4 }; 
     4} 
    55?> 
    6 <h1>Plogger Install</h1> 
    7 <form method="POST"> 
    8 <p>Configuration setup is now complete.<br/>Click 'Install' to finish installation.</p> 
    9 <p>Your username is <?php echo $_SESSION['install_values']['admin_username']; ?> and your password is `<?php echo $_SESSION['install_values']['admin_password']; ?>`</p> 
     6        <h1>Plogger Install</h1> 
     7        <form method="POST"> 
     8        <p>Configuration setup is now complete.<br />Click 'Install' to finish installation.</p> 
     9        <p>Your username is <?php echo $_SESSION['install_values']['admin_username']; ?> and your password is `<?php echo $_SESSION['install_values']['admin_password']; ?>`</p> 
    1010<?php if (!empty($_SESSION["plogger_config"])) { ?> 
    11 <p>Before you can proceed, please <input type="submit" name="dlconfig" value="click here"/> to download configuration file for your gallery, then upload it to your webhost (into the same directory where you installed Plogger itself).</p> 
     11        <p>Before you can proceed, please <input type="submit" name="dlconfig" value="click here"/> to download configuration file for your gallery, then upload it to your webhost (into the same directory where you installed Plogger itself).</p> 
    1212<?php } ?> 
    13 <p> 
    14 <input type="submit" name="proceed" id="proceed" value="Install"/> 
    15 </p> 
    16 </form> 
     13        <p> 
     14                <input type="submit" name="proceed" id="proceed" value="Install"/> 
     15        </p> 
     16        </form> 
  • trunk/plog-admin/includes/install-form-setup.php

    r546 r550  
    44}; 
    55?> 
    6 <h1>Plogger Configuration Setup</h1> 
    7 <p>To install, simply fill out the following form.  If there are any problems, you will be notified and asked to fix them before the installation will continue.  After the installation has finished, you will be redirected to the Plogger admin page.</p> 
    8 <form action="_install.php" method="post"> 
    9 <input type="hidden" name="action" value="install" /> 
    10 <table> 
    11         <tr> 
    12         <td colspan="2"> 
    13                 <div id="navcontainer"> 
    14                         <h1>Database Setup</h1> 
    15                 </div> 
    16                 </td> 
    17         </tr> 
    18         <tr> 
    19                 <td class="form_label"><label for="db_host">MySQL host:</label></td> 
    20                 <td class="form_input"><input type="text" name="db_host" id="db_host" value="<?php echo $form['db_host']; ?>" /></td> 
    21         </tr> 
     6        <h1>Plogger Configuration Setup</h1> 
     7        <p>To install, simply fill out the following form.  If there are any problems, you will be notified and asked to fix them before the installation will continue.  After the installation has finished, you will be redirected to the Plogger admin page.</p> 
     8        <form action="_install.php" method="post"> 
     9        <input type="hidden" name="action" value="install" /> 
     10        <table> 
     11                <tr> 
     12                        <td colspan="2"> 
     13                                <div id="navcontainer"> 
     14                                        <h1>Database Setup</h1> 
     15                                </div> 
     16                        </td> 
     17                </tr> 
     18                <tr> 
     19                        <td class="form_label"><label for="db_host">MySQL host:</label></td> 
     20                        <td class="form_input"><input type="text" name="db_host" id="db_host" value="<?php echo $form['db_host']; ?>" /></td> 
     21                </tr> 
    2222 
    23         <tr> 
    24                 <td class="form_label"><label for="db_user">MySQL Username:</label></td> 
    25                 <td class="form_input"><input type="text" name="db_user" id="db_user" value="<?php echo $form['db_user']; ?>" /></td> 
    26         </tr> 
    27         <tr> 
    28                 <td class="form_label"><label for="db_password">MySQL Password:</label></td> 
    29                 <td class="form_input"><input type="password" name="db_pass" id="db_pass" value="<?php echo $form['db_pass']; ?>" /></td> 
    30         </tr> 
     23                <tr> 
     24                        <td class="form_label"><label for="db_user">MySQL Username:</label></td> 
     25                        <td class="form_input"><input type="text" name="db_user" id="db_user" value="<?php echo $form['db_user']; ?>" /></td> 
     26                </tr> 
     27                <tr> 
     28                        <td class="form_label"><label for="db_password">MySQL Password:</label></td> 
     29                        <td class="form_input"><input type="password" name="db_pass" id="db_pass" value="<?php echo $form['db_pass']; ?>" /></td> 
     30                </tr> 
    3131 
    32         <tr> 
    33                 <td class="form_label"><label for="db_name">MySQL Database:</label></td> 
    34                 <td class="form_input"><input type="text" name="db_name" id="db_name" value="<?php echo $form['db_name']; ?>" /></td> 
    35         </tr> 
    36         <tr> 
    37                 <td colspan="2"> 
    38                 <div id="navcontainer"> 
    39                         <h1>Administrative Setup</h1> 
    40                 </div> 
    41                 </td> 
    42         </tr> 
    43         <tr> 
    44                 <td class="form_label"><label for="gallery">Gallery Name:</label></td> 
    45                 <td class="form_input"><input type="text" name="gallery_name" id="gallery" value="<?php echo $form['gallery_name']; ?>" /></td> 
    46         </tr> 
    47         <tr> 
    48                 <td class="form_label"><label for="username">Your e-mail:</label></td> 
    49                 <td class="form_input"><input type="text" name="admin_email" id="email" value="<?php echo $form['admin_email']; ?>" /></td> 
    50         </tr> 
    51    <?php 
    52    //if server is safe_mode enabled, prompt user for FTP info for FTP workaround 
    53    if (ini_get('safe_mode') && function_exists('ftp_connect')){?> 
    54    <tr> 
    55         <td colspan="2"> 
    56                 <div id="navcontainer"> 
    57                         <h1>Safe_mode FTP workaround</h1> 
    58          <br />Safe mode has been detected on your server.  FTP access is needed to allow Plogger to work correctly with safe_mode enabled. 
    59       </div> 
    60                 </td> 
    61         </tr> 
    62         <tr> 
    63                 <td class="form_label"><label for="ftp_host">FTP Host:</label></td> 
    64                 <td class="form_input"><input type="text" name="ftp_host" id="ftp_host" value="<?php echo $form['ftp_host']; ?>" /></td> 
    65         </tr> 
    66         <tr> 
    67                 <td class="form_label"><label for="ftp_user">FTP Username:</label></td> 
    68                 <td class="form_input"><input type="text" name="ftp_user" id="ftp_user" value="<?php echo $form['ftp_user']; ?>" /></td> 
    69         </tr> 
    70         <tr> 
    71                 <td class="form_label"><label for="ftp_password">FTP Password:</label></td> 
    72                 <td class="form_input"><input type="password" name="ftp_pass" id="ftp_pass" value="<?php echo $form['ftp_pass']; ?>" /></td> 
    73         </tr> 
    74         <tr> 
    75                 <td class="form_label"><label for="ftp_path">FTP Path to Plogger Base Folder (from FTP login):</label></td> 
    76                 <td class="form_input"><input type="text" name="ftp_path" id="ftp_path" value="<?php echo $form['ftp_path']; ?>" /></td> 
    77         </tr> 
    78    <?php } //end safe_mode workaround ?> 
    79    <tr> 
    80                 <td class="submitButtonRow" colspan="2"> 
    81                         <input type="submit" name="submit" id="submit" value="Proceed" /> 
    82                 </td> 
    83         </tr> 
    84 </table> 
    85 </form> 
     32                <tr> 
     33                        <td class="form_label"><label for="db_name">MySQL Database:</label></td> 
     34                        <td class="form_input"><input type="text" name="db_name" id="db_name" value="<?php echo $form['db_name']; ?>" /></td> 
     35                </tr> 
     36                <tr> 
     37                        <td colspan="2"> 
     38                                <div id="navcontainer"> 
     39                                        <h1>Administrative Setup</h1> 
     40                                </div> 
     41                        </td> 
     42                </tr> 
     43                <tr> 
     44                        <td class="form_label"><label for="gallery">Gallery Name:</label></td> 
     45                        <td class="form_input"><input type="text" name="gallery_name" id="gallery" value="<?php echo $form['gallery_name']; ?>" /></td> 
     46                </tr> 
     47                <tr> 
     48                        <td class="form_label"><label for="username">Your e-mail:</label></td> 
     49                        <td class="form_input"><input type="text" name="admin_email" id="email" value="<?php echo $form['admin_email']; ?>" /></td> 
     50                </tr> 
     51<?php 
     52//if server is safe_mode enabled, prompt user for FTP info for FTP workaround 
     53        if (ini_get('safe_mode') && function_exists('ftp_connect')){ 
     54?> 
     55                <tr> 
     56                        <td colspan="2"> 
     57                                <div id="navcontainer"> 
     58                                        <h1>Safe_mode FTP workaround</h1> 
     59                                        <br />Safe mode has been detected on your server.  FTP access is needed to allow Plogger to work correctly with safe_mode enabled. 
     60                                </div> 
     61                        </td> 
     62                </tr> 
     63                <tr> 
     64                        <td class="form_label"><label for="ftp_host">FTP Host:</label></td> 
     65                        <td class="form_input"><input type="text" name="ftp_host" id="ftp_host" value="<?php echo $form['ftp_host']; ?>" /></td> 
     66                </tr> 
     67                <tr> 
     68                        <td class="form_label"><label for="ftp_user">FTP Username:</label></td> 
     69                        <td class="form_input"><input type="text" name="ftp_user" id="ftp_user" value="<?php echo $form['ftp_user']; ?>" /></td> 
     70                </tr> 
     71                <tr> 
     72                        <td class="form_label"><label for="ftp_password">FTP Password:</label></td> 
     73                        <td class="form_input"><input type="password" name="ftp_pass" id="ftp_pass" value="<?php echo $form['ftp_pass']; ?>" /></td> 
     74                </tr> 
     75                <tr> 
     76                        <td class="form_label"><label for="ftp_path">FTP Path to Plogger Base Folder (from FTP login):</label></td> 
     77                        <td class="form_input"><input type="text" name="ftp_path" id="ftp_path" value="<?php echo $form['ftp_path']; ?>" /></td> 
     78                </tr> 
     79<?php } //end safe_mode workaround ?> 
     80                <tr> 
     81                        <td class="submitButtonRow" colspan="2"> 
     82                                <input type="submit" name="submit" id="submit" value="Proceed" /> 
     83                        </td> 
     84                </tr> 
     85        </table> 
     86        </form> 
  • trunk/plog-admin/includes/install-functions.php

    r546 r550  
    11<?php 
    2 require_once(PLOGGER_DIR . 'admin/plog-admin-functions.php'); 
    3 @include(PLOGGER_DIR . 'plog-config.php'); 
     2if (!defined('PLOGGER_DIR')) { 
     3        return false; 
     4} 
     5require_once(PLOGGER_DIR.'plog-admin/plog-admin-functions.php'); 
     6@include(PLOGGER_DIR.'plog-config.php'); 
    47 
    58function do_install($form) { 
    69        $form = array_map('stripslashes',$form); 
    710        $form = array_map('trim',$form); 
    8          
     11 
    912        $errors = check_requirements(); 
    1013        if (sizeof($errors) > 0) { 
     
    4346                        $errors[] = 'Please enter the MySQL password.'; 
    4447                } 
    45                  
     48 
    4649                if (empty($form['db_name'])) { 
    4750                        $errors[] = 'Please enter the MySQL database name.'; 
    4851                } 
    49                  
     52 
    5053                if (empty($form['gallery_name'])) { 
    5154                        $errors[] = 'Please enter the name for your gallery.'; 
    5255                } 
    53                  
     56 
    5457                if (empty($form['admin_email'])) { 
    5558                        $errors[] = 'Please enter your e-mail address.'; 
    5659                } 
    57        
     60 
    5861                if (ini_get('safe_mode') && function_exists('ftp_connect')) { 
    5962                        //if safe_mode enabled, check the FTP information form inputs 
     
    6770 
    6871                        if (empty($form['ftp_pass'])) { 
    69                                 $errors[] = 'Please enter the FTP password.'; 
    70                         } 
    71           
     72                                $errors[] = 'Please enter the FTP password.'; 
     73                        } 
     74 
    7275                        if (!empty($form['ftp_path'])) { 
    7376                                if (substr($form['ftp_path'],0,1)!="/"){ 
     
    98101                        $password = generate_password(); 
    99102                        $_SESSION["install_values"] = array( 
    100                                 "gallery_name" => $form["gallery_name"], 
    101                                 "admin_email" => $form["admin_email"], 
    102                                 "admin_password" => $password, 
    103                                 "admin_username" => "admin" 
     103                        "gallery_name" => $form["gallery_name"], 
     104                        "admin_email" => $form["admin_email"], 
     105                        "admin_password" => $password, 
     106                        "admin_username" => "admin" 
    104107                        ); 
    105                                  
     108 
    106109                        if (ini_get('safe_mode') && function_exists('ftp_connect')) { 
    107110                                $conf = create_config_file($form['db_host'],$form['db_user'],$form['db_pass'],$form['db_name'],$form['ftp_host'],$form['ftp_user'],$form['ftp_pass'],$form['ftp_path']); 
     
    117120                                $_SESSION["plogger_config"] = $conf; 
    118121                        } 
    119                         require(PLOGGER_DIR . 'lib/plogger/form_setup_complete.php'); 
     122                        require(PLOGGER_DIR . 'plog-admin/includes/install-form-setup-complete.php'); 
    120123                        return true; 
    121124                } 
     
    126129                $form['db_host'] = 'localhost'; 
    127130        } 
    128    if (empty($form['ftp_host'])) { 
     131        if (empty($form['ftp_host'])) { 
    129132                $form['ftp_host'] = 'localhost'; 
    130133        } 
     
    136139                } 
    137140        } 
    138         require(PLOGGER_DIR . 'lib/plogger/form_setup.php'); 
     141        require(PLOGGER_DIR . 'plog-admin/includes/install-form-setup.php'); 
    139142} 
    140143 
     
    152155 
    153156        maybe_add_table( 
    154                 TABLE_PREFIX . 'collections' 
    155                 ,"`name` varchar(128) NOT NULL default '', 
    156                 `description` varchar(255) NOT NULL default '', 
    157                 `path` varchar(255) NOT NULL default '', 
    158                 `id` int(11) NOT NULL auto_increment, 
    159                 `thumbnail_id` int(11) NOT NULL DEFAULT '0', 
    160                 PRIMARY KEY  (id)" 
    161                 ,"Type=MyISAM $default_charset"); 
    162  
    163  
    164         maybe_add_table( 
    165                 TABLE_PREFIX . 'albums' 
    166                 ," `name` varchar(128) NOT NULL default '', 
    167                 `id` int(11) NOT NULL auto_increment, 
    168                 `description` varchar(255) NOT NULL default '', 
    169                 `path` varchar(255) NOT NULL default '', 
    170                 `parent_id` int(11) NOT NULL default '0', 
    171                 `thumbnail_id` int(11) NOT NULL default '0', 
    172                  PRIMARY KEY  (id), 
    173                  INDEX pid_idx (parent_id)" 
    174                 ," Type=MyISAM $default_charset"); 
    175          
    176         maybe_add_table( 
    177                 TABLE_PREFIX . 'pictures' 
    178                 ,"`path` varchar(255) NOT NULL default '', 
    179                 `parent_album` int(11) NOT NULL default '0', 
    180                 `parent_collection` int(11) NOT NULL default '0', 
    181                 `caption` mediumtext NOT NULL, 
    182                 `description` text NOT NULL, 
    183                 `id` int(11) NOT NULL auto_increment, 
    184                 `date_modified` timestamp(14) NOT NULL, 
    185                 `date_submitted` timestamp(14) NOT NULL, 
    186                 `EXIF_date_taken` varchar(64) NOT NULL default '', 
    187                 `EXIF_camera` varchar(64) NOT NULL default '', 
    188                 `EXIF_shutterspeed` varchar(64) NOT NULL default '', 
    189                 `EXIF_focallength` varchar(64) NOT NULL default '', 
    190                 `EXIF_flash` varchar(64) NOT NULL default '', 
    191                 `EXIF_aperture` varchar(64) NOT NULL default '', 
    192                 `allow_comments` int(11) NOT NULL default '1', 
    193                 PRIMARY KEY  (id), 
    194                 INDEX pa_idx (parent_album), 
    195                 INDEX pc_idx (parent_collection)" 
    196                 ,"Type=MyISAM $default_charset"); 
    197          
    198         maybe_add_table( 
    199                 TABLE_PREFIX . 'comments' 
    200                 ,"`id` int(11) NOT NULL auto_increment, 
    201                 `parent_id` int(11) NOT NULL default '0', 
    202                 `author` varchar(64) NOT NULL default '', 
    203                 `email` varchar(64) NOT NULL default '', 
    204                 `url` varchar(64) NOT NULL default '', 
    205                 `date` datetime NOT NULL, 
    206                 `comment` longtext NOT NULL, 
    207                 `ip` char(64), 
    208                 `approved` tinyint default '1', 
    209                 PRIMARY KEY  (id), 
    210                 INDEX pid_idx (parent_id), 
    211                 INDEX approved_idx (approved)" 
    212                 ,"Type=MyISAM $default_charset"); 
    213  
    214         maybe_add_table( 
    215                 TABLE_PREFIX . 'config' 
    216                 ,"`max_thumbnail_size` int(11) NOT NULL default '0', 
    217                 `max_display_size` int(11) NOT NULL default '0', 
    218                 `thumb_num` int(11) NOT NULL default '0', 
    219                 `admin_username` varchar(64) NOT NULL default '', 
    220                 `admin_password` varchar(64) NOT NULL default '', 
    221                 `admin_email` varchar(50) NOT NULL default '', 
    222                 `date_format` varchar(64) NOT NULL default '', 
    223                 `compression` int(11) NOT NULL default '75', 
    224                 `default_sortby` varchar(20) NOT NULL default '', 
    225                 `default_sortdir` varchar(5) NOT NULL default '', 
    226                 `album_sortby` varchar(20) NOT NULL default '', 
    227                 `album_sortdir` varchar(5) NOT NULL default '', 
    228                 `collection_sortby` varchar(20) NOT NULL default '', 
    229                 `collection_sortdir` varchar(5) NOT NULL default '', 
    230                 `gallery_name` varchar(255) NOT NULL default '', 
    231                 `allow_dl` smallint(1) NOT NULL default '0', 
    232                 `allow_comments` smallint(1) NOT NULL default '1', 
    233                 `allow_print` smallint(1) NOT NULL default '1', 
    234                 `truncate` int(11) NOT NULL default '12', 
    235                 `square_thumbs` tinyint default 1, 
    236                 `feed_num_entries` int(15) NOT NULL default '15', 
    237                 `rss_thumbsize` int(11) NOT NULL default '400', 
    238                 `feed_title` text NOT NULL, 
    239                 `use_mod_rewrite` tinyint NOT NULL default '0', 
    240                 `gallery_url` varchar(255) NOT NULL default '', 
    241                 `comments_notify` tinyint NOT NULL default '1', 
    242                 `comments_moderate` tinyint NOT NULL default '0', 
    243                 `feed_language` varchar(255) NOT NULL default 'en-us', 
    244                 `theme_dir` varchar(128) NOT NULL default '', 
    245                 `thumb_nav_range` int(11) NOT NULL default '0', 
    246                 `enable_thumb_nav` tinyint default '0', 
    247                 `allow_fullpic` tinyint default '1'" 
    248                 ,"Type=MyISAM $default_charset"); 
    249  
    250         maybe_add_table( 
    251                 TABLE_PREFIX . 'thumbnail_config' 
    252                 ,"`id` int(10) unsigned NOT NULL auto_increment, 
    253                 `update_timestamp` int(10) unsigned default NULL, 
    254                 `max_size` int(10) unsigned default NULL, 
    255                 `disabled` tinyint default 0, 
    256                 PRIMARY KEY  (`id`)"); 
    257          
    258         maybe_add_table( 
    259                 TABLE_PREFIX . 'tag2picture' 
    260                 ,"`tag_id` bigint(20) unsigned NOT NULL default '0', 
    261                   `picture_id` bigint(20) unsigned NOT NULL default '0', 
    262                   `tagdate` datetime default NULL, 
    263                   KEY `tag_id` (`tag_id`), 
    264                   KEY `picture_id` (`picture_id`)" 
    265                 ,"Type=MyISAM $default_charset"); 
    266          
    267         maybe_add_table( 
    268                 TABLE_PREFIX . 'tags' 
    269                 ,"`id` bigint(20) unsigned NOT NULL auto_increment, 
    270                   `tag` char(50) NOT NULL default '', 
    271                   `tagdate` datetime NOT NULL default '0000-00-00 00:00:00', 
    272                   `urlified` char(50) NOT NULL default '', 
    273                   PRIMARY KEY  (`id`), 
    274                   UNIQUE `tag` (`tag`), 
    275                   UNIQUE `urlified` (`urlified`)" 
    276                 ,"Type=MyISAM $default_charset"); 
     157        TABLE_PREFIX . 'collections' 
     158        ,"`name` varchar(128) NOT NULL default '', 
     159        `description` varchar(255) NOT NULL default '', 
     160        `path` varchar(255) NOT NULL default '', 
     161        `id` int(11) NOT NULL auto_increment, 
     162        `thumbnail_id` int(11) NOT NULL DEFAULT '0', 
     163        PRIMARY KEY  (id)" 
     164        ,"Type=MyISAM $default_charset"); 
     165 
     166 
     167        maybe_add_table( 
     168        TABLE_PREFIX . 'albums' 
     169        ," `name` varchar(128) NOT NULL default '', 
     170        `id` int(11) NOT NULL auto_increment, 
     171        `description` varchar(255) NOT NULL default '', 
     172        `path` varchar(255) NOT NULL default '', 
     173        `parent_id` int(11) NOT NULL default '0', 
     174        `thumbnail_id` int(11) NOT NULL default '0', 
     175        PRIMARY KEY  (id), 
     176        INDEX pid_idx (parent_id)" 
     177        ," Type=MyISAM $default_charset"); 
     178 
     179        maybe_add_table( 
     180        TABLE_PREFIX . 'pictures' 
     181        ,"`path` varchar(255) NOT NULL default '', 
     182        `parent_album` int(11) NOT NULL default '0', 
     183        `parent_collection` int(11) NOT NULL default '0', 
     184        `caption` mediumtext NOT NULL, 
     185        `description` text NOT NULL, 
     186        `id` int(11) NOT NULL auto_increment, 
     187        `date_modified` timestamp(14) NOT NULL, 
     188        `date_submitted` timestamp(14) NOT NULL, 
     189        `EXIF_date_taken` varchar(64) NOT NULL default '', 
     190        `EXIF_camera` varchar(64) NOT NULL default '', 
     191        `EXIF_shutterspeed` varchar(64) NOT NULL default '', 
     192        `EXIF_focallength` varchar(64) NOT NULL default '', 
     193        `EXIF_flash` varchar(64) NOT NULL default '', 
     194        `EXIF_aperture` varchar(64) NOT NULL default '', 
     195        `allow_comments` int(11) NOT NULL default '1', 
     196        PRIMARY KEY  (id), 
     197        INDEX pa_idx (parent_album), 
     198        INDEX pc_idx (parent_collection)" 
     199        ,"Type=MyISAM $default_charset"); 
     200 
     201        maybe_add_table( 
     202        TABLE_PREFIX . 'comments' 
     203        ,"`id` int(11) NOT NULL auto_increment, 
     204        `parent_id` int(11) NOT NULL default '0', 
     205        `author` varchar(64) NOT NULL default '', 
     206        `email` varchar(64) NOT NULL default '', 
     207        `url` varchar(64) NOT NULL default '', 
     208        `date` datetime NOT NULL, 
     209        `comment` longtext NOT NULL, 
     210        `ip` char(64), 
     211        `approved` tinyint default '1', 
     212        PRIMARY KEY  (id), 
     213        INDEX pid_idx (parent_id), 
     214        INDEX approved_idx (approved)" 
     215        ,"Type=MyISAM $default_charset"); 
     216 
     217        maybe_add_table( 
     218        TABLE_PREFIX . 'config' 
     219        ,"`max_thumbnail_size` int(11) NOT NULL default '0', 
     220        `max_display_size` int(11) NOT NULL default '0', 
     221        `thumb_num` int(11) NOT NULL default '0', 
     222        `admin_username` varchar(64) NOT NULL default '', 
     223        `admin_password` varchar(64) NOT NULL default '', 
     224        `admin_email` varchar(50) NOT NULL default '', 
     225        `date_format` varchar(64) NOT NULL default '', 
     226        `compression` int(11) NOT NULL default '75', 
     227        `default_sortby` varchar(20) NOT NULL default '', 
     228        `default_sortdir` varchar(5) NOT NULL default '', 
     229        `album_sortby` varchar(20) NOT NULL default '', 
     230        `album_sortdir` varchar(5) NOT NULL default '', 
     231        `collection_sortby` varchar(20) NOT NULL default '', 
     232        `collection_sortdir` varchar(5) NOT NULL default '', 
     233        `gallery_name` varchar(255) NOT NULL default '', 
     234        `allow_dl` smallint(1) NOT NULL default '0', 
     235        `allow_comments` smallint(1) NOT NULL default '1', 
     236        `allow_print` smallint(1) NOT NULL default '1', 
     237        `truncate` int(11) NOT NULL default '12', 
     238        `square_thumbs` tinyint default 1, 
     239        `feed_num_entries` int(15) NOT NULL default '15', 
     240        `rss_thumbsize` int(11) NOT NULL default '400', 
     241        `feed_title` text NOT NULL, 
     242        `use_mod_rewrite` tinyint NOT NULL default '0', 
     243        `gallery_url` varchar(255) NOT NULL default '', 
     244        `comments_notify` tinyint NOT NULL default '1', 
     245        `comments_moderate` tinyint NOT NULL default '0', 
     246        `feed_language` varchar(255) NOT NULL default 'en-us', 
     247        `theme_dir` varchar(128) NOT NULL default '', 
     248        `thumb_nav_range` int(11) NOT NULL default '0', 
     249        `enable_thumb_nav` tinyint default '0', 
     250        `allow_fullpic` tinyint default '1'" 
     251        ,"Type=MyISAM $default_charset"); 
     252 
     253        maybe_add_table( 
     254        TABLE_PREFIX . 'thumbnail_config' 
     255        ,"`id` int(10) unsigned NOT NULL auto_increment, 
     256        `update_timestamp` int(10) unsigned default NULL, 
     257        `max_size` int(10) unsigned default NULL, 
     258        `disabled` tinyint default 0, 
     259        PRIMARY KEY  (`id`)"); 
     260 
     261        maybe_add_table( 
     262        TABLE_PREFIX . 'tag2picture' 
     263        ,"`tag_id` bigint(20) unsigned NOT NULL default '0', 
     264        `picture_id` bigint(20) unsigned NOT NULL default '0', 
     265        `tagdate` datetime default NULL, 
     266        KEY `tag_id` (`tag_id`), 
     267        KEY `picture_id` (`picture_id`)" 
     268        ,"Type=MyISAM $default_charset"); 
     269 
     270        maybe_add_table( 
     271        TABLE_PREFIX . 'tags' 
     272        ,"`id` bigint(20) unsigned NOT NULL auto_increment, 
     273        `tag` char(50) NOT NULL default '', 
     274        `tagdate` datetime NOT NULL default '0000-00-00 00:00:00', 
     275        `urlified` char(50) NOT NULL default '', 
     276        PRIMARY KEY  (`id`), 
     277        UNIQUE `tag` (`tag`), 
     278        UNIQUE `urlified` (`urlified`)" 
     279        ,"Type=MyISAM $default_charset"); 
    277280 
    278281} 
     
    283286 
    284287        $thumbnail_sizes = array( 
    285                 THUMB_SMALL => 100, 
    286                 THUMB_LARGE => 500, 
    287                 THUMB_RSS => 400, 
    288                 THUMB_NAV => 60 
     288        THUMB_SMALL => 100, 
     289        THUMB_LARGE => 500, 
     290        THUMB_RSS => 400, 
     291        THUMB_NAV => 60 
    289292        ); 
    290293 
    291294        foreach($thumbnail_sizes as $key => $size) { 
    292295                $sql = "INSERT INTO `".TABLE_PREFIX."thumbnail_config` (id,update_timestamp,max_size) 
    293                         VALUES('$key','$long_ago','$size')"; 
     296                VALUES('$key','$long_ago','$size')"; 
    294297                mysql_query($sql); 
    295298        } 
    296299 
    297         $config['default_theme_dir'] = PLOGGER_DIR . 'themes/default/'; 
    298         $config['baseurl'] = "http://".$_SERVER["SERVER_NAME"]. substr($_SERVER["PHP_SELF"],0,strrpos($_SERVER["PHP_SELF"],"/")) . "/"; 
     300        $config['default_theme_dir'] = PLOGGER_DIR . 'plog-content/themes/default/'; 
     301        $config['gallery_url'] = "http://".$_SERVER["SERVER_NAME"]. dirname(dirname($_SERVER["PHP_SELF"])); 
     302        // verify that gallery URL contains a trailing slash. if not, add one. 
     303        if      ($config['gallery_url']{strlen($config['gallery_url'])-1} != '/'){ 
     304                $config['gallery_url'] .= '/'; 
     305        } 
     306        // verify that the gallery URL begins with 'http://' for mod_rewrite 301 redirects 
     307        if (strpos($config['gallery_url'], 'http://') === false){ 
     308                $config['gallery_url'] = 'http://'.$config['gallery_url']; 
     309        } 
     310        // verify that the gallery URL has a 'www.' for mod_rewrite 301 redirects 
     311        if (strpos($config['gallery_url'], "www.") === false){ 
     312                $config['gallery_url'] = str_replace("http://", "http://www.", $config['gallery_url']); 
     313        } 
    299314        $config['admin_username'] = 'admin'; 
    300315        $config['admin_password'] = $form['admin_password']; 
    301316        $config['admin_email'] = $form['admin_email']; 
    302317        $config['gallery_name'] = $form['gallery_name']; 
    303          
     318 
    304319        $config = array_map('mysql_real_escape_string',$config); 
    305          
     320 
    306321        $row_exist = mysql_query("SELECT * FROM `".TABLE_PREFIX."config`"); 
    307322        $row_exist_num = mysql_num_rows($row_exist); 
     
    309324        if ($row_exist_num == 0) { 
    310325                $query = "INSERT INTO `".TABLE_PREFIX."config` 
    311                         (`theme_dir`, 
    312                         `compression`, 
    313                         `max_thumbnail_size`, 
    314                         `max_display_size`, 
    315                         `thumb_num`, 
    316                         `admin_username`, 
    317                         `admin_email`, 
    318                         `admin_password`, 
    319                         `date_format`, 
    320                         `feed_title`, 
    321                         `gallery_name`, 
    322                         `gallery_url`) 
     326                (`theme_dir`, 
     327                `compression`, 
     328                `max_thumbnail_size`, 
     329                `max_display_size`, 
     330                `thumb_num`, 
     331                `admin_username`, 
     332                `admin_email`, 
     333                `admin_password`, 
     334                `date_format`, 
     335                `feed_title`, 
     336                `gallery_name`, 
     337                `gallery_url`) 
    323338                VALUES 
    324                         ('${config['default_theme_dir']}', 
     339                ('${config['default_theme_dir']}', 
    325340                        75, 
    326341                        100, 
     
    328343                        20, 
    329344                        '${config['admin_username']}', 
    330                         '${config['admin_email']}', 
    331                         MD5('${config['admin_password']}'), 
    332                         'n.j.Y', 
    333                         'Plogger Photo Feed', 
    334                         '${config['gallery_name']}', 
    335                         '${config['baseurl']}')"; 
    336         } else { 
    337                 $query = "UPDATE `".TABLE_PREFIX."config` SET 
    338                         `theme_dir` = '${config['default_theme_dir']}', 
    339                         `compression` = 75, 
    340                         `max_thumbnail_size` = 100, 
    341                         `max_display_size` = 500, 
    342                         `thumb_num` = 20, 
    343                         `admin_username` = '${config['admin_username']}', 
    344                         `admin_email` = '${config['admin_email']}', 
    345                         `admin_password` = MD5('${config['admin_password']}'), 
    346                         `date_format` = 'n.j.Y', 
    347                         `feed_title` = 'Plogger Photo Feed', 
    348                         `gallery_name` = '${config['gallery_name']}', 
    349                         `gallery_url` = '${config['baseurl']}'"; 
    350         } 
    351  
    352         mysql_query($query) or die(mysql_error().'<br /><br />'. $query); 
    353  
    354         mail($config['admin_email'],"Your new gallery","You have successfully installed your new Plogger gallery. You can manage it at ${config['baseurl']}admin Username is ${config['admin_username']} and password ${config['admin_password']}."); 
    355 } 
    356  
    357 function create_config_file($db_host,$db_user,$db_pass,$db_name,$ftp_host,$ftp_user,$ftp_pass,$ftp_path) { 
    358         $cfg_file = "<?php\n"; 
    359         $cfg_file .= '// this is the file used to connect to your database.'."\n"; 
    360         $cfg_file .= '// you must change these values in order to run the gallery.'."\n"; 
    361         $cfg_file .= 'define("PLOGGER_DB_HOST","'.$db_host.'");'."\n"; 
    362         $cfg_file .= 'define("PLOGGER_DB_USER","'.$db_user.'");'."\n"; 
    363         $cfg_file .= 'define("PLOGGER_DB_PW","'.addcslashes($db_pass, '\\$"').'");'."\n";  // escape certain password characters stored in double quotes (\) ($) (") 
    364         $cfg_file .= 'define("PLOGGER_DB_NAME","'.$db_name.'");'."\n"; 
    365         $cfg_file .= ''."\n"; 
    366         $cfg_file .= '// define("PLOGGER_EMBEDDED","");        // 1/0 (True/False) if set will overrule automatic check'."\n"; 
    367         $cfg_file .= '// define("PLOGGER_LOCALE","");         // da_DK de et fr pl ro_RO tr ...etc.'."\n"; 
    368         if (ini_get('safe_mode') && function_exists('ftp_connect') && !empty($ftp_host)) { 
    369         //if safe_mode enabled, write the FTP workaround information to plog-config.php with db information 
    370                 $cfg_file .= "\n"; 
    371                 $cfg_file .= '// these values are used to connect via FTP.'."\n"; 
    372                 $cfg_file .= 'define("PLOGGER_FTP_HOST","'.$ftp_host.'");'."\n"; 
    373                 $cfg_file .= 'define("PLOGGER_FTP_USER","'.$ftp_user.'");'."\n"; 
    374                 $cfg_file .= 'define("PLOGGER_FTP_PW","'.addcslashes($ftp_pass, '\\$"').'");'."\n";  // escape certain password characters stored in double quotes (\) ($) (") 
    375                 $cfg_file .= 'define("PLOGGER_FTP_PATH","'.$ftp_path.'");'."\n"; 
    376         } 
    377  
    378         $cfg_file .= "?>\n"; 
    379         return $cfg_file; 
    380 } 
    381  
    382  
    383 function maybe_add_column($table,$column,$add_sql) { 
    384         $sql = "DESCRIBE $table"; 
    385         $res = mysql_query($sql); 
    386         $found = false; 
    387         while($row = mysql_fetch_array($res,MYSQL_NUM)) { 
    388                 if ($row[0] == $column) $found = true; 
    389         } 
    390         if (!$found) { 
    391                 mysql_query("ALTER TABLE $table ADD `$column` ". $add_sql); 
    392                 return "<li>Adding new field $column to database."; 
    393         } else { 
    394                 return "<li>$column already present in database."; 
    395         } 
    396 } 
    397  
    398 function maybe_drop_column($table,$column) { 
    399         $sql = "DESCRIBE $table"; 
    400         $res = mysql_query($sql); 
    401         $found = false; 
    402         while($row = mysql_fetch_array($res,MYSQL_NUM)) { 
    403                 if ($row[0] == $column) $found = true; 
    404         } 
    405         if ($found) { 
    406                 $sql = "ALTER TABLE $table DROP `$column`"; 
    407                 mysql_query($sql); 
    408                 return "<li>dropping $column"; 
    409         } else { 
    410                 //print "$column does not exist<br/>"; 
    411         } 
    412 } 
    413  
    414 function maybe_add_table($table,$add_sql,$options = "") { 
    415         $sql = "DESCRIBE $table"; 
    416         $res = mysql_query($sql); 
    417         if (!$res) { 
    418                 $q = "CREATE table `$table` ($add_sql) $options"; 
    419                 mysql_query($q); 
    420                 if (mysql_error()) { 
    421                         var_dump(mysql_error()); 
    422                 } 
    423         } else { 
    424                 return "<li>Table `$table` already exists, ignoring."; 
    425         } 
    426 } 
    427  
    428 function gd_missing() { 
    429         require_once(dirname(__FILE__) . '/../../lib/phpthumb/phpthumb.functions.php'); 
    430         // this is copied over from phpthumb 
    431         return phpthumb_functions::gd_version() < 1; 
    432 } 
    433  
    434 function check_requirements() { 
    435         $errors = array(); 
    436         if (gd_missing()) { 
    437                 $errors[] = "PHP GD module was not detected."; 
    438         } 
    439  
    440         if (!function_exists('mysql_connect')) { 
    441                 $errors[] = "PHP MySQL module was not detected."; 
    442         } 
    443  
    444         $files_to_read = array("./","./admin","./css","./images","./lib","./thumbs","./uploads"); 
    445         foreach($files_to_read as $file){ 
    446                 if (!is_readable(PLOGGER_DIR . $file)){ 
    447                         $errors[] = "The path ".realpath(PLOGGER_DIR . $file)." (".$file.") is not readable."; 
    448                 } 
    449         } 
    450  
    451         $files_to_write = array("./","./thumbs","./images", "./uploads"); 
    452                 foreach($files_to_write as $file){ 
    453                         if (!is_writable(PLOGGER_DIR . $file)){ 
    454                                 $errors[] = 'The path '.realpath(PLOGGER_DIR . $file).' is not writable by the Web server.'; 
    455                         } 
    456                 } 
    457  
    458         return $errors; 
    459 } 
    460  
    461 function check_mysql($host,$user,$pass,$database) { 
    462         $errors = array(); 
    463         if (function_exists('mysql_connect')) { 
    464                 $connection = @mysql_connect($host,$user,$pass); 
    465                 if (!$connection) { 
    466                         $errors[] = "Cannot connect to MySQL with the information provided. MySQL error: "  
    467                                         . mysql_error(); 
    468                 } 
    469         } 
    470         $select = @mysql_select_db($database); 
    471         if (!$select) { 
    472                 $errors[] = "Couldn't find the database $database. MySQL error: " . mysql_error(); 
    473  
    474         } 
    475         return $errors; 
    476 } 
    477  
    478 function check_FTP($host, $user, $pass, $path) { 
    479         $errors = array(); 
    480  
    481         $connection = @ftp_connect($host); 
    482         if (!$connection) { 
    483                 $errors[] = "Couldn't connect to FTP host \"$host\".  Please check your FTP Host:"; 
    484         } else { 
    485                 $login = @ftp_login($connection, $user, $pass); 
    486                 if (!$login) { 
    487                         $errors[] = "Couldn't login to FTP host \"$host\" with username \"$user\" and password \"$pass\".  Please check your FTP Username: and FTP Password:"; 
    488                 } else { 
    489                         $checkdir = @ftp_chdir($connection, $path."images/"); // check to see if the images/ folder is accessible 
    490                         if (!$checkdir) { 
    491                                 $errors[] = "Couldn't find the Plogger images\ folder along the path \"$path\".  Please check your FTP Path to Plogger Base Folder (from FTP login):"; 
    492                         } 
    493                 } 
    494         } 
    495         @ftp_close($connection); 
    496         return $errors; 
    497 } 
    498  
    499 function generate_password() { 
    500         $src = preg_split("//","abcdefghkmnpqrstuvwxyz23456789",-1,PREG_SPLIT_NO_EMPTY); 
    501         shuffle($src); 
    502         return join("",array_slice($src,0,5)); 
    503 } 
    504  
    505 function config_writable() { 
    506         $cf = PLOGGER_DIR . "plog-config.php"; 
    507         if (file_exists($cf)) { 
    508                 return is_writable($cf); 
    509         } 
    510         return is_writable(PLOGGER_DIR); 
    511 }        
    512  
    513 function write_config($data) { 
    514         $cf = PLOGGER_DIR . "plog-config.php"; 
    515         $handle = fopen($cf,"w"); 
    516         fwrite($handle,$data); 
    517         fclose($handle); 
    518 } 
     345                                '${config['admin_email']}', 
     346                                        MD5('${config['admin_password']}'), 
     347                                                'n.j.Y', 
     348                                                'Plogger Photo Feed', 
     349                                                '${config['gallery_name']}', 
     350                                                        '${config['gallery_url']}')"; 
     351                                                        } else { 
     352                                                                $query = "UPDATE `".TABLE_PREFIX."config` SET 
     353                                                                `theme_dir` = '${config['default_theme_dir']}', 
     354                                                                        `compression` = 75, 
     355                                                                        `max_thumbnail_size` = 100, 
     356                                                                        `max_display_size` = 500, 
     357                                                                        `thumb_num` = 20, 
     358                                                                        `admin_username` = '${config['admin_username']}', 
     359                                                                                `admin_email` = '${config['admin_email']}', 
     360                                                                                        `admin_password` = MD5('${config['admin_password']}'), 
     361                                                                                                `date_format` = 'n.j.Y', 
     362                                                                                                `feed_title` = 'Plogger Photo Feed', 
     363                                                                                                `gallery_name` = '${config['gallery_name']}', 
     364                                                                                                        `gallery_url` = '${config['gallery_url']}'"; 
     365                                                                                                        } 
     366 
     367                                                                                                        mysql_query($query) or die(mysql_error().'<br /><br />'. $query); 
     368 
     369                                                                                                        mail($config['admin_email'],"Your new gallery","You have successfully installed your new Plogger gallery. You can manage it at ${config['gallery_url']}plog-admin Username is ${config['admin_username']} and password ${config['admin_password']}."); 
     370                                                                                                } 
     371 
     372                                                                                                function create_config_file($db_host,$db_user,$db_pass,$db_name,$ftp_host,$ftp_user,$ftp_pass,$ftp_path) { 
     373$cfg_file = "<?php\n"; 
     374                                                                                                        $cfg_file .= '// this is the file used to connect to your database.'."\n"; 
     375                                                                                                        $cfg_file .= '// you must change these values in order to run the gallery.'."\n"; 
     376                                                                                                        $cfg_file .= 'define("PLOGGER_DB_HOST","'.$db_host.'");'."\n"; 
     377                                                                                                        $cfg_file .= 'define("PLOGGER_DB_USER","'.$db_user.'");'."\n"; 
     378                                                                                                        $cfg_file .= 'define("PLOGGER_DB_PW","'.addcslashes($db_pass, '\\$"').'");'."\n";  // escape certain password characters stored in double quotes (\) ($) (") 
     379                                                                                                        $cfg_file .= 'define("PLOGGER_DB_NAME","'.$db_name.'");'."\n"; 
     380                                                                                                        $cfg_file .= ''."\n"; 
     381                                                                                                        $cfg_file .= '// define("PLOGGER_EMBEDDED","");        // 1/0 (True/False) if set will overrule automatic check'."\n"; 
     382                                                                                                        $cfg_file .= '// define("PLOGGER_LOCALE","");         // da_DK de et fr pl ro_RO tr ...etc.'."\n"; 
     383                                                                                                        if (ini_get('safe_mode') && function_exists('ftp_connect') && !empty($ftp_host)) { 
     384                                                                                                                //if safe_mode enabled, write the FTP workaround information to plog-config.php with db information 
     385                                                                                                                $cfg_file .= "\n"; 
     386                                                                                                                $cfg_file .= '// these values are used to connect via FTP.'."\n"; 
     387                                                                                                                $cfg_file .= 'define("PLOGGER_FTP_HOST","'.$ftp_host.'");'."\n"; 
     388                                                                                                                $cfg_file .= 'define("PLOGGER_FTP_USER","'.$ftp_user.'");'."\n"; 
     389                                                                                                                $cfg_file .= 'define("PLOGGER_FTP_PW","'.addcslashes($ftp_pass, '\\$"').'");'."\n";  // escape certain password characters stored in double quotes (\) ($) (") 
     390                                                                                                                $cfg_file .= 'define("PLOGGER_FTP_PATH","'.$ftp_path.'");'."\n"; 
     391                                                                                                        } 
     392 
     393                                                                                                        $cfg_file .= "?>\n"; 
     394                                                                                                        return $cfg_file; 
     395                                                                                                } 
     396 
     397 
     398                                                                                                function maybe_add_column($table,$column,$add_sql) { 
     399                                                                                                        $sql = "DESCRIBE $table"; 
     400                                                                                                        $res = mysql_query($sql); 
     401                                                                                                        $found = false; 
     402                                                                                                        while($row = mysql_fetch_array($res,MYSQL_NUM)) { 
     403                                                                                                                if ($row[0] == $column) $found = true; 
     404                                                                                                        } 
     405                                                                                                        if (!$found) { 
     406                                                                                                                mysql_query("ALTER TABLE $table ADD `$column` ". $add_sql); 
     407                                                                                                                return "<li>Adding new field $column to database."; 
     408                                                                                                        } else { 
     409                                                                                                                return "<li>$column already present in database."; 
     410                                                                                                        } 
     411                                                                                                } 
     412 
     413                                                                                                function maybe_drop_column($table,$column) { 
     414                                                                                                        $sql = "DESCRIBE $table"; 
     415                                                                                                        $res = mysql_query($sql); 
     416                                                                                                        $found = false; 
     417                                                                                                        while($row = mysql_fetch_array($res,MYSQL_NUM)) { 
     418                                                                                                                if ($row[0] == $column) $found = true; 
     419                                                                                                        } 
     420                                                                                                        if ($found) { 
     421                                                                                                                $sql = "ALTER TABLE $table DROP `$column`"; 
     422                                                                                                                mysql_query($sql); 
     423                                                                                                                return "<li>dropping $column"; 
     424                                                                                                        } else { 
     425                                                                                                                //print "$column does not exist<br/>";