BBCode for embedding LDraw parts now available - UPDATE - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: General (https://forums.ldraw.org/forum-12.html) +--- Forum: LDraw.org Announcements (https://forums.ldraw.org/forum-1.html) +--- Thread: BBCode for embedding LDraw parts now available - UPDATE (/thread-3992.html) |
BBCode for embedding LDraw parts now available - UPDATE - Orion Pobursky - 2012-03-25 Admin - Due to latency problems between the 2 LDraw servers causing extremely page long load times on tag intensive posts, this tag has been disabled until a code revision can be made to account for this. Format is: [dat_part <partno> (unofficial|text)] where: <partno> is the part number with or without the ".dat". Note the "parts" folder need not be specified but the "p", "s", and "48" do. "unofficial" forces the PT version if the part is under revision on the PT "text" forces a text link instead of an image link If a part image does not exist (i.e. official primitives) then it defaults to a text link. If the part is neither official or unofficial it returns the part number as plain text. Official Part: image link: [dat_part 3001] text link: [dat_part 3001 text] Unofficial Part: image link: [dat_part 92590] text link: [dat_part 92590 text] Part that is both: official image: [dat_part 112] official text: [dat_part 112 text] unofficial image: [dat_part 112 unofficial] unofficial text: [dat_part 112 unofficial text] This part does not exist: [dat_part 33431333s02] Re: BBCode for embedding LDraw parts now available - Steffen - 2012-03-25 VERY nice feature! Can we do something about the different scaling of official and unofficial parts? PS: hey, I just noticed that the parts tracker has been improved when you click on the image on e.g. this page: http://www.ldraw.org/cgi-bin/ptdetail.cgi?f=parts/x185c02.dat it now shows a dark background, and the part image is centered. Much better this way! BUT: there is a small bug in that feature, the link pointing to the image has a duplicated slash // in it, this should be fixed IMHO Re: BBCode for embedding LDraw parts now available - Chris Dee - 2012-03-25 Steffen Wrote:PS: I think the image display is a feature of your browser - in my Firefox 10.0 it is left-aligned with no background. The duplicated slash bug has been fixed. Re: BBCode for embedding LDraw parts now available - Chris Dee - 2012-03-25 Steffen Wrote:VERY nice feature! Can we do something about the different scaling of official and unofficial parts? I'm not sure how Orion guessed at the location for the official images, but those at http://www.ldraw.org/library/official/images/ are not up-to-date, have not been refereshed since July 2003, and were almost certainly generated by ldglite. The current Parts Update process refreshes the official images at http://www.ldraw.org/library/official/images/7/100/ for use by the peeron partsref. However, this also still uses ldglite to ensure constant scale and no cropping. The unofficial library images are generated by a special build of ldview which, as I understand it, doesn't have a size option, but rather a "camera distance" option, and crops at 640px x 480px - see this example. So it is tough to ensure a size match between ldglite and ldview images. I suppose I could re-generate the official images at http://www.ldraw.org/library/official/images/, using LDview if that makes sense. Re: BBCode for embedding LDraw parts now available - Steffen - 2012-03-25 ah, then Firefox must have changed that behaviour with 11.0 The attached screenshot shows what you see in Firefox 11.0 when clicking onto a parts tracker image of a part. Previously, the image used to be top-left with white background. Re: BBCode for embedding LDraw parts now available - Orion Pobursky - 2012-03-25 Chris Dee Wrote:I suppose I could re-generate the official images at http://www.ldraw.org/library/official/images/, using LDview if that makes sense. Don't bother. I'll just use whatever is currently up to date. No need to have 2 image sets. Re: BBCode for embedding LDraw parts now available - Orion Pobursky - 2012-03-25 URL for official images updated. Re: BBCode for embedding LDraw parts now available - Chris Dee - 2012-03-25 ... even if this doesn't resolve Steffen's point about differing sizes. One more image set to the ~80 that already exist is probably no big deal. The /7/ in the filepath is the LDraw colour code, and many others are also generated for peeron. Re: BBCode for embedding LDraw parts now available - Steffen - 2012-03-25 For the size issue, it would suffice to roughly estimate the proper scaling factors by eye. The images should just "match" each other enough IMHO. EDIT: I just hit reload and saw that image size now fits well between official and unofficial. Only thing now remaining IMHO is the different grey colors. Can we get proper ldconfig.ldr color 16 renders for both, please? Re: BBCode for embedding LDraw parts now available - Steffen - 2012-03-25 > I'm not sure how Orion guessed at the location for the official images, > but those at http://www.ldraw.org/library/official/images/ > are not up-to-date, have not been refereshed since July 2003, > and were almost certainly generated by ldglite. I suggest that we put an overlay over these images, telling people about that, and pointing them to the proper location. Otherwise many sites will still use the wrong image instances. Re: BBCode for embedding LDraw parts now available - Steffen - 2012-03-25 Using this feature will allow us to here in the forums compose our own "review summary" pages like those mentioned here on the bottom right list: http://www.ldraw.org/library/tracker/ . This has been something I had always wanted to do, and wanted to avoid having to bother Chris with creating and updating of such pages. Test: [dat_part s/u592s00.dat] [dat_part s/u592s01.dat] [dat_part s/u592s02.dat] [dat_part s/u592s03.dat] [dat_part s/u592s04.dat] [dat_part u592.dat] [dat_part u592p01.dat] [dat_part u592p01c01.dat] [dat_part u592p01c02.dat] [dat_part u592p01c03.dat] [dat_part u592p01c04.dat] [dat_part u592p02.dat] [dat_part u592p02c01.dat] [dat_part u9102p17.dat] [dat_part u592p02c02.dat] [dat_part s/u600s00.dat] [dat_part s/u600s01.dat] [dat_part s/u600s02.dat] [dat_part s/u600s03.dat] [dat_part s/u600s04.dat] [dat_part u600.dat] [dat_part u600p01.dat] [dat_part u600p01c01.dat] [dat_part u600p01c02.dat] [dat_part u600p02.dat] [dat_part u600p02c01.dat] [dat_part u600p02c02.dat] Re: BBCode for embedding LDraw parts now available - Steffen - 2012-03-25 can we get rid of the dotted lines below all the images somehow? Re: BBCode for embedding LDraw parts now available - Steffen - 2012-03-25 while looking at that test page above: it would be nice if we could also show the rectangularish parts tracker status icon at the parts. Maybe by using another optional keyword like "status". And another keyword "caption" for the part title, please :-)))) Re: BBCode for embedding LDraw parts now available - Orion Pobursky - 2012-03-25 Steffen Wrote:while looking at that test page above: This would require a bit more advanced coding than I know how to do at the moment. I'll put it on the todo list Steffen Wrote:And another keyword "caption" for the part title, please :-)))) This I can start on now Re: BBCode for embedding LDraw parts now available - Steffen - 2012-03-25 (a) dotted lines: should be easy to remove (b) status: you could abuse page http://www.ldraw.org/cgi-bin/tracker/activity.cgi?f=parts/32084.dat for that purpose and "grab" the topmost icon shown in the table. or Chris could provide you with a dedicated CGI © caption: I meant the first line of a .dat file. this way, the name of a part can be shown along with its image (d) getting a proper ldconfig.ldr color 16 rendering for both official and unofficial files: should also be easy to correct Re: BBCode for embedding LDraw parts now available - Chris Dee - 2012-03-26 Steffen Wrote:(a) dotted lines: should be easy to remove this is the culprit in the CSS: #phorum a, #phorum a:link #phorum a:active { ... border-bottom: 1px dotted; ... } Steffen Wrote:(b) status: you could abuse page http://www.ldraw.org/cgi-bin/tracker/activity.cgi?f=parts/32084.dat for that purpose and "grab" the topmost icon shown in the table. or Chris could provide you with a dedicated CGI please don't harvest this from the output from activity.cgi - that will just load the server unnecessarily. I'll provide a leaner method. Steffen Wrote:© caption: I meant the first line of a .dat file. this way, the name of a part can be shown along with its image already exists as an internal function within the Parts Tracker - could probably be externalised. Steffen Wrote:(d) getting a proper ldconfig.ldr color 16 rendering for both official and unofficial files: should also be easy to correct I think the easiest way to do that would be to maintain colour 16 ldview-generated images in http://www.ldraw.org/library/official/images/ At the moment I'd like to concentrate on 2012-01, but will try to pick up (b), © and (d) after that. Re: BBCode for embedding LDraw parts now available - Orion Pobursky - 2012-03-26 Steffen Wrote:(a) dotted lines: should be easy to remove They're staying for now until we get the CSS finalized. Steffen Wrote:(b) status: you could abuse page http://www.ldraw.org/cgi-bin/tracker/activity.cgi?f=parts/32084.dat for that purpose and "grab" the topmost icon shown in the table. or Chris could provide you with a dedicated CGI As Chris wrote, I'm not going to screen scrape anything. We control the files to the PT and I'll write code that just pings the backend. Steffen Wrote:© caption: I meant the first line of a .dat file. this way, the name of a part can be shown along with its image That's a little more work so I'll add it to the todo list Steffen Wrote:(d) getting a proper ldconfig.ldr color 16 rendering for both official and unofficial files: should also be easy to correct See Chris's post on this. Re: BBCode for embedding LDraw parts now available - Orion Pobursky - 2012-03-26 From the land of unintended "Features" this new module seems to be significantly slowing down the Recent Messages page. I suspect that is because the Recent Messages module loads the messages bodies but those are never shown. Since Steffen made a fairly graphic intensive post that's still on Recent Messages, this is prolly causing the slowdown. Re: BBCode for embedding LDraw parts now available - Orion Pobursky - 2012-03-26 This suspicion is now confirmed. The tag speed is dependent on the speed of the server the library is on (which is not same as the forums server). Re: BBCode for embedding LDraw parts now available - Chris Dee - 2012-05-04 Orion Pobursky Wrote:Steffen Wrote:(b) status: you could abuse page http://www.ldraw.org/cgi-bin/tracker/activity.cgi?f=parts/32084.dat for that purpose and "grab" the topmost icon shown in the table. or Chris could provide you with a dedicated CGI If you can call a cgi-bin script from within the module, does this help? http://www.ldraw.org/cgi-bin/ptstat.cgi?s=parts/973pr0 Re: BBCode for embedding LDraw parts now available - Chris Dee - 2012-05-04 Orion Pobursky Wrote:Steffen Wrote:© caption: I meant the first line of a .dat file. this way, the name of a part can be shown along with its image This cgi-bin call will provide the title: http://www.ldraw.org/cgi-bin/pttitle.cgi?s=parts/973pc23.dat It looks first in the unofficial library, then the official library, or returns "File xxxxxxxxxxxxxxx not found.". |