|
Roadblock with updating database
|
|
07-29-2010, 05:19 PM
(This post was last modified: 07-29-2010 06:04 PM by stevenm.)
Post: #1
|
|||
|
|||
|
Roadblock with updating database
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: PHP Code: <ERRORS>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":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? |
|||
|
07-29-2010, 07:27 PM
Post: #2
|
|||
|
|||
|
RE: Roadblock with updating database
Well, you just need to edit the post function to include the lines of code that update it.
And for the orderform, you just need to perform all the code you need in the index and then use the template system to get the code on the orderform. Jonny H - THT Main Developer & Founder |
|||
|
07-29-2010, 07:55 PM
(This post was last modified: 07-29-2010 07:55 PM by Nick.)
Post: #3
|
|||
|
|||
|
RE: Roadblock with updating database
your current ACP page already works perfectly, thanks to the fact that all submitted data on the settings page is automatically updated into the config by the following portion of admin/pages/settings.php, so nothing needs to be done there.
PHP Code: if($_POST) {As for the orderform, do as Jonny said and put the php code in order/index.php and use the templating system ($style->replaceVar) with the %VAR% variables to get it into the order form. What you have so far looks nice, hopefully you will release this as a plugin once its done. Nick - TheHostingTool Staff Coordinator ![]() |
|||
|
07-12-2011, 01:57 AM
Post: #4
|
|||
|
|||
|
RE: Roadblock with updating database
But even with such steps in place, the DBA and SQL developers encountered roadblocks when updating the databases.
Bariatric Surgery in India |
|||
|
07-14-2011, 08:25 PM
Post: #5
|
|||
|
|||
RE: Roadblock with updating database
(07-29-2010 07:55 PM)Nick Wrote: your current ACP page already works perfectly, thanks to the fact that all submitted data on the settings page is automatically updated into the config by the following portion of admin/pages/settings.php, so nothing needs to be done there. Looking back on this, my gut really hates that code's approach. Kevin Mark - TheHostingTool Lead Developer |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)






![[Image: standard.png]](http://twitstamp.com/thehostingtool/standard.png)

![[Image: standard.png]](http://twitstamp.com/kmark937/standard.png)