Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Use a PHP library installed on the website server.
Phpqrcode is a full PHP library :
Implemented purely in PHP, with no external dependencies (except GD2 if needed).
I tweak the Mobile Codes in order to use it and it works fine. I also use the Libraries API module.
Comments
Comment #1
newToo CreditAttribution: newToo commentedCan you share the tweaked Mobile Codes code?
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedOK.
I'll try to find some time this week end.
Comment #3
newToo CreditAttribution: newToo commentedThanks!
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedThis is not mandatory.
The call to Nokia webservice is commented and replaced by phpqrcode generation.
In mobile_codes/mobile_codes.module
Hope this work for you.
Comment #5
newToo CreditAttribution: newToo commentedThank you very much! I'm going to try it today.
Comment #6
newToo CreditAttribution: newToo commentedWorks great! Thanks again.
I do have a somewhat related question to this module and I was wondering if you knew. I'm trying to create an inventory system where the qr code points to a node. So basically a user would create a node and the url of that node would be embedded in the qr code on the fly. The problem I'm having is getting the node url to insert itself into a field in a node so that mobile codes can read it and create the qr code. I hope this makes sense.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedI've done the same stuff you need !
Here is the source code added on a module especially created for the project.
The project is called tazas which is spanish word for english word cups. So the module is called tazas.
I add 3 functions :
Here is the code :
Guess you can find a better and thinner solution ! This is a quick answer I wrote with lack of knowledges on certain Drupal area.
Feel free to feedback remarks !
Comment #8
newToo CreditAttribution: newToo commentedThank you! I will give it a try.
Comment #9
newToo CreditAttribution: newToo commentedDid you add this to the Mobile Codes module and rename the module, or did you create a new module? I'm not sure how to implement this. Do I create a new content type for "tazas" (for testing)? Thanks for your help.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedYou have to create a new module.
Do not create a content type for testing
You could in a first try comment the node type evaluation code. The function tazas_nodeapi is then :
or even thinner with no display condition :
The Mobile Codes module is well build so you can read the code and the comments to learn more about how to realize specific things.
Comment #11
newToo CreditAttribution: newToo commentedI'll try it, thanks... Would I create a field called "QR_Code" in an existing page content type? I'm just not getting where the data will be stored and retrieved my mobile codes to create the qr code.
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedMobile Codes module store QR_Code pictures in files/mobile_codes directory : when asking to display QR_Code it determines whether it have to generate a new file or display an existing one.
To retrieve this picture you only have to use theme function for Mobile Codes module with the current node alias :
Comment #13
newToo CreditAttribution: newToo commentedThanks Domsou... I've found a module which should allow me to use tokens to create the url for Mobile Codes. It's called Link (http://drupal.org/project/link) So basically I would need to figure out how to use this module with the same field types Mobile Codes use so Mobile Codes can create the qr code. :) I think.
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedIf I well understand your needs, I think module Link is useless as QR_code is generated using node alias data. If you want to have some automatic URL alias creation I then recommend using Path Auto module.
If you want to retrieve QR_Code image from node, you can use Mobile Codes API to do this.
You can also create a specific content type for QR_Code representing a specific URL. In this case you can use CCK field to reference a node (and then it's alias you need to build QR Code).
Or maybe I do not understand your need ! In my case it was the following : generate QR_CODE for content node linking. Let's say I create a book page : the QR Code representing the page URL is generated and displayed to specific user which then can copy it and add it to whatever print media desired (flyer, poster, CV...).
I realize we are out of the scope of this issue : use phpqrcode library.
So if you want to continue this discussion I suggest you open a support request ticket.
Comment #15
newToo CreditAttribution: newToo commentedThank you for your suggestions! I am using pathauto to create the node alias, and all of that is working correctly. I'm using Token to get the node alias into Mobile Codes and the image is being created. But the one problem I'm having is with Views, once I want to use the field that contains the url information that generates the qr code, it stops after the "/" in the url and produces a new qr code for the domain only.
So to clarify.
The CCK field produces a qr code that leads to: http://example.com/2232 - that's what i want.
But when brought over into views a new qr code is created for: http://example.com/
Everything after the slash is dropped, so the url alias is missing only on the view. It's weird, it's as if Mobile Codes produces a new qr code everytime the node is accessed.
I too realize this is beyond the scope of this disscusion, i just wanted to complete this thought.
Thank you so much for all of your help.
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedPlease, open a support ticket in Mobiles Codes and add the link to this ticket in this thread.
Since #12 we are beyond the scope !
Comment #17
newToo CreditAttribution: newToo commentedI've created a new support ticket for the Views issue (http://drupal.org/node/791794).
Comment #18
Deciphered CreditAttribution: Deciphered commentedSupport for PHP QR Code library coming to 6.x-2.x. It won't be dependent, but if the Libraries module is enabled and the Library is present it will be available as a Provider.
Comment #19
Deciphered CreditAttribution: Deciphered commentedCommitted to https://github.com/Decipher/mobile_codes (will be moved over to D.o. when ready for release).
Comment #21
newnewuser CreditAttribution: newnewuser commentedsubscribe
Comment #22
lameei CreditAttribution: lameei commentedhave done everything said on the readme file for adding the "phpqrcode" but it is not shown on the "providers" list. Am i missing something?