Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#271 2006-02-04 14:03:54
- MrsAgentSmith
- New Member
- From: Japan
- Registered: 2006-02-04
- Posts: 2
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
Thanks for the awesome plugin. I am replying really quickly as I have been having the same problem as nardo, bloke, et. al. with the usearticle and catfield attributes.
For your reference I’ve included the tag I was trying to create —
<code> <txp:rss_thumbpop mode=“table” orderby=“date asc” showcaption=“0” showalt=“0” divpop=“1” cols=“5” showfullcaption=“1” clickonly=“0” usearticle=“1” catfield=“ImageCat” /></code>
- if you put attributes (and others like clickonly — didn’t test them all tho) in front of “mode” funny things begin to happen.
- for me when I put usearticle / catfield in front of “mode” the (div)pop images will not show but I will get the thumbs… all of them
Last edited by MrsAgentSmith (2006-02-04 15:17:25)
Offline
#272 2006-02-08 05:53:04
- theonlydrew
- Member
- Registered: 2006-01-10
- Posts: 21
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
Strange Behavior.
I did get the usearticle/catfield to function. Kind of. It kept showing images from all my categories, and not the one designated in catfield=“custom_field”. So, after playing around I found out that when I made showpagelinks=“0” then the appropriate images from the designated category in my customfield showed! And no other images from any other categories! Woopee! Hoorah! BUT, theres always a but, while looking at the page in debug mode I noticed that there was a tag error:
————
tag_error {txp:rss_thumbpop mode=“table” usearticle=“1” catfield=“custom_9” limit=“8” orderby=“datedesc” pagepop=“1” showpagelinks=“0” cols=“4” showcaption=“0” padwidth=“50” padheight=“50” label=“Images” /} -> Notice: Undefined variable: numPages on line 194
————
Wierd, huh? But if I made showpagelinks=“1”, then no tag error, but then every image from all categories would display!
So, you can see my current tag in the tag error above. I’d like to work this problem out with some folks, but I’m not much of a coder.
Last edited by theonlydrew (2006-02-08 05:56:22)
Offline
#273 2006-02-11 23:02:31
- panik
- Member
- From: Bonn, Germany
- Registered: 2005-08-13
- Posts: 13
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
I had the same problem with the usearticle and catfield attributes. I’m using the following tag in an article-form and it’s working.
<code>
<txp:rss_thumbpop mode=“float” jpop=“1” clickonly=“1” cols=“6” showpagelinks=“0” usearticle=“1” catfield=“custom_1” addpermlink=“0” fullontop=“0” orderby=“dateasc”/>
</code>
Last edited by panik (2006-02-11 23:03:01)
Offline
#274 2006-02-12 07:52:07
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
theonlydrew and panik – I’m having the same troubles with usearticle and catfield. I can’t seem to make it work at all! I’m getting every img in the system dumped out to the screen. I’m using catfield custom_1 and have tried panik’s code – no dice :( Any suggestions?
I’m new to textpattern and still wrapping my head around all of it… Any help would be great! Thanks
I’ve tried a bunch of different attribute combinations, currenlty this is what I’ve got: <code><txp:rss_thumbpop mode=“float” showpagelinks=“0” usearticle=“1” catfield=“custom_1”/></code>
Last edited by rbe (2006-02-12 07:57:30)
Offline
#275 2006-02-12 08:30:06
- panik
- Member
- From: Bonn, Germany
- Registered: 2005-08-13
- Posts: 13
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
rbe, did you put your tag in an article form or in your page template?
my tag is only working in an article form and i had to use <code>addpermlink=“0”</code> to link the thumbnails to the full size image and not to the article again.
Offline
#276 2006-02-12 09:09:58
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
Ahaaaaaaaa!
Think I’ve found the bug. It intrigued me that theonlydrew and panik got it to work so I did some digging to find out what was different between their implementations and mine. At first I thought it was the order you specify the arguments (didn’t make sense but I tried it anyway). It didn’t help that I was being a pillock in the first place and using the name I’d assigned to my article as the catfield argument (catfield=“gallery_images” is wrong, it should be catfield=“custom_n” where n was the number of the custom field I was using… what a dumbass mistake, d’oh).
Anyway, after much experimentation, the “trigger” argument appears to be showpagelinks="1"; as theonlydrew found. I dug around in the code and lo and behold there’s a small bug in the part that handles paging. Go to your (v0.6.1) plugin code, scroll down to just above the halfway point to where it says “// DO PAGING”. On the last line before the } else { statement, change it from:
$results = safe_rows('*', 'txp_image', $categories.$obfield.' LIMIT '.$offset.','.$limit);
to:
$results = safe_rows('*', 'txp_image', $categories.$artcat.$obfield.' LIMIT '.$offset.','.$limit);
Adding that little .$artcat to the line appears to make the pagelinks work with usearticle=“1”. Haven’t tested it fully yet but it works for me so far. Hope it works for you guys.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#277 2006-02-12 10:22:12
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
And hot on the heels of that one, I’ve added another function to my rss_thumbpop. Might be useful to someone else so here it is.
Sometimes my galleries aren’t at the top of the page so when paging through with next/previous, the page reloads and drops the surfer back to the top, whereby they have to scroll down to the photos again. What would be useful in this case is a way to use the html tag <a name="photos"></a> immediately above your photo gallery and have the plugin return you to that part of the page.
Enter the aname= argument… simply specify the name of the section of the page defined by your <a name=..></a> tag and the surfer is put back at the top of the gallery when they click next or previous.
To do this you need to add two lines to your v0.6.1 plugin code and change two other lines as follows:
1) In the declaration block at the top of the code, add this line (I added mine under the $addpermlink = isset($addpermlink) ? $addpermlink: "1"; line but it doesn’t matter too much where it is as long as it’s in that block at the top somewhere) :
$aname = isset($aname) ? $aname: "";
2) Then scroll almost to the bottom of the code and find the bit that starts:
...
if ($numPages > 1 && $showpagelinks) {
$next = ($numPages > 1 && $thumbpage != $numPages);
$back = ($numPages > 1 && $thumbpage > 1);
...
and add this line right below it:
$anameStr = ($aname) ? "#".$aname : "";
3) A line or two below that you find two lines that start:
$output[] = ($back) ? ...
and
$output[] = ($next) ? ...
They need to have .$anameStr added to them, thus:
$output[] = ($back) ? '<li class="left"><a href="?tpg='.($thumbpage-1).$anameStr.'">'.$backlabel.'</a></li>'.n : '';
$output[] = ($next) ? '<li class="right"><a href="?tpg='.($thumbpage+1).$anameStr.'">'.$nextlabel.'</a></li>'.n : '';
And that’s it. So if you now add <a name="photos"></a> immediately above the txp:rss_thumbpop... tag in your article form, and add an option aname="photos" to the rss_thumbpop arguments you’re all set.
Usual disclaimer applies if your site explodes after making these changes, but it should work ok providing you’re careful. And if somebody finds a better way of doing this, I’m all, erm, eyes.
[ edit: btw, forgot to mention that <a name="..."></a> doesn’t strictly validate as XHTML; it should technically be <a id="..."></a>. Despite this minor discrepancy, I left the plugin option as aname=, because aid= sounds like it might offer some sort of help :o) ]
Last edited by Bloke (2006-03-04 20:48:34)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#278 2006-02-12 16:33:05
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
Thanks panik! That was the problem. I had it in a page template… I moved it out to an article form and all was well… It must be something with the variables in textpattern, the plugin probebly doesn’t know what the article attributes are so it is matching everything. I did have to use the <code>addpermlink=“0”</code> to get the popups to work as well… Oh well, no worries…
bloke great find and ideas, I’ll try them out today and let you know what my milage is… I’m trying to rebuild a website from legacy asp code and port it to textpattern, the image galleries was the only point of contention, with these last couple changes and finds, this might be the ticket! Thanks
willshire – it might be helpful in the docs to add somethign to the effect of if you want to use the <code>usearticle=“1” catfield=“cat_field”</code> then the plugin must reside in an article form. This is a GREAT plugin, thanks so much for all of your hard work!
Last edited by rbe (2006-02-12 16:36:12)
Offline
#279 2006-02-14 03:18:28
- sonnyzm
- New Member
- Registered: 2006-02-14
- Posts: 9
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
Hi I’m trying to install rss_thumbpop, but after i press install, it just says “plugin install failed”, anyone know the solution? (btw i’ve tried it on two different servers with the same result.
cheers, Sonny
Offline
#280 2006-02-14 17:20:54
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
sonny… the only time i’ve had that happen is if I got a corrupted download… i’d try to download the plugin again, and open it with a basic text editor (notepad on windows or textpad on mac). copy, paste and you should be good.
Offline
#281 2006-02-15 07:59:09
- sonnyzm
- New Member
- Registered: 2006-02-14
- Posts: 9
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
Thanks for the reply rbe, but that wasnt the problem, I reinstalled older an older version of php and it worked fine, I dont think the script is compatible with php 5.
Offline
#282 2006-02-16 03:05:25
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
Made another minor mod today to this awesome plugin. When using usearticle="1", this hack allows multiple categories to be specified as a comma-separated list in your article’s custom field. So the custom field then works the same way as the category= option.
If that sounds like something you want, make these highlighted changes to your v0.6.1 plugin code (this bit is near the top of the code, just after the declaration block) :
...
if ($res) {
foreach($res as $a) {
extract($a);
populateArticleData($a);
foreach (explode(',', doSlash($a[$catfield])) as $artcategory) {$artcatsql[] = ($artcategory) ? " (category = '" . doSlash($artcategory) . "') " : "";}$artcat = " AND ";$artcat .= ($artcategory) ? '(' . join(' OR ', $artcatsql) . ')' : '1=1 ';
$artlink = permlinkurl($a);
}
}
That’s it. Essentially, you’re swapping out the original line that was there:
$artcat = " AND (category = '" . doSlash($a[$catfield]) . "') ";
with those 5 bulletted lines of code there. Don’t ask me why I had to put the $artcat = " AND "; on a separate line rather than combining it with the next line; for some reason it wouldn’t work with it all on one line :-/
It’s quite inefficient so if you have loads of categories it’ll probably slow down a bit. There’s no doubt a better way by using the SQL ‘IN’ statement and supplying a list instead of keep doing OR (category="cat1") OR (category="cat2") OR.... Perhaps even using wildcards? Anyone care to mod the mod to make it faster?!
No warranties again, but it’s working here through my limited testing. Should work for you. Enjoy.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#283 2006-02-18 02:22:35
- sonnyzm
- New Member
- Registered: 2006-02-14
- Posts: 9
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
Hi, is there a way to display multiple thumbnail galleries on a single page, I’ve ebeen playing around with it and cant get it to work.
Offline
#284 2006-02-18 02:40:44
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
sonnyzm, what have you tried to get them to display? I’m using it to show a gallery that is associated to a single article, but I’m sure it can be done. If you set the category attribute on the tag for each gallery, I don’t see why it wouldn’t work. The jpop functionality might be a little dicey, but the popups should be good to go…
Offline
#285 2006-02-18 02:52:08
- sonnyzm
- New Member
- Registered: 2006-02-14
- Posts: 9
Re: [plugin] [ORPHAN] rss_thumbpop - Thumbnail Image Gallery w/ popups
Well lets say I have a portfolio of my graphics:
I have section: Graphics
then I have categories for different types of graphics i.e sections: 2d, 3d, vector
each one of those sections is a different category, but I cant get them to show all in one page (all three gallery sections) I can only make links to the individual pages with the thumbnails
I’ve only started using textpattern this week so please forgive my newbness lol =)
cheers, sonny
Offline