Changeset 555

Show
Ignore:
Timestamp:
07/07/08 17:22:49 (5 months ago)
Author:
kimparsell
Message:

+ Major cleanup of markup in plog-admin section files - markup now structured properly and validates as XHTML Strict
+ Added plog-admin/images/diag-bg.gif - left out of original restructuring
+ plog-admin/plog-options.php - reworked date formats/added 2 new formats
+ plog-admin/includes/install-functions.php - change install email layout
+ plog-admin/js/plogger.js - changed line endings to unix
+ plog-admin/js/ajax_editing.js - minor markup correction
+ plog-includes/js/plog-slideshow.js - corrected markup, changed loop to false
+ plog-includes/plog-functions.php - minor change to comment notification email, minor markup tweaks
+ index.php - markup tweaks in prep for front-end/theme cleanup
+ gallery.php - minor cleanup (remove extra blank line at end of file)
+ plogger.php - minor cleanup (remove extra blank line at end of file)

Location:
trunk
Files:
1 added
25 modified

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r550 r555  
    2222<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    2323        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     24<html xml:lang="<?php echo $language; ?>" lang="<?php echo $language; ?>" xmlns="http://www.w3.org/1999/xhtml"> 
     25<head> 
     26<?php the_gallery_head(); ?> 
     27</head> 
    2428 
    25 <html xml:lang="<?php echo $language; ?>" lang="<?php echo $language; ?>" xmlns="http://www.w3.org/1999/xhtml"> 
     29<body> 
    2630 
    27         <head> 
    28                 <?php the_gallery_head(); ?> 
     31<?php the_gallery(); ?> 
    2932 
    30         </head> 
    31  
    32         <body> 
    33                 <?php the_gallery(); ?> 
    34  
    35         </body> 
    36  
     33</body> 
    3734</html> 
  • trunk/plog-admin/_install.php

    r552 r555  
    3636} 
    3737?> 
    38 <html> 
    39         <head> 
    40                 <title>Install Plogger</title> 
    41                 <link rel="stylesheet" type="text/css" href="css/admin.css"> 
    42         </head> 
    43         <body> 
    44                 <img src="images/plogger.gif" alt="Plogger"> 
     38<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
     39        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     40<html xmlns="http://www.w3.org/1999/xhtml"> 
     41<head> 
     42        <title>Install Plogger</title> 
     43        <meta http-equiv="Content-Type" content="txt/html; charset=utf-8" /> 
     44        <link rel="stylesheet" type="text/css" href="css/admin.css" /> 
     45</head> 
     46 
     47<body> 
     48 
     49<div><img src="images/plogger.gif" alt="Plogger" /></div> 
     50 
    4551<?php 
    4652if (empty($_POST['proceed'])) { 
     
    5056} 
    5157?> 
     58 
    5259</body> 
    5360</html> 
  • trunk/plog-admin/_upgrade.php

    r551 r555  
    11<?php 
    22error_reporting(E_ERROR); 
    3 echo ' 
    4         <html> 
    5                 <head> 
    6                         <title>Upgrade Plogger</title> 
    7                         <link rel="stylesheet" type="text/css" href="css/admin.css"> 
    8                 </head> 
    9                 <body> 
    10                 <img src="images/plogger.gif" alt="Plogger"> 
    11                 <h1>Performing Upgrade...</h1>'; 
    12          
     3echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
     4        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     5<html xmlns="http://www.w3.org/1999/xhtml"> 
     6<head> 
     7        <title>Upgrade Plogger</title> 
     8        <link rel="stylesheet" type="text/css" href="css/admin.css"> 
     9</head> 
     10 
     11<body> 
     12 
     13<div><img src="images/plogger.gif" alt="Plogger" /></div> 
     14 
     15        <h1>Performing Upgrade...</h1>'; 
     16 
    1317// This is the upgrade file for upgrading your Plogger gallery from Beta 1 
    1418$workdir = dirname(dirname(__FILE__)); 
    1519if (file_exists($workdir.'/plog-connect.php')) 
    1620{ 
    17         print "Rewriting configuration files...<br/>"; 
     21        print "Rewriting configuration files...<br />"; 
    1822        // this check will also make sure that we can delete plog-connect when done, since deleting 
    1923        // is actually _writing_ to a directory 
     
    6165function makeDirs($strPath, $mode = 0777) //creates directory tree recursively 
    6266{ 
    63    return is_dir($strPath) or ( makeDirs(dirname($strPath), $mode) and mkdir($strPath, $mode) ); 
     67        return is_dir($strPath) or ( makeDirs(dirname($strPath), $mode) and mkdir($strPath, $mode) ); 
    6468} 
    6569 
     
    9195                mysql_query($sql); 
    9296        } else { 
    93                 //print "$column does not exist<br/>"; 
     97                //print "$column does not exist<br />"; 
    9498        } 
    9599} 
     
    186190maybe_drop_column($config_table,"rss_thumbsize"); 
    187191 
    188  
    189192maybe_add_column($config_table,'gallery_url',"varchar(255) NOT NULL"); 
    190193 
     
    195198        mysql_query($sql); 
    196199} 
    197  
    198200 
    199201// RSS config 
     
    214216// 
    215217maybe_add_column($config_table,'allow_fullpic',"tinyint NOT NULL default '1'"); 
    216                  
     218 
    217219// comment notify 
    218220maybe_add_column($config_table,'comments_notify',"tinyint NOT NULL"); 
     
    231233maybe_add_column(TABLE_PREFIX.'albums','path',"varchar(255) NOT NULL"); 
    232234maybe_add_column(TABLE_PREFIX.'collections','path',"varchar(255) NOT NULL"); 
    233                  
    234235 
    235236// add ip and approved fields to comments table 
     
    277278        echo("<p>Database has already been upgraded to support smart thumbnail caching!</p>"); 
    278279*/ 
    279                          
     280 
    280281echo "</ul>"; 
    281282echo "<p>Reorganizing your 'images/' folder..."; 
     
    290291        $sql = "UPDATE ".TABLE_PREFIX."collections SET path = '" . strtolower(sanitize_filename($row['name'])) . "' WHERE id = " . $row['id']; 
    291292        #print $sql; 
    292         #print "<br/>"; 
     293        #print "<br />"; 
    293294        mysql_query($sql); 
    294 }  
     295} 
    295296 
    296297$sql = "SELECT id,name FROM ".TABLE_PREFIX."albums"; 
     
    299300        $sql = "UPDATE ".TABLE_PREFIX."albums SET path = '" . strtolower(sanitize_filename($row['name'])) . "' WHERE id = " . $row['id']; 
    300301        #print $sql; 
    301         #print "<br/>"; 
     302        #print "<br />"; 
    302303        mysql_query($sql); 
    303 }  
     304} 
    304305 
    305306// loop through each image from the pictures table, get its parent album name and parent collection 
     
    311312                FROM ".TABLE_PREFIX."albums a, ".TABLE_PREFIX."pictures p, ".TABLE_PREFIX."collections c  
    312313                WHERE p.parent_album = a.id AND p.parent_collection = c.id"; 
    313                  
    314314 
    315315$result = mysql_query($sql) or die(mysql_error() . "<br /><br />" . $sql); 
    316316 
    317  
    318317echo "<ul>"; 
    319318 
    320319while($row = mysql_fetch_assoc($result)) { 
    321          
     320 
    322321        $errors = 0; 
    323322        $filename = basename($row['path']); 
     
    325324        $new_path = "plog-content/images/".$directory.$filename; 
    326325        if ($row['path'] == $new_path) continue; 
    327         echo "<li>Moving $row[path] -> $new_path</li>"; 
    328          
     326                echo "<li>Moving $row[path] -> $new_path</li>"; 
     327 
    329328        // move physical file, create directory if necessary and update path in database 
    330329        if (!makeDirs("plog-content/images/".$directory, 0755)) 
    331                         echo "<ul><li>Error: Could not create directory $directory!</li></ul>"; 
    332          
     330                echo "<ul><li>Error: Could not create directory $directory!</li></ul>"; 
     331 
    333332        if (!rename("images/" . $row['path'], $new_path)) { 
    334333                echo "<li>Error: could not move file!</li>"; 
    335334                $errors++;  
    336335                } 
    337         else {   
     336        else { 
    338337                $directory = mysql_real_escape_string($directory . $filename); 
    339338                // update database 
     
    341340                mysql_query($sql) or die("<li>Error: ".mysql_error()." in query " . $sql . "</li>"); 
    342341        } 
    343          
    344 }  
    345          
     342 
     343} 
     344 
    346345echo "</ul>"; 
    347346 
     
    351350        echo "There were $errors errors, check your permissions settings."; 
    352351} 
    353  
    354  
    355          
    356352 
    357353// convert charsets 
     
    366362{ 
    367363        $charset = "utf8"; 
    368         print "<br/>"; 
     364        print "<br />"; 
    369365        $tables = array("collections","albums","pictures","comments","config"); 
    370366        foreach($tables as $table) { 
     
    372368                $sql = "ALTER TABLE $tablename DEFAULT CHARACTER SET $charset"; 
    373369                if (mysql_query($sql)) { 
    374                         print $tablename . " converted to $charset<br/>"; 
     370                        print $tablename . " converted to $charset<br />"; 
    375371                } else { 
    376                         print "failed to convert $tablename to $charset<br/>"; 
     372                        print "failed to convert $tablename to $charset<br />"; 
    377373                        print mysql_error(); 
    378374                } 
     
    380376} 
    381377 
    382 echo "<p>Upgrade has completed!</p>" 
     378echo "<p>Upgrade has completed!</p> 
     379 
     380</body> 
     381</html>" 
    383382?> 
  • trunk/plog-admin/css/admin.css

    r550 r555  
    5959h2 { 
    6060        font-family: "Verdana", "Lucida Sans", "Lucida Grande", "Trebuchet MS", sans-serif; 
    61         font-size: 1.0em; 
     61        font-size: 1.2em; 
    6262        margin-top: 20px; 
    6363        margin-bottom: 15px; 
    6464        text-decoration: underline; 
     65} 
     66 
     67h3 { 
     68        font-family: "Verdana", "Lucida Sans", "Lucida Grande", "Trebuchet MS", sans-serif; 
     69        font-size: 1.0em; 
     70        margin-top: 15px; 
     71        margin-bottom: 10px; 
    6572} 
    6673 
     
    152159} 
    153160 
    154 tr.header td { 
     161tr.header th { 
    155162        padding: 6px; 
    156163} 
     
    162169} 
    163170 
     171tr.footer { 
     172        background-color: #264e75; 
     173} 
     174 
     175tr.footer td { 
     176        padding: 6px; 
     177} 
     178 
    164179label { 
    165180        padding: 8px; 
     
    189204        text-align: center; 
    190205        margin-top: 100px; 
     206} 
     207 
     208.login-error { 
     209        text-align: center; 
     210        font-size: 1.1em; 
     211        font-weight: bold; 
     212        color: #c00; 
    191213} 
    192214 
     
    258280        color: #333; 
    259281        margin:0; 
    260         padding:0; 
     282        padding: 0; 
    261283        vertical-align: middle; 
    262284        position: relative; 
     
    386408} 
    387409 
    388 #contentList #pagination { 
     410#contentList .pagination { 
    389411        font-size: 1.3em; 
    390412        padding: 5px 3px 5px 0; 
     
    430452} 
    431453 
    432 .editable{ 
     454.editable { 
    433455        color: #000; 
    434456        background: #fff url("../images/diag-bg.gif") repeat top left; 
  • trunk/plog-admin/includes/install-form-setup-complete.php

    r552 r555  
    1010?> 
    1111        <h1>Plogger Install</h1> 
    12         <form method="POST"> 
    13         <p>Configuration setup is now complete.<br />Click 'Install' to finish installation.</p> 
    14         <p>Your username is `<strong><?php echo $_SESSION['install_values']['admin_username']; ?></strong>` and your password is `<strong><?php echo $_SESSION['install_values']['admin_password']; ?></strong>`</p> 
     12 
     13        <form action="_install.php" method="post"> 
     14                <p>Configuration setup is now complete.</p> 
     15                <p>Click 'Install' to finish installation.</p> 
     16                <p>Your username is <strong><?php echo $_SESSION['install_values']['admin_username']; ?></strong> and your password is <strong><?php echo $_SESSION['install_values']['admin_password']; ?></strong></p> 
    1517<?php if (!empty($_SESSION["plogger_config"])) { ?> 
    16         <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> 
     18                <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> 
    1719<?php } ?> 
    18         <p> 
    19                 <input type="submit" name="proceed" id="proceed" value="Install"/> 
    20         </p> 
     20                <p><input type="submit" name="proceed" id="proceed" value="Install" /></p> 
    2121        </form> 
  • trunk/plog-admin/includes/install-form-setup.php

    r552 r555  
    1010?> 
    1111        <h1>Plogger Configuration Setup</h1> 
    12         <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> 
     12 
     13        <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> 
     14 
    1315        <form action="_install.php" method="post"> 
    1416        <input type="hidden" name="action" value="install" /> 
    1517        <table> 
    1618                <tr> 
    17                         <td colspan="2"> 
    18                                 <div id="navcontainer"> 
    19                                         <h1>Database Setup</h1> 
    20                                 </div> 
    21                         </td> 
     19                        <td colspan="2"><h2>Database Setup</h2></td> 
    2220                </tr> 
    2321                <tr> 
     
    2523                        <td class="form_input"><input type="text" name="db_host" id="db_host" value="<?php echo $form['db_host']; ?>" /></td> 
    2624                </tr> 
    27  
    2825                <tr> 
    2926                        <td class="form_label"><label for="db_user">MySQL Username:</label></td> 
     
    3128                </tr> 
    3229                <tr> 
    33                         <td class="form_label"><label for="db_password">MySQL Password:</label></td> 
     30                        <td class="form_label"><label for="db_pass">MySQL Password:</label></td> 
    3431                        <td class="form_input"><input type="password" name="db_pass" id="db_pass" value="<?php echo $form['db_pass']; ?>" /></td> 
    3532                </tr> 
    36  
    3733                <tr> 
    3834                        <td class="form_label"><label for="db_name">MySQL Database:</label></td> 
     
    4036                </tr> 
    4137                <tr> 
    42                         <td colspan="2"> 
    43                                 <div id="navcontainer"> 
    44                                         <h1>Administrative Setup</h1> 
    45                                 </div> 
    46                         </td> 
     38                        <td colspan="2"><h2>Administrative Setup</h2></td> 
    4739                </tr> 
    4840                <tr> 
    49                         <td class="form_label"><label for="gallery">Gallery Name:</label></td> 
    50                         <td class="form_input"><input type="text" name="gallery_name" id="gallery" value="<?php echo $form['gallery_name']; ?>" /></td> 
     41                        <td class="form_label"><label for="gallery_name">Gallery Name:</label></td> 
     42                        <td class="form_input"><input type="text" name="gallery_name" id="gallery_name" value="<?php echo $form['gallery_name']; ?>" /></td> 
    5143                </tr> 
    5244                <tr> 
    53                         <td class="form_label"><label for="username">Your e-mail:</label></td> 
    54                         <td class="form_input"><input type="text" name="admin_email" id="email" value="<?php echo $form['admin_email']; ?>" /></td> 
     45                        <td class="form_label"><label for="admin_email">Your e-mail:</label></td> 
     46                        <td class="form_input"><input type="text" name="admin_email" id="admin_email" value="<?php echo $form['admin_email']; ?>" /></td> 
    5547                </tr> 
    5648<?php 
     
    6052                <tr> 
    6153                        <td colspan="2"> 
    62                                 <div id="navcontainer"> 
    63                                         <h1>Safe_mode FTP workaround</h1> 
    64                                         <br />Safe mode has been detected on your server.  FTP access is needed to allow Plogger to work correctly with safe_mode enabled. 
    65                                 </div> 
     54                                        <h2>Safe_mode FTP workaround</h2> 
     55                                        <p>Safe mode has been detected on your server. FTP access is needed to allow Plogger to work correctly with safe_mode enabled.</p> 
    6656                        </td> 
    6757                </tr> 
  • trunk/plog-admin/includes/install-functions.php

    r552 r555  
    1818        $errors = check_requirements(); 
    1919        if (sizeof($errors) > 0) { 
    20                 print '<p>Plogger wont work until the following problems are resolved</p>'; 
     20                print '<p>Plogger will not work until the following problems are resolved</p>'; 
    2121                print '<ul>'; 
    2222                foreach($errors as $error) { 
     
    2424                } 
    2525                print '</ul>'; 
    26                 print '<form method="GET" action="_install.php"><input type="submit" value="Try again"/></form>'; 
     26                print '<form method="get" action="_install.php"><input type="submit" value="Try again" /></form>'; 
    2727                return false; 
    2828        } 
     
    101101 
    102102                if (!$ok) { 
    103                         print '<ul><li>'; 
     103                        print '<ul>\n<li>'; 
    104104                        print join("</li>\n<li>",$errors); 
    105                         print '</li></ul>'; 
     105                        print '</li>\n</ul>'; 
    106106                } else { 
    107107                        $password = generate_password(); 
     
    169169        PRIMARY KEY  (id)" 
    170170        ,"Type=MyISAM $default_charset"); 
    171  
    172171 
    173172        maybe_add_table( 
     
    373372        mysql_query($query) or die(mysql_error().'<br /><br />'. $query); 
    374373 
    375         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']}`."); 
    376 } 
     374                mail($config['admin_email'],"[Plogger] Your new gallery","You have successfully installed your new Plogger gallery.\n\nYou can login and manage it at ${config['gallery_url']}plog-admin.\n\nUsername: ${config['admin_username']}\nPassword: ${config['admin_password']}"); 
     375                } 
    377376 
    378377function create_config_file($db_host,$db_user,$db_pass,$db_name,$ftp_host,$ftp_user,$ftp_pass,$ftp_path) { 
     
    401400} 
    402401 
    403  
    404402function maybe_add_column($table,$column,$add_sql) { 
    405403        $sql = "DESCRIBE $table"; 
     
    429427                return "<li>dropping $column"; 
    430428        } else { 
    431                 //print "$column does not exist<br/>"; 
     429                //print "$column does not exist<br />"; 
    432430        } 
    433431} 
     
    506504                $login = @ftp_login($connection, $user, $pass); 
    507505                if (!$login) { 
    508                         $errors[] = "Couldn't login to FTP host \"$host\" with username \"$user\" and password \"$pass\".  Please check your FTP Username: and FTP Password:"; 
     506                        $errors[] = "Couldn't login to FTP host \"$host\" with username \"$user\" and password \"$pass\". Please check your FTP Username: and FTP Password:"; 
    509507                } else { 
    510508                        $checkdir = @ftp_chdir($connection, $path."plog-content/images/"); // check to see if the plog-content/images/ folder is accessible 
    511509                        if (!$checkdir) { 
    512                                 $errors[] = "Couldn't find the Plogger 'plog-content/images/' folder along the path \"$path\".  Please check your FTP Path to Plogger Base Folder (from FTP login):"; 
     510                                $errors[] = "Couldn't find the Plogger 'plog-content/images/' folder along the path \"$path\". Please check your FTP Path to Plogger Base Folder (from FTP login):"; 
    513511                        } 
    514512                } 
  • trunk/plog-admin/index.php

    r550 r555  
    33require_once(dirname(dirname(__FILE__))."/plog-load-config.php"); 
    44 
    5  
    65$output = ''; 
    76 
    8 $output .= ' 
    9         <html> 
    10                 <head> 
    11                         <title>' . plog_tr('Plogger Administrative Login') . '</title> 
    12                         <link href="'.$config['gallery_url'].'plog-admin/css/admin.css" type="text/css" rel="stylesheet" /> 
    13                         <script type="text/javascript" src="'.$config['gallery_url'].'plog-admin/js/plogger.js"></script> 
    14                 </head> 
    15                 <body id="login-page" onload="focus_first_input()"> 
    16                          
    17                 <div id="login">         
    18                         <form action="plog-upload.php" method="post"> 
    19                                  
    20                                         <div align="center"> 
    21                                                 <table width="380"> 
    22                                                         <tr>'; 
    23                  
    24                 if (isset($_REQUEST["errorcode"])){ 
    25                         switch($_REQUEST["errorcode"]){ 
    26                                 case 1: 
    27                                         $output .= '<td colspan="2" align="center"><em>' . plog_tr('Invalid login') . '.</em></td>'; 
    28                                         break; 
    29                         } 
     7$output .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<