Changeset 653
- Timestamp:
- 11/14/08 12:11:05 (3 years ago)
- Location:
- trunk/ImageGalleryPlugin
- Files:
-
- 3 edited
-
data/TWiki/ImageGalleryPlugin.txt (modified) (4 diffs)
-
lib/TWiki/Plugins/ImageGalleryPlugin.pm (modified) (2 diffs)
-
lib/TWiki/Plugins/ImageGalleryPlugin/Core.pm (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ImageGalleryPlugin/data/TWiki/ImageGalleryPlugin.txt
r549 r653 13 13 <tr> 14 14 <td><img src="%ATTACHURLPATH%/wikiringlogo40x40.png"></td> 15 <td><a href="http://wikiring. de" title="Make your Wiki ring!" style="text-decoration:none">15 <td><a href="http://wikiring.com" title="Make your Wiki ring!" style="text-decoration:none"> 16 16 Powered by <br /> <nop>WikiRing Consultants </a> 17 17 </td> … … 164 164 | *File:* | *Description:* | 165 165 %$MANIFEST% 166 * Visit =configure= in your TWikiinstallation, and enable the plugin in the {Plugins} section.166 * Visit =configure= in your installation, and enable the plugin in the {Plugins} section. 167 167 168 168 ---++ Plugin Info … … 172 172 173 173 174 | Plugin Author: | TWiki:Main/MichaelDaum, TWiki:Main/WillNorris |174 | Plugin Author: | Michael Daum, TWiki:Main/WillNorris | 175 175 | Copyright ©: | 2002-2003, Will Norris; 2005-2008, Michael Daum http://michaeldaumconsulting.com | 176 176 | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | 177 | Plugin Version: | v 3.72|177 | Plugin Version: | v4.00-per1 | 178 178 | Change History: | <!-- versions below in reverse order --> | 179 | 14 Nov 2008 | made format string for galleries more flexible | 179 180 | 16 Jul 2008 | don't crash on images that start with a digits pattern | 180 181 | 07 Jul 2008 | fixing use of string as hash | … … 214 215 | Other Dependencies: | | 215 216 | Perl Version: | 5.8 | 216 | Plugin Home: | TWiki:Plugins/%TOPIC% | 217 | Feedback: | TWiki:Plugins/%TOPIC%Dev | 218 | Appraisal: | TWiki:Plugins/%TOPIC%Appraisal | 219 220 -- TWiki:Main.MichaelDaum - 16 Jul 2008 217 | Plugin Home: | http://nextwiki.org/Extensions/%TOPIC% | 218 | Feedback: | http://nextwiki.org/Extensions/%TOPIC%Dev | 219 221 220 222 221 %META:FILEATTACHMENT{name="wikiringlogo40x40.png" attachment="wikiringlogo40x40.png" attr="h" comment="" date="1189787359" path="wikiringlogo40x40.png" size="2571" stream="wikiringlogo40x40.png" tmpFilename="" user="ProjectContributor" version="1"}% -
trunk/ImageGalleryPlugin/lib/TWiki/Plugins/ImageGalleryPlugin.pm
r464 r653 1 # Plugin for TWiki Enterprise Collaboration Platform, http://TWiki.org/2 #3 1 # Copyright (C) 2002-2003 Will Norris. All Rights Reserved. (wbniv@saneasylumstudios.com) 4 2 # Copyright (C) 2005-2008 Michael Daum http://michaeldaumconsulting.com … … 26 24 27 25 $VERSION = '$Rev: 17034 $'; 28 $RELEASE = ' 3.72';26 $RELEASE = '4.00-pre1'; 29 27 $NO_PREFS_IN_TOPIC = 1; 30 28 $SHORTDESCRIPTION = 'Displays image gallery with auto-generated thumbnails from attachments'; -
trunk/ImageGalleryPlugin/lib/TWiki/Plugins/ImageGalleryPlugin/Core.pm
r424 r653 1 #2 # TWiki WikiClone ($wikiversion has version info)3 #4 1 # Copyright (C) 2002-2003 Will Norris. All Rights Reserved. (wbniv@saneasylumstudios.com) 5 2 # Copyright (C) 2005-2008 Michael Daum http://michaeldaumconsulting.com … … 176 173 $this->{minwidth} = $params->{minwidth} || 0; 177 174 $this->{minwidth} = $this->{maxwidth} if $this->{minwidth} > $this->{maxwidth}; 178 $this->{format} = $params->{format} || 179 '<a href="$origurl"><img src="$imageurl" title="$comment" width="$width" height="$height"/></a>'; 175 $this->{format} = $params->{format}; 180 176 $this->{title} = $params->{title} || ' $comment ($imgnr/$nrimgs) $reddot'; 181 177 $this->{doTitles} = ($this->{title} eq 'off')?0:1; … … 267 263 join(', ', $this->{info}{topics}{value}) ne join(', ', @{$this->{topics}}); 268 264 269 my $result = "<div class=\"igp\"><a name=\"igp$this->{id}\"></a>";265 my $result; 270 266 271 267 # get filename query string … … 273 269 my $id = $this->{query}->param("id") || ''; 274 270 275 if ($id eq $this->{id} && $filename) { 276 # picture mode 277 $result .= $this->renderImage($filename); 271 if ($this->{format}) { 272 $result = $this->renderFormatted(); 278 273 } else { 279 # thumbnails mode 280 $result .= $this->renderThumbnails(); 281 } 282 283 $result .= "</div>\n"; 274 $result = "<div class=\"igp\"><a name=\"igp$this->{id}\"></a>"; 275 if ($id eq $this->{id} && $filename) { 276 # picture mode 277 $result .= $this->renderImage($filename); 278 } else { 279 # thumbnails mode 280 $result .= $this->renderThumbnails(); 281 } 282 $result .= "</div>\n"; 283 $result = '<noautolink>'.$result.'</noautolink>'; 284 } 285 284 286 285 287 $this->writeInfo(); 286 return '<noautolink>'.$result.'</noautolink>'; 288 289 #writeDebug("result=$result"); 290 return $result; 287 291 } 288 292 … … 368 372 369 373 # img 374 my $imgFormat = '<a href="$origurl"><img src="$imageurl" title="$comment" width="$width" height="$height"/></a>'; 370 375 $result .= "<tr><td class=\"igpPicture\">" 371 . $this->replaceVars($ this->{format}, $thisImg);376 . $this->replaceVars($imgFormat, $thisImg); 372 377 373 378 # navi … … 416 421 417 422 # ========================= 418 sub renderThumbnails { 419 423 sub renderFormatted { 420 424 my $this = shift; 421 422 #writeDebug("renderThumbnails()");425 426 writeDebug("renderFormatted()"); 423 427 424 428 if (!@{$this->{images}}) { … … 427 431 428 432 my $maxCols = $this->{columns}; 429 my $result = "<div class=\"igpThumbNails\"><table class=\"igpThumbNailsTable\"><tr>\n"; 433 my $header = $this->{header} || ''; 434 my $footer = $this->{footer} || ''; 435 my $format = $this->{format} || ' * $imageurl'; 436 my $separator = $this->{separator}; 437 438 $separator = "\n" unless defined $separator; 439 my @result; 440 441 my $imageNr = 0; 442 my @rowOfImages = (); 443 my $skip = $this->{skip}; 444 foreach my $image (@{$this->{images}}) { 445 446 $skip--; 447 next if $skip >= 0; 448 last if $this->{limit} && $imageNr >= $this->{limit}; 449 $imageNr++; 450 451 $this->computeImageSize($image); 452 if (!$this->createImg($image)) { 453 return renderError($this->{errorMsg}); 454 } 455 if (!$this->createImg($image, 1)) { 456 return renderError($this->{errorMsg}); 457 } 458 459 460 my $line = $this->replaceVars($format, $image); 461 $line =~ s/\$index/$imageNr/g; 462 push @result, $line; 463 464 465 } 466 return $header.join($separator, @result).$footer; 467 } 468 469 # ========================= 470 sub renderThumbnails { 471 472 my $this = shift; 473 474 writeDebug("renderThumbnails()"); 475 476 if (!@{$this->{images}}) { 477 return renderError($this->{warn}); 478 } 479 480 my $maxCols = $this->{columns}; 481 my $result = "<div class='igpThumbNails'><table class='igpThumbNailsTable'><tr>"; 430 482 my $imageNr = 0; 431 483 my @rowOfImages = (); … … 758 810 $format =~ s/\$wikiusername/$image->{user}/gos; 759 811 $format =~ s/\$username/TWiki::Func::wikiToUserName($image->{user})/geos; 760 $format =~ s ,\$thumburl,$this->{imagesPubUrl}/thumb_$imageName,gos;761 $format =~ s ,\$imageurl,$this->{imagesPubUrl}/$imageName,gos;762 $format =~ s ,\$origurl,$image->{IGP_url},gos;812 $format =~ s/\$thumburl/$this->{imagesPubUrl}\/thumb_$imageName/gos; 813 $format =~ s/\$imageurl/$this->{imagesPubUrl}\/$imageName/gos; 814 $format =~ s/\$origurl/$image->{IGP_url}/gos; 763 815 $format =~ s/\$web/$image->{IGP_web}/gos; 764 816 $format =~ s/\$topic/$image->{IGP_topic}/gos; … … 983 1035 } 984 1036 985 986 987 1037 1;
Note: See TracChangeset
for help on using the changeset viewer.
