11-27-2008, 02:29 PM
Yeah, this is basically a plugin doc.
The Classes
Tons of actions can be done with the THT Default Classes: $main, $db, $email and $style.
A example would be:
Self Explanatory. More will be written soon.
The Classes
Tons of actions can be done with the THT Default Classes: $main, $db, $email and $style.
A example would be:
PHP Code:
<?php
//////////////////////////
// The Hosting Tool
// By Jonny H
//////////////////////////
/*
* Global
*/
global $style, $main, $db;
/* First Example, show /includes/tpl/test.tpl with vars predefined
*/
$array['TESTVAR'] = 'test';
$style->replaceVar('tpl/test.tpl',$array);
/*
This shows test.tpl, and in test.tpl you can put %TESTVAR% anywhere to show 'test' (no quotes) in the screen.
*/
/* Second Example, get the value of configuration 'test_config' and prints it with /includes/tpl/test2.tpl, in the var %CONFIGVALUE%
*/
$array['CONFIGVALUE'] = $db->config('test_config');
$style->replaceVar('tpl/test2.tpl', $array);
/* Final Example, return a html for a tht table, with the content "LOL", title "Test", printed in the var %LOL% in /includes/tpl/test3.tpl */
$array['LOL'] = $main->table('Test','LOL');
$style->replaceVar('tpl/test3.tpl',$array);
?>
Self Explanatory. More will be written soon.