Jump to content

XimixHH

Member
  • Posts

    4
  • Joined

  • Last visited

Everything posted by XimixHH

  1. I had an answer on stackoverflow to this question that worked. Just wanted to post the link here so it can help others: https://stackoverflow.com/questions/46648184/whmcs-and-changing-home-link-with-variable
  2. Doesnt seem to work. When I keep the $redirect static like in your example, it's fine. Soon as I make that into a variable it fails: <?php $aedit_just_domain = preg_replace("/^(.*\.)?([^.]*\..*)$/", "$2", $_SERVER['HTTP_HOST']); $aedit_homepageurl = "http://www.". $aedit_just_domain ."/"; use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $redirect = $aedit_homepageurl; if (!is_null($primaryNavbar->getChild('Home'))) { $primaryNavbar->getChild('Home') ->setURI($redirect); } }); Because I use the multibrand addon, the only thing I really want is that it picks up the url in the address field like http://billing.mydomain.com/, replace "billing." with "www." so it becomes http://www.mydomain.com, then makes the home button link there. Anyone else or maybe you again Brian! that can think of a solution? Thanks again and thanks in advance!
  3. Thank you very much. Not much to say about me. Just a coder using WHMCS
  4. Hi, I use the multi brand addon in my whmcs setup, what means I have multiple brands on one whmcs installation. All these brands have a domain like http://billing.anydomain.com/. Now I would like to point the home button to http://www.anydomain.com/ where I have a static site. Thats easy to change if you have only one brand. If I change it now every brand will have this domain, so what I was trying to do is pick up the domain from the address bar and then inserting that in the Home link. I have made a php file in the /includes/hooks directory with the following code. <?php $aedit_just_domain = preg_replace("/^(.*\.)?([^.]*\..*)$/", "$2", $_SERVER['HTTP_HOST']); $aedit_homepageurl = "http://www.". $aedit_just_domain ."/"; #adding Menu Item to primaryNavbar use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { /** Rename the "Home" menu item. **/ $primaryNavbar->getChild('Home') ->setUri ($aedit_homepageurl); }); No here you see my problem ->setUri ($aedit_homepageurl); has a variable what is aparently not possible. When I try ->setUri ('http://someurl.com'); it works fine, but I cant use that as I need a variable in there. In this case the variable $aedit_homepageurl. I have tried many different things like: ->setUri ('{$aedit_homepageurl}'); ->setUri (' .$aedit_homepageurl. '); ->setUri ({$aedit_homepageurl}); ->setUri $aedit_homepageurl; All with the same failing result. Is there anyone who can help me with this issue? Thanks a lot in advance!
×
×
  • 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