Jump to content

Action Hooks and Echo"$results" - How to wrap into a template?


Recommended Posts

Hi there,

 

I am using actionhook_AfterModuleCreate function to execute an external script and to echo the output to the screen. It works properly but the results are displayed without the whmcs template, just in blank screen. I tried using the standard way of creating custom pages (code below) with changed paths (because actionhooks.php resides in whmcs/includes/) but it only displays a blank page.

 

Is there a proper way of doing this? Or Is there a way to have a php file that's using a template in /includes/ ?

 

require("../dbconnect.php");
require("functions.php");
require("clientareafunctions.php");

$pagetitle = "Test";
$pageicon = "../images/support/clientarea.gif";
$breadcrumbnav = '<a href="../index.php">'.$_LANG['globalsystemname'].'</a>';
$breadcrumbnav .= ' > <a href="test.php">Test</a>'; 

initialiseClientArea($pagetitle,$pageicon,$breadcrumbnav);

if ($_SESSION['uid']) {
 # User is Logged In - put any code you like here
} 

# To assign variables in Smarty use the following syntax.
# This can then be used as {$variablename} in the template

$smartyvalues["variablename"] = $value; 

# Define the template filename to be used without the .tpl extension

$templatefile = "test"; 

outputClientArea($templatefile);

Link to comment
Share on other sites

I tried using the standard way of creating custom pages (code below) with changed paths (because actionhooks.php resides in whmcs/includes/) but it only displays a blank page.

 

It seems that it's not necessary to change the relative paths since the page is generated by cart.php not /includes/actionhooks.php, however it's still showing a blank page.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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