Jump to content

Techsmith

Member
  • Posts

    4
  • Joined

  • Last visited

About Techsmith

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Techsmith's Achievements

Junior Member

Junior Member (1/3)

-1

Reputation

  1. So for anyone else scratching their head, passing everything statically obviously wasn't sitting well with me so echo $theHtmlFile; was never going to be a "proper" solution. Seeing as I already had access to smarty for right or wrong I ended up going with the following in order to use templates that are able to use smarty variables: $smarty = new Smarty(); $smarty->assign('version', $vars['version']); $smarty->assign('otherVars', 'thatYouNeed'); $smarty->caching = false; $smarty->compile_dir = $GLOBALS['templates_compiledir']; $smarty->display(dirname(__FILE__) . '/admin/admin.tpl'); To give full credit where credit is due I finally used an obscure enough search term to get a stackoverflow question from 2013 and the above is identical (functionally) to the answer given by Akahadaka. http://stackoverflow.com/questions/14246279/whmcs-addon-module-admin-section-template
  2. Thanks for trying to help although I guess my title is a little misleading as I am not trying to hook into the admin area, I am trying to work with an Addon modules blog_output($vars) and call a template rather than just echo ''; my presentation where I would prefer to keep just functionality.
  3. I have been trying to do the good old search and have found plenty of ways of doing what I want... just not where I want to do it, so I finally got to the point of just reaching out to the community. I am looking at developing an addon and for the most part everything seems simple enough although I am trying to use an template file for part of the admin output and i'm struggling to achieve what I want. The documentation (https://developers.whmcs.com/addon-modules/admin-area-output/) mentions: "Things aren’t limited to just one file. Use the _output function to include other files, call templates, etc. The system is flexible." which I took to mean that I can call a smarty template .tpl file although currently I am at a loss as to how I should be calling it, can anyone give me a quick couple of lines as to whether "templates" actually means smarty templates and how I should make the call. Something crude like: $thepage = file_get_contents('/home/user/public_html/dev/modules/addons/theaddon/admin/admin.tpl'); echo $thepage; works for displaying html although i'd prefer to be able to: pass {$smarty} variables. Keeping design and functionality separate. Appreciate any direct examples, ideas or just pointers in the right direction.
  4. Just a quick response after scouring forums and hassling whmcs support they pointed me to something I should of seen right from the start, on login to the Admin page I could see under errors "Smarty Error: unable to read resource: /home/ts/public_html/clients/templates/orderforms/tscomparison/products.tpl" Now under v5.0.3 this should have been ts_comparison and somehow magically the _ had been stripped out of what it was looking for, I renamed the folder to what whmcs was expecting and bam everything back how it should be. For those that aren't getting anywhere with paypal.php give your admin page a look and see if any errors pop up in your activity log.
×
×
  • 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