Jump to content

Lek

Member
  • Posts

    39
  • Joined

  • Last visited

1 Follower

About Lek

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Lek's Achievements

Member

Member (2/3)

0

Reputation

  1. Hello brian! You direct me in the right direction. It was an hosting related feature. To let idn_to_utf8 works also intl must be enable. So I did enable it and now it is OK, I can read the domain in both Latin and Thai characters. Thank you very much. By the way, I did try and then abandoned the idea of wrap php in tpl in the {php} tags but did not work. Maybe should be enable other things in the smarty. I wrap the whole code at the really top of the page. But at this point really it does not matter. Have a nice day, bye. Lek
  2. Yes this is exactly what I was looking for but for some reasons in my system the idn_to_utf8($domain.domain) or echo idn_to_utf8('xn--tst-qla.de'); does not work, instead it does work this: <?php // for those who has PHP older than version 5.3 class IDN { // adapt bias for punycode algorithm private static function punyAdapt( $delta, $numpoints, $firsttime ) { $delta = $firsttime ? $delta / 700 : $delta / 2; $delta += $delta / $numpoints; for ($k = 0; $delta > 455; $k += 36) $delta = intval($delta / 35); return $k + (36 * $delta) / ($delta + 38); } // translate character to punycode number private static function decodeDigit($cp) { $cp = strtolower($cp); if ($cp >= 'a' && $cp <= 'z') return ord($cp) - ord('a'); elseif ($cp >= '0' && $cp <= '9') return ord($cp) - ord('0')+26; } // make utf8 string from unicode codepoint number private static function utf8($cp) { if ($cp < 128) return chr($cp); if ($cp < 2048) return chr(192+($cp >> 6)).chr(128+($cp & 63)); if ($cp < 65536) return chr(224+($cp >> 12)). chr(128+(($cp >> 6) & 63)). chr(128+($cp & 63)); if ($cp < 2097152) return chr(240+($cp >> 18)). chr(128+(($cp >> 12) & 63)). chr(128+(($cp >> 6) & 63)). chr(128+($cp & 63)); // it should never get here } // main decoding function private static function decodePart($input) { if (substr($input,0,4) != "xn--") // prefix check... return $input; $input = substr($input,4); // discard prefix $a = explode("-",$input); if (count($a) > 1) { $input = str_split(array_pop($a)); $output = str_split(implode("-",$a)); } else { $output = array(); $input = str_split($input); } $n = 128; $i = 0; $bias = 72; // init punycode vars while (!empty($input)) { $oldi = $i; $w = 1; for ($k = 36;;$k += 36) { $digit = IDN::decodeDigit(array_shift($input)); $i += $digit * $w; if ($k <= $bias) $t = 1; elseif ($k >= $bias + 26) $t = 26; else $t = $k - $bias; if ($digit < $t) break; $w *= intval(36 - $t); } $bias = IDN::punyAdapt( $i-$oldi, count($output)+1, $oldi == 0 ); $n += intval($i / (count($output) + 1)); $i %= count($output) + 1; array_splice($output,$i,0,array(IDN::utf8($n))); $i++; } return implode("",$output); } public static function decodeIDN($name) { // split it, parse it and put it back together return implode( ".", array_map("IDN::decodePart",explode(".",$name)) ); } } echo IDN::decodeIDN($_SERVER['HTTP_HOST']); ?> I don't know why the idn_to_utf8 does not work, I have php 5.6 it should work. Anyway how can I add the above php instruction in the .tpl? So I will then use IDN::decodeIDN instead of idn_to_utf8. Thank you, bye. Lek
  3. Hello, I would like to show idn domain in the client area/my domains in utf8. For example instead of seei xn--tst-qla.de it should be able to see both: xn--tst-qla.de and täst.de I already have the php that translate from idn to utf8 so I just should insert a duplication of the database query. Which one is the file that contain that specific line? I attached an image to better understand. In the image there is no correspondence is an example. Thank you, bye. Lek
  4. Hi, I found it and did work, the file is in templates/name_of_template(six in my case)/includes. But I would like to apply captcha only in the contact form (contact.php). Thank you for any idea. Lek
  5. Hi, please can you tell me where is this file and the name? Thank you.
  6. Hi, maybe I will upgrade but still I am afraid to incur in many problems after upgrade so I should find the time to do it right. Thank you anyway for now. Bye, Lek
  7. Hi Brian, thank you for your answer. Yes I check already these solution and I did apply to my tables. The problem is that then are not shown (show only 2 decimal). I think the solution is in here: https://requests.whmcs.com/topic/apostrophe-thousand-separator-currency-format Exactely from WHMCS Dev Team: but before update I would like to be sure it works. I did not find any recall in http://docs.whmcs.com/Version_7.1_Release_Notes Do you have a 7.1 that show 4 decimal? About the Marketplace all the plugin let you shop in common currency and then they convert in Bitcoin as I am already doing. Instead, I would like to show the price in Bitcoin. Thank you, bye. Lek
  8. Hi, I would like to have at list 4 decimal to accept payment in Bitcoin. I already modify the table (decimal 10, 2 to 10,4) and I even modify the current rate to convert to base currency to 10,8 (8 decimal). But the cart show only 2 decimal. I think the problem is in the currency format (configcurrencies.php)That offer only 4 different format. How can be edited it? Or other solution to show more decimal to sell with Bitcoin? Version WHMCS: 6.3.1 Thank you.
  9. OK, got it. So let's renounce to all icons of the fontawesome pack, how to remove? Should I change all css that link to it or there is another way? Or beside the css there are other file to modify? Thank you, Bye. Lek
  10. Hi, thank you for your inputs. Yes fontawesome for icon I want to keep. About the font file even if it is only 98Kb I wish to use standard Arial font. I will try anyway to use the link to https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff well, I was thinking to do it before replay to you but got busy a little, sorry, I will try as soon. The 300ms issue depend from where I check it. For example from Europe is much less. Please let me know if/how can avoid to use the webfont woff. Thank you, bye. Lek
  11. Hi, I always worry about speed. Sometimes I worry too much but as user of internet I get annoyed from slow websites and I abandon them. I perfectly understand that an e-commerce with cart that allow choose services and put in the cart can't be as fast as a static website. Anyway I noted that some precious seconds of my life are taken for loading fonts also in Whmcs. In details assets/fonts/fontawesome-webfont.woff... 1) How can I remove completely the use of these font? 2) Can just use default fonts in browser or in css (for example font-family:arial) without download? 3) Should I remove all the css instruction referring to .woff file or there is a fast way to disable completely? 4) I try to rename the folder font to avoid the use of the font and the website apparently looks the same but anyway it use about 300ms for each 404 answer in the time frame and it does not look to me a valid solution. Thank you in advance for any suggestion, สวัสดี Lek
  12. Yes, perfectly working! Thank you, bye. Lek
  13. Hi, thank you for your easy suggestion. I applied it and I saw the "page 2/2" but only at the end of the second page. So what I did (no pain road) was also to add the footer in the header... : # Header Bar $pdf->SetFont($pdfFont, 'B', 15); $pdf->SetFillColor(239); $pdf->Cell(0, 8, $pagetitle, 0, 1, 'L', '1'); $pdf->SetFont($pdfFont, '', 10); $pdf->Cell(0, 6, Lang::trans('invoicesdatecreated') . ': ' . $datecreated, 0, 1, 'L', '1'); $pdf->Cell(0, 6, Lang::trans('invoicesdatedue') . ': ' . $duedate, 0, 1, 'L', '1'); $pdf->Ln(10); $startpage = $pdf->GetPage(); # Here my add: $pdf->setPrintFooter(true); # Clients Details So now I have page 1/2 in first page and page 2/2 in the second page It works! It does not matter is only English. Eventually I can modify the word page and add a second word. Any known side effect of this footer in the header? Waiting for comments. Bye, Lek
  14. Hi, it sounds good and exactly what I need. But what about my Version: 6.3.1? Can i do the same? Thank you
  15. Hi, thank you for your replay. The problem is not when the customer see the invoice on the screen, that can be vary, but when they print as pdf (download as pdf). In that case if the invoice has more than one page there is no note that state how many pages are in total so, officially, the invoice can end at the end of the first page. I could in the first page add an item: "Page one of two" with price = 0 and in the second page another item "page 2 of 2" with price = 0. ...not so fancy... But I was thinking if the pdf generated with the invoice template can automatically insert the number of page of the file in the format "page 1 of 2", "page 2 of 2". Like in Word for example when you insert page number and automatically more the file is long the page number of pages will be reported. let me know if any idea. Bye, Lek
×
×
  • 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