dqwh0108 2014-04-30 13:11
浏览 45

WHMCS和编写模块

I’m trying to write a module for WHMCS and have a question.

When i use rapi_output function and put my codes there everything is ok and the result shown in admin area but when i try to put the code in rapi_clientarea nothing happened in the clientarea.

The written module exists here: modules/addons. I also put my codes in modules/servers and create product for client but not work clientarea function:

 {
 function Rapi_ClientArea($params) {
      $code = '
      <form action="" method="post" >
            <input type="submit" value="Login to Control PanelA" />
       </form>';

      return $code;

 }
 }
  • 写回答

1条回答 默认 最新

  • drzdu44226 2014-12-21 08:41
    关注

    use the following code:

    function Rapi_clientarea($vars) {
    
        $modulelink = $vars['modulelink'];
        $version = $vars['version'];
        $option1 = $vars['option1'];
        $option2 = $vars['option2'];
        $option3 = $vars['option3'];
        $option4 = $vars['option4'];
        $option5 = $vars['option5'];
        $option6 = $vars['option6'];
        $LANG = $vars['_lang'];
    
        return array(
            'pagetitle' => 'Addon Module',
            'breadcrumb' => array('index.php?m=demo'=>'Demo Addon'),
            'templatefile' => 'clienthome',
            'requirelogin' => true, # or false
            'vars' => array(
                'testvar' => 'demo',
                'anothervar' => 'value',
                'sample' => 'test',
            ),
        );
    
    }
    

    add your client area code to clienthome.tpl in your module folder, then access that page using the url: http://yourwhmcsurl.com/index.php?m=Rapi

    More can be found in the official docs: http://docs.whmcs.com/Addon_Modules

    评论

报告相同问题?

悬赏问题

  • ¥15 关于大棚监测的pcb板设计
  • ¥20 sim800c模块 at指令及平台
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计