Jump to content

NutterChen

New Member
  • Posts

    3
  • Joined

  • Last visited

About NutterChen

NutterChen's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. I have tried using in function addonmodule_output($vars) return array( 'pagetitle' => 'Sample Addon Module', 'breadcrumb' => array( 'index.php?m=addonmodule' => 'Sample Addon Module', ), 'templatefile' => 'publicpage', 'requirelogin' => false, // Set true to restrict access to authenticated client users 'forcessl' => false, // Deprecated as of Version 7.0. Requests will always use SSL if available. 'vars' => array( 'modulelink' => $modulelink, 'configTextField' => $configTextField, 'customVariable' => 'your own content goes here', ), ); But alas, it doesn't work
  2. im useing hooks to add some code after cronjob heres my hooks file ,i have try to use it in whmcs 7 ,and its running well but since 17th this month, i found its stop work when i turn on the hooks debug mod, and got 21/10/2020 20:57 Cron Job: Hooks Debug: No Hook Functions Defined for AfterCronJob - 21/10/2020 20:57 Cron Job: Hooks Debug: Called Hook Point AfterCronJob - 21/10/2020 20:55 Cron Job: Hooks Debug: No Hook Functions Defined for AfterCronJob - 21/10/2020 20:55 Cron Job: Hooks Debug: Called Hook Point AfterCronJob - 21/10/2020 20:50 Cron Job: Hooks Debug: No Hook Functions Defined for AfterCronJob - 21/10/2020 20:50 Cron Job: Hooks Debug: Called Hook Point AfterCronJob - 21/10/2020 20:48 Cron Job: Hooks Debug: No Hook Functions Defined for AfterCronJob Does anyone have any comments or experience on this? thank u guys whmcs 8.0.3 php 7.4.11 <?php use WHMCS\Database\Capsule; add_hook('AfterCronJob', 1, function(){ try { $query = \WHMCS\Database\Capsule::table('tblproducts')->where('servertype', 'V2RaySocks')->get(); $query2 = \WHMCS\Database\Capsule::table('tblhosting')->where('domainstatus', 'Active')->get(); $query3 = \WHMCS\Database\Capsule::table('tblservers')->where('type', 'V2RaySocks')->get(); $products = V2RaySocks_QueryToArray($query); $clients = V2RaySocks_QueryToArray($query2); $servers = V2RaySocks_QueryToArray($query3); $pids = V2RaySocks_prase_pid($products); $pro = V2RaySocks_get_client_products_with_pids($clients,$pids,array('Active','Suspended')); $pro = V2RaySocks_update_network($pro,$servers,V2RaySocks_prase_product_DB($products),$products); }catch (Exception $e){ } }); add_hook('AfterCronJob', 1, function() { try { $query = \WHMCS\Database\Capsule::table('tblproducts')->where('servertype', 'V2RaySocks')->get(); $query2 = \WHMCS\Database\Capsule::table('tblhosting')->where('domainstatus', 'Active')->get(); $query3 = \WHMCS\Database\Capsule::table('tblservers')->where('type', 'V2RaySocks')->get(); $products = V2RaySocks_QueryToArray($query); $clients = V2RaySocks_QueryToArray($query2); $servers = V2RaySocks_QueryToArray($query3); $pids = V2RaySocks_prase_pid($products); $pro = V2RaySocks_get_client_products_with_pids($clients,$pids,array('Active','Suspended')); $rproducts = V2RaySocks_RebuildProductArray($products); $pro = V2RaySocks_CalcBandReset($pro,$rproducts,$servers); }catch (Exception $e){ } }); function V2RaySocks_QueryToArray($query){ $products = array(); foreach ($query as $product) { $producta = array(); foreach($product as $k => $produc){ $producta[$k] = $produc; } $products[] = $producta; } return $products; } ......
×
×
  • 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