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)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • 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?>