Extension talk:SmoothGallery/LQT Archive 1

Nothing Displayed After Bug
I am using MediaWiki 1.15, and Jon's SmoothGallery 2.0. The installation instructions were not clear if you are not familiar with untaring. I kept/put everything (Jon's software files and the extension files) into the same directory at "extensions/SmoothGallery/". In the instructions, it just says to put Jon's software "in a folder in extensions" but doesn't specify a name for said folder. I altered the LocalSettings code from including "extensions/SmoothGallery.php" to "extensions/SmoothGallery/SmoothGallery.php" because when SmoothGallery.php is moved outside of the SmoothGallery folder, I get errors that it cannot find SmoothGalleryClass.php (and if I move that outside the folder, it then cannot find SmoothGalleryParser.php). By having everything in one folder and altering the LocalSettings inclusion, it all works without any error messages.

The problem I have is anything after is not displayed, be it another sgallery or even simple text. Thus, I can only use it at the very end of a page.

Picasa & SmoothGallery
Hi Ryan,

Is there any way to modify SmoothGallery with Picasa (online) albums? There seems to be a piece of code to pull albums via RSS feed? Where can I get it and how do I implement it (where? how?)

Cheers, Christian


 * If there is code to use RSS feeds, I'll look into making an option for this. --Ryan lane 21:45, 21 July 2009 (UTC)

Examples
Any examples of this in use, please? 128.250.80.15 01:42, 10 January 2007 (UTC)


 * Sorry, I don't have a publicly accessible website available (yet). The best I can say right now is to visit the SmoothGallery site and look at examples of SmoothGallery in action. --Ryan lane 21:30, 11 January 2007 (UTC)


 * I have one now, it is at my sandbox (currently view only). --Ryan lane 06:56, 3 March 2007 (UTC)

PHP Bug
Hey I keep getting the: Call to a member function getThumbnail on a non-object From this line (and probably more along the way): $full_thumb_obj = $img_obj->getThumbnail( $width, $height ); I been googling a lot and it seems to be a new 'feature' in the newer versions of php5.+ Concerning passing non-objects to functionszzzz. blablabla. Im using PHP Version 5.0.5-2 Zend Engine v2.0.5 Apache20 Has anyone found a solution for this?? Thx a lot! Rune.


 * I've tried it using PHP 4.3, and MediaWiki 1.6; and PHP 5.1, and MediaWiki 1.8. $img_obj is being created through an object factory function, and $img_obj->getThumbnail($width,$height) is being passed two strings. It is possible that Image::newFromName is returning a null value... How are you using the extension? Image:Image.png or Image.png ; Notice you need the latter of the two. --Ryan lane 19:28, 16 January 2007 (UTC)


 * Looks like this is exactly the issue. I wasn't checking to make sure the image object wasn't null when it was returned, which of course is a bug because Image::newFromName can return null values... Try the new version. --Ryan lane 19:59, 16 January 2007 (UTC)
 * YES! Tried the new version and it returned an error about not being able to find the files. great! So I found out that its because im uploading the images via sshfs and using the $wgUseSharedUploads = true; setting in LocalSettings.php. When I upload files via the upload feature in the wiki it works great. Only thing is that I had to change line 97 to $name = "myGallery" . mt_rand;. Because gmp_strval( gmp_random(1) gave me an error. Will try to make it support the $wgUseSharedUploads = true; and let you know if I succeed. Thankyou so much for your help!!!!! Rune.

Remark to "Installation"
A phantastic extension, A++++. One little remark. I installed the extension on the 1.9.1 version, running on an Fedora Core 6 Linux in a separate directory outside the document root with a symlink. In LocalSettings.php, I had to change the specific configuration as follows to make the extension work. Change the filename of SmoothGallery to whatever your name is.

require_once("extensions/SmoothGallery.php"); $wgSmoothGalleryExtensionPath = "$wgScriptPath/extensions/SmoothGallery"; $wgSmoothGalleryDelimiter = "\n";

The extension worked immediately - only trap is that you have to use the upload function within the Wiki to get the images displayed.

dutchfrog 2007-02-01

Looks very broken with JS disabled
Hm, nice - but if you view the page with JavaScript disabled, it looks completely broken. It would be nice if it would degrade gracefully. This could be achived by simply setting all images to display:none per default, for example. It would be ideal to provide a completely separate view, like mediawikis build-in galleries, which is hidden if JS is enabled - this should be simple, ImageGallery.php can be used to create it. -- Duesentrieb ⇌ 17:24, 3 March 2007 (UTC)


 * Agreed. There are a few things I need to work out before I even mark this as beta. If you can send me some patches, or help fix it in svn I wouldn't mind ;). --Ryan lane 14:17, 13 March 2007 (UTC)

Ok, I just was bold and added the fallback functionality in 20420 (diff). Have a look if you like. Some more things I came across:
 * mentioning your mail address in extension code will get it spamed.
 * watch out for HTML injection - for example, the with and height attributes could be used for XSS attacks, it seems.
 * split out the code for rendering and the special page into separate files, so only a minimal amount of code is loaded if SmoothGallery isn't used on a page.
 * the dummy parser seems pointless, it's never used. $dummy = NULL will do fine.
 * use separate localization files, only load messages when needed
 * only link JS/CSS files when SmoothGallery is being used on a page. This can be done by putting a flag into the parser output object, and looking for it in a OutputPageParserOutput hook.

Just some thoughts :) If you don't mind, I'll implement some when I feel the urge. Have a look at Extension:Player too, by the way. I have used some of the things i talked about there.

Regards, and thanks for the eye candy -- Duesentrieb ⇌ 00:18, 14 March 2007 (UTC)


 * Wow. I just tried the patched version in svn, and it works perfectly without javascript. Thanks a lot for the patches! Seeing how well you fixed the javascript degrading issue, I don't mind if you update the plugin whenever you'd like.


 * As for the tips, I'll look into these soon; if you hit a few before me, I don't mind. I'll probably up the version number, and change the download link whenever the full list is done. --Ryan lane 21:35, 14 March 2007 (UTC)


 * Well, what I did does have the disadvantage that yet another thumbnail is loaded for each image, even if its never shown :(
 * Anyway... I'll keep digging around (see below). sooner or later the code needs some restructuring though (rendering class, special page class, etc) -- Duesentrieb ⇌ 23:31, 14 March 2007 (UTC)


 * Yeah, that is true. Maybe it is possible to reuse the thumbnails from MediaWiki's image gallery for the smooth gallery's gallery? --24.252.67.18 02:08, 15 March 2007 (UTC)


 * Hm, I tried and failed. When i set thumbHeight to 120 (or anything > 75), the carousel starts jumping (at least in FF). -- Duesentrieb ⇌ 22:12, 15 March 2007 (UTC)


 * Looks like a SmoothGallery bug. I'll look into it. I remember reading about a similar one when too many images were added to the gallery. --Ryan lane 03:06, 16 March 2007 (UTC)


 * Its an issue with the css. I fixed this by changing some of the carousel height pixel values:
 * In .jdGallery div.carouselContainer change height to 160px
 * In .jdGallery .carousel change height to 140px
 * In .jdGallery .carousel .carouselWrapper change height to 123px
 * I'm using the newest version of SmoothGallery. It seems this makes IE act erratically. I fixed IE by changing:
 * "this.carouselInner.style.width = ((this.maxIter * (this.options.thumbWidth + this.options.thumbSpacing)) - this.options.thumbSpacing + this.options.thumbWidth) + "px";
 * to
 * this.carouselInner.style.width = ((this.maxIter * (this.options.thumbWidth + this.options.thumbSpacing + 8)) + this.options.thumbSpacing) + "px";
 * The javascript fix was mentioned in the SmoothGallery forums.
 * --Ryan lane 17:48, 16 March 2007 (UTC)

category-to-gallery
I have added support for category-based galleries. To make a SmoothGallery from the images in category Foo, simply do this: Category:Foo

I'll probably also add a convenient mode for this to the special page: Special:SmoothGallery/Foo would show the images from category Foo. what do you think? -- Duesentrieb ⇌ 23:28, 14 March 2007 (UTC)


 * Sounds great! The special page was kind of limiting with just image names (as it is limited by url length). Categories would make it far more useful. --24.252.67.18 01:59, 15 March 2007 (UTC)

I did some cleanup and tweaking today... have a peek at 20503 if you like. -- Duesentrieb ⇌ 22:13, 15 March 2007 (UTC)


 * Heh. Looks like you broke it a little. When you took out the "$previousoption" stuff, you caused the javascript to fail to parse (some options may or may not be used, and the list is comma delimited). I've added that back in for now. --Ryan lane 03:25, 16 March 2007 (UTC)


 * Uh, really? The code works fine for me, and since I added the thumbWidth and thumbHeight options, there's *always* a previous option, and the $previousoption flag is not needed. In fact, if it is used, it'll break the JS code, because no comma is emitted for the first item, even though it's preceeded by thumbHeight: 75. What problem did you have with my version of the code? -- Duesentrieb ⇌ 12:42, 16 March 2007 (UTC)


 * I tried Image:Test.png and the javascript failed to parse; however, I found the real culprit. $output .= 'timed: true,';</tt> needed to be: $output .= ', timed: true,';</tt>


 * When I get home later I'll revert the changes I made, and add that fix. --128.160.138.129 14:20, 16 March 2007 (UTC)

I can't get this function to work for the life of me. I can get all the other functionality of SmoothMedia, but not the Category Gallery. Is it still in the current build? -Rich 2 May 2007


 * Well, this hasn't been really released yet. If you use the beta version from SVN, this will work. The version from SVN most likely requires a much higher version of MediaWiki though (possibly even 1.10). The SVN version currently has one bug as well (which may not be a bug in MediaWiki 1.10), the title of the special page doesn't display. Other than that minor bug, it should work fine. --Ryan lane 13:39, 2 May 2007 (UTC)

Title / Description
Ryan,
 * Could you find a way to implement the title and description functions, into this extension. I don't think everyone wants to be reading the filename as the title. I'm on a robotics team, and this actually helps cut down on space, but I know some visitors would have no clue what is going on in some of the pictures we take. They are saying to themselves something along the lines of "Oh robots...what does that one over there do? or this one?" or "What is that person trying to do with the robot?". People like our Non-Engineering Mentors.

Thanks, Qsheets 01:16, 2 May 2007 (UTC)


 * The description currently pulls the text from the image page's text, so if you edit the image page, you can add a description. I'm contemplating matching the syntax of regular galleries, and letting users put descriptions right into the gallery. As for title, I'll try to figure out a way to do it. Currently, it uses the image name (the title of the image page). I'd recommend naming your images descriptively for now. --Ryan lane 13:41, 2 May 2007 (UTC)

Has anyone implemented this new feature? I'm definitely gonna need it for a project I'm working on, so if someone already has it done it would be a great time saver. If not, I'll keep y'all updated on how its going.

--AlanG

I would also like to see this functionality added. I've been using the image page text in the mean time. It works out for me but it comes in so small it is really hard to read. Does anybody have any ideas on how to increase the font size. -- LeeA


 * You should be able to change the text size via the CSS. --Ryan lane 14:47, 22 January 2008 (UTC)

Sorry to be a pain in the a**, but having a tite and a description would be extremely important! Sometimes you use pictures for different puproses and so the workaround does not work anymore. Furtermore, editing the description of numerous pictures takes a lot of time at this moment... As far as I can see, a titile function is supported by the Smooth Gallery (2.0) itself. Would be really great! Your extension is great anyway! --Jorgusch 15:05, 4 June 2008 (UTC)


 * Thanks. You can actually put a description for each picture in the gallery like so:


 * Image:picture1.png|This is the description for picture1
 * Image:picture2.png|This is the description for this one
 * Image:andSoOn.png|You get the picture
 * Image:andSoOn.png|You get the picture


 * Notice that this is how regular MediaWiki galleries work. I'll see what I can do about titles. I'm rediculously busy with other projects right now, so I can't promise anything; however, if you feel like adding it in, I was thinking something like the following format:


 * Image:picture1.png|desc=This is the description for picture1|title=This is picture 1's title
 * Image:picture2.png|title=This is picture 1's title|desc=This is the description for picture1
 * Image:picture2.png|title=My title|This is the description
 * Image:andSoOn.png|If no variables are used, the first pipe is always a description|And the second pipe is always a title
 * Image:andSoOn.png|If no variables are used, the first pipe is always a description|And the second pipe is always a title


 * Send me a patch via the email functionality of this wiki. --Ryan lane 19:50, 4 June 2008 (UTC)


 * See, I am such a dummy that I cannot hold of you E-mail or do not know, where to find it… Using | does not work - the picture won't be displayed - a page:
 * Thanks for quick respond!! --Jorgusch 12:19, 5 June 2008 (UTC)


 * Ah, you are using 1.0h. You need to use 1.1c. Don't worry about it saying beta. It is actually fairly stable (at least as stable as 1.0h). Btw, to email people through the wiki, visit their user page, and there will be a link to email them via the toolbox on the bottom right of the page. --Ryan lane 13:38, 5 June 2008 (UTC)


 * This a expains a lot ;-) And your E-mail adress is not only in the toolbox but also in the code... However, could you give a link to the complete new version as a zip? I do not get it with the change things. Maybe just add another link to the trunks in the table - me dummy, you know.
 * I allowed myself to add the code example with the description to the extension page. Thanks again!! --Jorgusch 11:48, 7 June 2008 (UTC)


 * I just installed the SVN version and it doesn't appear to be picking up the description text entered after the '|' after image name. Any suggestions or examples on where this is actually working?  Did not see an example at: http://www.movethefloor.com/sandbox/SmoothGallery of the description implementation.  btw, I am using the following syntax:
 * Image:Slide1.png|This is slide one
 * Image:Slide2.png|This is slide two
 * Image:Slide3.png|This is slide three
 * Image:Slide4.png|This is slide four
 * Image:Slide4.png|This is slide four


 * Thanks, Jeff --Mindblender 21:40, 8 July 2008 (UTC)

Two errors
Hi, I am trying to implement the smooth gallery. However It is only partially working on my localhost, and is not working at all on the private site.

The first issue (using the latest code from Subversion) is that the line 302 $plain_gallery->add( $img_obj->getTitle ); //TODO: use text throws an error Fatal error: Call to undefined method Title::getName in C:\xampp\htdocs\cw\includes\ImageGallery.php on line 94

The second error is that It does not render as a smooth gallery at all, just A large image, and a thumbnail, all the way down the page

I have tried both formats i.e Image:animage.jpg Image:animage2.jpg

and animage.jpg animage2.jpg

I am using mediawiki 1.10. I have the following files in my Extension Directory folder smoothgallery_1.0.1 which i obtained from the site and unzipped. I then renamed it to smoothgallery I then have the following files SmoothGallery.php SpecialSmoothGallery.php SmoothGalleryClass.php SmoothGallery.i18n.php jd.gallery.js.patch jd.gallery.css.patch in the extension directory.

My local settings for this are include("extensions/SmoothGallery.php"); $wgSmoothGalleryExtensionPath = "$wgScriptPath/extensions/smoothgallery"; $wgSmoothGalleryDelimiter = "\n"

any suggestions would be greatly appreciated, thanks 85.210.41.52 00:07, 4 June 2007 (UTC)


 * I haven't yet tested this with MediaWiki 1.10. Let me test this and get back to you. --Ryan lane 19:28, 6 July 2007 (UTC)


 * For all it is worth, I had the same problem with Mediawiki 1.10.1 Correcting the jd.gallery.css helped somehow but the page was still broken (would show images properly but navigation pane, logo etc broken). What I did was embed the gallery into a table and it just works!
 * Hope this can help
 * Guy, from Geneva


 * This is fixed in SVN --Ryan lane 19:41, 12 October 2007 (UTC)


 * Also, I'm not sure if '$wgSmoothGalleryExtensionPath = "$wgScriptPath/extensions/smoothgallery";' is correct. I usually just browse to the scripts, and take the relative path. I can try to verify if this works for me though... --Ryan lane 19:43, 12 October 2007 (UTC)


 * I too have the same problem. There are two images of each image, one large and one small. Whats going on here??? I am afraid your instructions or requirements are incomplete -whit


 * They could very well be; however, it is more likely that your site is configured in a way that is simply different from the documentation. Essentially, if you are seeing a bunch of images, and not the gallery, it is because your css/javascript isn't being found by the browser. You need to figure out what "$wgSmoothGalleryExtensionPath" needs to be set to. Find the files manually, using your browser, then take the relative path, and use that. --Ryan lane 13:24, 19 March 2008 (UTC)


 * Still not working. Looking at the page source, it loads css/jd.gallery.css, however nothing else after that. It seems as though $outputPage->addScript does nothing. Do I need to load something else to get this to work? -whit


 * SmoothGallery does not work with the dusk skin. This was my problem!! -whit


 * Oh, that makes sense. The addScript stuff probably only works in the monobook skin. I'll add that to the documentation page. --Ryan lane 14:28, 28 March 2008 (UTC)

Two feature requests
This is an incredibly useful extension! Two small things I would love to see would be

1) when taking the caption from the image description page, it would be really nice if categories were not included. I did this myself as follows, but I know nothing at all about PHP so I'm sure there's a better way.  This just takes the first line of the image description and ditches the rest (ideal for what I do on my own site):


 * In SmoothGallery.php, after


 * I added

2) Where images are used in sgalleries, the page the gallery is on does not appear in the list of pages using the image (at least, it doesn't in MW 1.11). Is there any way of rectifying this?

81.179.87.236 23:14, 27 October 2007 (UTC)


 * I'm considering moving away from using the page's content for image descriptions, more towards the way regular galleries work, so the categories thing won't be an issue.


 * As for #2. I tried getting this working, and simply couldn't figure out how to do it. I'll probably ask in the developer's irc channel; they'll probably know how to do it. --Ryan lane 21:43, 29 October 2007 (UTC)


 * I second the support for #2 and caption syntax like the regulare tag. After you have that this things is about perfect. Great work. --LeeA

Problem with SmoothGallery 2.0 and MW 1.7.3
Hi, i have installed Smoothgallery as in the manual but it will not work. I have downloaded the SmoothGallery.php from http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/SmoothGallery/SmoothGallery.php?revision=20132 and i also have downloaded thi zip file of SmoothGallery from http://smoothgallery.jondesign.net/mint/pepper/tillkruess/downloads/tracker.php?uri=http%3A//smoothgallery.jondesign.net/files/SmoothGallery-2.0.zip . My folder are now = In my Mediawiki folder is the folder extensions where i have copied the file SmoothGallery.php and where i also have copied the folder SmoothGallery-2.0 which i have renamed to SmoothGallery.

In the Localsettings.php have i require_once("extensions/SmoothGallery.php"); $wgUseImageResize = true; $wgSmoothGalleryExtensionPath = "$wgScriptPath/extensions/SmoothGallery/"; $wgSmoothGalleryDelimiter = "\n"; When i try now to get an album, i just see the pictures among each other but not as album. Can anyone help me???

I have tried it with: <sgallery width="600" height="500" showarrows="false" showcarousel="false" showinfopane="false" timed="true" delay="4000"> Image:Tree.jpg Image:Creek.jpg and also with: <sgallery width="600" height="500" showarrows="false" showcarousel="false" showinfopane="false" timed="true" delay="4000"> Tree.jpg Creek.jpg

My folder structure: bin config docs extensions =SmoothGallery.php =SmoothGallery

Problem solved: I have found SmoothGallery 1.0.1 in the net and it works.... I think 2.0 is not compatible!?!


 * I think your problem is just due to a script having been renamed in smooth gallery 2.0. If you look in SmoothGallery.php you'll find a chunk like this:

Check the filename of the mootools.js file - it may be called mootools.v1.11.uncompressed.js. Just change the filename as required and things should work. 81.179.87.236 17:00, 28 October 2007 (UTC)


 * You are GREAT (*_*)

It works..... But i have one more Question. Is it Possible to make a link wo another Wiki Page when i click on a Picture?


 * I am searching now for about more then 6 hours to find an answer of this Question :-(
 * Is it possible to make a link of the Pictures? I habe 8 pictures which i want to show in the dia show, but each picture needs a link to a MW Page.
 * Is something like that possible? Thanks a lot for your such so good Job


 * Ummmm... I don't really understand what you mean. What exactly do you want to link to, and where is the link? Do you mean you want to click on the picture, and have the URL be something other than the wiki page? Other than the wiki page, what would the link be? I think it would be fairly hard to allow different links for arbitrary pictures. Either all of the picture link to a different url, or they all point to their wiki page. If you want the pictures to point to the images directly instead of the wiki page, that is far more doable. --Ryan lane 19:50, 15 November 2007 (UTC)

Smooth Gallery 2.0
Ryan, could you add the newest features of the smooth gallery to this extension (i.e. multiple albums in one gallery). Thanks, --Qsheets 04:34, 8 November 2007 (UTC)


 * I was working on this a while ago, and got sidetracked. It is actually going to be a little harder than I thought at first. I'd really like to work in the preloading, but I can't seem to figure it out. I'll try to work on this again soon. --Ryan lane 19:50, 15 November 2007 (UTC)


 * I've added the gallery sets into svn head. It seems to work, but it isn't well tested. --Ryan lane 01:31, 28 December 2007 (UTC)


 * The newest version in SVN head supports nearly all of the SmoothGallery 2.0 features. To create a gallery set, you can make one by wrapping multiple sgalleries with :

Category:A Category:B Image:1.png Image:2.png


 * Currently, you can't assign names to the galleries, they'll show up as Gallery0, Gallery1, or something similar. Also, you can't currently have more than one gallery set per article (seems to be an issue with SmoothGallery, and not with the plugin...).


 * Unfortunately, special pages aren't working perfectly yet in svn head. I'm allowing the storage of galleries in the database, but it isn't really ready for use now, and I'm still allowing the old way of creating galleries via special page, but it is currently disabled. If you plan on using the version from svn head, please bear with the current limitations, and don't use the database for special pages (it is an option which is off by default). --Ryan lane 06:12, 22 February 2008 (UTC)

get pictures automatically?
Hi Ryan, thanks for this great extension. I like it very much :-) Is it possible, that smoothgallery takes the pictures automatically of a shared folder in the network? I mean for example, i have in my network a shared folder in which i save my pictures in subfolders one for Holiday 2007 and one holiday 2008. I don't want to add each picture manually, so it would be grat when i just can say, take all pictures in folder \\pictures\2007 or something... Or what is the Idea of your extension when someone has more than 100 pictures? Thanks


 * That would probably be pretty difficult. Most browsers won't let javascript access network resources, and most also won't connect to windows style shares. I know someone was looking at somehow getting this working when $wgUseSharedUploads = true; is enabled; I haven't tried it. It may work if you share the network share to your web server, and enable shared uploads (and somehow the extension works with it). --Ryan lane 02:42, 27 November 2007 (UTC)

file name bug
I tried to install smooth gallery on my mediawiki site a few days ago. There were some javascript errors. I fixed them by renaming the files:

mootools.v1.11.ext.js

mootools.v1.11.js

mootools.v1.11.uncompressed.js

to

mootools.ext.js

mootools.js

mootools.uncompressed.js

Problems with wrong file format
Hi,

Accidentally I handed a PowerPoint File to the gallery.

Image:SomePowerPoint.ppt

This results in a blank page and it took me a while to get to the error source.

Is there a way to avoid this?


 * In the current stable version of this plugin, no; unfortunately, it doesn't have much error checking. In the current alpha version, this should work without issue. I've been working pretty heavily on this plugin recently, and the new version should be out soon. I have a few issues to work out before I can label it ready. Good news is, when I release the new version, I'll change the status of the plugin from experimental to beta, and soon afterwards as stable. Hopefully it'll be ready in a month or so. --Ryan lane 06:02, 22 February 2008 (UTC)

SmoothGallery 2.1
kwé kwé,

like on the guy, Jon's, site says, there's a 2.1 available, and I'm about to start editing the extension to work with that. Just for fun, and see if I can. I'll let you know here.

--Kjikaqawej 23:48, 7 March 2008 (UTC)


 * I can't seem to find 2.1 anywhere on his site. Can you send me a direct link? Definately send me patches if you work some nice features in. Make sure to patch against HEAD in svn, it is the current beta version. --Ryan lane 13:28, 19 March 2008 (UTC)

Cant get it to work...
--Danielmd 21:34, 14 April 2008 (UTC)

Hey i spend a couple of hours trying to figure out how to make this work, but all i get is :

'''SmoothGallery error:No images were found in this gallery. Make sure all images requested exist. The following images were not found: 1.jpg, 2.jpg, 3.jpg, 4.jpg'''

My structure has the svn version on extensions folder and smoothgallery (v2.0 with renamed moo files) inside extensions:

http://danielmd.net/wiki/extensions/ http://danielmd.net/wiki/extensions/SmoothGallery/

This is my LocalSettings.php changes

include("extensions/SmoothGallery.php"); $wgSmoothGalleryExtensionPath = "/wiki/extensions/SmoothGallery"; $wgSmoothGalleryDelimiter = "\n"; $wgUseImageResize=true;

I am using mediawiki 1.12 and here is the sample http://www.danielmd.net/wiki/index.php?title=Sandbox What am i doing wrong? BTW, is there a way to have all the files inside the same folder? like on the Geshi Extension.

Thanks!


 * Looks like you got it working. Sorry I wasn't around to help! --Ryan lane 21:30, 13 May 2008 (UTC)
 * Experiencing same error on MW 1.15.3 -- Wish I knew what he did to get it working. --User:E71 12:45, May 26 2010 (UTC)

Not loading CSS/JS, addSmoothGalleryJavascriptAndCSS appears not to be Working
Here's my setup:

host:/var/lib/mediawiki1.7/extensions# pwd /var/lib/mediawiki1.7/extensions host:/var/lib/mediawiki1.7/extensions# ls SmoothGallery.php SmoothGallery.php host:/var/lib/mediawiki1.7# cat LocalSettings.php | tail -n 8 # # include("extensions/SmoothGallery.php"); $wgSmoothGalleryExtensionPath = "/SmoothGallery2"; $wgSmoothGalleryDelimiter = "\n"; ?> host:/var/www/SmoothGallery2# pwd /var/www/SmoothGallery2 host:/var/www/SmoothGallery2# ls -l ../mediawiki lrwxrwxrwx 1 root root 21 Jul 21 2007 ../mediawiki -> /var/lib/mediawiki1.7
 * 1) Slideshow stuff

When I look at the generated html from putting in the mediawiki tags for the extension, they do the correct thing. However, looking in the head section, the following lines don't exist (taken from SmoothGallery installation instructions):

<script src="scripts/mootools.v1.11.js" type="text/javascript"> <script src="scripts/jd.gallery.js" type="text/javascript"> <link rel="stylesheet" href="css/jd.gallery.css" type="text/css" media="screen" /> <script src="scripts/jd.gallery.set.js" type="text/javascript">

Looking at the extension source code, it appears addSmoothGalleryJavascriptAndCSS should be doing this, but it isn't for some reason. I've used a browser to go to the path of the SmoothGallery installation, which is $website/SmoothGallery2 (as the above shows my web root is /var/www). I've tried various permutations of the path, moving it around this way and that and resetting the variables and am at the end of my rope. I really want to use this extension.

If there's not a clear solution, I don't mind hacking the CSS/JS includes into place in mediawiki, I'm just not sure where to start. Like I said, the mediawiki tag is working fine, just not the includes.

--josh


 * Those lines only get created if the tag is being used in a page. This is done for performance reasons (there is no reason to load js/css when it isn't being used). Also, please rename "mootools.v1.11.js" to "mootools.js", I don't want to have to change my code every time they decide to change the version of mootools. --Ryan lane 21:29, 13 May 2008 (UTC)

Error
Error creating thumbnail:

Warning: passthru [<a href='function.passthru'>function.passthru</a>]: Unable to fork ['/usr/local/www/zooworlds.org/www/bin/ulimit4.sh' 30 102400 102400 \/usr/bin/convert'\ -background white -size 120 '\/usr/local/www/zooworlds.org/www/images/c/c0/Chimp_care.gif'\ -coalesce -thumbnail '\120x90!'\ -depth 8 '\/usr/local/www/zooworlds.org/www/images/thumb/c/c0/Chimp_care.gif/120px-Chimp_care.gif'\'' 2&gt;&amp;1'] in /usr/local/www/zooworlds.org/www/includes/GlobalFunctions.php on line 1885


 * Sounds like you have a system problem. MediaWiki isn't able to run convert, which is required to make thumbnails. You need to figure out why convert can't run. --Ryan lane 20:58, 3 June 2008 (UTC)

Do you update and make your extension stable?
Hi, do you have any plan to update?


 * I do update the plugin on occasion. As of right now I'm only doing bug fixes, but more feature updates will come in the future. The plugin is actually fairly stable, and I don't plan on making any drastic changes in syntax or functionality. I've changed the status from experimental to beta, as I'm not terribly comfortable marking it stable without doing a full suite of tests on it, and without updating the documentation to show usage syntax for new features. Don't let any of that stop you from using it though. --Ryan lane 19:39, 8 July 2008 (UTC)

Caption problems
I've got Smoothgallery 2.0 and 1.1c installed on MW1.12.0 and it seems to be working properly except the caption syntax is acting weird. If I use something like Image:name.jpg

1.1c shows no caption where 1.0h used to pull the caption from the image page description. Not a big deal but when I use something like

Image:name.jpg|caption

1.1c pulls the description from the image page but deletes the first word of it. It doesn't display the word "caption" at all.

Anybody have any idea how to get it to display the entered caption? --LeeA


 * Thats odd. Looking at the code, I can't see why this wouldn't work. I'll try to test it out in the next few days and see if I'm having the same problem. --Ryan lane 19:58, 8 July 2008 (UTC)


 * It seems that Jeff is having similar problems --LeeA


 * Ryan did you get a chance to investigate this problem? I'm still experiencing it and am confounded.  I plan on upgrading to MW1.13.0 soon I wonder if this will help things? --LeeA 13:25, 2 September 2008 (UTC)

Special Pages Problem
I have downloaded and installed SmoothGallery (version 1.2) and it seems to be working very well (thanks). The only problem seems to be when I try to access Special Pages (Special:Specialpages) i get the following error message:

Warning: require(...\www\wiki\extensions/SpecialSmoothGallery.php) [function.require]: failed to open stream: No such file or directory in ...\www\wiki\includes\AutoLoader.php on line 366

Fatal error: require [function.require]: Failed opening required '...\www\wiki\extensions/SpecialSmoothGallery.php' (include_path='...\www\wiki;...\www\wiki/includes;...\www\wiki/languages;.;...\php5') in ...\www\wiki\includes\AutoLoader.php on line 366

What am I doing wrong? Thanks, AMS


 * It looks like it is having problems finding SpecialSmoothGallery.php; did you download that file from svn as well? It is a required file, as are all of the php files in the SmoothGallery svn directory if you are using the newer version of SmoothGallery... --Ryan lane 19:43, 8 July 2008 (UTC)

Noob Question Alert - how to position within mediawiki pages?
I'd like to position this on the right margin with text flowing on the left side... a dumb question I'm sure...  any help appreciated.


 * Wrap it in a div, and float it:
 * Image:whatever.png
 * --Ryan lane 13:18, 20 August 2008 (UTC)

Stupid Newbie Question: How do I download the latest version??
Okay, I Googled around. I read the documentation and the FAQs (alright, some of it).

How do I download the latest version of SmoothGallery.php ??? On this page people talk about a version 1.1c, but I tried downloading either the nightly release or using svn I only get the file that says 1.0h in the comments up top.

Where's 1.1c and how do I get hold of it? (If the answer is svn, please give some tips. I tried svn and all I get is 1.0h.)

-Richard


 * Answering my own post: Okay, that was a stupid question, but I won't delete for the next guy with the same problem. Turns out that I did download version 1.1c. Don't look at the top of the file for the version number. Scroll down to the bottom. Oh, and you can use the Special:Version page to find the version of the extensions. -Richard

Newbie Installation Question
Ryan, I love the gallery and would like to use it to upload sketching instructions, but this is the first extension I am trying to install and I am missing something, since the gallery is not triggered. This is what I have done so far in MediaWiki 1.13.1:

1. downloaded SmoothGallery 2.0 untar it and placed it in the extension folder and renamed the javascript files.

2. I downloaded the extension SmoothGallery.php and SmoothGallery.i18n.php and placed it in the extension folder aswell -> is that where they are supposed to be?

3. Went through the bug fixes; left the "javascript edit toolbar" as is since i have a newer version of MediaWiki

4. added the following lines to my LocalSettings.php $wgSmoothGalleryExtensionPath = "/sketchwiki/extensions/smoothgallery"; $wgSmoothGalleryDelimiter = "\n";

5. I went to my site [] and added the base syntax of :
 * Image:Brewer-grid-01.jpg
 * Image:Brewer-grid-02.jpg
 * Image:Brewer-grid-03.jpg

After that I spend a couple of hours trying to find what I missed in the instructions. It would be great if I could get some assistance to get the gallery running.

Thanks, Thomas

Caption after pipe symbol disappears or is replaced
example: Brewer-grid-01.jpg|This a caption

In SmoothGalleryParser.php the caption after the pipe always gets replaced by the picture name space description. The picture name space description should only be used if no "pipe" caption is provided. I applied some dirty hacks to SmoothGalleryParser.php. Here they are:

Now it works fine for me

Using external images
Hi Ryan. Great extension, works well. Would it be possible however to use external urls as images? Is it a quick change or a complete re-write of the image handling part of the code...?

Thank you for your time, --78.86.165.177 15:56, November 3 2008 (UTC)


 * Ah, just noticed the $wgSmoothGalleryAllowExternal variable. Anyway, thanks for this great plugin. --78.86.165.177 16:17, November 3 2008 (UTC)

Parser Function Patch
Hi,

I've put together a patch which adds Parser Function syntax. This makes it possible to use SmoothGallery inside a template.

I'll admit it's not exactly been thoroughly tested, but it seems to work OK for me ;-) Also I didn't do sgalleryset as handling the nesting is a bit more complicated :-(

Here's an example of the syntax - basically it takes all the same options as the existing version, and anything without a equals sign in it is treated as an image :

As you can see, in order to have a image caption it is necessary to use the common | workaround.

Index: SmoothGallery.php

=
====================================================== --- SmoothGallery.php	(revision 43579) +++ SmoothGallery.php	(working copy) @@ -25,6 +25,9 @@ # # +# +# sgallery Parser Function changes contributed by David Claughton <dave@eclecticdave.com> +# if( !defined( 'MEDIAWIKI' ) ) die( -1 ); @@ -32,6 +35,7 @@ $wgExtensionFunctions[] = "efSmoothGallery"; $wgHooks['OutputPageParserOutput'][] = 'smoothGalleryParserOutput'; +$wgHooks['LanguageGetMagic'][] = 'smoothGalleryLanguageGetMagic'; $dir = dirname(__FILE__). '/'; $wgExtensionMessagesFiles['SmoothGallery'] = $dir. 'SmoothGallery.i18n.php'; @@ -49,8 +53,43 @@ 	$wgParser->setHook( 'sgallery', 'initSmoothGallery' ); $wgParser->setHook( 'sgalleryset', 'initSmoothGallerySet' ); + +	$wgParser->setFunctionHook( 'sgallery', 'initSmoothGalleryPF' ); } +function initSmoothGalleryPF(&$parser) { +	global $wgSmoothGalleryDelimiter; +	+	$numargs = func_num_args; +	if ($numargs < 2) { +		$input = "#SmoothGallery: no arguments specified"; +		return str_replace('§','<','§pre>§nowiki>'.$input.'§/nowiki>§/pre>'); +	} + +	// fetch all user-provided arguments (skipping $parser) +	$input = ""; +	$argv = array; +	$arg_list = func_get_args; +	for ($i = 1; $i < $numargs; $i++) { +		$p1 = $arg_list[$i]; + +		$aParam = explode('=', $p1, 2); +		if (count($aParam) < 2) { +			$input .= str_replace("\n","",$p1). $wgSmoothGalleryDelimiter; +			continue; +		} +		$sKey = trim($aParam[0]); +		$sVal = trim($aParam[1]); + +		if ($sKey != ''){ +			$argv[$sKey] = $sVal; +		} +	} + +	$output = initSmoothGallery($input, $argv, $parser); +	return array( $output, noparse => true, isHTML => true); +} + function initSmoothGallery( $input, $argv, &$parser, $calledAsSet=false ) { require_once( 'SmoothGalleryParser.php' ); @@ -101,3 +140,13 @@ 	'descriptionmsg' => 'smoothgallery-desc', 'url'        => 'http://www.mediawiki.org/wiki/Extension:SmoothGallery', ); + +/** + * We ignore langCode - parser function names can be translated but + * we are not using this feature + */ +function smoothGalleryLanguageGetMagic( &$magicWords, $langCode ) { +	$magicWords['sgallery'] = array(0, 'sgallery'); +	return true; +} +
 * 1) Version 1.0i / 2007-02-03

Cheers, Eclecticdave 23:22, 22 November 2008 (UTC)

Does not resize images
Everything works fine, except that it doesn't resize images that are larger than the gallery window. Do you know why this might be? I'm using MW1.12, 1.1c of the extension and 2.0 of the main SmoothGallery script. (Great extension by the way, thanks.) --Giles, 5th Dec 08


 * I'm having a problem with this too. It doesn't appear to proportionally resize to fit. --78.86.165.177 17:49, February 3 2009


 * This should be working. The extension should be making thumbnails to fit the size of your gallery window. Are your thumbnails working properly elsewhere in the wiki? --Ryan lane 16:03, 6 May 2009 (UTC)

Does not work for other users or with Firefox
I have really no idea, why this is happening. Everything works great with the IE, but when I try to open the wiki-article with Firefox, everything looks extremely broken (I see the blue, linked image name, a small jpg-symbol and the pictures in two different sizes). Same situation for other users in the network, but with both browsers. This definately sucks, because I love this extension and I would like to build up an image database with SmoothGallery. BTW: Java-Scripts are activated and this might be the problem. Think it is a java-script failure. Thanks for your help, --dvL 09:36, 9 January 2009 (UTC)


 * I've tested it in Firefox, IE, and Safari without any issues. It may be a configuration issue? I haven't had this issue. --Ryan lane 21:49, 21 July 2009 (UTC)

Adding a div on top of the images
Hi, I want to be able to add text to my images, but not use the info pane at the bottom. I have set this to false. Is there anyway of overlaying a div on the gallery and changing the text in div for each image? Thanks in advance for your thoughts Chris2305 17:11, 12 February 2009 (UTC)


 * Rather than replace the info pane, your best bet is probably to modify it to suit your needs. Moving it to the top is probably a bit involved - but if you can live with it at the bottom you can stop it overlapping the image with a quick hack to alter the thumbnail height ...

diff --git a/SmoothGalleryParser.php b/SmoothGalleryParser.php index 2b1e10f..bab3ce4 100644 --- a/SmoothGalleryParser.php +++ b/SmoothGalleryParser.php @@ -223,7 +223,7 @@ class SmoothGalleryParser { //Create a thumbnail the same size as our gallery so that //full images fit correctly -		$full_thumb_obj = $img_obj->getThumbnail( $this->argumentArray["width"], $this->argumentArray["height"] ); +		$full_thumb_obj = $img_obj->getThumbnail( $this->argumentArray["width"], $this->argumentArray["height"]-40 ); if ( !is_null($full_thumb_obj) ) { $full_thumb = $full_thumb_obj->getUrl; } else {


 * You then might want to apply my patch in the section below, which will allow you to set the infopane's opacity to 1 and stop it
 * from sliding.


 * Cheers, Eclecticdave 22:43, 1 April 2009 (UTC)

Patch for infopane sliding and opacity
Hi, I thought I'd contribute this patch which adds parameters for controlling whether the infopane should slide up (turn this off and it just fades in and out in place) and also to control its opacity.

diff --git a/SmoothGalleryClass.php b/SmoothGalleryClass.php index eb0ab9f..d8ad190 100644 --- a/SmoothGalleryClass.php +++ b/SmoothGalleryClass.php @@ -254,6 +254,14 @@ class SmoothGallery { $output .= ', showInfopane: false'; } +		if ( !$this->argumentArray["slideinfozoneslide"] ) { +			$output .= ', slideInfoZoneSlide: false'; +		} +	+		if ( $this->argumentArray["slideinfozoneopacity"] ) { +			$output .= ', slideInfoZoneOpacity: '. $this->argumentArray["slideinfozoneopacity"]; +		} +	 		#$output .= ', useHistoryManager: true'; #$output .= ', preloader: true'; #$output .= ', preloaderImage: true'; diff --git a/SmoothGalleryParser.php b/SmoothGalleryParser.php index 2b1e10f..00af4f5 100644 --- a/SmoothGalleryParser.php +++ b/SmoothGalleryParser.php @@ -63,7 +63,19 @@ class SmoothGalleryParser { } else { $this->argumentArray["showinfopane"] = true; } -	+ +		if ( isset( $argv["slideinfozoneslide"] ) && $argv["slideinfozoneslide"] == "false" ) { +			$this->argumentArray["slideinfozoneslide"] = false; +		} else { +			$this->argumentArray["slideinfozoneslide"] = true; +		} + +		if ( isset( $argv["slideinfozoneopacity"] ) && is_numeric($argv["slideinfozoneopacity"]) ) { +			$this->argumentArray["slideinfozoneopacity"] = $argv["slideinfozoneopacity"]; +		} else { +			$this->argumentArray["slideinfozoneopacity"] = "0.7"; +		} + 		if ( isset( $argv["fallback"] ) ) { $this->argumentArray["fallback"] = htmlspecialchars( $argv["fallback"] ); } else {

Cheers, Eclecticdave 22:09, 1 April 2009 (UTC)

Problem with MW1.14 (with workaround)
Attempting to use the extension with MediaWiki 1.14 produces the following error ...

Fatal error: Unsupported operand types in /home/dclaughton/test.encoresoup.net/includes/parser/LinkHolderArray.php on line 33

As a workaround - comment out all references to $local_parser from SmoothGalleryParser.php, this gets it working again, but since this code seems to be used to expand nested templates, that functionality probably won't work ;-)

Eclecticdave 22:58, 2 April 2009 (UTC)


 * Note: We installed SmoothGallery 1.1d on MW 1.16 alpha without requiring to change the code as described above. The above may refer to an earlier SmoothGallery version. --G.Hagedorn 13:50, 2 June 2009 (UTC)

Bug in SmoothGallery 1.1e
If no description for an image is provided, and the image comes from a shared repository that uses API connection (such as using images from Wikimedia Commons), then the following code in SmoothGalleryParser fails with a fatal error:

if ( $description == '' ) { // Load the image page from the database with the provided title from the image object $db = wfGetDB( DB_SLAVE ); $img_rev = Revision::loadFromTitle( $db, $title ); // Get the text from the image page's description $description = $img_rev->getText; }

Fatal error: Call to a member function getText on a non-object. (This is bug ) --G.Hagedorn 22:02, 11 June 2009 (UTC)
 * The error was fixed in subversion --G.Hagedorn 15:00, 16 June 2009 (UTC)

Small requests for next version
Make the following gallery options changeable from LocalSettings:
 * 1) "textShowCarousel:" The default is 'Pictures', which makes the extension unusable in other languages. Furthermore, the string may contain placeholders for the number of images. Setting it to '{1} images ({0})' is very useful to inform users on the number of images present
 * 2) Same for "textPreloadingCarousel" (default: 'Loading...')
 * 3) "thumbIdleOpacity:" default is 0.2 which makes the non-active images almost invisible. We would prefer 0.6. This is a matter of taste; it would just be nice to be settable without code modifications.
 * 4) "carouselMaximizedOpacity:" to 1.0. With the default (0.9), high-contrast current images show irritatingly through to the thumbnails.

Furthermore, I have an issue that I would like to call SmoothGallery inside a template, which is possible using the function syntax, but which is very hard for varying numbers of parameters to output the right number of lines. Currently SmoothGallery reacts allergic to empty lines in the list of images. I have patched this by adding in front of $line_arr = preg_split( "/$wgSmoothGalleryDelimiter/", $input, -1, PREG_SPLIT_NO_EMPTY ); in SmoothGalleryParser.php:

// The image array is a delimited list of images (strings) // Normally the list does not contain empty cells, but this is possible when using templates: $input = str_replace($wgSmoothGalleryDelimiter.$wgSmoothGalleryDelimiter.$wgSmoothGalleryDelimiter.$wgSmoothGalleryDelimiter, $wgSmoothGalleryDelimiter, $input); $input = str_replace($wgSmoothGalleryDelimiter.$wgSmoothGalleryDelimiter.$wgSmoothGalleryDelimiter, $wgSmoothGalleryDelimiter, $input); $input = str_replace($wgSmoothGalleryDelimiter.$wgSmoothGalleryDelimiter, $wgSmoothGalleryDelimiter, $input); // Ready for splitting:

This certainly can be written more elegantly. It would be nice if this this could be included in the main code, making SmoothGallery easier to use in templates and also more resistant to users accidentially adding empty lines (perhaps with blanks).

--G.Hagedorn 22:20, 11 June 2009 (UTC)


 * I'll look into adding these changes. The language stuff looks like it would be better suited to be in the .i18n files; then they'd be translated automatically by translatewiki.org. --Ryan lane 21:47, 21 July 2009 (UTC)

Problems with foreign repository, especially wikimedia commons
If multiple images from wikimedia commons are used in a wiki, on the first view(s) to the page with the new gallery the page may not display. Later, the page will display ok. This is probably due to thumbnails being not generated fast enough. The error occurs on "Call to a member function on a non-object" occurs on $full_thumb_obj->getUrl. This can be fixed by adding "&& is_object( $full_thumb_obj )" as shown below:

$full_thumb_obj = $img_obj->getThumbnail( $this->argumentArray["width"], $this->argumentArray["height"] ); if ( !is_null( $full_thumb_obj ) && is_object( $full_thumb_obj ) ) { $full_thumb = $full_thumb_obj->getUrl;

--G.Hagedorn 15:00, 16 June 2009 (UTC)


 * I don't know how to configure foreign repositories, since I have never had a need to. Can you post your configuration so that I can test this? --Ryan lane 16:40, 16 June 2009 (UTC)

Using SmoothGallery in Semantic Templates
Would it be possible to see an example of using SmoothGallery in a Semantic Temaplate that is populated by a Semantic Form? I've been unsuccessful in my attempts to get this to work. I get the correct framework output from the template, but I always get the ''SmoothGallery error:No images were added into the gallery. Please add at least one image.'' error when viewing the page. Many thanks for your help and this spiffy extension. Brian

Working example
This took quite a bit of experimentation on my part but here is a working example that will display the SmoothGallery widget in an infobox-style on the right hand side of the page.

The code below can be placed in your includeonly tags or used by itself. All of the Semantic Properties are defined as data type String. (This is key to getting it right. You may be tempted to use the Page datatype for an uploaded image, but that doesn't work.) The default image defined in the properties makes it easier to debug while building your layouts, but isn't required. Take note that without it SmoothGallery will present an error message due to no images being found.

Thanks for this spiffy extension.

Brian


 * Glad to see you were able to get it working. It is nice to have a semantic example around. Maybe one day I'll get around to making this an results format for semantic mediawiki; it seems like it could be a fairly useful format. --Ryan lane 14:17, 13 August 2009 (UTC)

sgallery Magic Word error
I would love to get this extension working, but keep getting an error, as follows:

I am running MW-1.15.1 and downloaded SmoothGallery-MW1.15-r48763.tar, unpacked that into ..../extensions/ (the contents wanted to go into ..../extensions/SmoothGallery/, but I see most people here put the .php files directly into ..../extensions/, so I followed suit). Grabbed JonDesign's SmoothGallery-2.0.tar and put its contents into ..../extensions/SmoothGallery/. Renamed the 3 filenames per the bug mentioned here above. Using the following syntax in LocalSettings.php:

require_once( "$IP/extensions/SmoothGallery.php" ); $wgSmoothGalleryExtensionPath = "/mediawiki/extensions/SmoothGallery"; $wgSmoothGalleryDelimiter = "\n"; $wgUseImageResize              = true;

...and am getting the following error on any page load:

Magic word 'sgallery' not found

Backtrace:


 * 1) 0 /var/www/html/colorist/wiki3/includes/MagicWord.php(244): Language->getMagic(Object(MagicWord))
 * 2) 1 /var/www/html/colorist/wiki3/includes/MagicWord.php(197): MagicWord->load('sgallery')
 * 3) 2 /var/www/html/colorist/wiki3/includes/parser/Parser.php(4034): MagicWord::get('sgallery')
 * 4) 3 /var/www/html/colorist/wiki3/extensions/SmoothGallery.php(68): Parser->setFunctionHook('sgallery', 'initSmoothGalle...')
 * 5) 4 [internal function]: efSmoothGallery
 * 6) 5 /var/www/html/colorist/wiki3/includes/Setup.php(310): call_user_func('efSmoothGallery')
 * 7) 6 /var/www/html/colorist/wiki3/includes/WebStart.php(129): require_once('/var/www/html/c...')
 * 8) 7 /var/www/html/colorist/wiki3/index.php(42): require_once('/var/www/html/c...')
 * 9) 8 {main}

Thanks in advance for any help. Really hope to use it. Robling 22:45, 26 August 2009 (UTC)


 * Hi, just a thought - Have you got SmoothGallery.i18n.php and SmoothGallery.i18n.magic.php in your extensions directory alongside SmoothGallery.php?
 * Eclecticdave 12:06, 27 August 2009 (UTC)


 * It really is better to let the extension go into a directory called "SmoothGallery". It makes for a far less cluttered extensions directory. Otherwise, for the error, there was an internationalization change made to the extension recently that isn't backwards compliant (1.16+ only). I've asked the person who made the change to do so in a backwards compliant way. I'll let you know when the fix is in. --Ryan lane 14:19, 27 August 2009 (UTC)


 * I cleaned up the install per your suggestion Ryan, everything is in extensions/SmoothGallery now. Is there a chance I could back off to the version before the change you mention?  I'm not sure where to find it.   In case this helps, here's a listing of the files I'm using for the extension:

-rw-r--r-- 1 root root 12005 Aug 26 23:16 SmoothGalleryClass.php -rw-r--r-- 1 root root   278 Aug 26 23:16 SmoothGallery.i18n.magic.php -rw-r--r-- 1 root root 52156 Aug 26 23:16 SmoothGallery.i18n.php -rw-r--r-- 1 root root  9548 Aug 26 23:16 SmoothGalleryParser.php -rw-r--r-- 1 root root  4905 Aug 26 23:16 SmoothGallery.php
 * --Robling 15:39, 27 August 2009 (UTC)


 * You can download the correct version via SVN. The revision you want is 51766:
 * --Ryan lane 17:51, 27 August 2009 (UTC)
 * --Ryan lane 17:51, 27 August 2009 (UTC)


 * grabbed the 51766 per above and am getting a different error:

Detected bug in an extension! Hook smoothGalleryParserOutput failed to return a value; should return true to continue hook processing or false to abort. Backtrace:
 * 1) 0 /var/www/html/colorist/wiki3/includes/OutputPage.php(565): wfRunHooks('OutputPageParse...', Array)
 * 2) 1 /var/www/html/colorist/wiki3/includes/OutputPage.php(573): OutputPage->addParserOutputNoText(Object(ParserOutput))
 * 3) 2 /var/www/html/colorist/wiki3/includes/Article.php(3615): OutputPage->addParserOutput(Object(ParserOutput))
 * 4) 3 /var/www/html/colorist/wiki3/includes/Article.php(979): Article->outputWikiText('{{#Click:http:/...')
 * 5) 4 /var/www/html/colorist/wiki3/includes/Wiki.php(450): Article->view
 * 6) 5 /var/www/html/colorist/wiki3/includes/Wiki.php(63): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
 * 7) 6 /var/www/html/colorist/wiki3/index.php(116): MediaWiki->initialize(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest))
 * 8) 7 {main}


 * thank you for all the help, sorry for the trouble. perhaps I should try yet another version?
 * Robling 00:36, 28 August 2009 (UTC)


 * It's possible I told you the wrong revision. Let me see if I can find you a better one. --Ryan lane 13:47, 28 August 2009 (UTC)

This is fixed now. Please update to the latest version in SVN. --Ryan lane 23:08, 3 October 2009 (UTC)


 * I have still this hooks problem, look at the end of the descussion bellow Extension talk SmoothGallery Magic word sgallery not found. I tried it with SVN 57434 today. Monon 20:33, 6 October 2009 (UTC)

Magic word 'sgallery' not found
I have mw 1.15, downloaded Revision 55676: /trunk/extensions/SmoothGallery, and Jon's Smooth code 2.0 (unzipped to its own directory, with pertinent adjustment made in LocalSettings, i.e. $wgSmoothGalleryExtensionPath = "/mediawiki/extensions/SmoothGallery-2.0"

I also received the message: Magic word 'sgallery' not found. Your help is greatly appreciated - thanks in advance!


 * There is a problem with SmoothGallery and any version of MediaWiki below 1.16 right now. Try revision 51766. --Ryan lane 14:11, 31 August 2009 (UTC)
 * Installed 1.16_alpha (r55738 from Sept. 1 2009) to test SmoothGallery and after getting the wiki working SmoothGallery returns:

Detected bug in an extension! Hook smoothGalleryParserOutput failed to return a value; should return true to continue hook processing or false to abort. Backtrace:
 * 1) 0 /var/www/html/colorist/wiki_test/phase3/includes/OutputPage.php(745): wfRunHooks('OutputPageParse...', Array)
 * 2) 1 /var/www/html/colorist/wiki_test/phase3/includes/OutputPage.php(753): OutputPage->addParserOutputNoText(Object(ParserOutput))
 * 3) 2 /var/www/html/colorist/wiki_test/phase3/includes/Article.php(3935): OutputPage->addParserOutput(Object(ParserOutput))
 * 4) 3 /var/www/html/colorist/wiki_test/phase3/includes/Article.php(1319): Article->outputWikiText(' '''MediaWi...', true, Object(ParserOptions))
 * 5) 4 [internal function]: Article->doViewParse
 * 6) 5 /var/www/html/colorist/wiki_test/phase3/includes/PoolCounter.php(59): call_user_func(Array)
 * 7) 6 /var/www/html/colorist/wiki_test/phase3/includes/Article.php(900): PoolCounter_Stub->executeProtected(Array, Array)
 * 8) 7 /var/www/html/colorist/wiki_test/phase3/includes/Wiki.php(463): Article->view
 * 9) 8 /var/www/html/colorist/wiki_test/phase3/includes/Wiki.php(67): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
 * 10) 9 /var/www/html/colorist/wiki_test/phase3/index.php(117): MediaWiki->performRequestForTitle(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest))
 * 11) 10 {main}
 * Wish I could help out with this, and still look forward to getting SG working on my 1.15.1 production installation.  Robling 02:47, 2 September 2009 (UTC)


 * I don't see how this is possible. What version of the extension are you using when you get this error? I looked at the code, and that hook definitely returns true. Do you have any PHP errors in your error logs?


 * I can't test this right now, but I'll test it soon and try to fix the issues. --Ryan lane 13:43, 2 September 2009 (UTC)


 * I'm using the extension that comes with the MW 1.16 snapshot I grabbed the night of Sep 1. let me see if I can verify the version #..  I'll try to find the log entries.   --Robling 17:29, 2 September 2009 (UTC)


 * the version I'm running, by using the Download Snapshot link on the SmoothGallery extension page, is r55701. SmoothGallery installed per instructions for mootools js filename fixes and relevant lines for LocalSettings.php . Mediawiki version is the build of the night Sep 1, v 1.16, phase3-nightly-r55738 .  PHP error log shows the following:

[03-Sep-2009 19:37:33] PHP Warning: call_user_func_array [<a href='function.call-user-func-ar ray'>function.call-user-func-array</a>]: It is not safe to rely on the system's timezone setting s. You are *required* to use the date.timezone setting or the date_default_timezone_set functi on. In case you used any of those methods and you are still getting this warning, you most likel y misspelled the timezone identifier. We selected 'Europe/London' for 'BST/1.0/DST' instead in / var/www/html/colorist/wiki_test/phase3/includes/Hooks.php on line 133

[03-Sep-2009 19:37:33] PHP Warning: Parameter 2 to smoothGalleryParserOutput expected to be a reference, value given in /var/www/html/colorist/wiki_test/phase3/includes/Hooks.php on line 13 3
 * ...I believe the first error is not related to the extension.  thanks again for the help.  --Robling 18:48, 3 September 2009 (UTC)

In the belief that sometimes it's best to revisit a problem a few days later to get a fresh perspective and start from the beginning; and also in the hope that it might help Ryan, I documented the error output of two different installations of SmoothGallery and MW as noted at http://www.colorist.org/wiki3/index.php/SmoothGallery_error  --Robling 20:02, 9 September 2009 (UTC)

I am unfortuately experiencing the same error ("Hook smoothGalleryParserOutput failed to return a value") after a fresh installation of MW1.15.1, and the SmoothGallery Extension (trunk-r56856 as well as MW1.15-r48763).--Michip 07:49, 30 September 2009 (UTC)

Please let me know if you get it working, I'm still in the same position as of 9 September. thanks. --Robling 18:46, 30 September 2009 (UTC)

The error is related to PHP 5.3, I have a similar problem since I upgraded my server to php5.3. I had PHP5.2.9 before and it was working fine, after the upgrade most of my extensions dont work. Warning: Parameter 2 to smoothGalleryParserOutput expected to be a reference, value given in ...\includes\Hooks.php on line 117 After setting "$wgShowExceptionDetails = true;" I got this:

Detected bug in an extension! Hook smoothGalleryParserOutput failed to return a value; should return true to continue hook processing or false to abort. Backtrace: Look here: Hooks not working for PHP 5.3.0 Monon 14:41, 2 October 2009 (UTC)
 * 1) 0 ...\includes\OutputPage.php(565): wfRunHooks('OutputPageParse...', Array)
 * 2) 1 ...\includes\OutputPage.php(573): OutputPage->addParserOutputNoText(Object(ParserOutput))
 * 3) 2 ...\includes\Article.php(3615): OutputPage->addParserOutput(Object(ParserOutput))
 * 4) 3 ...\includes\Article.php(979): Article->outputWikiText('<div style="mar...')
 * 5) 4 ...\includes\Wiki.php(450): Article->view
 * 6) 5 ...\includes\Wiki.php(63): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
 * 7) 6 ...\index.php(116): MediaWiki->initialize(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest))
 * 8) 7 {main}

Links in description not working
Hi, after following the installation procedure and fixing filenames and bugs, I had this extension working in 15 minutes or so. So very stable and reliable extension. Everything appeared to working ok.

BUT then i noticed something... my links in my image descriptions are not working.

I have for example: Image:78569l.jpg|View from the summit of Mont Durand with the Obergabelhorn in the back. The col between is the Arbenjoch. Which leads to a description 'View from the summit of Mont Durand with the in the back. The col between is the .' It seems that linked words are just skipped, which is rather odd, as the link to the file title is working ok. Is there a reason why the links in the description are not working? or is it just not implemented yet?

An example is here: http://www.mountwiki.com/wiki/view/Mont_Durand?section=7#Additional_photos


 * It is implemented, and should be working. Honestly though, I've always had issues with the image descriptions. If you happen to fix it before I get a chance. I'd love to get a patch. --Ryan lane 17:09, 9 September 2009 (UTC)


 * Can you tell us what version of Mediawiki you're running, and which version of the extension?  Robling 18:22, 9 September 2009 (UTC)
 * Answering my own question, I see it's MW 1.12 and 1.1f.  Robling 18:37, 9 September 2009 (UTC)


 * Is it possible that using 1.1e of 1.1d would fix this problem? -78.22.168.161 18:52, 9 September 2009 (UTC)
 * Apparently 1.1d does not fix it... And i cannot get a 1.1e version? Is it somewhere floating around on the web? -78.22.168.161 19:15, 9 September 2009 (UTC)


 * The only way to get 1.1e is by rummaging through the SVN server to find the right revision, and downloading that revision. Needless to say, you are generally supposed to use the newest version of the plugin; except right now it is broken. --Ryan lane 19:25, 9 September 2009 (UTC)


 * I tested 1.1f to 1.1b and all are showing it incorrect. My only guess is that it has something to do with my MW version? Too bad as i was really looking forward to using this gallery -78.22.168.161 20:22, 9 September 2009 (UTC)


 * Noone an idea on how to fix this? -157.193.89.172 13:37, 15 September 2009 (UTC)

Setting a Default Image
Hi Ryan,

I have a need to display a default image when no images have been added to a gallery, instead of the standard "No images were added into the gallery..." error message. This need arose from using the extension in a template used in a semantic form on my site, SC Dimensions. (I documented the template code above.) Click on one of the cars in the Latest Changes list to see it in action. I originally used the default value feature of the semantic property, but if a user didn't supply an image for each one of the fields then the default image would be displayed in the carousel. I suppose I could have solved this with some really ugly template parser code, but I thought it would be much easier to simply declare a default image to be used when the carousel is empty in my LocalSettings.php file.

In order to achieve this goal I added the following code to the parseGallery function in the SmoothGalleryParser.php file immediately following the line where the delimited image list is split into an array of image names. (At or around line 123)

// Add a default image if no image names have been provided and one is assigned if ((count($line_arr) == 0) && (strlen($wgSmoothGalleryDefaultImage) > 0)) {''' $line_arr[]=$wgSmoothGalleryDefaultImage;''' }

I also created a new global setting called $wgSmoothGalleryDefaultImage which I initialize on line 61 of SmoothGallery.php and then reference at line 116 of SmoothGalleryParser.php, after the other global declarations.

So now the first ~20 lines of the function parseGallery look like this:

function parseGallery( $input, $parser ) { global $wgTitle; global $wgSmoothGalleryDelimiter; global $wgSmoothGalleryAllowExternal; global $wgSmoothGalleryDefaultImage; $galleryArray = Array; // Expand templates in the input $input = $parser->recursiveTagParse( $input ); // The image array is a delimited list of images (strings) $line_arr = preg_split( "/$wgSmoothGalleryDelimiter/", $input, -1, PREG_SPLIT_NO_EMPTY ); // Add a default image if no image names have been provided and one is assigned if ((count($line_arr) == 0) && (strlen($wgSmoothGalleryDefaultImage) > 0)) { $line_arr[]=$wgSmoothGalleryDefaultImage; }    foreach ( $line_arr as $line ) { ...

Now I can declare $wgSmoothGalleryDefaultImage = 'some_default_image_name'; in my LocalSettings.php file and it will be displayed when users haven't provided any images for the carousel associated with an article. 'some_default_image_name' is the title of an image in my File namespace. On my wiki it is named 'default_image.jpg'.

I hope this small change helps a few people with their wikis that use your great extension. Perhaps you might consider adding this functionality to the official extension?

Best regards, Brian

Random Image Carousel Example
I wanted to add a random image carousel to the homepage of my wiki. SC Dimenensions After experimenting with a couple of random content extensions that didn't quite meet my needs I decided to put two extensions together: DPL and SmoothGallery. The example below shows how to create a random image SmoothGallery by leveraging the DPL extension's ability to retrieve a random list of image names from a specified category in the correct format for SmoothGallery's imagelist parameter.

In a nutshell, the DPL extension is configured to look in the File namespace and return image names in the Slot Car Image category. It will return up to 500 images (count=500 parameter) and then select 10 random names from those 500. (The randomcount=10 parameter) The randomseed value provides a new seed every time the page refreshes to avoid repeating the group of images. You can seed this with a Ymd argument to get a new seed value every day, which would provide a new list of images each day instead of on each page refresh. The escapelinks=true paramenter prevents the image category from being pulled into the page on which you have placed the SmoothGallery code. The format argument creates the list of file names that is returned to the imagelist parameter. A note of caution: The description that follows the | template call seems to be necessary or else weird things happen on the page. You don't have to display it, but something seems to need to be there or content gets jumbled.

Simply installing the DPL extension and copying and pasting the code above should work for you as long as you adjust the category name for one that exists in your wiki. Visit the DPL extension page for more info on that extension.

Hope this helps some folks who are working with this great little extension.

Brian

Passing file names as parameters in a template
Building a template to enable graphics (i.e. - Test.png) file names to be passed in SmoothGallery functionality as a parameter. Receive an error - ''moothGallery error:No images were found in this gallery. Make sure all images requested exist. The following images were not found: S''

Does anyone have experience passing image file names in template parameter?

Template code: This is the 'Briefing Tag Box' template. Each parameter represents: - Title of the Tag Cloud - Name of Presentation - Height of the presentation - Width of presentation - Image file - Image file It should be called in the following format:

Edit the page to see the template text.

MW tag corruption
This is a very slick extension. Thank you very much for you contributed efforts...but I have a functional issue. :)

I have installed SmoothGallery-2.0 and SmoothGallery-trunk-r58688.tar.gz and MediaWiki 1.15.1. The the sgallery displays fine and seems to be fully functional. (yeah!) Unfortunately, there is odd character garbage on all of the section titles (tag?) in the window for the page with an sgallery embedded. Here's an exmaple:

The source:

Validation Tests
The display: UNIQ69451f064e42a89e-h-0--QINUValidation Tests

The corruption is to all of the selectioning on the page, but goes away as soon as I remove the sgallery.

Do you have any suggestions? One of the particulars of my set-up is that the Wiki is running HTTPS (secure sockets)---don't think that should matter.

One last piece of info, the number after the "h-X" increments by 1 for each heading and the "UNIQ" garabage stays the same. Perhaps an issue with Wiki section numbering?

Thanks.


 * I experienced the same. It happens when using . REX 23:38, 19 November 2009 (UTC)


 * Wow. The info pane is nice, but I'm more than happy to turn it off since (as I've confirmed) it fixes the tag corruption on the page. Thanks Rex for the tip. &mdash; squeen 11:35, 20 November 2009

Category included
Hi, how to prevent the image categories from included? It seems that  always included the category of the last image, even if I use   tag. REX 00:03, 20 November 2009 (UTC)

Help! Just can't get this working!
Hi. I'm running MW 1.15.1, Smooth Gallery 2.0 and version 1.1g of this extension. I'm using the Monobook skin. I've applied the javascript name changes. I have te SmoothGallery 2.0 code in the same folder as the extension code. In Localsettings.php I have the following: require_once( "$IP/extensions/SmoothGallery/SmoothGallery.php" ); $wgSmoothGalleryExtensionPath = "/mediawiki/extensions/SmoothGallery"; $wgUseImageResize=true; $wgSmoothGalleryDelimiter = "\n"; In my page I have:

What I get is the first image showing at 640x480 with the text "Image1.png" above it, but I don't get a slideshow of the the images. It stays stuck on the first image. All the images exist. Neither do I get the arrows, carousel or info panel. What am I doing wrong? Any ideas? Thanks mitchelln 15:38, 11 February 2010

Smooth Gallery 2.0 Error
Ryan, I am at loss at what to do because I have followed your instructions and I get an graphic error when I use your gallery. I see a link of the pic above the main pic then I see a TINY pic below it. Here are the steps I did, perhaps I did something wrong, Downloaded JonDesign's SmoothGallery 2.0 and unzipped it into a folder in my wiki/extensions/SmoothGallery Renamed the Javascript files Downloaded the extension snapshot 1.15 and unzipped it to wiki/extensions/SmoothGallery folder Performed the bugfixes Added to LocalSetting.php require_once( "$IP/extensions/SmoothGallery/SmoothGallery.php" ); $wgSmoothGalleryExtensionPath = "/mediawiki/extensions/smoothgallery"; $wgSmoothGalleryDelimiter = "\n"; Got an error for Fatal error: Unsupported operand types in /home/dclaughton/test.encoresoup.net/includes/parser/LinkHolderArray.php on line 33 So followed the bug fix for it which was comment out all references to $local_parser from SmoothGalleryParser.php So where did I go wrong??

Thanks Allen February 13, 2010

It doesn't work for me
Hi,

I've this setup: MediaWiki 1.15.1 PHP      5.3.1 (apache2handler) MySQL    5.0.51a-24+lenny3-log SmoothGallery 1.1c beta

Image:botrugno_marchesale13.JPG Image:botrugno_marchesale14.JPG

I've done all the installation procedure but it would not show any images. No errors or exceptions. 

what's the problem? please help me, thank you very much for all. enrico

I read that you need this

botrugno_marchesale13.JPG

botrugno_marchesale14.JPG

ie no image or file