-M- Posted July 15, 2016 Share Posted July 15, 2016 Hi (seems it's question day today ) I never knew anything about the existence of 'Data Feeds' (thanks again for pointing that out brian!). Anyways, I need to make a small modification to the 'domainpricing.php' so it adds a simple text to it's output. Here is most of the code from it: $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"]; $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."');"; I am guessing that the variable I want to "modify" is the one called $year. Now it displays just 1, 2, 3, etc. (amount of years for minimum registration period). I want it to show 1 jaar, 2 jaar, 3 jaar, etc. So I don't only want a number but also the term "jaar" behind it. I tried various things, but I get a blank page (improper coding clearly) or I don't get "jaar" added... My "best" try so far: $jaar = $year . "jaar"; <snip> $jaar, The word 'jaar' is not being added... Normally this is the correct way to display text behind a variable right? ...what am I doing wrong? Regards 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 15, 2016 Share Posted July 15, 2016 you're going to like this... what you need to do is change the table output line... '<tr><td>%s</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td></tr>', to... '<tr><td>%s</td><td>%d jaar</td><td>%s</td><td>%s</td><td>%s</td></tr>', 1 Quote Link to comment Share on other sites More sharing options...
-M- Posted July 15, 2016 Author Share Posted July 15, 2016 you're going to like this... what you need to do is change the table output line... '<tr><td>%s</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td></tr>', to... '<tr><td>%s</td><td>%d jaar</td><td>%s</td><td>%s</td><td>%s</td></tr>', Aaaaaaaaargh.... Now that you showed me, it makes complete sense. I don't understand why I am doing everything the hard way... Thanks for answering my foolish question brian! 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.