# Main > Technical Support and Notices >  Thumbnail gallery for Cartographers Choice

## J.Edward

@Robbie and/or @RedRobes...
I was wondering why we don't have a thumbnail gallery of the Cartographers Choice awards.
It seems like an obvious choice for that. Is it a problem to do one?
I think it would be great to have.

----------


## Falconius

Probably a good idea, a few times I went to peruse the CG maps and it's not easy.  Usually I just end up looking at your amalgamation collection poster and then search them out one by one for bigger ones.

----------


## Robbie

I thought we had one, actually... It's not hard to do. I'll take a look. 

Sent from my Pixel XL using Tapatalk

----------


## J.Edward

Excellent  :Smile: 
We need to be able to see all that glorious mappage as one scrolling wall of awesome. :p

----------


## Redrobes

I think we can set one up so long as its all contained on a forum board. I *think* (because its certainly been a while...) that the script takes in the forum board number and will extract all of the thumbs for that boards threads as the first image posted. We can also set the date to a specific year if required too which we use for the annual mappies.

Edit: Yeah so I put one in and have battled with the PHP but dang I cannot see why its stopping at Devins Mad Monk thumb. The code looks like it ought to go through them all and if you ask the forum for all the threads it goes right back to 2006 but they wont show. Theres nothing in the PHP to say only get me threads up to X. SQL is not my forte, maybe RobA can do his magic on it. If anyone else has any better idea why its the case then do let me know.

Edit2: I got it now. The entries before that date have the image embedded in as a URL link to the map. Those more recent have it as an attachment. It needs to be an attachment before the thumbnailer will pick it up. We need to have access to the attachment dimensions to scale it for display and the URL links wont have that info without the PHP crawling the link to it and getting it - which I can tell you I am not capable of writing in PHP ! So the link as it stands is about the best I can give you.

Link to thumbs is above the cartographers choice forum - or for the lazy... https://www.cartographersguild.com/c...ice_thumbs.php

----------


## Greason Wolfe

You ROCK Redrobes!!!! 

**does the happy tail-chase dance and drops a special chew toy for the man with the plan**

----------


## Falconius

Nice work Redrobes.  Hopefully someone will figure out why it stops, or if it can be paginated.

----------


## ChickPea

@redrobes Can we edit the posts to change the image to an attachment? I just clicked randomly on one of the older threads (that doesn't show in the thumbnails) and it certainly looks like I could remove the existing image and then 'attach' the original (full size) map.

There aren't a huge number of maps, and I wouldn't mind working through them over the next couple of weeks. I guess the image would show automatically in the thumbnails if it were an attachment?



EDIT: OK, I'm answering my own questions. I tried it with our very first CC Award and it works. It now shows in the gallery. 

I think it's just a matter of going through the old threads, deleting the existing image and re-uploading the full size map as a new attachment. I'll work through them over the next week or two when I have time.

----------


## Redrobes

@Greason - I wish all my clients were that happy with my coding !!!
Thanks Falconius.
ChickPea: Yes I believe that the script runs on the current active forum database and pulls up all of the current threads and performs the calculation of page layout at the time of the request in a similar manner to if someone adds a new challenge entry with new WIP tag then it ought to become a new thumbnail for the next person to request the thumbnails page. If you want to edit the older threads then by all means have a go. Try one and check if it works. If you want to edit the post for Devins mad monk one too as its showing the wrong image that would also be great. I guess in that instance you can change the current attachment to a URL of the image its pointing to and it will fix that one. It may fix itself if the proper image was an attachment. I dont know if it will pick the first attachment or the second. The proper Mad Monk map was pretty cool if I recall.

Edit: Ahh I see that its already been changed - or maybe its being changed as I check whether its being changed.... I am confused now  :Very Happy: 

Edit2: I see ChickPeas Edit. Were on Ninja Edits now !!

----------


## ChickPea

There's some weirdness with the thumbnails....! 

I've been going  into a few threads, clicking on the image to open it in a new tab,  saving that image, then uploading it again as an attachment to the  original post and deleting the original pic. I've done half a dozen or  so now, and they're all showing fine, except for this thread...

https://www.cartographersguild.com/s...=4052#post4052

The  greyscale pic showing is the correct image, and it appears in the  gallery, however if you go into the thumbnails gallery now and scroll  down near the bottom, there are about 20ish dungeon maps on parchment  added. If you click on them, they all link to the thread above, though  they do not appear in the thread anywhere. I don't know where they've  come from. They just appeared after I updated the attachment. If you go  into the original WIP thread (link is in the first comment of Robbie's  award post) it looks like some images are missing, or perhaps removed by  the OP. Not sure if these could be our phantom parchment dungeon maps?

Not  sure if it's relevant but I think this user changed their user name.  The text in the original image says the map maker is 'Artimidor' but  when you go to the original thread for the map (linked in the first  comment) the user name is 'Artimidor Federkiel'. Might be coincidence,  but thought I'd mention it anyway.

Not sure how to proceed here  or how to get rid of all those maps that don't belong there, apart from  removing the attachment from the original post (at least, I'm assuming  that'll get rid of them). I won't touch anything else for now.

----------


## Ilanthar

Good idea & excellent work, guys  :Smile: !

@ChickPea : I'm no expert, but I think you're probably right. The name is part of the url, so a changed name seems to be a confusing thing...

----------


## Falconius

@ChickPea, thanks for putting in the time to go through and relink all these things.

Some of the CG announcement threads, and therefore some of the thumbs, don't link to the big image in the original threads.  Such as "Kaiserreich Drachenstein by Veuxin" and "Etrakien Revisited by Clercon" and "Plumton by Crayons".

----------


## bkh1914

I just had to poke around. 
(I haven't done much of anything with software in a very long time, and I was curious.)

The spurious images are from one of geoff_nunn's albums https://www.cartographersguild.com/a...p?albumid=4052

Don't know if that helps...

----------


## ChickPea

@falconius Once we figure this out, I'll go through everything and make sure it's all correct, starting with those threads!

@bkh1914 Thanks, that's very helpful. I knew I'd seen those pics before but I couldn't remember who the artist was. I note the album ID in the URL is 4052, and the link to the CC award post also contains 4052. I don't think that's a coincidence. I hope Redrobes or Robbie can figure it out.

----------


## Redrobes

Great stuff ChickPea !

I looked at the issue and I cannot find out what is happening. Its an old thread and the format for threads have changed. It seems that the PHP and SQL used to pull up the list is adding these extra entries for some reason. Maybe they got added to the choice maps by mistake and then got deleted and the SQL is not filtering out deleted ones. But I dont think so. Something very odd.

Well to fix it I have dropped all the thread=499 entries so that we lose them but we also lose that correct greyscale map too. If you fix up some others and then numerous or wrong images appear then let me know.

----------


## ChickPea

I've gone through everything, and I think all the thumbnails are in the gallery now, excepting our problem thread. It didn't take anywhere near as long as I thought it might. I've also fixed the small maps linked from the thumbnails, though some of the oldest maps are very small anyway. If there was a bigger version, I think I've got it linked, but if anyone spots one I've missed, let me know. 

There don't seem to be any other issues with thumbnails. I think that was one rogue thread, and we'll just need to live without it in the gallery unfortunately.

Next thing I'd love to see is a gallery of old challenge winners, but I'm not quite certain of the best way to achieve that....!  :Very Happy:

----------


## Redrobes

Thanks ChickPea for all the effort - I am sure it was quite a task, ill have a look at it in all its glory in a mo.

Old challenge winners - Ahh well now that may be a mighty difficult thing to address. You have two per month and many many entrants. You would need all those WIP tags included in order to know which one was the real McCoy. I think we could put up a thumbnailer for the archive dir and since all the threads were locked then it would group them all together by date so that you would get blocks of thumbs for the right month but it would be an awful lot of images. It would only go back as far as we were doing the WIP tags but its a tougher call that one. Many people took their entries and made them into finished maps in any case - although lazy sods like me didn't.   :Very Happy:

----------


## ChickPea

@Redrobes I've been thinking about how to display old challenge winners, and I wanted to run something by you.

I don't know much about the thumbnail scraper, but I assume that 'Latest WIP' is really just a variable, so could it be changed? What I'm thinking is this...

Would it be possible to create a copy of the script, but change it so that instead of searching for ### Latest WIP ###, it looked for (for example) ### Winner ###. I was updating links in the (regular) Mapping Challenge Hall of Fame thread, and with the ones I added from 2014, the link goes directly to the comment with the winning map. Those comments should already have ### Latest WIP ### in them, and it wouldn't take too long to change each tag to ### Winner ###. (The older threads will need a little more work, as well as all of the Lite Challenge winners, but I could go through them. There's no deadline on this.) So, the thumbnail crawler would go through every thread in the Mapping Challenge archive folder and look for the ones with the Winner tag, and it'd build the thumbnail gallery from those. Going forward, (if they remember!) Bogie and Diamond could change the 'Latest WIP' tag to 'Winner' when they award the compass. Even if they forget, if we keep on top of it, it's not too big a job to keep it up to date.

I'm not certain how it all works in the backend, so I don't know if there would be any technical 'gotchas' with this idea (perhaps issues with running two different crawlers), but I thought I'd put it to you anyway.  :Very Happy:

----------


## Redrobes

Well now, if your prepared to go through a load of threads and add a new tag to them, and all of these threads are in one forum folder such as the Challenge Archive, then I think that changes things and is a goer. The issue was trying to cross reference a winners list with the links there to the winning thread and post and then collect the attachment - all just in SQL. Its a whole lot easier if the winning post itself has the tag on it as I can ask it to give me back all the posts with the correct wip tag from forum 59 (the archive).

The tag was something I chose a long time ago when the original scraper was done in perl and I could easily look for the tag. Its completely arbitrary. It was something that was absurdly unlikely to appear in the normal text of someones post.

A copy of the existing thumbnail scraper for the challenge entry threads could be modified and we could have something very similar looking with the new tag. I guess all of the lite and main challenge entries are put into the same archive but it would not be a bad thing to mix the main and lite winners together in the thumbs page. If you wanted two lists, one for main challenge winners and one for lite challenge winners, then could you have two tag types and ill just look for the correct one per page of thumbs.

If you like that and want to start putting the tags in on the last few winners of each type then let me know the tag you have added and ill set up the script and link. I had better have a couple of posts with tags in to test it to make sure its ok.

Oh and if I am ever away for a while when I should be doing something and it looks like I have forgotten about it then do PM me because its likely I have ! I usually only look at the days latest posts and run down the list looking for titles that are interesting or need attention. If the call to arms runs off the bottom of the latest posts list then I dont see it.

----------


## ChickPea

Aw thanks for getting on board with this, Redrobes!  :Very Happy: 

I've gone into the posts for this year's regular challenge winners, and I've added the tag...

*### Winner ###*

So right now there are seven maps with this tag. Your scraper should return the following maps, all going well...

Anaethir, by Ilanthar
The Fall of the Kingdom of Cauldrons, by Abu Lafia
The Big War of Resh, in Frel & Floris, by MistyBeee
Magocracy of Tirasea, by MistyBeee
Stamps from the Grand Thordar Republic, by Tonquani
Ten, by Larb
Iri-Oriand, World of Living Magic, by J.Edward

If you need to check any of the posts, you can find them in this comment.

I don't see any issue with putting Lite & Regular winners in the one gallery. 

If everything works, I can get to work on updating the other challenge winners. It won't take much time for the 2014 - 2017 regular challenge winners, as I've already got links directly to the winning maps, and I can work through the older ones, as well as the Lite, over the next week or two. Also... no rush at all for this, if you're busy with other things. 

Thanks again for looking at it!  :Smile:

----------


## Straf

I have noticed that the awards link to a particular post where the winning map was uploaded but only for regular challenges. This doesn't seem to be true for the Lite Challenge though. Would it not therefore be possible to build a query that listed the post ID for all of the awards of a particular type? So for regular challenges every post ID that returns award4 as true would be in the list and then the scraper could work off that.

----------


## Redrobes

ChickPea: Thanks for that - ill have a go at getting the new scraper up and running shortly - perhaps tomorrow eve.

Straf: I know that somehow it would be possible to obtain a list of all the awards and check if they were a challenge winner and then go through that to the link but its a hard way around of doing it. What ChickPea is doing is adding a tag directly to all the winning posts. So we can ask the database for all posts that have that tag in them and have an attachment with it and then just show those attachments. If I were programming it with some scripting language then I could do any of these things. But with just SQL, which I am less able, its better if I can create a query that will generate the post list in one shot rather than getting a list, looking at those posts and then indexing into them via links to some other post etc. The harder part of this is not the doing of it exactly but doing it within the constraints of the forum architecture. You have to supply the correct stuff to the forum renderer via these template things so that it shows up the thumbs. You dont get an opportunity to insert a script or whatever into the flow to do anything too fancy. Well, ok I am sure its possible if your a whiz at this and know the forum architecture very well, and your prepared to rewrite a lot of stuff when we upgrate the forum version, but lacking that, then its best to just go with its flow.

----------


## Straf

You wouldn't have to obtain a list of all the awards, just the ones that are relevant to that challenge. It also depends on how the awards system is structured though. I'd personally have it so that an award's category ID is applied to a post's ID in a separate table. That's assuming that every piece of information can be obtained from a post's ID. I know the list of users who've won an award can be listed by award here.

OK I think I've just realised that the awards are applied to users and there's a comment/reason field where the relevant post's URL can be entered. The awards aren't just applied to individual posts but for being a jolly good egg in general so a post ID wouldn't be appropriate in that respect. My apologies, I had a totally different structure in my mind.


EDIT: And now I'm going to spend the whole day thinking about it, instead of getting on with my own work  :Razz:

----------


## Redrobes

Yes thats just it. Firstly the awards are general so we would need to work out which awards. But that is not so difficult as although we can apply awards to many things we have a special gold and silver compass types for challenge winners. The real issue is that it would require that the award have the post link in it which is often the case but not guaranteed. The other issue and I think is a bigger one, is that we dont have specs for the vBulletin about the database and what fields relate to other things. We can guess many of them but its not a dead cert. Also, in the case of the awards specifically, its an add on to vBulletin which was written for the V4.x.x forum software. We could upgrade to V5 but the person who wrote the awards add on has abandoned it and there is no V5 compatible version for it so for a while were stuck with V4 unless we either a) port the awards PHP files to V5 with no specs or b) abandon all the awards (I doubt that would be popular !) or c) wait until a V5 awards add on becomes available.

So the awards are a particularly gnarly bit of the forum code that I would not want to pin the effort of thumbnail scrapers against.

I am going to have a go now at getting a few of ChickPeas Winner tags showing up with a new thumbnail script / link and then maybe the list of those post attachments can be expanded to cover all of the winning entries.

Edit: OK, that seems to be working ok now... I hope !

https://www.cartographersguild.com/f...play.php?f=109

----------


## ChickPea

Thanks, Redrobes. It looks great! I'll get to work on the rest of the threads.

----------

