Hi all,
I've tried Google but couldn't find any EAN-generator extension for Mediawiki. Does anyone know of any such extension, or any hint about how to achieve the functionality of generating the EAN code from a number.
TIA
// Rolf Lampa
Hi!I have made a quick programming session and developed exactly such an extension for you. You (and of course everybody else) can download it and read more about it (as well as see its results) at http://www.chaosreligion.com/wtl/index.php5?title=EAN or at its MediaWiki page:http://www.mediawiki.org/wiki/Extension:EAN
greetings, Markus
Date: Fri, 1 Aug 2008 17:06:23 +0200> From: rolf.lampa@rilnet.com> To: mediawiki-l@lists.wikimedia.org> Subject: [Mediawiki-l] EAN-code generator for Mediawiki> > Hi all,> > I've tried Google but couldn't find any EAN-generator extension for > Mediawiki. Does anyone know of any such extension, or any hint about how > to achieve the functionality of generating the EAN code from a number.> > TIA> > // Rolf Lampa> > _______________________________________________> MediaWiki-l mailing list> MediaWiki-l@lists.wikimedia.org> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_________________________________________________________________ Windows Live Spaces - Ihr Leben, Ihr Space. Hier klicken und informieren. http://get.live.com/spaces/overview
M Sz wrote:
Hi!I have made a quick programming session and developed exactly such an extension for you. You (and of course everybody else) can download it and read more about it (as well as see its results) at http://www.chaosreligion.com/wtl/index.php5?title=EAN or at its MediaWiki page:http://www.mediawiki.org/wiki/Extension:EAN
- Wow! Thank you very much!
And it works! One thing though; the tag <ean>1234...0</ean> requires minimum 13 digits before it will try to render. It would be very useful to have the option to let the extension pad with leading zero's if the number given i shorter than 13 digits (for example serie numbers often is shorter than 13 digits and it can be a bit tricky to pad with zero's using ParserFunctions).
I also added some install instructions regarding the new '/ean' directory to the Extension:EAN article (Apache on my server didn't have the rights to let your script automatically create the folder so I gave a hint about adding it manually instead).
Again, thank you very much! May I guess that you already thought of making the EAN code result resizable using parameter but you haven't had the time to write the road map yet... :)
In any case, <thumbs up> !
Regards,
// Rolf Lampa
Hi!No problem, you're welcome.
It already should have been possible to use only 12 digits too, since the 13th digit is calculated anyway. But however, I have done what you suggested and now the number will be filled up with zeros as far as needed ;) The inside of the tag (all that's between the open- and end-tag) will now be parsed through and everything in the outcome that's not a number will be thrown away. So any number outcome by Templates should now be used as barcode by the extension.
Additionally I have added the support for EAN-8 and UPC-A barcodes. the EAN-8 code uses <ean8>...</ean8> tags and the UPC-A code uses <upc>...</upc> tags. EAN-8 needs 7 digits (or otherwise the rest will be filled up with zeros, as suggested) and the UPC-A would need 11 (again, otherwise the rest will be filled up with zeros).
Much fun ;) Hope it's usefull!
greetings, Markus
Date: Sat, 2 Aug 2008 01:13:14 +0200> From: rolf.lampa@rilnet.com> To: mediawiki-l@lists.wikimedia.org> Subject: Re: [Mediawiki-l] EAN-code generator for Mediawiki> > M Sz wrote:> > Hi!I have made a quick programming session and developed exactly such an extension for you. You (and of course everybody else) can download it and read more about it (as well as see its results) at> > http://www.chaosreligion.com/wtl/index.php5?title=EAN%3E > or at its MediaWiki page:http://www.mediawiki.org/wiki/Extension:EAN%3E > - Wow! Thank you very much!> > And it works! One thing though; the tag <ean>1234...0</ean> requires > minimum 13 digits before it will try to render. It would be very useful > to have the option to let the extension pad with leading zero's if the > number given i shorter than 13 digits (for example serie numbers often > is shorter than 13 digits and it can be a bit tricky to pad with zero's > using ParserFunctions).> > I also added some install instructions regarding the new '/ean' > directory to the Extension:EAN article (Apache on my server didn't have > the rights to let your script automatically create the folder so I gave > a hint about adding it manually instead).> > Again, thank you very much! May I guess that you already thought of > making the EAN code result resizable using parameter but you haven't had > the time to write the road map yet... :)> > In any case, <thumbs up> !> > Regards,> > // Rolf Lampa> > _______________________________________________> MediaWiki-l mailing list> MediaWiki-l@lists.wikimedia.org> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_________________________________________________________________ Sie haben nie Platz in Ihrer Inbox? Mit Windows Live Hotmail haben Sie jetzt 5GB Speicherplatz - gratis! Holen Sie sich hier Ihren neuen Windows Live Hotmail Account! http://get.live.com/mail/overview
M Sz wrote:
Hi! No problem, you're welcome.
It already should have been possible to use only 12 digits too, since the 13th digit is calculated anyway. But however, I have done what you suggested and now the number will be filled up with zeros as far as needed ;)
Yes, now it works fine! And now also the parsing of variables and SMW ParserFunctions is taking place before the <ean>...</ean> tags. It all works like a charm!
Additionally I have added the support for EAN-8 and UPC-A barcodes. <...>
Much fun ;) Hope it's usefull!
Very fun. It will probably become very useful !
Any chance that the size of the bar-code image could be determined using a parameter?
Regards,
// Rolf Lampa
Done ;) Version 1.1.2 ready for download ;)simply add the option size=X to the opening tag (X is the size in number, like <ean size=1>). Standard is the smallest size (size=0) but you can change the standard size by changing the global wgBarWidth variable in ean.setup.php to you desired standard size. If you set your standard size to 1, you can still make barcodes with size 0 by adding the option <ean size="-1">, this would make the barcode smaller by one size. But minus values for the size option are only working if you change the standard size to something else but zero ;)
Ok, I think we've built something good here together ;)
greetings, Markus
Date: Sat, 2 Aug 2008 18:21:20 +0200> From: rolf.lampa@rilnet.com> To: mediawiki-l@lists.wikimedia.org> Subject: Re: [Mediawiki-l] EAN-code generator for Mediawiki> > > > M Sz wrote:> > Hi! No problem, you're welcome.> > > > It already should have been possible to use only 12 digits too, since the 13th digit is calculated anyway.> > But however, I have done what you suggested and now the number will be filled up with zeros as far as needed ;)> > Yes, now it works fine! And now also the parsing of variables and SMW > ParserFunctions is taking place before the <ean>...</ean> tags. It all > works like a charm!> > > Additionally I have added the support for EAN-8 and UPC-A barcodes. <...>> > > > Much fun ;) Hope it's usefull!> > Very fun. It will probably become very useful !> > Any chance that the size of the bar-code image could be determined using > a parameter?> > Regards,> > // Rolf Lampa> > _______________________________________________> MediaWiki-l mailing list> MediaWiki-l@lists.wikimedia.org> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_________________________________________________________________ Es ist höchste Zeit dabei zu sein - Holen Sie sich jetzt die neue Generation der Windows Live Services! http://get.live.com/
Hey!
I have just put up version 2.0, which will be the final version ;)It uses the tag "barcode" and the tag-parameter "code" to define the code. So now its <barcode code="upc">...</barcode> and <barcode code="ean8">...</barcode> EAN-13 is the standard code, so it is enough to write <barcode>...</barcode> for EAN-13New is, that now the subdirectory is no longer needed. It adds the pictures to the other normal pictures of your MediaWiki and you can find no longer needed pictures with the "Unused images" special page of your MediaWiki ;) Also, you can use a new parameter called "options" to add image thumbs or other image options. Just use it like the image options. For example, for a nice thumb with text: <barcode code="ean" size=1 options="thumb|400px|left|This is some text">123456781234</barcode> greetings, Markus ;)
Date: Sat, 2 Aug 2008 18:21:20 +0200> From: rolf.lampa@rilnet.com> To: mediawiki-l@lists.wikimedia.org> Subject: Re: [Mediawiki-l] EAN-code generator for Mediawiki> > > > M Sz wrote:> > Hi! No problem, you're welcome.> > > > It already should have been possible to use only 12 digits too, since the 13th digit is calculated anyway.> > But however, I have done what you suggested and now the number will be filled up with zeros as far as needed ;)> > Yes, now it works fine! And now also the parsing of variables and SMW > ParserFunctions is taking place before the <ean>...</ean> tags. It all > works like a charm!> > > Additionally I have added the support for EAN-8 and UPC-A barcodes. <...>> > > > Much fun ;) Hope it's usefull!> > Very fun. It will probably become very useful !> > Any chance that the size of the bar-code image could be determined using > a parameter?> > Regards,> > // Rolf Lampa> > _______________________________________________> MediaWiki-l mailing list> MediaWiki-l@lists.wikimedia.org> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_________________________________________________________________ Windows Live Spaces - Ihr Leben, Ihr Space. Hier klicken und informieren. http://get.live.com/spaces/overview
M Sz wrote:
Hi!I have made a quick programming session and developed exactly such an extension for you. You (and of course everybody else) can download it and read more about it (as well as see its results) at http://www.chaosreligion.com/wtl/index.php5?title=EAN or at its MediaWiki page:http://www.mediawiki.org/wiki/Extension:EAN
Hi again,
I experience a problem with the <ean>-tag not being rendered when feeded by parser & variable functions and SemanticMediawiki queries. I tried the following but it would render the bar-code in all cases:
== This works ==
<ean>000000190000</ean>
== But not this ==
{{#vardefine:sn|000000{{#ask: [[<some pagename>]] | ?Serie number = }}}} {{#var:sn}} <-- test to visually verify correct number = OK. <ean>{{#var:sn}}</ean> <-- no bar-code
== Nor this ==
<ean>{{#ask: [[{{PAGENAME}}]] | ?Serie number = }}</ean>
Perhaps there's another better hook that can be used which is parsed after the variables and SMW queries?
Regards,
// Rolf Lampa
mediawiki-l@lists.wikimedia.org