jaatendi Posted July 16, 2010 Share Posted July 16, 2010 I took the part of the registration process where the viewer clicks "DNS management" out, as I found it confusing. I would like to allow my clients to manage their DNS settings if they choose to do so, and would like to set it up so that DNS management is automatically turned on. I understand that in their account area along with their support tickets and invoices, will be an area to manage DNS. I have heard that I need to set up a hook to make this happen, but I am not a programmer. Is there some existing code that I can paste in? I would be super appreciative if anyone can point me in the right direction. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Grizzlyware Josh Posted July 17, 2010 Share Posted July 17, 2010 This code should do it for you... I tested it on my dev setup so it works Just to confirm what it does: it will turn DNS Management ON for EVERY domain in your system. If that's not what you want, don't install it! <?php // Written by Josh Bonfield - josh@b-digital.biz // Place these lines in a file called autodns_manage_hook.php in the /includes/hooks/ folder // On the daily cron, it will search for all who have DNS management as OFF and set it to ON. function autodns_manage_hook() { // Set all DNS Management options to ON $sql = "SELECT id FROM `tbldomains` WHERE `dnsmanagement` = '';"; $sql = mysql_query($sql); while($row = mysql_fetch_assoc($sql)) { // Loop through & set them all to 'on' $sql2 = "UPDATE `tbldomains` SET `dnsmanagement` = 'on' WHERE `tbldomains`.`id` =".$row["id"].";"; $sql2 = mysql_query($sql2); } } add_hook('DailyCronJob', 0, 'autodns_manage_hook'); ?> 0 Quote Link to comment Share on other sites More sharing options...
jaatendi Posted July 30, 2010 Author Share Posted July 30, 2010 Sweet! thanks alot 0 Quote Link to comment Share on other sites More sharing options...
jaatendi Posted July 30, 2010 Author Share Posted July 30, 2010 Shoot it didn't work 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted July 30, 2010 Share Posted July 30, 2010 Not really sure why you're looping through all the domains, its not really needed other than to add extra fluff to basically a one-liner. Try this: function autodns_manage_hook() { update_query("tbldomains", array("dnsmanagement"=>"on"), array("dnsmanagement"=>"")); } add_hook('DailyCronJob', 0, 'autodns_manage_hook'); 0 Quote Link to comment Share on other sites More sharing options...
jaatendi Posted August 2, 2010 Author Share Posted August 2, 2010 Thanks, should I place the code in a file called autodns_manage_hook.php in the /includes/hooks/ folder? I got the same result as using bdigitalstudios code, it places the following code above my website (visible in the frontend): {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf250 {\fonttbl\f0\fmodern\fcharset0 Courier;} {\colortbl;\red255\green255\blue255;} \margl1440\margr1440\vieww9000\viewh8400\viewkind0 \deftab720 \pard\pardeftab720 \f0\fs24 \cf0 function autodns_manage_hook()\ \{\ update_query("tbldomains", array("dnsmanagement"=>"on"), array("dnsmanagement"=>""));\ \}\ \ add_hook('DailyCronJob', 0, 'autodns_manage_hook');\ } Could this be due to the fact that I am using softwared called Jintegrator! to integrate WHMCS into joomla? 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted August 2, 2010 Share Posted August 2, 2010 Could be, make sure that display_errors is turned off in configuration.php 0 Quote Link to comment Share on other sites More sharing options...
jaatendi Posted August 3, 2010 Author Share Posted August 3, 2010 ok, I looked at the configuration.php file in the root of my WHMCS, as well as the joomla one, I didnt see anyting about display_errors. Which file, and where? 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted August 3, 2010 Share Posted August 3, 2010 ok, I looked at the configuration.php file in the root of my WHMCS, as well as the joomla one, I didnt see anyting about display_errors. Which file, and where? display_errors would be in the configuration.php file for whmcs. Its not there by default, so you would have had add it for it to be there. Otherwise I'm not sure what the problem might be. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.