Back to vBulletin 4.x Template Modifications

QR Codes: In Templates and BB Codes
Mod Version: 1.0, by mmfgamer5

vB Version: 4.x.x Rating: (2 votes - 5.00 average) Installs: 11
Released: 03 Aug 2011 Last Update: Never Downloads: 0
Not Supported Template Edits Re-usable Code External Content  

What is a QR Code?
For those that don't know, a QR Code is a two dimensional graphic which can be interpreted by apps such as RedLaser (iPhone/Android). They are similar in principle to bar codes. QR Codes can link to a URL, show text, write emails, etc. They are being used more commonly in the real world, and on websites to allow people to quickly go where they want to on their mobile devices.

Templates
This template modification shows a QR Code automatically where the code is placed in templates. This is useful for users if they want to quickly get to somewhere on your forum on their mobiles.

Demo: http://www.cjmmedia.com/ (see the footer of each page - it leads to the current page URL; also in the post editor, there is the BB Code)

You can place these snippets anywhere in templates.

Page URL: leads users to the current URL that they are visiting.
PHP Code:
<!-- QR CodePage URL -->
<
img src="http://qrcode.kaywa.com/img.php?s=3&d=http://www.example.com/{vb:raw relpath}" alt=""/>
<!-- 
End of QR Code --> 
This could be placed in the footer template.

Member Profile: leads users to the profile of the user the QR Code is located on.
PHP Code:
<!-- QR CodeMember Profile -->
<
img src="http://qrcode.kaywa.com/img.php?s=3&d=http://www.example.com/member.php?{vb:raw post.userid}" alt=""/>
<!-- 
End of QR Code --> 
This could be placed in the postbit or postbit_legacy template.

Post Jump: leads users to the post that the QR Code is located on.
PHP Code:
<!-- QR CodePost Jump -->
<
img src="http://qrcode.kaywa.com/img.php?s=3&d=http://www.example.com/showthread.php?&p={vb:raw post.postid}&viewfull=1#post{vb:raw post.postid}" alt=""/>
<!-- 
End of QR Code --> 
This could be placed in the postbit or postbit_legacy template.

Change http://www.example.com/ to the URL of your website. The "s=3" is the size of the QR Code. This can also be changed. Below is a size 3 QR Code.



Feedback is always welcome. If you have any nice additional snippets for QR Codes and want to add them, feel free to post them below, and I'll add them.

NOTE: The license of http://qrcode.kaywa.com states that these should be used for non-commercial use only. Please use appropriately. Also note that the Kaywa QR Code generator is currently in beta. I do not own http://qrcode.kaywa.com, nor am I affiliated with it.

BB Code
This BB Code allows users to easily generate their own BB Codes. It allows users to change the size, too.

Title: QR Code Generator
BB Code Tag Name: qr
Replacement:
PHP Code:
<img src="http://qrcode.kaywa.com/img.php?s={option}&d={param}" alt=""/> 
Example: [qr="4"]http://www.example.com[/qr]
Description: Generates a QR Code based on the URL and size.
Use Option: Yes
Button Image:
Remove Tag If Empty: Yes
Disable BB Code Within This BB Code: Yes
Disable Smilies Within This BB Code: Yes
Disable Word Wrapping Within This BB Code: Yes
Disable Automatic Link Parsing Within This BB Code: Yes

When you add the new BB Code, it will probably give you an error - you can just ignore this.

Again, feedback is always welcone.

Download

No files for download.

Similar Mods

BB Code Images Miscellaneous Images
Profile Enhancements URL, BB code & Embed code information under album images vBulletin 3.7 Template Modifications

vblts.ru supports vBulletin®, 2022-2024