- Timestamp:
- 08/28/08 13:07:07 (3 months ago)
- Location:
- trunk
- Files:
-
- 11 modified
-
gallery.php (modified) (1 diff)
-
index.php (modified) (1 diff)
-
plog-admin/index.php (modified) (1 diff)
-
plog-content/themes/air/comments.php (modified) (1 diff)
-
plog-content/themes/air/slideshow.php (modified) (1 diff)
-
plog-content/themes/default/slideshow.php (modified) (1 diff)
-
plog-content/themes/lucid/slideshow.php (modified) (1 diff)
-
plog-includes/lib/phpthumb/phpthumb.class.php (modified) (1 diff)
-
plog-includes/plog-functions.php (modified) (6 diffs)
-
plog-rss.php (modified) (4 diffs)
-
plogger.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gallery.php
r555 r573 4 4 5 5 function the_gallery_head() { 6 return the_plogger_ gallery_head();6 return the_plogger_head(); 7 7 } 8 8 -
trunk/index.php
r555 r573 19 19 */ 20 20 ?> 21 <?php require(" gallery.php"); ?>21 <?php require("plogger.php"); ?> 22 22 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 23 23 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 24 24 <html xml:lang="<?php echo $language; ?>" lang="<?php echo $language; ?>" xmlns="http://www.w3.org/1999/xhtml"> 25 25 <head> 26 <?php the_ gallery_head(); ?>26 <?php the_plogger_head(); ?> 27 27 </head> 28 28 29 29 <body> 30 30 31 <?php the_ gallery(); ?>31 <?php the_plogger_gallery(); ?> 32 32 33 33 </body> -
trunk/plog-admin/index.php
r571 r573 36 36 </tr>' . "\n"; 37 37 break; 38 }39 38 } 39 } 40 40 $output .= "\n\t\t" . '<tr> 41 41 <td><label for="plog-username"><strong>' . plog_tr('Username') . ':</strong></label></td> -
trunk/plog-content/themes/air/comments.php
r557 r573 18 18 </li> 19 19 <?php $counter++; 20 } ?>20 } ?> 21 21 </ol> 22 22 <?php } else { ?> -
trunk/plog-content/themes/air/slideshow.php
r572 r573 23 23 </script> 24 24 25 <?php echo generate_slideshow_interface(); ?> 25 <?php echo generate_slideshow_nav(); ?> 26 <div id="picture-holder"> 27 <a href="javascript:slides.hotlink()"><img id="slideshow_image" class="photos-large" src="about:blank" title="<?php echo plogger_get_picture_caption(); ?>" alt="<?php echo plogger_get_picture_caption(); ?>" /></a> 28 </div><!-- /picture-holder --> 29 30 <script type="text/javascript"> 31 <!-- 32 if (document.images) 33 { 34 slides.set_image(document.images.slideshow_image); 35 slides.textid = "picture_caption"; // optional 36 slides.imagenameid = "image_name"; // optional 37 slides.update(); 38 slides.play(); 39 } 40 //--> 41 </script> 42 26 43 <?php else : ?> 27 44 <div id="no-pictures-msg"> -
trunk/plog-content/themes/default/slideshow.php
r572 r573 31 31 </div><!-- /inner_wrapper --> 32 32 33 <?php echo generate_slideshow_interface(); ?> 33 <?php echo generate_slideshow_nav(); ?> 34 <div id="picture-holder"> 35 <a href="javascript:slides.hotlink()"><img id="slideshow_image" class="photos-large" src="about:blank" title="<?php echo plogger_get_picture_caption(); ?>" alt="<?php echo plogger_get_picture_caption(); ?>" /></a> 36 </div><!-- /picture-holder --> 37 38 <script type="text/javascript"> 39 <!-- 40 if (document.images) 41 { 42 slides.set_image(document.images.slideshow_image); 43 slides.textid = "picture_caption"; // optional 44 slides.imagenameid = "image_name"; // optional 45 slides.update(); 46 slides.play(); 47 } 48 //--> 49 </script> 50 34 51 <?php else : ?> 35 52 <div id="no-pictures-msg"> -
trunk/plog-content/themes/lucid/slideshow.php
r572 r573 31 31 </div><!-- /inner_wrapper --> 32 32 33 <?php echo generate_slideshow_interface(); ?> 33 <?php echo generate_slideshow_nav(); ?> 34 <div id="picture-holder"> 35 <a href="javascript:slides.hotlink()"><img id="slideshow_image" class="photos-large" src="about:blank" title="<?php echo plogger_get_picture_caption(); ?>" alt="<?php echo plogger_get_picture_caption(); ?>" /></a> 36 </div><!-- /picture-holder --> 37 38 <script type="text/javascript"> 39 <!-- 40 if (document.images) 41 { 42 slides.set_image(document.images.slideshow_image); 43 slides.textid = "picture_caption"; // optional 44 slides.imagenameid = "image_name"; // optional 45 slides.update(); 46 slides.play(); 47 } 48 //--> 49 </script> 50 34 51 <?php else : ?> 35 52 <div id="no-pictures-msg"> -
trunk/plog-includes/lib/phpthumb/phpthumb.class.php
r486 r573 929 929 if ($this->ra || $this->ar) { 930 930 if (!function_exists('ImageRotate')) { 931 $this->DebugMessage('!function_exists(ImageRotate)', __FILE__, __LINE__); 932 return false; 931 //$this->DebugMessage('!function_exists(ImageRotate)', __FILE__, __LINE__); 932 //return false; 933 // Code by Dominik Scholz: http://php.net/manual/en/function.imagerotate.php#82261 934 function imagerotate($src_img, $angle) { 935 $src_x = imagesx($src_img); 936 $src_y = imagesy($src_img); 937 if ($angle == 180) { 938 $dest_x = $src_x; 939 $dest_y = $src_y; 940 } elseif (($angle == 90) || ($angle == 270)) { 941 $dest_x = $src_y; 942 $dest_y = $src_x; 943 } else { 944 return $src_img; 945 } 946 947 $rotate=imagecreatetruecolor($dest_x,$dest_y); 948 imagealphablending($rotate, false); 949 950 switch ($angle) { 951 case 270: 952 $dest_x--; 953 for ($y = 0; $y < $src_y; $y++) 954 for ($x = 0; $x < $src_x; $x++) 955 imagesetpixel($rotate, $dest_x - $y, $x, imagecolorat($src_img, $x, $y)); 956 break; 957 case 90: 958 $dest_y--; 959 for ($y = 0; $y < $src_y; $y++) 960 for ($x = 0; $x < $src_x; $x++) 961 imagesetpixel($rotate, $y, $dest_y - $x, imagecolorat($src_img, $x, $y)); 962 break; 963 case 180: 964 $dest_x--; 965 $dest_y--; 966 for ($y = 0; $y < $src_y; $y++) 967 for ($x = 0; $x < $src_x; $x++) 968 imagesetpixel($rotate, $dest_x - $x, $dest_y - $y, imagecolorat($src_img, $x, $y)); 969 break; 970 } 971 return $rotate; 972 } 933 973 } 934 974 if (!include_once(dirname(__FILE__).'/phpthumb.filters.php')) { -
trunk/plog-includes/plog-functions.php
r572 r573 430 430 431 431 // function for generating the slideshow interface 432 function generate_slideshow_ interface() {432 function generate_slideshow_nav($pre_pre='', $pre='', $post='', $post_post='') { 433 433 global $config, $thumbnail_config; 434 434 435 $picture_caption = plogger_get_picture_caption(); 436 437 $large_link = '<a accesskey="v" title="' . plog_tr('View Large Image') . '" href="javascript:slides.hotlink()"><img src="'.THEME_URL.'images/search.gif" width="16" height="16" alt="'. plog_tr('View Large Image') . '" /></a> '; 438 $prev_url = '<a accesskey="," title="' .plog_tr('Previous Image') . '" href="javascript:slides.previous();"><img src="'.THEME_URL.'images/rewind.gif" width="16" height="16" alt="' . plog_tr('Previous Image') . '" /></a> '; 439 $stop_url = '<a accesskey="x" title="'. plog_tr('Stop Slideshow') . '" href="javascript:slides.pause();"><img src="'.THEME_URL.'images/stop.gif" width="16" height="16" alt="' . plog_tr('Stop Slideshow') . '" /></a> '; 440 $play_url = '<a accesskey="s" title="'. plog_tr('Start Slideshow') . '" href="javascript:slides.play();"><img src="'.THEME_URL.'images/play.gif" width="16" height="16" alt="' . plog_tr('Start Slideshow') . '" /></a> '; 441 $next_url = '<a accesskey="." title="' . plog_tr('Next Image') . '" href="javascript:slides.next();"><img src="'.THEME_URL.'images/fforward.gif" width="16" height="16" alt="' . plog_tr('Next Image') . '" /></a>'; 442 443 $output = "\t\t\t" . '<div class="large-thumb-toolbar" style="width: '.$thumbnail_config[THUMB_LARGE].'px;">'.$large_link.$prev_url.$stop_url.$play_url.$next_url.'</div><!-- /large-thumb-toolbar -->'; 444 445 $imgtag = '<img id="slideshow_image" class="photos-large" src="about:blank" title="'.$picture_caption.'" alt="'.$picture_caption.'" />'; 446 447 $output .= "\n\n\t\t\t" . '<div id="picture-holder"> 448 <a href="javascript:slides.hotlink()">'.$imgtag.'</a> 449 </div><!-- /picture-holder --> 450 <br />'; 451 // activate slideshow object using javascript block 452 $output .= "\n\t\t\t" . '<script type="text/javascript"> 453 <!-- 454 if (document.images) 455 { 456 slides.set_image(document.images.slideshow_image); 457 slides.textid = "picture_caption"; // optional 458 slides.imagenameid = "image_name"; // optional 459 slides.update(); 460 slides.play(); 461 } 462 //--> 463 </script>'; 435 $large_link = $pre.'<a accesskey="v" title="' . plog_tr('View Large Image') . '" href="javascript:slides.hotlink()"><img src="'.THEME_URL.'images/search.gif" width="16" height="16" alt="'. plog_tr('View Large Image') . '" /></a> '.$post; 436 $prev_url = $pre.'<a accesskey="," title="' .plog_tr('Previous Image') . '" href="javascript:slides.previous();"><img src="'.THEME_URL.'images/rewind.gif" width="16" height="16" alt="' . plog_tr('Previous Image') . '" /></a> '.$post; 437 $stop_url = $pre.'<a accesskey="x" title="'. plog_tr('Stop Slideshow') . '" href="javascript:slides.pause();"><img src="'.THEME_URL.'images/stop.gif" width="16" height="16" alt="' . plog_tr('Stop Slideshow') . '" /></a> '.$post; 438 $play_url = $pre.'<a accesskey="s" title="'. plog_tr('Start Slideshow') . '" href="javascript:slides.play();"><img src="'.THEME_URL.'images/play.gif" width="16" height="16" alt="' . plog_tr('Start Slideshow') . '" /></a> '.$post; 439 $next_url = $pre.'<a accesskey="." title="' . plog_tr('Next Image') . '" href="javascript:slides.next();"><img src="'.THEME_URL.'images/fforward.gif" width="16" height="16" alt="' . plog_tr('Next Image') . '" /></a>'.$post; 440 441 $output = '<div class="large-thumb-toolbar" style="width: '.$thumbnail_config[THUMB_LARGE].'px;">'.$pre_pre.$large_link.$prev_url.$stop_url.$play_url.$next_url.$post_post.'</div><!-- /large-thumb-toolbar -->'; 442 464 443 return $output; 465 444 } … … 1163 1142 // no such caption, perhaps we have better luck with path? 1164 1143 if (!$picture) { 1144 // check if it's an RSS feed for the picture comments 1145 while (!empty($names['arg1']) && $names['arg1'] == "feed") { 1146 $feed = array_pop($names); 1147 } 1165 1148 $filepath = join("/",$names); 1166 1149 $like_match = array("_", "%"); … … 1614 1597 WHERE `parent_id`=".intval($id)." 1615 1598 AND `approved`=1"; 1599 if (isset($arr['comments'])) { 1600 $query .= " ORDER BY `id` "; 1601 if ($arr['comments'] == "ASC") { 1602 $query .= "ASC"; 1603 } else { 1604 $query .= "DESC"; 1605 } 1606 } 1616 1607 $result = run_query($query) or die(mysql_error()); 1617 1608 … … 1986 1977 if ($config["use_mod_rewrite"]) { 1987 1978 global $path; 1988 if (!empty($path)) 1989 $rss_link .= "http://".$_SERVER['HTTP_HOST']."/".SmartStripSlashes(substr($path,1))."feed/";1990 else1991 $rss_link .= $config['gallery_url']."feed/";1992 1993 } 1994 else {1979 if (!empty($path)) { 1980 $rss_link .= "http://".$_SERVER['HTTP_HOST']."/".SmartStripSlashes(substr($path,1))."feed/"; 1981 } else { 1982 $rss_link .= $config['gallery_url']."feed/"; 1983 } 1984 1985 } else { 1995 1986 $rss_link .= $config["gallery_url"] . "plog-rss.php?level=".$GLOBALS['plogger_level']."&id=".$GLOBALS['plogger_id']; 1996 1987 } … … 2008 1999 global $config; 2009 2000 2010 if ($GLOBALS['plogger_mode'] != "slideshow" && $GLOBALS['plogger_level'] != " picture" && $GLOBALS['plogger_level'] != "404") {2001 if ($GLOBALS['plogger_mode'] != "slideshow" && $GLOBALS['plogger_level'] != "404") { 2011 2002 $rss_link = ""; 2012 2003 // change the tooltip message to reflect the nature of the RSS aggregate link. 2013 if ($GLOBALS['plogger_level'] != "") 2014 $rss_tooltip = plog_tr('RSS 2.0 subscribe to') . ': ' . $GLOBALS["plogger_level"]; 2015 else 2016 $rss_tooltip = plog_tr('RSS 2.0 subscribe to all images'); 2004 if ($GLOBALS['plogger_level'] != "") { 2005 $rss_tooltip = plog_tr('RSS 2.0 subscribe to') . ': ' . $GLOBALS["plogger_level"]; 2006 } else { 2007 $rss_tooltip = plog_tr('RSS 2.0 subscribe to all images'); 2008 } 2017 2009 2018 2010 $rss_link = plogger_rss_link(); … … 2216 2208 else 2217 2209 return 0; 2210 } 2211 2212 function plogger_get_picture_filename($specialchars = false) { 2213 global $config; 2214 $filename = SmartStripSlashes(basename($GLOBALS['current_picture']['path'])); //get the basename and clean up the text a little 2215 $filename = substr($filename, 0, strrpos($filename, '.')); //remove the file extension 2216 //if the truncate value is set and the filename is longer than the truncate value 2217 //chop it off and add the trailing ellipses 2218 if (intval($config['truncate']) > 0 && isset($filename{ intval($config['truncate'])})) { 2219 $filename = substr($filename, 0, intval($config['truncate'])).'...'; 2220 } 2221 if ($specialchars) { 2222 return htmlspecialchars($filename); 2223 } 2224 return $filename; 2218 2225 } 2219 2226 -
trunk/plog-rss.php
r568 r573 31 31 $config["feed_title"] .= ": " . $album['album_name'] . " " . plog_tr("Album"); 32 32 33 } else if ($level == "picture") { 34 plogger_init_picture(array( 35 'id' => $id, 36 'comments' => 'DESC' 37 )); 38 $picture = get_picture_by_id($id); 39 $config["feed_title"] .= ": " . basename($picture['path']); 40 33 41 } else if ($level == "search") { 34 42 plogger_init_search(array( … … 46 54 } 47 55 48 $header = 1;49 50 56 // generate RSS header 51 $rssFeed = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";57 $rssFeed = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; 52 58 $rssFeed.= "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:media=\"http://search.yahoo.com/mrss/\">\n"; 53 59 … … 61 67 $rssFeed.= "<atom:link href=\"http://".$_SERVER['HTTP_HOST'].str_replace('&', '&', $_SERVER['REQUEST_URI'])."\" rel=\"self\" type=\"application/rss+xml\" />\n"; 62 68 69 $header = 1; 70 63 71 while(plogger_has_pictures()) { 64 72 plogger_load_picture(); 65 $submitdate = plogger_get_picture_date("D, d M Y H:i:s O",1); 66 $takendate = plogger_get_picture_date(); 73 // if at picture level, check to make sure it has comments first 74 if ($level != "picture" || plogger_picture_has_comments()) { 75 76 if ($header) { 77 $submitdate = plogger_get_picture_date("D, d M Y H:i:s O",1); 78 $takendate = plogger_get_picture_date(); 79 80 $rssFeed.= "<pubDate>". $submitdate . "</pubDate>\n"; 81 $rssFeed.= "<lastBuildDate>". $submitdate . "</lastBuildDate>\n"; 82 $header = 0; 83 } 67 84 68 if ($header) { 69 $rssFeed.= "<pubDate>". $submitdate . "</pubDate>\n"; 70 $rssFeed.= "<lastBuildDate>". $submitdate . "</lastBuildDate>\n"; 71 $header = 0; 85 $rssFeed .= "<item>\n"; 86 87 $urlPath = str_replace(array("%2F", "%3A"), array("/", ":"), rawurlencode(plogger_get_source_picture_url())); 88 89 $caption = plogger_get_picture_caption(); 90 $thumbpath = plogger_get_picture_thumb(THUMB_RSS); 91 92 //$pagelink = $config["address"] . plogger_get_picture_url(); 93 // XXX: Below won't look nice with mod_rewrite, but plogger_get_picture_url 94 // returns wrong filename, needs to be fixed - still needs to be fixed as this does not always work as wanted either 95 $pagelink = $config['gallery_url'] . "?level=picture&id=" . plogger_get_picture_id(); 96 97 if ($caption == "" || $caption == " ") $caption = plog_tr("New Image (no caption)"); 98 $caption .= " - " . $takendate; 99 100 $descript = '<p><a href="'.$pagelink.'" 101 title="'.$caption.'"> 102 <img src="'.$thumbpath.'" alt="'.$caption.'" style="border: 1px solid #000000;" /> 103 </a></p><p>'.$caption.'</p>'; 104 105 $descript .= '<p>'.htmlspecialchars(plogger_get_picture_description()).'</p>'; 106 107 $rssFeed .= "\t<pubDate>" . $submitdate . "</pubDate>\n"; 108 $rssFeed .= "\t<title>" . $caption . "</title>\n"; 109 $rssFeed .= "\t<link>" . $pagelink . "</link>\n"; 110 $rssFeed .= "\t<description>" . $descript . "</description>\n"; 111 $rssFeed .= "\t<guid isPermaLink=\"false\">".$thumbpath."</guid>\n"; 112 $rssFeed .= "\t<media:content url=\"" . $urlPath . "\" type=\"image/jpeg\" />\n"; 113 $rssFeed .= "\t<media:title>" . $caption . "</media:title>\n"; 114 $rssFeed .= "</item>\n"; 115 if ($level == "picture") { 116 while(plogger_picture_has_comments()) { 117 plogger_load_comment(); 118 $rssFeed .= "<item>\n"; 119 $rssFeed .= "\t<pubDate>" . plogger_get_comment_date("D, d M Y H:i:s O") . "</pubDate>\n"; 120 $rssFeed .= "\t<title>Comment by " . plogger_get_comment_author() . "</title>\n"; 121 $rssFeed .= "\t<link>" . $pagelink . "</link>\n"; 122 $rssFeed .= "\t<description>" . plogger_get_comment_text() . "</description>\n"; 123 $rssFeed .= "\t<guid isPermaLink=\"true\">".$pagelink."#Comment-".plogger_get_comment_id()."</guid>\n"; 124 $rssFeed .= "</item>\n"; 125 } 126 } 72 127 } 73 74 $rssFeed .= "<item>\n";75 76 $urlPath = plogger_get_source_picture_url();77 78 $caption = plogger_get_picture_caption();79 $thumbpath = plogger_get_picture_thumb(THUMB_SMALL);80 81 //$pagelink = $config["address"] . plogger_get_picture_url();82 // XXX: Below won't look nice with mod_rewrite, but plogger_get_picture_url83 // returns wrong filename, needs to be fixed - still needs to be fixed as this does not always work as wanted either84 $pagelink = $config['gallery_url'] . "?level=picture&id=" . plogger_get_picture_id();85 86 if ($caption == "" || $caption == " ") $caption = plog_tr("New Image (no caption)");87 $caption .= " - " . $takendate;88 89 $discript = '<p><a href="'.$pagelink.'"90 title="'.$caption.'">91 <img src="'.$thumbpath.'" alt="'.$caption.'" style="border: 1px solid #000000;" />92 </a></p><p>'.$caption.'</p>';93 94 $discript .= '<p>'.htmlspecialchars(plogger_get_picture_description()).'</p>';95 96 $rssFeed .= "\t<pubDate>" . $submitdate . "</pubDate>\n";97 $rssFeed .= "\t<title>" . $caption . "</title>\n";98 $rssFeed .= "\t<link>" . $pagelink . "</link>\n";99 $rssFeed .= "\t<description>" . $discript . "</description>\n";100 $rssFeed .= "\t<guid isPermaLink=\"false\">".$thumbpath."</guid>\n";101 $rssFeed .= "\t<media:content url=\"" . $urlPath . "\" type=\"image/jpeg\"/>\n";102 $rssFeed .= "\t<media:title>" . $caption . "</media:title>\n";103 $rssFeed .= "</item>\n";104 128 } 105 129 … … 122 146 $path = join("/",array_diff(explode("/",$_SERVER["REQUEST_URI"]),explode("/",$_SERVER["PHP_SELF"]))); 123 147 $resolved_path = resolve_path($path); 124 // there is no meaningful RSS feed for images 125 if (is_array($resolved_path) && isset($resolved_path['level']) && $resolved_path['level'] != "picture") { 126 $level = (isset($resolved_path['level'])) ? $resolved_path['level'] : "collections"; 127 $id = (isset($resolved_path['id'])) ? $resolved_path['id'] : 0; 128 } 148 $level = (isset($resolved_path['level'])) ? $resolved_path['level'] : "collections"; 149 $id = (isset($resolved_path['id'])) ? $resolved_path['id'] : 0; 129 150 } 130 151 -
trunk/plogger.php
r568 r573 116 116 } 117 117 118 function the_plogger_ gallery_head() {118 function the_plogger_head() { 119 119 plogger_head(); 120 120
