Jump to content

Domain Pricing Table feed by tld for every year


marieneige

Recommended Posts

Hi I would like to have the domain price table for every year but I don't get to do it. I tried to modify the feeds php file but this is just how far I went. I don't see how to change the years and I would like to have it only for 1 tld at once.

 

 

http://docs.whmcs.com/Data_Feeds

 

<?php

require("../init.php");
require("../includes/domainfunctions.php");

/*
*** USAGE SAMPLES ***

<style type="text/css">
table.domainpricing {
   width: 600px;
   background-color: #ccc;
}
table.domainpricing th {
   padding: 3px;
   background-color: #efefef;
   font-weight: bold;
}
table.domainpricing td {
   padding: 3px;
   background-color: #fff;
   text-align: center;
}
</style>
<script language="javascript" src="feeds/domainpricing.php?currency=1"></script>

*/

$code = '<table cellspacing="1" cellpadding="0" class="domainpricing"><tr><th>TLD</th><th>For 1 year</th></tr>';

if (!is_numeric($currency)) {
   $currency = array();
} else {
   $currency = getCurrency('', $currency);
}

if (!$currency || !is_array($currency) || !isset($currency['id'])) {
   $currency = getCurrency();
}

$whmcs = WHMCS_Application::getInstance();
$type = $whmcs->get_req_var('type');

$freeamt = formatCurrency(0);
$tldslist = getTLDList();
foreach ($tldslist AS $tld) {
   $tldpricing = getTLDPriceList($tld, true);
   $firstoption = current($tldpricing);
   $year = key($tldpricing);
   $code .= sprintf(
       '<tr><td>%s</td><td>%s</td></tr>',
       htmlspecialchars($tld, ENT_QUOTES, 'UTF-8'),
       htmlspecialchars($firstoption["register"], ENT_QUOTES, 'UTF-8')
   );
}


$code .= '</table>';

echo "document.write('".$code."');";

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated