Open tditlu opened 5 years ago
I'll check this out over the weekend.
Okay I checked this out; takes ages to generate the votekey page (I'm running it on a Raspberry Pi) and I think it's because it's all tables? Wouldn't it be easier to have an qrcodevotekeys/image.php?url=...
that just serves up the images? Or at least have an option for it?
Another thing is that I think we had a misunderstanding; I meant that the QR should be a substitution token like {%VOTEKEY%}
on www_admin/votekeys.php
so that people can arrange them any way they want and add text around it.
(If you don't wanna deal with these that's fine by me, I can go and do these adjustments myself.)
Can do the table to image option, but the votekey-thingey you have to elaborate some more... ;)
I have added ability to change how the QR code is generated, I also found a bug, see above
Can do the table to image option, but the votekey-thingey you have to elaborate some more... ;)
Yeah, what I meant was rather than having the votekeys_print_votekey_*
hooks print directly, they should offer the user new {%...%} tokens so that they can format the votekey+QR any way they want.
Basically something like:
print("<li>");
$html = str_replace("{%VOTEKEY%}", $t->votekey, $format);
run_hook("votekeys_print_votekey_after", array("html" => &$html)); // this code can do even more replacements
echo $html;
print("</li>");
... and then add a hook to the admin to notify the user of more {%...%} tokens. That way the user can shuffle the {%VOTEKEY%} and e.g. {%QRIMG%} tags around, add custom text, custom markup, formatting, and so on.
Does that make sense?
Yes, now i understand, but if a user then has set the votekey format (votekeys_format
) in settings to something like <h1>{%VOTEKEY%}</h1>
, then the string sent into the QR Code genarator would include HTML, or?
Yes, now I understand, but if a user then has set the votekey format (
votekeys_format
) in settings to something like<h1>{%VOTEKEY%}</h1>
, then the string sent into the QR Code genarator would include HTML, or?
Or do you mean that you have to add {%QRIMG%}
to votekeys_format
to get the plugin to work?
The latter; meaning that if the user wants their QR code on the votekey, they can change it to something like {%QRIMG%}<br/>{%VOTEKEY%}
, or switch the two if they want the key above the votekey, or completely remove the votekey, etc etc.
Only minor changes made to the core, everything else in a plugin