brian! Posted November 12, 2016 Share Posted November 12, 2016 any chance you can post your feed code so I can see which you're using - i've posted so many variations in this thread, it would be helpful to know. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 13, 2016 Share Posted November 13, 2016 with regards to removing GBP, one option would be to change the line of code below from true to false - that would remove all currencies symbols from the pricing output, and you could then add the £ symbol back in to the output... $tldpricing = getTLDPriceList($tld, false); and... $code .= sprintf('<tr><td>%s</td><td><strike>£%s</strike> <font color=red>£%s</font></td><td>£%s</td><td>£%s</td></tr>', 0 Quote Link to comment Share on other sites More sharing options...
Solid Dev Posted November 13, 2016 Share Posted November 13, 2016 Hi, Thanks for the help with removing the currency symbols. This has had the knock-on effect of resolving the other issue with displaying the offer prices, possibly because comparison of the register price and the renew price is only dealing with numbers now. 0 Quote Link to comment Share on other sites More sharing options...
mihai666g Posted April 8, 2020 Share Posted April 8, 2020 (edited) Hi @brian! I tried to replicate your table feed example and I got this error PHP Parse error: syntax error, unexpected '$code' (T_VARIABLE) in /path/datafeed.php on line 13 Is this code valid for php 7.2 ? <?php require("../init.php"); require("../includes/domainfunctions.php"); /* *** USAGE SAMPLES *** <script language="javascript" src="feeds/domainpricing2.php?currency=1"></script> */ $code = '<table cellspacing="1" cellpadding="0" class="domainpricing"><tr><th>TLD</th><th>Min. Years</th><th>Register</th><th>Transfer</th><th>Renew</th></tr>'; if (!is_numeric($currency)) { $currency = array(); } else { $currency = getCurrency('', $currency); } if (!$currency || !is_array($currency) || !isset($currency['id'])) { $currency = getCurrency(); } $freeamt = formatCurrency(0); $tldslist = getTLDList(); foreach ($tldslist AS $tld) { $tldpricing = getTLDPriceList($tld, true); $firstoption = current($tldpricing); $year = key($tldpricing); $transfer = ($firstoption["transfer"] == $freeamt) ? $_LANG['orderfree'] : $firstoption["transfer"]; if ($firstoption["register"] < $firstoption["renew"]) { $code .= sprintf( '<tr><td>%s</td><td>%d</td><td><strike>%s</strike> <font color=red>%s</font></td><td>%s</td><td>%s</td></tr>', htmlspecialchars($tld, ENT_QUOTES, 'UTF-8'), $year, htmlspecialchars($firstoption["renew"], ENT_QUOTES, 'UTF-8'), htmlspecialchars($firstoption["register"], ENT_QUOTES, 'UTF-8'), htmlspecialchars($transfer, ENT_QUOTES, 'UTF-8'), htmlspecialchars($firstoption["renew"], ENT_QUOTES, 'UTF-8') ); } else { $code .= sprintf( '<tr><td>%s</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td></tr>', htmlspecialchars($tld, ENT_QUOTES, 'UTF-8'), $year, htmlspecialchars($firstoption["register"], ENT_QUOTES, 'UTF-8'), htmlspecialchars($transfer, ENT_QUOTES, 'UTF-8'), htmlspecialchars($firstoption["renew"], ENT_QUOTES, 'UTF-8') ); } } $code .= '</table>'; echo "document.write('".$code."');"; Edited April 8, 2020 by mihai666g 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 9, 2020 Share Posted April 9, 2020 19 hours ago, mihai666g said: I tried to replicate your table feed example and I got this error it's rarely a good idea to use 4 year old code... no guarantees that it's going to work. 🙂 just use the version you have of the domainpricing.php feed as a starting point... if you need to make changes to it, duplicate it and edit the duplicate. 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.