dsnw2651 2015-02-08 08:16
浏览 34
已采纳

WHMCS Action Hook

Here's what I have for my WHMCS Hook:

<?php
function hook_api_suspend($vars) {

$table = "apis_user_profiles";
$update = array("status"=>"0");
$where = array("user_id"=>"342329");
update_query($table,$update,$where);
}

add_hook('AfterModuleSuspend', 1, 'hook_api_suspend');

?>

This is the line I'm specifically having problems with:

$where = array("user_id"=>"342329");

When I suspend an account, it does update the status correctly for the user with a user_id of 342329. However, how can I make it use the user_id of the actual user's account who is getting suspended? I've already tried entering a few variables there but none seem to be working...?

  • 写回答

1条回答 默认 最新

  • douhuangjian9627 2015-02-18 11:12
    关注

    According to the hook documentation, the user id is passed in $vars['params']['userid']. and the $where array becomes:

    $where = array("user_id" => $vars['params']['userid']);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏