Hey guys!
I just installed THT v1.2.2 and LOVE the new features, however the included CAPTCHA didn't work for me for some reason. As a result, I began coding in functionality for THT to use reCAPTCHA instead. I've found all the TPLs and edited the PHP files, but for the life of me I can't figure out how to get THT to update the database when I click the "Edit Settings" button on the "reCAPTCHA Configuration" admin page that I created. Here's the code I currently have in recaptchasettings.tpl:
Very simple - it creates 2 text boxes and an "Edit Settings" button. If I manually add the public and private keys to the new rows in the database ("rc-publickey" and "rc-privatekey" in the *_config table), they will show up in the fields (with the following code added to admin/pages/settings.php):
I've also added the code to the same file that will display the link to my new page.
What do I need to do to get the entered keys into the database? Help will be greatly appreciated!
P.S. I hope that all makes sense!
EDIT: Another question: in orderform.tpl, how do I include PHP code, and include the $db global?
I just installed THT v1.2.2 and LOVE the new features, however the included CAPTCHA didn't work for me for some reason. As a result, I began coding in functionality for THT to use reCAPTCHA instead. I've found all the TPLs and edited the PHP files, but for the life of me I can't figure out how to get THT to update the database when I click the "Edit Settings" button on the "reCAPTCHA Configuration" admin page that I created. Here's the code I currently have in recaptchasettings.tpl:
PHP Code:
<ERRORS>
<form id="settings" name="settings" method="post" action="">
<table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td valign="top">reCAPTCHA Public Key:</td>
<td><input size="60" type="text" name="rc-publickey" id="rc-publickey" value="%PUBLICKEY%" /></td>
</tr>
<tr>
<td valign="top">reCAPTCHA Private Key:</td>
<td><input size="60" type="text" name="rc-privatekey" id="rc-privatekey" value="%PRIVATEKEY%" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="add" id="add" value="Edit Settings" /></td>
</tr>
</table>
</form>
Very simple - it creates 2 text boxes and an "Edit Settings" button. If I manually add the public and private keys to the new rows in the database ("rc-publickey" and "rc-privatekey" in the *_config table), they will show up in the fields (with the following code added to admin/pages/settings.php):
PHP Code:
case "recaptcha":
$array['PUBLICKEY'] = $db->config("rc-publickey");
$array['PRIVATEKEY'] = $db->config("rc-privatekey");
echo $style->replaceVar("tpl/recaptchasettings.tpl", $array);
break;
I've also added the code to the same file that will display the link to my new page.
What do I need to do to get the entered keys into the database? Help will be greatly appreciated!
P.S. I hope that all makes sense!

EDIT: Another question: in orderform.tpl, how do I include PHP code, and include the $db global?