Jump to content

JackRabbit

Member
  • Posts

    82
  • Joined

  • Last visited

  • Days Won

    1

JackRabbit last won the day on July 10 2018

JackRabbit had the most liked content!

1 Follower

About JackRabbit

Recent Profile Visitors

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

JackRabbit's Achievements

Member

Member (2/3)

2

Reputation

  1. I did have that enabled, but you're right, it was disabled somehow. Thanks Damo
  2. I've got robots signing up on my register.php page in WHMCS, a majority of users register through the cart. Maybe it would be better to rename this page so bots can't find it or use a firewall addon that has a honeypot or that blocks bots. But all of the bots are using URL's in the street address field, is there a setting that I can use that will not allow urls in specific fields?
  3. Got it! in the configuration file $disable_hook_loading = true; This little guy almost caused nuclear war. I only updated whmcs, I'm not sure why it was set to true. I'm going to use all your suggestions here. As always, you're the brain brian! Thank you for taking the extra time to help, I appreciate that so much! WHMCS would be a different world without you.
  4. same problem with 6 it exploded. jk. same problem, adding the new hook. {debug} $services isn't there If you've got a headache from this, you don't need to be here tonight. We can continue later if you want to.
  5. yes, it's my own account. the quicklinks were working before the 8.1.3 update me either, 9pm for me. 😕 And you don't have to do this, you're being very nice. I tried that already too. I have it that way now and it's still not working.
  6. No $services (I used ctrl+f) Man, this is so frustrating Brian. Maybe it's a nice puzzle for you. I'm going to attach the 3 files here. I don't know if there are any other hooks interfering. I don't think there are. quicklinks-jr.zip
  7. Sorry Brian, I'm not so good with this. there is an active cpanel so I've switched that to clientareahome I'm not sure what you mean by this, I shouldn't include the quicklinks file? I've switched it to ClientAreaPage Here's my hook: <?php use WHMCS\Database\Capsule; function jackrabbit_quicklinks($vars) { if ($vars['templatefile'] == "clientareahome") { $client = Menu::context('client'); $services = Capsule::select('SELECT tblhosting.id, tblproducts.name, tblhosting.domain FROM tblhosting,tblproducts WHERE userid = "' . $client->id . '" AND tblhosting.packageid = tblproducts.id AND tblhosting.domainstatus = "Active" AND tblproducts.servertype = "cpanel"'); return array("services" => $services); } } add_hook("ClientAreaPage", 1, "jackrabbit_quicklinks"); here's my include code in the clientareahome.tpl {if count($services) > 0} {foreach $services as $service} {include file="modules/servers/cpanel/templates/quicklinks.tpl" serviceid=$service->id} {/foreach} {/if} Still, the hook isn't working , the quicklinks don't appear in the client area home. The array appears to be empty still, my modifications didn't resolve it. So I removed the if statement and only included the file: {include file="modules/servers/cpanel/templates/quicklinks.tpl" serviceid=$service->id} And the quick links still don't work, the service id isn't being populated. What is the correct code I should put on each page? I apologize if I'm making you roll your eyes 😕 I know you're not obligated to help here, I really appreciate your help. I may just find a developer who will do this for me.
  8. When I copy the link address for the file manager, this is what I get: https://www.jackrabbit.host/dashboard/clientarea.php?action=productdetails&id=&dosinglesignon=1&app=FileManager_Home The service id is missing.
  9. I first tried the full suggestion you gave, but the quicklinks disappeared on the clientareahome.tpl so I put everything back the way it was, then just tried your first suggestion (in your last post here) and this is what I have, but the quicklink to the filemanager still sends me to the products page in the client area <?php use WHMCS\Database\Capsule; function jackrabbit_quicklinks($vars) { if ($vars['templatefile'] == "quicklinks") { $client = Menu::context('client'); $services = Capsule::select('SELECT tblhosting.id FROM tblhosting,tblproducts WHERE userid = "' . $client->id . '" AND tblhosting.packageid = tblproducts.id AND tblhosting.domainstatus = "Active" AND tblproducts.servertype = "cpanel"'); return array("services" => $services); } } add_hook("ClientAreaHomepage", 1, "jackrabbit_quicklinks"); and in the clientareahome.tpl: {if $clientsstats.productsnumactivehosting eq "1"} {include file="modules/servers/cpanel/templates/quicklinks.tpl" serviceid=$service->id} {else} {/if}
  10. Ah, but now we have another problem. I'll put this here since it may be related to this hook. If the user has one cpanel account, the quicklinks for that cpanel account get replicated on the clientareahome.tpl for them. If you look at the code above for the quicklinks.tpl, you'll see the file manager link for direct access to their file manager. When I click on this filemanager link now, I'm not taken to cpanel, but to the clientareaproducts.tpl page - the original quicklinks work fine from the product details page, just not from my custom quicklinks on the clientareahome.tpl It worked before, but not now. I'm not sure if it's the update or the new hook. How can I get that to work again?
  11. Thank you Brian, It works! Your short fix didn't work but your hook solution worked great. So in case anyone is curious, here's the solution: <?php use WHMCS\Database\Capsule; function jackrabbit_quicklinks($vars) { if ($vars['templatefile'] == "quicklinks") { $client = Menu::context('client'); $services = Capsule::select('SELECT tblhosting.id FROM tblhosting,tblproducts WHERE userid = "' . $client->id . '" AND tblhosting.packageid = tblproducts.id AND tblhosting.domainstatus = "Active" AND tblproducts.servertype = "cpanel"'); return array("serviceid" => $services[0]->id); } } add_hook("ClientAreaHomepage", 1, "jackrabbit_quicklinks"); I've got a file called quicklinks.tpl which has the code I want to display (original code from the first post here, but I've removed the php) So here's what it looks like now: <link href="modules/servers/cpanel/css/client.css" rel="stylesheet"> <script src="modules/servers/cpanel/js/client.js"></script> {if $clientsstats.productsnumactivehosting eq "0"} <div class="alert alert-warning text-center" role="alert"> {if $suspendreason} <strong>{$suspendreason}</strong><br /> {/if} {$LANG.cPanel.packageNotActive} {$status}.<br /> {if $systemStatus eq "Pending"} {$LANG.cPanel.statusPendingNotice} {elseif $systemStatus eq "Suspended"} {$LANG.cPanel.statusSuspendedNotice} {/if} </div> {else if $clientsstats.productsnumactivehosting eq "1"} <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">{$LANG.cPanel.quickShortcuts}</h3> </div> <div class="panel-body text-center"> <div class="row cpanel-feature-row"> <div class="col-sm-3 col-xs-6" id="cPanelFileManager"> <a href="clientarea.php?action=productdetails&amp;id={$serviceid}&amp;dosinglesignon=1&amp;app=FileManager_Home" target="_blank"> <img src="modules/servers/cpanel/img/file_manager.png" /> {$LANG.cPanel.fileManager} </a> </div> </div> </div> </div> {else} {/if} And finally, I've inserting that quicklinks.tpl into the clientareahome.tpl using this: {if $clientsstats.productsnumactivehosting eq "1"} {include file="modules/servers/cpanel/templates/quicklinks.tpl"} {else} {/if} I'm always so grateful to you Brian, you're the best.
  12. I'm getting an error after upgrading (see screenshot) Here's the code that's giving the error (I removed the code between the else statement to keep it short here) This is a custom tpl <link href="modules/servers/cpanel/css/client.css" rel="stylesheet"> <script src="modules/servers/cpanel/js/client.js"></script> {php} $smartyvars = $template->getTemplateVars(); $userid = $smartyvars['clientsdetails']['id']; $query = mysql_query("SELECT tblhosting.id as serviceid FROM tblhosting,tblproducts WHERE userid = $userid AND tblhosting.packageid = tblproducts.id AND tblhosting.domainstatus = 'Active' AND tblproducts.servertype = 'cpanel'"); $result = mysql_fetch_array($query); $services = $result["serviceid"]; $template->assign('serviceid', $services); {/php} {if $clientsstats.productsnumactivehosting eq "0"} <div class="alert alert-warning text-center" role="alert"> {if $suspendreason} <strong>{$suspendreason}</strong><br /> {/if} {$LANG.cPanel.packageNotActive} {$status}.<br /> {if $systemStatus eq "Pending"} {$LANG.cPanel.statusPendingNotice} {elseif $systemStatus eq "Suspended"} {$LANG.cPanel.statusSuspendedNotice} {/if} </div> {else if $clientsstats.productsnumactivehosting eq "1"} (output here) {else} {/if} How can I solve this?
  13. Thank you so much Brian, I used the latter which works perfect. You're awesome.
  14. This was such a long time ago and I'm finally going to add this. I'm not a coder, so I'm a little confused. I want to create a hook that says: If client has less than 2 invoices paid, hide "Registrar Lock" from the sidebar on the domain overview page. I'm trying to use this for help: https://docs.whmcs.com/Client_Area_Sidebars_Cheatsheet I'll use this code example: <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if(!is_null($primarySidebar->getChild('My Account')) && !is_null($primarySidebar->getChild('My Account')->getChild('Billing Information'))){ $primarySidebar->getChild('My Account')->removeChild('Billing Information'); } }); But how can I add the variable $clientstats.numpaidinvoices to the php? I've been trying several variations without luck.
  15. I should have left Module logging off. No wonder my database was so big.
×
×
  • 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