Jump to content

HancoEuropa

Member
  • Content Count

    46
  • Joined

  • Last visited

Community Reputation

2 Neutral

About HancoEuropa

  • Rank
    Member

Recent Profile Visitors

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

  1. +1 snake. i'd like to pipe a bunch of email boxes to a single support department. having to make a separate department for each email is ... odd thinking. Only 13 years later now :)))
  2. Issue -- for anyone who cares -- was competing parsers. This issue is only likely to affect sites running on multiple language-specific domains (i.e., not the domain specified in General Settings) using WPML in WordPress. WHMCS Bridge in WordPress uses its parser.inc.php file, competing with the WHMCS url functions .... we also use WPML parser on top of WordPress, just to make our lives insanely complicated. But for multi-language, multi-currency, multi-domain -- gotta have all 4 parsers singing the same tune somehow. That "singing the same tune" means ALL parsers need to be "basic" rather than Friendly. (Yes, despite everyone thinking THEIR parser "should" work fine with Friendly urls). We did a week of intense testing to figure out what and how would work -- after about 15 dead ends -- finally, the "all-basic" thing worked. But that means going through and enforcing the "dumbed down" urls everywhere. For example, the reference to one of Stripe's "/get/payment" type post commands in the js was in the friendly mode ... additionally, the < link reference to the scripts.min.js was also in friendly mode. Changes to resolve: Add a seemingly superfluous script to includes/head.tpl saying with src="{$root}?ccce=js&ajax=1&js=templates/templatename/js/scripts.min.js" (in "basic" url parameter=value format). This allows the non-base WHMCS domains to access that file in a way that Stripe (and clientarea!) can figure out. Change the references in the stripe.js to remove the WHMCS.getRouteURL with plain-text references using basic links. A strange side effect of all this is that the WHMCS Bridge parser continually tries to substitute the "six" template for the default and set WHMCS template -- but only in the non-English language domains, English with the domain set in General Settings works seamlessly. For now, we're just copying over the whole default template to six. So bizarre, but works. We base all templates on latest Twenty-One template of course. End of the day, basic urls are the only "lingua franca" that parsers can manage. One day when we have time, we'll need to write an uber-parser or something I think. I remember how Brian! chided WHMCS for it's lack of awareness with multi-language sites (we all miss him I'm sure). Frankly the version 8 improvements are really fantastic. For example, Stripe, now working fine in all languages and domains, is a JOY to have on our checkout and invoice payment template pages! While WHMCS has a lot on it's plate and is doing well on gateways and integrations -- would be nice if they could get a team together to explore real-world, multi-domain, multi-language scenarios. WordPress isn't going away, and having a native WordPress bridge with a unified cross-origin/cross-domain parser would be brilliant, particularly one that works with WPML or one or two other language plug-ins. It's just that our issues should be handled by the core functions in WHMCS, rather than tacking together add-ons and plug-ins to cope with the basic business requirement of selling in different languages. People would pay handsomely for a WHMCS International version with WP front end. I know we would have. Cheers!
  3. Nevermind, it's a template issue, we copied over fresh standard_cart and twenty-one from github, transaction went through. Rebuilding our custom work now figuring out what and why the issue is. Thanks!
  4. Hehe no bear, no full secret keys being shown there :)) And I think on the secret there (highlighted in red), they show the "last four" on the screen after an elipsis. You can see they both start with the "sk_live" moniker. So yeah, honest, the bits entered in the module ARE indeed identical copy pastes from Stripe. We just can't figure out how to "monitor" what is being sent by WHMCS to Stripe to confirm Stripe's assertion that the correct secret key is not being sent. The PHP files of course are all ioncube in WHMCS that do the work ...
  5. Okay, this one is odd. We've got the right keys in the right slots with the Stripe Gateway payment method, but Stripe says WHMCS is not sending the right keys. Weird. Did error logging, disabled all custom hooks, looked at all logs ... no clue. Everything thinks it is working just fine -- except for Stripe, which says This API call cannot be made with a publishable API key. Please use a secret API key. Which is kinda nuts, cuz yeah, we checked, we put the right keys in the right boxes (doesn't accept wrong keys anyway in the gateway module). Yes, we changed to twenty-one template and tested, made sure we're on 8.4.1 with updated scripts and everything, and no, zero errors in the Console, although a strange [WHMCS] Parse error shows up in the Info messages (probably been there a while). Stripe is just dead certain it's being fed the wrong keys, despite the fine art of "copy and paste" being employed by us from their live keys. Help!
  6. Sorry to bother, but I must be missing something fundamental here. I'm a noob at feeds (clearly). productsinfo.php is working fine, producing results perfectly in the Wordpress header. I'm doing a "userstatus.php", but I can't seem to get ahold of the CurrentUser Tried: (See screenshot 1, cloudflare on this board isn't letting me paste php code ...) Also tried the old fashioned way: (See screenshot 2 please) Neither work -- both return "Logged Out". For voodoo, I included script in the wordpress head: (screenshot 3) What gives? Why can't I get the SESSION or the CurrentUser using a feed in a wordpress page? Perversely, even when the clientarea is showing (see attached), that feed will throw up "Logged out" :))) Clearly I'm missing something quite obvious! Thanks, David
  7. Yeah, I have similar issue with keys -- Stripe is saying WHMCS is providing a publishable instead of secret key No idea. The keys are live and correct in the gateway module.
  8. As our Brian had noted, the language files do indeed have month and day names in them, such as "$_LANG['dateTime']['january']". This could be used to do a "lookup" using the written month name in English within a template by using a lowercase month name value with the {lang key=$monthname} somehow. But that means that the system date formatting needs to have the full month name, which is not always useful elsewhere throughout WHMCS. We found it's easier to just add a little list in the language files of numbered month (and day) names, like this: $_LANG['month-01'] = "January"; $_LANG['month-02'] = "February"; $_LANG['month-03'] = "March"; etc And in General Settings, the global system date is set to the standard DD/MM/YYYY and formatting also set to that Global setting That way, formatting a date within the template to the right language is slightly simpler: {$date|substr:0:2} {$monthnum = $date|substr:3:2}{lang key="month-$monthnum"} {$date|substr:6:4} Not too long, not perfect, but works fine. Cheers
  9. Hey ricrey! You can append single words after the search, such as /knowledgebase/search/cpanel/ Sometimes it works using hyphens as well, such as /cpanel-tutorial/ I've only tested this with friendly URLs (i.e. /whmcs/knowledgebase/search/wordhere ) Good question though, and clearly would be useful if it were reliable. I tested also with spaces, '%20', +, & etc, but no-go, it turns those into nulls, making for an ugly word in the search box (and no results). Maybe there is a ?query= type parameter we don't know about. Hope this helps mate.
  10. Andrew and string, thanks so much for the investigation, and yes, I suspected there was some check and clear routine associated with the Add/Edit hooks. My workaround was fairly simple -- I just moved the function to the AdminAreaPage hook and tested for filename/pagetitle to filter. Worked fine there, avoided the extra checking from the other hook points. Really appreciate you confirming this was an intended feature. We're using the announcements table as product pages -- the explanation of the products/services for the clients, adding pid and gid columns to suit. My code is auto-inserting the language rows for the announcements (we have quite a few), using automated translations hooks to fetch the translations and insert them on the fly. Native language staff later review the auto-translations, only making minor corrections, rather than starting with a blank page. Andrew, appreciate the job to look at adjustment in hook point running: string, I did use your: most useful, thanks for that -- and yes, it is created for a few milliseconds and then gets "cleaned up" by the AnnouncementEdit hook. Cheers mates! ============ The function where this was happening -- at the insertGetId , made a note about 1/3 way down: function checkAnnounce ($pid, $lang) { $product = Capsule::table('tblproducts')->where('id',$pid)->first(); if ($product) { $trantime = date('Y-m-d H:i:s'); $productname = trim($product->name); if (strlen($productname) < 3) { $productname = '('.Lang::trans('product.placeholder').' for Solution '.$pid.')'; } $hourly = intval($product->is_hourly); $pid = intval($product->id); $aid = intval($product->aid); $gid = intval($product->gid); $kid = intval($product->kid); $slug = trim($product->slug); $descproduct = trim($product->description); $thisannounce = Capsule::table('tblannouncements')->where([['pid',$pid],['language','']])->first(); $descannounce = $thisannounce->announcement; if ($descannounce == null) { $descannounce = ' '.Lang::trans('thisnewsolution'); } $tranparent = $thisannounce->id; //additional languages added here in foreach after beta $tranlang = 'romanian'; $tranphrase = '<h5>În prezent traducem această pagină în limba română</h5>'; if (strlen($descannounce) < 10) { $descannounce = $descproduct; } /*in case the friggin' name changed, update English version... */ $update = Capsule::table('tblannouncements')->updateOrInsert(array('pid'=> $pid, 'language'=>''), array('date' => $trantime,'updated_at' => $trantime, 'pid'=>$pid,'gid'=>$gid,'kid'=>$kid, 'published'=>1, 'language'=>'', 'parentid' => 0, 'announcement' => $descannounce)); $getenglish = Capsule::table('tblannouncements')->where([['pid',$pid],[ 'language','']])->first(); if ($getenglish && ($aid == 0 || $aid !== $getenglish->id)) { $aid = $getenglish->id; //the aid has changed. $productupdate = Capsule::table('tblproducts')->where('id',$pid)->update(array('aid'=>$aid,'gid'=>$gid,'name'=>$productname)); $tranparent = $getenglish->id; } $gettran = Capsule::table('tblannouncements')->where([['pid',$pid],[ 'language',$tranlang],['parentid',$tranparent]])->first(); if ($gettran) { $tranaid = $gettran->id; //the aid has changed. //check for defective tran (too short compared to english) if (strlen($gettran->announcement) < (.9*strlen($getenglish->announcement))) { $updatetran = Capsule::table('tblannouncements')->where([['pid',$pid],[ 'language',$tranlang],['parentid',$tranparent]])->update(array('announcement'=>$getenglish->announcement)); } } else { /* This is where the announcement was created and then deleted when run with trigger of AnnouncementEdit hook */ $tranannounce = Capsule::table('tblannouncements')->insertGetId(array('date' => $trantime,'updated_at'=>$trantime,'title' => $productname,'pid'=>$pid,'gid'=>$gid,'kid'=>$kid, 'published'=>0, 'language'=>$tranlang, 'parentid'=>$tranparent, 'announcement' => $tranphrase.$thisannounce->announcement)); $tranaid = $tranannounce; } $gettran = Capsule::table('tblannouncements')->where([['pid',$pid],[ 'language',$tranlang],['parentid',$tranparent]])->first(); //now see if we can move any Solutions translations into the foreign Solutions page name/desc IF needed (short announcement) if (strlen($gettran->announcement) < 15) { //Finally update (or make additional) announcement records in foreign language using only the dynamic translations IF there is no foreign announcment, and dynamic record exists. $trans = Capsule::table('tbldynamic_translations')->where([['related_id', $pid],['related_type','product.{id}.name'],['language',$tranlang]]) ->get(); $tranname = $productname; //incase there are no trans for later $targetname = $tranname; foreach ($trans as $tran) { if ($tran->language !== 'english') { $tranname = $tran->translation; $tranlang = $tran->language; #if ($tranlang == $lang) { $targetname = $tranname; #} } else { //in case there is NO foreign announcement for the pid yet. $tranname = $productname.' '.ucwords($tranlang); $tranlang = ''; // english in announcements is blank, not 'english' $parentid = 0; } $targetname = $tranname; $tranannounce = Capsule::table('tblannouncements')->updateOrInsert(array('parentid'=> $tranparent, 'language'=>$tranlang), array('date' => $trantime,'title' => $tranname,'pid'=>$pid,'gid'=>$gid,'kid'=>$kid, 'published'=>1, 'language'=>$tranlang, 'parentid'=>$tranparent)); } $transdescs = Capsule::table('tbldynamic_translations')->where([['related_id', $pid],['related_type','product.{id}.description'],['language',$tranlang]]) ->get(); $trandesc = $descproduct; //in case there are no trans for later $targetdesc = $trandesc; foreach ($transdescs as $tran) { $trandesc = $tran->translation; $tranlang = $tran->language; $targetdesc = $trandesc; $announce = Capsule::table('tblannouncements')->where([['parentid',$tranparent],['language',$tranlang]])->first(); if ($announce && strlen($announce->announcement) < 10 ) { $tranannounce = Capsule::table('tblannouncements')->where([['parentid',$tranparent],['language',$tranlang]])->update(array('date' => $trantime,'announcement' => $trandesc)); } } } foreach ($needtrans as $needtran) { $tranaid = $needtran->id; //make a new todo record for Zapier $product = Capsule::table('tblproducts')->select('description')->where(id,$needtran->pid)->first(); $descproduct = trim($product->description); //needed for intro $strsize = 960; $maxsize = 998; $helpphrase = htmlspecialchars('<br/><h6><a href="https://domain.name/helpdesk">Let us know how else we may help you!</a></h6>');//this will be later translated by Zapier $announcement = str_replace($tranphrase,'',$needtran->announcement); if (strlen($announcement) > 0) { $announcement = htmlspecialchars($announcement.' ',ENT_NOQUOTES); $announcement = str_replace('&amp;amp;','&',$announcement); $descannounce1 = null; $descannounce2 = null; $descannounce3 = null; $descannounce4 = null; $descannounce5 = null; $descannounce6 = null; $nextstart = 0; $thislen = $strsize; for ($d = 1; $d < 6; $d++) { $dstring = 'descannounce'.$d; $$dstring = substr($announcement,$nextstart,$strsize); $lastspace = $strsize + 1; while ($thislen > 0 && $lastspace > $strsize) { $lastspace = strrpos($$dstring," "); //last space $$dstring = substr($$dstring,0,$lastspace); $thislen = strlen($$dstring); $nextstart += $thislen; } if ($thislen == 0) { $$dstring = null; $lastdstring = 'descannounce'.($d-1); break; } } } if ($thislen == 0 && strlen($$lastdstring) < ($strsize-strlen($helpphrase))) { $$lastdstring .= $helpphrase; } else { $$dstring .= $helpphrase; } $trantodo = Capsule::table('tbltodolist')->insert(array('aid'=> $tranaid,'date' => $trantime,'admin'=>1,'title' => trim($needtran->title),'intro'=>$descproduct,'description'=>$descannounce1,'description2'=>$descannounce2,'description3'=>$descannounce3,'description4'=>$descannounce4,'description5'=>$descannounce5, 'description6'=>$descannounce6,'status'=>'In Progress','do_announce'=>true,'do_product'=>false)); } $viewbutton = viewButton($aid,$pid,$gid,$kid,$lang); $editbutton = editButton ($aid,$lang); if (1==2) { $transReplace = tranUpdates(); $trandone = $transReplace['trandone']; $trancount = $transReplace['trancount']; } return array("tranname"=>$targetname,"trandesc"=>$targetdesc,"tranlang"=>$tranlang,"viewbutton"=>$viewbutton,"editbutton"=>$editbutton); } }
  11. Bit stumped. The Setup: Say I have an announcement in English, and I have not made any other language text by hook or by the Admin interface for Announcements. Using AnnouncementEdit hook, on save, I add a record in tblannouncements, set to the second language (parentid = englishid, language = newlanguage) I do that addition with insertGetId, and yeah, I get the new id for the inserted tblannouncements record just fine. It's sequential, the next one that was available. However, a second later, the record is not there. Doing a refresh on the tblannouncements table in phpMyAdmin, the new language record never shows, like it never existed. I'm able to take that insertGetId number and put it into a different table, which is why I know what it is and that it existed. So the id advances one each time -- but on save, something erases the new announcement record made in my hook. Can someone point me to where this happens? Cuz it's not in my hook, spent like 5 hours going over it. Guessing it is a "nobody but WHMCS is allowed to insert an announcement record with parentid" feature 👊 Thanks!
  12. Did put in some filters finally. But can't figure out how to put a variable in that HTML block part returned. Sure it's simple -- need to put in the variable $headerscroll where it has 188 in the html part. How? # Prevent Top Scrolling With Hash Links Hook # Written by brian! function prevent_hash_link_scrolling_hook($vars) { $title = $vars['pagetitle']; if ($title == LANG::trans('termsofservice') || $title == LANG::trans('knowledgebase.name')) { if ($title == LANG::trans('termsofservice')) { $headerscroll = 188; } elseif ($title == LANG::trans('knowledgebase.name')) { $headerscroll = 25; } else { $headerscroll = 177; } return <<<HTML <script> (function($) { $(document).ready(function() { var internalhash = window.location.hash; $('html, body').animate({ 'scrollTop': $(internalhash).offset().top - 188 }, 100); }); })(jQuery); </script> HTML; } }; Thanks for any suggestions :)
  13. Indeed a long day. WHMCS not responding to locale info from Geolocation hooks -- uploaded the new stuff via ftp, all the files there. Set config.php there to faithfully do the right things, I guess $countryToCurrency = array( 'default' => 'EUR', 'RO' => 'RON', 'GB' => 'GBP', 'DE' => 'EUR', // NOTE: You can add more below ); $countryToLanguage = array( 'default' => 'english', 'GB' => 'english', 'US' => 'english', 'RO' => 'romanian', ); $countryToTemplate = array( 'GB' => 'hanco', 'default' => 'hanco', // NOTE: You can add more below ); $templateToLanguage = array( 'english' => 'hanco', 'romanian' => 'hanco', 'default' => 'hanco', // NOTE: You can add more below ); Do I need to make different templates for some reason for each language in the config.php? All other Geo files pristine from the latest 2.2.3 release. But really, zero locale change happening in private window as guest user ... WHMCS responds fine to logged in users, all correct that way for language, currency etc ... but that's not really the geoip doing it's thing is it? Are there any variables for the geolocation I can see? did the {debug} and $var_dumps on templates, all giving completely the wrong locale (forever thinks we're in the UK, no idea why, all en_GB in smarty, everything). No clue ... no errors in the activity logs (turned on hooks, sql, php) ... no console errors ... geolocation_hook.php loading fine, just that Geo having no effect. Suggestions where to look? Thanks!
  14. Mea culpa, mea maxima culpa. My bad 100%. Brian: correct. Me: not so bright. And of course, had fun with yet more jQuery oddness ... dataTables were still not loading ... various jQuery complaints about popover() functions not existing, and jQuery then generally not existing. Solution was to change the jQuery library from the WHMCS to the WordPress by default in WHMCS-Bridge ... but that trick I know I've done before and "gremlins in the night" seem to un-do things. Just curious -- when a new template comes out (that WHMCS is presumably using with their 8.x), is it a good idea to copy over the .js scripts into our "native" custom template? Are there other similar considerations with jQuery and with Javascript when the ground shifts with new WHMCS versions?
  15. Thanks so much Kian, most appreciated! All fixed. Was a hook to prevent scrolling to top when going to a hash link, and another whmcs bridge method not quite right. Cheers mate!
×
×
  • 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