Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[archived] jmr_gallery : Article Associated Image Gallery
Notice: This thread is archived, this plugin is no longer available.
**********************************************************
The textpattern world probably doesn’t need another one of these but it works great for me so I’d though I’d share.
Plugin
jmr_gallery
Usage
There are two ways to use this:
1) <code><txp:jmr_gallery category=“some_category”/></code>
This will simply pull in all the images files in “some_category
Last edited by jmrhoades (2004-09-28 03:14:25)
Offline
#2 2004-09-28 07:31:31
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: [archived] jmr_gallery : Article Associated Image Gallery
This is going to sound silly, but how do I find out the article number?
Offline
Re: [archived] jmr_gallery : Article Associated Image Gallery
> lee wrote:
> This is going to sound silly, but how do I find out the article number?
Well, in clean mode, my urls look like this:
<code>http://www.jmrhoades.com/archive/4/trackin-machine</code>
the “4” after archive tells me that it’s article 4. Then I simply make an image category called “article-4”, put my pictures in there, and then I’m all set. Hope that clairifies things.
Offline
Re: [archived] jmr_gallery : Article Associated Image Gallery
Works very well, thanks for the effort!
A beautiful designed personal webpage, btw, all my best from Berlin to Japan!
http://ww.spreeblick.de, a weblog from Berlin
Offline
Re: [archived] jmr_gallery : Article Associated Image Gallery
OK, I have a problem. Some of the code in my default page:
<pre>
<txp:mdn_if_section section=“article”>
<txp:jmr_gallery />
<txp:article />
</txp:mdn_if_section>
</pre>
I have an image category named article-1 (and -2, -3 – just three test articles) and I’ve uploaded single image+thumbnail for each of those categories.
The thing is the code above does not output the “gallery”, just the “article”. Also tried <code><txp:jmr_gallery category=“article-1”/></code> – no effect. Where should I be looking for potential problems?
Last edited by Boby Dimitrov (2004-09-29 14:40:23)
Offline
#6 2004-09-29 20:07:19
- heikki74
- Member
- From: Finland
- Registered: 2004-08-17
- Posts: 100
Re: [archived] jmr_gallery : Article Associated Image Gallery
Hi!
I had the same problem, no images visible. I have the newest version of txp (revision 35).
I got it working by modifying plugin code this way
line 3: global $pretext,$img_dir, $thisarticle;
to: global $pretext,$img_dir, $id; //$thisarticle;
line 9: $category = ‘article-’ . $thisarticle[‘thisid’];
to: $category = ‘article-’ . $id; //$thisarticle[‘thisid’];
line 25: “select * from txp_image”,
to: “select * from (yourtableprefix_)txp_image”,
I couldn’t see ‘thisarticle’ global variable anywhere and the only variable that showed the current article number was called ‘id’. Maybe there has been some changes in txp variables? Line 25 assumed that there is no table prefix. In my first try the plugin was trying to display images from other installation of txp. Now it works great.
Last edited by heikki74 (2004-09-30 04:54:47)
Offline
Re: [archived] jmr_gallery : Article Associated Image Gallery
Is the problem noted above the reason that clicking “next image” drops me back out into the top level of the section?
NOTE: the following problem has been fixed and the links no longer do anything interesting. I’ll keep the message around for anyone else who has the same sort of problem.
{
Here’s the article page, with the first image displaying as one would hope: secretplans.org/Journal/71/letterpress-with-pictures, but the link to “next image” points here: http://secretplans.org/Journal?imagenum=2 rather than at an article URL.
Manually entering http://secretplans.org/Journal/71/letterpress-with-pictures/?imagenum=2 works just fine.
}
This is a very cool plugin — the article association is nicely done. Now if I can just get it to work…
Last edited by Matt (2004-11-10 00:24:38)
Offline
#8 2004-09-30 04:24:57
- heikki74
- Member
- From: Finland
- Registered: 2004-08-17
- Posts: 100
Re: [archived] jmr_gallery : Article Associated Image Gallery
Lines 64 and 65 in the plugin code define link urls.
.. href=”’ . str_replace(‘//’,’‘,$_SERVER[‘PHP_SELF’] . ‘?imagenum=’) ..
.. href=”’ . str_replace(‘//’,’‘,$_SERVER[‘PHP_SELF’] . ‘?imagenum=2’) ..
Because the ?imagenum-part comes out correctly, the problem must be in $_SERVER[‘PHP_SELF’] ? Perhaps you could add temporary line to output just that to see if it is the problem.
Offline
Re: [archived] jmr_gallery : Article Associated Image Gallery
heikki74, thanks for the tip, but I’m more willing to wait for the author of the plugin to update it to a working version. I’m using clear TXP RC1, btw…
Matt, at least you made it display the images! :) Seems like your is similar – broken plugin code :)
Offline
#10 2004-09-30 10:36:20
- heikki74
- Member
- From: Finland
- Registered: 2004-08-17
- Posts: 100
Re: [archived] jmr_gallery : Article Associated Image Gallery
You’re welcome.. the tip was for author as well. Great plugin.
Does anyone know if there is documentation about Textpattern global variables etc? I hate that i have to guess so much.
Offline
Re: [archived] jmr_gallery : Article Associated Image Gallery
I just hacked my way out of the “next” and “previous” problem I mentioned above.
For every line that builds a link URL, I have pasted the following code between <code>…[PHP_SELF]’</code> and <code>?imagenum=…</code>:
<code> . “/”.$thisarticle[‘thisid’].”/”.’</code>
Now the links are aware of what article they belong to, and no longer output the section.
Last edited by Matt (2004-10-15 20:15:05)
Offline
Re: [archived] jmr_gallery : Article Associated Image Gallery
I think this is the best damn thing since sliced bread.
Offline