Index: includes/images.php =================================================================== --- includes/images.php (revision 0) +++ includes/images.php (revision 0) @@ -0,0 +1,135 @@ +class = $_class; + $thumb_max_w = 600; + $thumb_max_h = 120; + $full_max_w = 600; + $full_max_h = 550; + $icon_max_w = 32; + $icon_max_h = 44; + $video_max_h = 100; + $video_max_w = 100; + $path = 'data/gallery/'; + $missing = skin_url."images/missing.gif"; + $missing_cache = "data/cache/gallery/other/missing.gif"; + + switch($_class) { + case "gallery-thumb": + $file = basename($_filename); + $outfile = 'data/cache/gallery/'.$_subtype.'/'.$file; + $max_w = $thumb_max_w; + $max_h = $thumb_max_h; + $this->uri = '?show_image='.urldecode($file.'&moverse='.$_subtype); + $this->src = urldecode($outfile); + $this->alt = $file; + break; + case "gallery-folder": + $file = basename($_filename); + $outfile='data/cache/gallery/'.$_subtype.'/'.$file.'.jpg'; + $max_w = $thumb_max_w; + $max_h = $thumb_max_h; + if ($_subtype=="") {$uri = $file;} + else {$uri = $_subtype.'/'.$file;} + $this->uri = '?moverse='.urldecode($uri); + $this->alt = $file.'.jpg'; + $thumbfile = $path.'/'.$_subtype.'/.thumbcache/'.$file; + if ( !file_exists( $thumbfile ) ) { + $_filename = $missing; + $this->src = $missing_cache; + $outfile = $missing_cache; + $_subtype = "other"; + } else { + $_filename = $thumbfile; + $this->src = urldecode($outfile); + } + break; + case "gallery-fullsize": + $file = basename($_filename); + $outfile = 'data/cache/gallery/'.$_subtype.'/fullsize/'.$file; + $this->src = urldecode($outfile); + $this->alt = $file; + #uri points to raw (real full size) image for save as link + $this->uri = $path.$_subtype.'/'.$file; + $max_w = $full_max_w; + $max_h = $full_max_h; + break; + case "gallery-video": + $file = basename($_filename); + $outfile = 'data/cache/gallery/'.$_subtype.'/'.$file; + copy($_filename,$outfile); #Block attempting a cache + $this->uri = urldecode('data/cache/gallery/'.$_subtype.'/'.$file); + $this->alt = $file; + $this->src = skin_url.'img/video.png'; + $max_w = $video_max_w; + $max_h = $video_max_h; + break; + case "icon": + $outfile = 'data/cache/icons/'.basename($_filename); + $max_w = $icon_max_w; + $max_h = $icon_max_h; + break; + case "video": + $outfile = 'data/cache/video/'.basename($_filename); + $max_w = $video_max_w; + $max_h = $video_max_h; + break; + } + if (!file_exists($outfile)) $this->cache_image($outfile,$max_w,$max_h,$_filename); + } + + + function cache_image($_outfile, $max_w, $max_h, $_infile) { + list($width, $height, $imgtype, $attr) = getimagesize($_infile); + + if (($imgtype==2) || ($imgtype==1) || ($imgtype==3) || ($imgtype==6)) + { + if ($imgtype == 6)$im = @imagecreatefrombmp($_infile); + if ($imgtype == 3)$im = @imagecreatefrompng($_infile); + if ($imgtype == 2)$im = @imagecreatefromjpeg($_infile); + if ($imgtype == 1)$im = @imagecreatefromgif($_infile); + if (!$im) { /* See if it failed */ + $im = imagecreate($max_w, $max_h); /* Create a blank image */ + $bgc = imagecolorallocate($im, 255, 255, 255); + $tc = imagecolorallocate($im, 0, 0, 0); + imagefilledrectangle($im, 0, 0, 150, 30, $bgc); + imagestring($im, 1, 5, 5, "Error opening image!", $tc); + } + else + { + if (($height/$width)<($max_h/$max_w)){ + // constrain by width + $new_height = $height*$max_w/$width; + $new_width = $max_w; + } else { + $new_width = $width*$max_h/$height; + $new_height = $max_h; + } + $tim = imagecreatetruecolor($new_width,$new_height); + } + imagecopyresampled($tim,$im,0,0,0,0,$new_width,$new_height,$width,$height); + $directory = dirname($_outfile); + if (!is_dir(dirname($_outfile))) mkdir(dirname($_outfile)); + switch ($imgtype) { + case 2: + imagejpeg($tim,$_outfile,100); + break; + case 1: + imagegif($tim,$_outfile,100); + break; + case 3: + imagepng($tim,$_outfile,100); + break; + case 6: + imagebmp($tim,$_outfile,100); + break; + } + imagedestroy($tim); + imagedestroy($im); + } + } +} + +?> Property changes on: includes/images.php ___________________________________________________________________ Name: svn:executable + * Index: includes/db_update.php =================================================================== --- includes/db_update.php (revision 11015) +++ includes/db_update.php (working copy) @@ -18,32 +18,3 @@ // What version does the database think it is? $db_vers = setting('WebDBSchemaVer'); -// The database is too new - if ($db_vers > db_version) - trigger_error("Current database version of $db_vers is newer than" - ." the code base version ".db_version, - FATAL); - -// Older database that needs to be upgraded - if ($db_vers < db_version) { - switch ($db_vers) { - // No version, no database - case 0: - $db->query('CREATE TABLE mythweb_sessions ( - id VARCHAR(128) PRIMARY KEY NOT NULL DEFAULT "", - modified TIMESTAMP, - data BLOB NOT NULL DEFAULT "", - INDEX (modified) - )'); - setting('WebDBSchemaVer', null, ++$db_vers); - // Moving settings into the database - case 1: - setting('WebPrefer_Channum', null, 1); - setting('WebDBSchemaVer', null, ++$db_vers); - // All other numbers should run their changes sequentially - #case 2: - # # do something to upgrade the database here - # $db_vers++; - } - } - Index: skins/default/gallery.css =================================================================== --- skins/default/gallery.css (revision 0) +++ skins/default/gallery.css (revision 0) @@ -0,0 +1,162 @@ +.gallery-folder { + float: left; + margin: 9px; + padding: 16px; + border: 3px outset black; + -moz-border-radius: 9px; + background: #347; + text-align: center; + font-size: 10pt; + font-weight: bold; +} +.gallery-folder a { + border: none; +} +.gallery-folder a:hover { + background-color: #458; +} + +.gallery-thumb { + float: left; + margin: 9px; + padding: 18px; + border: 1px outset black; + -moz-border-radius: 9px; + background: #347; + text-align: center; + font-size: 10pt; +} + +.gallery-fullsize { + + margin: 14px; + padding: 20px; + text-align: center; + font-size: 12pt; +} +.gallery-video { + float: left; + margin: 9px; + padding: 18px; + border: 1px outset black; + -moz-border-radius: 9px; + background: #347; + text-align: center; + font-size: 10pt; +} +.image img { + border: 2px solid black; + display: inline !important; +} + +div.clearer {clear: left; line-height: 0; height: 0;} + +.page_start { } + +#page_content { + margin-left: 15px; + margin-right: 15px; + margin-bottom: 15px; + background-color: #002030; + border-top: 2px solid #002520; + border-right: 2px solid #002520; + border-bottom: 2px solid #002630; + border-left: 2px solid #002630; + padding: 10px; + font-size: 8pt; + min-width: 800px; + color: white; +} + + +#images { + margin: 0px 10px; + padding: 10px; + white-space: nowrap; +} +#images a { + float: left; + margin: 0px 5px; + padding: 5px; + background-color: #347; + border-top: 1px solid #999; + border-right: 1px solid #003; + border-bottom: 1px solid #000; + border-left: 1px solid #AAA; + -moz-border-radius: 8px; + text-align: center; +} +#images a:hover { + background-color: #458; +} +#mainimg { + display: inline !important; + margin: 0px 2px; + padding: 17px; + -moz-border-radius: 9px; + background-color: #236; +} +#images img { + border: none; + display: inline !important; +} + +.toolbar { + border: none; + padding: 0px; + margin: 0px; + font-size: 10pt; + min-width: 786px; + vertical-align: top; + color: white; +} +.toolbar a { + border: none; + padding: 0px; + margin: 0px; + font-size: 10pt; + color: white; + vertical-align: top; +} + +.toolbar img { + border: none; + padding: 0px; + margin: 0px; + vertical-align: top; + behavior: url("js/pngbehavior.htc"); +} + +.toolbar-up { + float: left; + border: none; + padding: 0px; + margin: 0px; + font-size: 10pt; + color: white; + min-width: 16px; + vertical-align: top; +} + +.toolbar-mid { + float: left; + border: none; + padding: 0px; + margin: 0px; + font-size: 10pt; + vertical-align: top; + width: 70%; + text-align: center; +} + +.toolbar-spacer { + float: left; + border: none; + border-color: white; + padding: 0px; + margin: 0px; + font-size: 10pt; + color: white; + vertical-align: top; + width: 14%; +} Index: skins/grey/gallery.css =================================================================== --- skins/grey/gallery.css (revision 0) +++ skins/grey/gallery.css (revision 0) @@ -0,0 +1,162 @@ +.gallery-folder { + float: left; + margin: 9px; + padding: 16px; + border: 3px outset black; + -moz-border-radius: 9px; + background: #555; + text-align: center; + font-size: 10pt; + font-weight: bold; +} +.gallery-folder a { + border: none; +} +.gallery-folder a:hover { + background-color: #555; +} + +.gallery-thumb { + float: left; + margin: 9px; + padding: 18px; + border: 1px outset black; + -moz-border-radius: 9px; + background: #555; + text-align: center; + font-size: 10pt; +} + +.gallery-fullsize { + + margin: 14px; + padding: 20px; + text-align: center; + font-size: 12pt; +} +.gallery-video { + float: left; + margin: 9px; + padding: 18px; + border: 1px outset black; + -moz-border-radius: 9px; + background: #555; + text-align: center; + font-size: 10pt; +} +.image img { + border: 2px solid black; + display: inline !important; +} + +div.clearer {clear: left; line-height: 0; height: 0;} + +.page_start { } + +#page_content { + margin-left: 15px; + margin-right: 15px; + margin-bottom: 15px; + background-color: #222; + border-top: 2px solid #333222; + border-right: 2px solid #333222; + border-bottom: 2px solid #333333; + border-left: 2px solid #333333; + padding: 10px; + font-size: 8pt; + min-width: 800px; + color: white; +} + + +#images { + margin: 0px 10px; + padding: 10px; + white-space: nowrap; +} +#images a { + float: left; + margin: 0px 5px; + padding: 5px; + background-color: #444; + border-top: 1px solid #999; + border-right: 1px solid #003; + border-bottom: 1px solid #000; + border-left: 1px solid #AAA; + -moz-border-radius: 8px; + text-align: center; +} +#images a:hover { + background-color: #666; +} +#mainimg { + display: inline !important; + margin: 0px 2px; + padding: 17px; + -moz-border-radius: 9px; + background-color: #444; +} +#images img { + border: none; + display: inline !important; +} + +.toolbar { + border: none; + padding: 0px; + margin: 0px; + font-size: 10pt; + min-width: 786px; + vertical-align: top; + color: white; +} +.toolbar a { + border: none; + padding: 0px; + margin: 0px; + font-size: 10pt; + color: white; + vertical-align: top; +} + +.toolbar img { + border: none; + padding: 0px; + margin: 0px; + vertical-align: top; + behavior: url("js/pngbehavior.htc"); +} + +.toolbar-up { + float: left; + border: none; + padding: 0px; + margin: 0px; + font-size: 10pt; + color: white; + min-width: 16px; + vertical-align: top; +} + +.toolbar-mid { + float: left; + border: none; + padding: 0px; + margin: 0px; + font-size: 10pt; + vertical-align: top; + width: 70%; + text-align: center; +} + +.toolbar-spacer { + float: left; + border: none; + border-color: white; + padding: 0px; + margin: 0px; + font-size: 10pt; + color: white; + vertical-align: top; + width: 14%; +} \ No newline at end of file Index: modules/gallery/handler.php =================================================================== --- modules/gallery/handler.php (revision 0) +++ modules/gallery/handler.php (revision 0) @@ -0,0 +1,88 @@ + Index: modules/gallery/init.php =================================================================== --- modules/gallery/init.php (revision 0) +++ modules/gallery/init.php (revision 0) @@ -0,0 +1,24 @@ + 'gallery', + 'sort' => 5, + 'name' => t('Gallery'), + 'description' => t('') + ); + + Index: modules/gallery/tmpl/default/welcome.php =================================================================== --- modules/gallery/tmpl/default/welcome.php (revision 0) +++ modules/gallery/tmpl/default/welcome.php (revision 0) @@ -0,0 +1,14 @@ +', + '', + +// Print a basic overview of what this module does + t('welcome: gallery'), + +// Next, print a list of possible subsectons + #### + +// Close the div + "\n"; Property changes on: modules/gallery/tmpl/default/welcome.php ___________________________________________________________________ Name: svn:executable + * Index: modules/gallery/tmpl/default/gallery.php =================================================================== --- modules/gallery/tmpl/default/gallery.php (revision 0) +++ modules/gallery/tmpl/default/gallery.php (revision 0) @@ -0,0 +1,121 @@ +'; + // Print the page header + require 'modules/_shared/tmpl/'.tmpl.'/header.php'; + require_once "includes/css.php"; + require_once "includes/mouseovers.php"; + + print_menu_content(); +?> + +