Textpattern CMS support forum

You are not logged in. Register | Login | Help

#51 2008-05-08 18:35:02

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,458
Website

Re: smd_gallery: super-flexible gallery generator

fangonk wrote:

Is this question really unclear?

Currently, for my puny brain, I’m afraid the answer is yes :-s Is it related to your other post?

a whole bunch of little thumbnails that when clicked open up a larger version.

By “open up”, what do you mean? Popup the full size image in a new window? Or populate a div with the fullsize version of the clicked thumb (like rss_thumbpop)? Or something else? The answer to that will dictate how the gallery form and tag are used.

When I use the {url} tag, the plugin always outputs a link to the thumbnail and if I removed thumb=“1” in the template, the plugin always outputs the full size image on the thumbnail page.

You did remember that the thumb option has changed in the latest release to work like smd_slimbox. i.e. using thumb="1" (equivalent to thumb="1:1") will tell the plugin to use the ‘t’ image for both fullsize and thumbnail. Omit it (or use thumb="0:1") for conventional operation — the 1st number specifies whether to display a thumbnail for the fullsize image, and the 2nd number is whether to display thumbnails in the thumb gallery. 0 = no; 1= yes.

If you can give a little more detail about how you want the images displayed/laid out (and/or send me a link to the work in progress site if you like) I can take a look and see if we can work out a way of doing what you want. If you’re handy with Photoshop or Paint, sketch what you want the site to behave like and we’ll go from there ;-)

EDIT: btw, look at the {thumburl} replacement tag instead of the {url} tag to show the thumb’s URL!

Last edited by Bloke (2008-05-08 18:38:10)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#52 2008-05-09 10:38:53

fangonk
Member
Registered: 2007-07-12
Posts: 44

Re: smd_gallery: super-flexible gallery generator

Sorry to bother you man, it was just a middle-of-the-night-nothing-is-working freak out. I couldn’t figure out how to get individual articles to fire using a form. Which, as I now realize is way more of a textpattern problem. Either way, I’ve got everything working now and I might just make my deadline. Thanks for taking the time to answer me, I’ll try not to leave any more annoying too-much-coffee questions. I really appreciate your patience.

Offline

#53 2008-05-09 11:03:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,458
Website

Re: smd_gallery: super-flexible gallery generator

fangonk wrote:

I’ll try not to leave any more annoying too-much-coffee questions. I really appreciate your patience.

Hey no probs. Glad you got it working. And there’s no need to apologise for posting; I learn stuff about how to use TXP (and often my own plugins!) from people posting stuff just like you did. It’s all good.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#54 2008-05-11 20:57:10

rloaderro
Plugin Author
From: Costa Rica
Registered: 2006-01-05
Posts: 190
Website

Re: smd_gallery: super-flexible gallery generator

Slightly OT: just a message to let anyone who’s interested know that Slideshow 2 has officially been released!

The existing slideshow plugin – aro_slideshow – will be discontinued because the script should work perfectly with smd_gallery. If anyone gets a chance to try it out, let me know how it works. There is also a demo site up showing off some of the new features.


Travel Atlas * Org | Start Somewhere

Offline

#55 2008-05-11 21:03:21

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,458
Website

Re: smd_gallery: super-flexible gallery generator

rloaderro wrote:

Slideshow 2 has officially been released!

Way cool, thanks for the notification. When I get a chance I’ll give it a whirl. If there’s anything you (or anyone) can think of to make it work better/more efficiently with smd_gallery please holler. smd_gallery doesn’t have the “all-in-one” ease of use of aro_slideshow so it’ll be interesting to see how this develops.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#56 2008-05-21 17:32:03

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,201
Website

Re: smd_gallery: super-flexible gallery generator

Bloke>
So here’s a challenge for you nyuk, nyuk, nyuk….

I have a banner that has three parts ( square image [thumb] | wide image [image] | square image [thumb] )

Requirements

  1. I want to turn it into three slideshows that operate at different speeds
  2. each slideshow dips from the same massive pool of images
  3. each slideshow must start with a different image

That’s it! I figure that if your plugin can’t help achieve this it can’t be done.

So essentially there’d be three calls to the slideshow script at different speeds drawing randomly from a common pool, but starting with a unique image…

Go go gadget brain.

Offline

#57 2008-05-21 17:40:08

jelle
Member
Registered: 2006-06-07
Posts: 165

Re: smd_gallery: super-flexible gallery generator

Hy mrdale,

I think that if you combine smd_gallery with some jQuery magic it’ll work.
Check out the Animated Innerfade plugin for jQuery:
http://www.openstudio.fr/Animated-InnerFade-with-JQuery.html?lang=en

Last edited by jelle (2008-05-21 17:40:37)

Offline

#58 2008-05-21 18:07:15

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,159
Website

Re: smd_gallery: super-flexible gallery generator

If each start image just needs to be different but doesn’t have to be random you can hard code the first image of each sequence and use smd_gallery to generate the remaining html list of images to be referenced. Then use a script like jelle suggests.

second idea: thinking aloud here, I suppose you could call smd_gallery twice for each series of images, once for the first image and once for the remaining images. If you can restrict the random selection using offset/limit then you could make the start item of the first slideshow select a random image from images 1-3, the start item of the second a random image from images 4-6, the third start item a random image from images 6-9… lots of queries…

last idea: write a mini script to select three random numbers and check they are unique (can’t be too complex). Then use these for your three start items. Do the remaining images with smd_gallery.

Last edited by jakob (2008-05-21 18:07:42)


TXP Builders – finely-crafted code, design and txp

Offline

#59 2008-05-21 18:50:06

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,201
Website

Re: smd_gallery: super-flexible gallery generator

Thanks jelle and jakob.

I’m going to be using slideshow by aeron (rloaderro)

probably going to manually call the script.

Offline

#60 2008-05-21 21:42:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,458
Website

Re: smd_gallery: super-flexible gallery generator

Dammit, trust you to find the limit of the plugin :-p

My take on this would be to drop back into PHP and do something like this (semi-untested) :

<txp:php>
$rs = safe_column("id", "txp_image", "category='your-chosen-category'");
$chosen = array_rand($rs,3);
for ($idx = 0; $idx < 3; $idx++) {
  $gal = array($chosen[$idx]);
  shuffle($rs);
  foreach ($rs as $row) {
    if ($row != $chosen[$idx]) {
      $gal[] = $row;
    }
  }

  $gal = join (",", $gal);
  $galNum = ($idx%2)+1;
  $ctr = $idx+1;
  echo smd_gallery(array(
    "id" => $gal,
    "form" => "galPart$galNum",
    "sort" => "fixed",
    "combo" => "uniq:$ctr",
    "collate" => "quote:{thumbdef}:{imagedef}:{alt}",
  ));
}
</txp:php>

That grabs the image IDs of all the pics in your pool, picks 3 at random, makes up 3 arrays from the shuffled IDs, making sure the 1st item is the one chosen at random and the rest follow without duplication. Then it makes the call to smd_gallery and tells it to use the list of IDs and keep the sort order fixed (since we’ve already shuffled them for each gallery).

Then proceed as per the slideshow example and make 2 forms (galPart1 and galPart2) to hold your thumb and image slideshows respectively. You’ll need some jiggery pokery to make sure the slideshows get unique IDs (hence the combo definition). So your galPart1 form might look like this (based on slideshow v1; not looked at v2 syntax yet) :

<div class="slideshow" id="slideshow{uniq#1}">
 <img src="<txp:site_url />images/{id#1}.jpg"
     alt="{alt#1}" width="{width#1}" height="{height#1}" />
</div>

<script type="text/javascript">
myShow1 = new Slideshow("slideshow{uniq#1}",
  { hu: "<txp:site_url />images/",
    images: [{thumbdef}],
    captions: [{alt}],
    classes: ["prev","next","active"],
    type: "fade"
  });
</script>

galPart2 is the same but with the {imagedef} replacement tag.

OK, it’s not quite the all-in-one you had hoped but it should work.

EDIT: Haven’t taken into account the different speeds but that’s down to slideshow, right? You could pick a random number between some upper and lower limit and assign it as a combo for use in the slideshow form?

Last edited by Bloke (2008-05-21 21:46:45)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB