Jump to content

Dadou76620

Member
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Dadou76620

  1. Hello I create a hook and my function shows me his results 1 My hooks.php use Illuminate\Database\Capsule\Manager as Capsule; $pdo = Capsule::connection()->getPdo(); $pdo->beginTransaction(); function simple_news_hook_clientarea($vars) { global $smarty; $statement = $pdo->prepare("SELECT * FROM mod_simple_news ORDER BY idnews DESC"); $statement->execute(); $pdo->commit(); $list_news = array(); $i = 0; while($data = $statement->fetch()){ $list_news[$i]['idnews'] = $data['idnews']; $list_news[$i]['titre'] = $data['titre']; $list_news[$i]['news'] = $data['news']; $list_news[$i]['date'] = $data['date']; $list_news[$i]['auteur'] = $data['auteur']; $i++; } $smarty->assign('list_news', $list_news); } add_hook('ClientAreaHeaderOutput', 1, 'simple_news_hook_clientarea'); My file TPL $list_news displays '1' I have an error in my function? Thank you for your help
  2. Hello I have wanted to see the list of products on my website-hosting.tpl as products.tpl file located in (/templates/orderforms/premium_comparison). But the following code shows me nothing {foreach from=$products key=num item=product} {/foreach} Thank you for your future responses
  3. Hello I have wanted to know how to recover the root or a whmcs eter settle in function demo_output($vars) { $modulelink = $vars['modulelink']; $version = $vars['version']; $LANG = $vars['_lang']; $webroot = $vars['WEB_ROOT']; my hook.php add_hook('ClientAreaHeaderOutput', 1, demo_output); Sorry if I do not fully understand the operation I am french Cordially
  4. Sorry if I do not understand I'm french you ask me:
  5. I really like you but $WEB_ROOT displays nothing <?php function demo_output($vars) { $modulelink = $vars['modulelink']; $version = $vars['version']; $WEB_ROOT = $vars['WEB_ROOT']; $LANG = $vars['_lang']; } ?>
  6. Thank you for your reply. I did like this it also works that correct? <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); use Illuminate\Database\Capsule\Manager as Capsule; function hook_template_variables_example($vars) { global $smarty; $data = Capsule::table('mod_wizardpanelsettings')->get(); foreach($data as $datas) { $extra = json_decode(json_encode($datas), true); } $array = array( 'favicon' => $extra['favicon'] ); $smarty->assign('wizardpanel', $array); } add_hook('ClientAreaHeaderOutput', 1, 'hook_template_variables_example'); ?> I have one last question In the function 'function demo_output($vars)' how can retrieve the variable '{$WEB_ROOT}' ? Cordially
  7. Hello I just created a hook but this one return me an array <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); use Illuminate\Database\Capsule\Manager as Capsule; function hook_template_variables_example($vars) { $data = Capsule::table('mod_wizardpanelsettings')->get(); foreach($data as $datas) { $extra = json_decode(json_encode($datas), true); } $array = array( 'favicon' => $extra['favicon'] ); return $array; } add_hook('ClientAreaHeaderOutput', 1, 'hook_template_variables_example'); ?> when I made a print_r($array); he return me Array ( [favicon] => teste url favicon ) as well header.tpl I call my variable {$favison} Cordially
×
×
  • 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