vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Miscellaneous Hacks - QR Codes: In Templates and BB Codes (https://vborg.vbsupport.ru/showthread.php?t=267847)

mmfgamer5 08-01-2011 10:00 PM

QR Codes: In Templates and BB Codes
 
1 Attachment(s)
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.

https://vborg.vbsupport.ru/external/...6p%3d1%23post1

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: https://vborg.vbsupport.ru/external/2011/08/117.png
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.

sulasno 08-02-2011 11:35 PM

tagged and thanks

final kaoss 05-03-2016 09:14 AM

Interesting. Still working with the latest vb4 versions?

tme_power 06-19-2016 08:43 AM

This BBcode depend on services at qrcode.kaywa.com


All times are GMT. The time now is 05:40 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01165 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete