Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#349 2009-02-13 15:30:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_gallery: super-flexible gallery generator

Oh, duh, sorry. You also need to put the two lines (probably immediately) beneath the “RewriteEngine On” line ;-)


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

#350 2009-02-13 15:32:33

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: smd_gallery: super-flexible gallery generator

Bloke:

Same error:

I am using the following file:

——————————-

#DirectoryIndex index.php index.html

#Options +FollowSymLinks
#Options -Indexes

<IfModule mod_rewrite.c>

RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.progressivetechnology\.net$ [NC,OR] RewriteRule ^(.*)$ http://progressivetechnology.net/$1 [R=permanent,L] #RewriteBase /relative/web/path/

RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]

RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*) index.php

RewriteCond %{HTTP:Authorization} !^$ RewriteRule .* – [E=REMOTE_USER:%{HTTP:Authorization}]

</IfModule>

—————————

#php_value register_globals 0

Offline

#351 2009-02-13 15:34:27

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: smd_gallery: super-flexible gallery generator

Bloke:

I also found this on the web , which I thought would be useful but can’t seem to get any of the combinations top work. Arg.

Offline

#352 2009-02-13 15:45:38

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_gallery: super-flexible gallery generator

progre55 wrote:

Same error:

Weird. Works on my installs. You could try this one which I’ve also used, but don’t ask me what it does:

RewriteCond %{HTTP_HOST} www\.your_site\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{REQUEST_URI} ^($|/.*$)
RewriteRule ^.* http://your_site.com%1 [R=permanent,L]

btw, it’s defintiely not a cache issue is it? I know Firefox is a bugger for cacheing bad requests and timeouts and you think it’s not fixed, when it really is.

I also don’t know what the ,OR directive does in the 1st example I gave. Could try removing it? *stabs in the dark*

Past that, I’m at the end of me tether. mod_rewrite is not my core competence (nowhere close!) I just rob rules from other people’s blogs and tweak them until the server stops giving Internal Server Error or Redirect Loop messages. Sorry I can’t be of any more use here; you need a Real Engineer :-)

Last edited by Bloke (2009-02-13 15:45:57)


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

#353 2009-02-13 16:06:21

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: smd_gallery: super-flexible gallery generator

Bloke:

I see now how you operate. Get me to think that I have finally found a problem that you cannot overcome (with the “Real Engineer :-) ) comment and then when I try your last ditch effort code thinking there is now way it is going to work … bam … it does the trick :)

Again, I greatly appreciate the assistance.

progre55

Offline

#354 2009-02-13 17:07:59

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_gallery: super-flexible gallery generator

Finally (fanfare): the big update I’ve been promising.

smd_gallery v0.5 | compressed

Features:

  • Requires smd_lib 0.34
  • Added MLP support (the shine only slightly lost by the fact that MLP doesn’t completely work under 4.0.8 and net-carver’s no longer patching)
  • Works with uncategorised images via SMD_EMPTY
  • ‘?’ vars expanded to link / image / file / <txp:variable /> and URL variable
  • New attributes: escape, html_id, format, gmt, lang, strictfields, columns
  • Improved {object} support and added objectform
  • {title} == {caption} (Yay!)
  • Native support for table extensions (such as cno_image_order)
  • Added smd_every syntax to onchange
  • Fixed offset bug

Apologies for the long delay. After all the work net-carver did fixing up MLP to work with my complicated queries, I went and changed them yesterday, which meant all the code he did stopped working :-( Ooops. The original approach Steve took wasn’t going to be viable under these new queries, so I spent parts of today trying to figure out how to do what MLP does so I could replicate it directly in the plugin.

The downside is that if the functions I use in MLP change in future, this plugin might die under an MLP install. The good news is that the functions I’m using are so deeply ingrained in the way it works that it’s a lot of hassle to change them so we’re safe for now :-)

Anyway, have at it and let me know how you get on.

P.S. Happy Birthday smd_gallery for tomorrow :-D

Last edited by Bloke (2009-02-13 20:47:46)


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

#355 2009-02-14 04:40:06

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: smd_gallery: super-flexible gallery generator

Hi Bloke,

thanks for the update! I will be testing the new version asap.

Do you think the new escape option (haven’t checked it yet, don’t know what is it) would be helpful in this smd_if situation?

BTW, a link to smd_lib somewhere in the first post thread would have been helpful. I’ve had to ask Mr. Google about where to find that plugin ;)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#356 2009-02-15 21:06:56

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_gallery: super-flexible gallery generator

maniqui wrote:

thanks for the update! I will be testing the new version asap.

No probs. Hope you like it. 90% of the new attributes were written for you :-D

Do you think the new escape option… would be helpful in <snip>

Yes. But that actually should have been fixed by me as a matter of routine when I updated the plugin. I’ll try and remember to fix it properly in the next revision. For now, the escape attribute’s default behaviour will mask the problem and make it seem like there’s nothing wrong!

a link to smd_lib somewhere in the first post thread would have been helpful

Done. Google probably won’t have helped much, since they are still insisting my site is unreachable due to a ‘DNS Issue’, when all other sites I own (hosted on the same server!) are all fine. Plus, all the links the googlebot is displaying “unreachable” in the webmaster control panel are clickable and take me straight to the correct page :-S

P.S. until I posted this, our forum post counts were identical at 1780 each. Spooky!

Last edited by Bloke (2009-02-15 21:07:58)


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

#357 2009-02-19 10:45:53

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: smd_gallery: super-flexible gallery generator

Stef,
again a big thanks for your wonderfull plugins !

Question : To test a gallery, I put 4x the same thumnail id, and the plugin give me only 1 thumbnail : normal ? bug ?

Offline

#358 2009-02-21 08:23:43

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_gallery: super-flexible gallery generator

jpdupont wrote:

To test a gallery, I put 4x the same thumnail id, and the plugin give me only 1 thumbnail : normal ? bug ?

Normal: it only pulls out unique images and discards duplicates.
Bug: depends on whether you actually want to show the same images in a real-life situation! Do you?


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

#359 2009-02-21 17:15:33

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: smd_gallery: super-flexible gallery generator

Hi Stef,

I’ve upgraded to 0.5, and there seems to be a bug that wasn’t there on 0.46.
And it seems to be related somewhat to MLP.
Let me explain:

I’ve a simple photo-gallery, which is rendered on an individual article URL (/en/section/photo-gallery/, /es/section/galeria-de-fotos).

Using smd_gallery 0.5:

On /en/section/photo-gallery, everything works fine, as expected, and as in 0.46.
But on /es/section/galeria-de-fotos, some pictures get duplicated on the output.

Using smd_gallery 0.46, both galleries (which are, btw, rendered by the exact same code) work as expected: no duplicate output.

For your reference, the code is:

<div class="article panel photo-gallery">  
  <h2><span><txp:title /></span></h2>
  <txp:smd_gallery category="habitacion,comodidades" sort="fixed">
  <txp:smd_if field="{counter}" operator="eq" value="1">
    <div class="photo-row">
  </txp:smd_if>

  <txp:upm_image image_id="{id}">
    <txp:variable name="alt" value="{alt}" />
    <div class="image">
      <a rel="lightbox-gallery" href="{url}" title="{caption}">
       <txp:thumbnail id="{id}" />
     <txp:if_variable name="alt" value="">
     <txp:else />
       <small><txp:upm_img_alt/>.</small> 
     </txp:if_variable>
    </a>
    </div>
  </txp:upm_image>

  <txp:smd_if field="{counter},{counter},{counter}" operator="divisible,not,not" value="3,1,{maximages}">
    </div>
    <div class="photo-row">
  </txp:smd_if>
  <txp:smd_if field="{counter}" operator="eq" value="{maximages}">
    </div>
  </txp:smd_if>
  </txp:smd_gallery>
</div><!-- .article.panel -->

Don’t be scare by the complexity of the code.
It’s just that complex because it has the ability to output rows of images :D
But the complexity is not related at all ( I hope) with the issue I’m having.

Important:

The weird thing is that not every image is being duplicated, but just the images belonging to “comodidades” category (and, I repeat, just on the spanish version).

Stef, tell me if you need more info or would like to take a look to the site.

Edit: in the code above I’m using {caption} (0.5+) but for 0.46 I’ve used {title} (just to discard this could have something to do with the issue)

Last edited by maniqui (2009-02-21 17:34:39)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#360 2009-02-21 18:57:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_gallery: super-flexible gallery generator

maniqui wrote:

on /es/section/galeria-de-fotos, some pictures get duplicated on the output… just the images belonging to “comodidades” category

That does sound very odd indeed. Hope it’s not a bug, but as I mentioned above in the release post, the good work that Steve did to completely rewrite the MLP engine for me to handle joins was (slightly) in vain because I had to subsequently rewrite my own plugin queries from scratch in order to cater for being able to pull out images from unassigned categories. The complete rewrite of the queries and the fact I am (essentially) trying to emulate what MLP does natively means I may well have stuffed up the query.

First thing’s first. Add debug="1" to the tag and let me know the SELECT DISTINCT * FROM... line for both the English and Spanish galleries. That should allow me to see if the query is being generated correctly.

Second port of call is to increase the debug level (to 2 I think, though it might be 3) and let me see which rows are being extracted. That might be a little bit too much info to post on the forum so you could either e-mail me that output, or let me have a site login if you don’t mind and I’ll see if I can find what the problem is.

Thirdly, plase check and double check the category assigment for each language. Are the category names (not titles) altered by MLP? I can’t remember if they are set per language or not. If so, that may well be it because MLP might be translating the category names into Spanish but my plugin won’t do that. Perhaps it is pulling out images from the English version but assigning the Spanish translations and when the two don’t match it is getting confused? (unlikely, but it’s worth checking)

The final diagnostic is to run the query itself in rss_db_admin_manager or phpMyAdmin and try to figure out why the it’s working for English but not Spanish.

If it’s a bug I apologise in advance. I tested it as much as could with MLP and it pulled out what I expected. A puzzler.

Last edited by Bloke (2009-02-21 19:00:03)


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