Jump to content

brian!

Level 2 Member
  • Content count

    11,106
  • Joined

  • Last visited

  • Days Won

    328

Everything posted by brian!

  1. brian!

    WHMCS Calendar Hook

    on the edit popup box ? it should work.
  2. declare the variable globally - then you can reference any element of it in the hook. so in the above example, i'm using a hook to effectively override a language string - in your case, declare $_LANG globally, then you can access it as you can with any other array.
  3. the usual way would be Lang::trans('mylanguagevariable')
  4. is "A" your default currency in WHMCS ? if so, then what you're trying to do should work. if I create a fake currency, BRI, and set it to 10x the default currency (in my case GBP)... and then run "Update Product Prices" routine from the currencies page, the BRI price for a product is updated to 10x the GBP price... if I then change the currency rate to 12, run the product price updater again, the BRI prices are changed to 12x the GBP prices... if "A" wasn't your default currency, then I don't think what you're trying to do will work without a lot of effort - but if it is, then it should work out of the box as I describe above.
  5. brian!

    WHMCS Calendar Hook

    ooh it's been years since anyone asked a question about the calendar in WHMCS! you should be able to do it with css... #calendarcontrols label.checkbox-inline:nth-last-child(n+3) {display: none;} obviously, there's no custom.css in the admin templates by default, but as you've used a previous hook of mine to add one, so you could add the above code to that.
  6. brian!

    This Pop up Add Products are hard coded

    it's not a template, it's hardcoded and I doubt you could even tweak it with a hook. I think you will have to live with it. btw - as a general point, be very careful about trying to micromanage changes to WHMCS like this - especially in the admin area... it's fine now, and probably for the rest of the year, because you're doing these changes in the v7.8 beta, but there is no knowing what changes are going to be in v8 and if you've got multiple hooks, css changes and template edits tweaking the admin area in the most minute details, then you may run into a lot of issues when updating in the future.
  7. on your site, I can't get anywhere using the Lagom theme and orderform... even with six & standard_cart, I can't add a domain registration by itself; when I add a product, I can't choose a domain to register; if I use existing to get to the next stage, then ordersummary is blank and I can't continue... I can't even get anywhere using Modern and that's one of the most forgiving templates to issues like this... possibly there are too many alternate TLDs for it to look up, but that's not the cause of the downloads issue. is this applying to old attachments, new ones or both? have you moved the attachments folder from a previous installation ?? there's no point in me testing the site using Safari (as that hasn't been updated for Windows for 10+ years), but with Firefox and Edge, i'm getting nowhere... plus if the downloads are client only, then I can't test those links... maybe Safari Mac is more forgiving to whatever the issue is and Firefox/Chrome are stricter (assuming there isn't an extension in either causing this) possibly it's a server issue - perhaps how it's handling files types or json - because whilst testing i'm seeing the way it handles certain files as unusual and I don't know if that's impacting on the running of WHMCS or not... it's certainly worth asking your hosts about this to see if they have any idea. btw - in the last few weeks have you made any server changes, e.g changed PHP versions ?
  8. that should work (with or without the single quotes) - and looking at your site, I see that it now is. 🙂 I thinks styles.css is no longer used and is just a legacy file... https://docs.whmcs.com/WHMCS_7.1_Asset_Changes
  9. using a subdomain option already exists within WHMCS and you can add it on a per-product basis as a domain option (alongside registration, transfer or use existing domain)... https://docs.whmcs.com/Products_and_Services
  10. Hi @Mauwiks technically, it's the ID value from the tblhosting database table that is used to reference this service internally... could be a product, a domain or something else - what it is isn't nicely stored in the table, it takes a little bit of investigation to determine what it is. I think the Enhanced To Do List admin widget that I posted a year ago might be able to help you... 🙂 it queries the todo list database table and attempts to identify the client/product/domain associated with those todo items... and then makes the client details (pink user icon); service details (grey server icon); domain details (grey domain icon) and assigned admin (green if assigned) available as tooltips when you run the mouse over the particular icon. I assume in the case of that screenshot, it's just a service that's been provisioned using the AutoRelease module and as part of that setup, it's currently configured to generate a ToDo list item when the provisioning occurs.
  11. they won't as it would be against the rules for them to do so here, .e.g if I had written a Google Drive module that did what the OP wanted, I wouldn't be able to tell them as it would be self promotion/advertising - though I think there is an unwritten exception to that rule that doesn't apply if the product linked to is free. only if this question had been asked in SO&R as wsa linked to (or maybe third party addons) would they be able to even mention their own commercial products or services.... and they're unlikely to mention any of their rivals services, just to help the member here. see section 3 of the above thread... for the record, i'm not aware of anything that does what the OP asks about... I could see a way to do the second part, but in the absence of a ready made solution, the OP would have to throw money at this to either option implemented.
  12. brian!

    License Registered to: Admin Side Bar

    ahh - never occurred to me that $pagetitle was translatable... curse of usually not coding on a Saturday! <?php # Change License Registered Name on License Info Hook # Written by brian! function change_license_info_hook($vars) { GLOBAL $_ADMINLANG; $licensestring = $_ADMINLANG['license']['title']; if ($vars['pagetitle'] == $licensestring) { return <<<EOF <script> $("tbody").html($("tbody").html().replace('old name','new name')); </script> EOF; }; } add_hook("AdminAreaFooterOutput",1,"change_license_info_hook"); you should have seen what this place was like 5+ years ago - there was far more of a community spirit back then with multiple posters replying to technical threads... I only stand out now because i'm the last one still doing it on a regular basis. it's not a good situation for any forums to be in to be so reliant on a small number of replying posters... but sadly you can't magic people like me (or the much missed sentq) out of thin air... if they could, i'd happily leave replying to others. it's a php hook, returning javascript trying to reference php or Smarty variables - i'm not saying it couldn't be done, just not by me quickly today... I tried, but couldn't make it work. but I assume you're not going to be changing the name every 5 minutes - so yes, it would be nice to be able to pull the info automatically, but I wasn't going to waste a lot of time trying to make it work that way when it's not really that important.
  13. brian!

    License Registered to: Admin Side Bar

    i'll post that license info hook that I mentioned previously... <?php # Change License Registered Name on License Info Hook # Written by brian! function change_license_info_hook($vars) { if ($vars['pagetitle'] == "License Information") { return <<<EOF <script> $("tbody").html($("tbody").html().replace('current name','new name')); </script> EOF; }; } add_hook("AdminAreaFooterOutput",1,"change_license_info_hook"); you will just have to update the values of 'current name' and 'new name' for the existing and replacement registered names.
  14. brian!

    License Registered to: Admin Side Bar

    yeah - I only quickly glanced at the menu code, saw that the link had an ID and assumed the rest... sadly, we're still back in the 2010s or whenever with their parent tags not having IDs. that code tells me that for any admin user who you don't want to see this license page, you could uncheck remove "Main Homepage" from their administrator roles... that will remove the link from the menu, though would probably prevent them seeing most of the widgets on the homepage too. they've probably been designed using modern standards - the menu in Blend, other than slight styling changes, hasn't really changed much in the 4-5 years it's been out... here's what it looked like in v5.3 with the code used... <li><a id="Menu-Help" title="Help" href="">{$_ADMINLANG.help.title}</a> <ul> <li><a id="Menu-Help-Documentation" href="http://docs.whmcs.com/" target="_blank">{$_ADMINLANG.help.docs}</a></li> {if in_array("Main Homepage",$admin_perms)}<li><a id="Menu-Help-License_Information" href="systemlicense.php">{$_ADMINLANG.help.licenseinfo}</a></li>{/if} {if in_array("Configure Administrators",$admin_perms)}<li><a id="Menu-Help-Change_License_Key" href="licenseerror.php?licenseerror=change">{$_ADMINLANG.help.changelicense}</a></li>{/if} {if in_array("Configure General Settings",$admin_perms)}<li><a id="Menu-Help-Check_For_Updates" href="systemupdates.php">{$_ADMINLANG.help.updates}</a></li> <li><a id="Menu-Help-Get_Help" href="systemsupportrequest.php">{$_ADMINLANG.help.support}</a></li>{/if} <li><a id="Menu-Help-Community_Forums" href="http://community.whmcs.com/" target="_blank">{$_ADMINLANG.help.forums}</a></li> </ul> I suppose you could use a redirection hook to prevent selected admin users from seeing the license page - but as you say, you might as well just edit the template...
  15. brian!

    License Registered to: Admin Side Bar

    it won't - it's not a value that's available in the template.... you'd have to pull it from the database. usually, i'd use Capsule - but as this is a configuration value, there's another way... <?php # Change License Registered Name in Admin Sidebar Hook # Written by brian! use WHMCS\Config\Setting; function license_registered_name_in_admin_sidebar_hook($vars) { $companyname = Setting::getValue('CompanyName'); if ($companyname) { $licenseinfo = $vars['licenseinfo']; $licenseinfo['registeredname'] = $companyname; return array("licenseinfo" => $licenseinfo); } } add_hook("AdminAreaPage", 1, "license_registered_name_in_admin_sidebar_hook"); it's not a template, it'll likely be hardcoded in the index.php file... needless to say there are no IDs used in their code, so attacking it JS/JQuery/css is awkward, but doable if you can hardcode the two strings (e.g not pull them from the db).... alternatively you could remove the link to this page from the menu using a hook if you wanted to - actually, you could do that with css, but as the admin templates still don't have their own custom.css file, you would need a hook.
  16. brian!

    Possible Hook to hide (No Domain)

    to fix the original clientsummary hook to use the language string... <?php # Change No Domain String In Client Summary Page Hook # Written by brian! function client_summary_change_nodomain_hook($vars) { GLOBAL $_ADMINLANG; if ($vars['filename'] == 'clientssummary') { $productsummary = $vars['productsummary']; $nodomain = $_ADMINLANG['addons']['nodomain']; foreach($productsummary as $key => $product) { if($product['domain'] == '('.$nodomain.')') { $productsummary[$key]['domain'] = "something else"; } } return array("productsummary" => $productsummary); } } add_hook("AdminAreaPage", 1, "client_summary_change_nodomain_hook"); if the output of what you're changing "No Domain" to has be in the client's language, then you'd replace "something else" with AdminLang::trans('some__language_string'). the hook works on the client summary page because it has a template to work with - you don't have that on the page you specify, so you'd need to use Language Overrides - I don't think the docs mention it, but you can use overrides in the admin languages too, you just need to know the specific string to change (or null) - and i've included that in the above hook... btw create the overrides folder in the admin /lang folder.
  17. brian!

    EPP Code Modification

    true - theoretically you could null the eppcode value and change the language string in the same hook... I thought of nulling the value with a hook yesterday, but it never occurred to me about the language string until you mentioned that specific hook. 🙄
  18. brian!

    Stamp on Invoice

    your problem is partially caused by ignoring one important bit of advice that Kian gave you... 🙂 as things stand, you're displaying your company logo and signature images in exactly the same place... with these pdfs, you have to think in terms of print, not web - so they are relative positions, based in mm, for x location (across), y location (down) and width (of image)... so your logo is 15mm across (from left), 25mm down (from top) and 75mm in width. if you were to change the signature location to 15,50,75, it should be below the logo (you might have to play with the 50 value depending on your logo size and the 75 value depending on the width of this signature. if ($paymentmodule == 'banktransfer') { $pdf->Image(ROOTDIR . '/assets/img/imza.png', 15, 50, 75); } note that in my code i'm using $paymentmodule and not $paymentmethod - $paymentmethod uses the display name of your gateway for the gateway settings, it's probably "Bank Transfer" unless you've changed it - but for BT, $paymentmodule will be equal to "banktransfer". i'd also suggest adding that status must be paid to that IF statement as I don't see the point of adding the signature to an unpaid invoice (unless i'm missing the point of adding this signature!).
  19. brian!

    License Registered to: Admin Side Bar

    the trick with this is to just look in sidebar.tpl and see what the variable is called - and then overwrite it with a hook. <?php # Change License Registered Name in Admin Sidebar Hook # Written by brian! function license_registered_name_in_admin_sidebar_hook($vars) { $licenseinfo = $vars['licenseinfo']; $licenseinfo['registeredname'] = "Theresa May"; return array("licenseinfo" => $licenseinfo); } add_hook("AdminAreaPage", 1, "license_registered_name_in_admin_sidebar_hook");
  20. my head hurts too trying to get around the maths in this... the complicating factor may be that you ran the bulk updater - so now when it's calculating the pro-rata refund now, it might be doing so on the understanding that product B is now 1299... though I can't see how it should be 42.10.... i'd need a cup of tea and Excel to figure this out! (formula used posted here) short-term fix - disable credit on downgrade (credit tab in general settings)... https://docs.whmcs.com/Credit_Tab#Credit_on_Downgrade ... or to put it the other way - when it's disabled, they won't receive any credit on downgrading.... so if they choose to downgrade, it won't cost you a penny (or cent I think for Rand).
  21. brian!

    UPW algorithm v7.7

    if it's creation formula has been changed (I don't know whether it has), then the best people to ask will be WHMCS themselves... it might be worth opening a ticket with them... if you get your license directly from WHMCS - https://www.whmcs.com/support/ if you get your license from a reseller / host - https://www.whmcs.com/reseller-support/ or on the off-chance that Andrew is around, mentioning him in the post @WHMCS Andrew and perhaps he'll be able to confirm if anything has changed, and if so, what.
  22. brian!

    Hello

    never give up - keep plugging anyway... I knew nothing about Smarty before using WHMCS in 2013, but it's simple enough to use once you get your head around the basics. 🙂
  23. brian!

    Promotion/ coupons question

    Chris meant to say £5, not $5 🙂
  24. brian!

    Domain search integration code

    if you're using v7.7 or later, you could keep captcha on, but only disable it from the domainchecker page *that's the old name for that cart page)and keep it on everywhere else...
  25. brian!

    Anchor

    is template2 a WHMCS template and that's the template filename ?? I quickly tried the following.. $validtemplates = array ('homepage','custom2'); custom2.tpl is a template used by brian4.php, so on the homepage template, I added the link as before... <a href="brian4.php#target_anchor">Link to external page</a> again, custom2 contains Lorem Ipsum text with the anchor used previously within it... clicking on the link in homepage, correctly takes me to the anchor on the custom page... if I disable the hook, the link just takes me to the top of the page.. what are you seeing? is it just taking you to the top of the page ??
×

Important Information

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