vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   QR codes into Downloads II mod (https://vborg.vbsupport.ru/showthread.php?t=266963)

pizzamargherita 07-17-2011 08:59 AM

QR codes into Downloads II mod
 
I've the intention to add automatically a QR for each file into the Downloads II mod I've installed into my website, to allow users downloading file from their smartphones.

I've yet found the code I need to reach this point, but it won't work properly for my case.

Check it:
The html...
HTML Code:

<img src="http://chart.apis.google.com/chart?chs=150x150&amp;cht=qr&amp;chl=convert-this&amp;choe=UTF-8&amp;chld=L|4">
...is able to convert the text "convert-this" into a QR code.

This is the return image:
https://vborg.vbsupport.ru/external/2011/07/66.jpg

So I put the page url in place of "convert-this" to have the QR code for each download page.
I've modified the code as you can see:
HTML Code:

<img src="http://chart.apis.google.com/chart?chs=150x150&amp;cht=qr&amp;chl=http://www.moddingstudio.com/downloads.php?do=file&amp;id={vb:raw file.id}&amp;choe=UTF-8&amp;chld=L|4"></img>
..but the variable {vb:raw file.id} is not interpreted by vbulletin. (is simply ignored).

What can I do to correct this issue?
(I think this can be useful for many people, also for vb pages or cms articles)

Thank you in advance!
(And sorry for my bad english, but I'm italian)

HMBeaty 07-17-2011 01:42 PM

Quote:

Originally Posted by pizzamargherita (Post 2221418)
I think that variables like {vb:raw abcd} are ignored by vbulletin under certain tags like <img>.
I'm true?
Alternatively, I can with any method insert under the <img> tag the current url??

Yes, so you would have to use...
HTML Code:

<img src="http://chart.apis.google.com/chart?chs=150x150&amp;cht=qr&amp;chl=http://www.moddingstudio.com/downloads.php?do=file&amp;id='.$file.id.'&amp;choe=UTF-8&amp;chld=L|4"></img>

pizzamargherita 07-18-2011 04:30 AM

SOLVED: Google charts recognizes the "&" digit as parameters separator.
It's enough to change the "&" digit in the url into "%26"...

resulting code:
HTML Code:

<img src="http://chart.apis.google.com/chart?chs=150x150&amp;cht=qr&amp;chl=http://www.moddingstudio.com/downloads.php?do=file%26id={vb:raw file.id}&amp;choe=UTF-8&amp;chld=L|4">
It works very nice!
You can check out the final result clicking here: http://www.moddingstudio.com/downloa...do=file&id=181

BirdOPrey5 07-18-2011 04:43 PM

Very cool :up:.


All times are GMT. The time now is 01:01 AM.

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.01088 seconds
  • Memory Usage 1,724KB
  • 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_html_printable
  • (1)bbcode_quote_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