Example #1
0
<?php

require_once '../Quicky.class.php';
define('MICROTIME_START', microtime(TRUE));
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$tpl = new Quicky();
//$tpl->force_compile = TRUE;
//$tpl->compile_check = FALSE;
require_once '../Quicky.form.class.php';
require_once QUICKY_DIR . 'plugins/addons/QCAPTCHA.class.session.php';
$form = new Quicky_form('form1');
$form->addElement('captcha1', new QCAPTCHA(array('name' => 'captcha1_text')));
$form->addElement('btn1', new QButton(array('name' => 'submit', 'type' => 'submit', 'value' => 'Check!')));
$form->done = FALSE;
if ($form->btn1->clicked()) {
    if (!$form->captcha1->validate()) {
        $form->captcha1->_errormsg = 'invalid text';
    } else {
        $form->done = TRUE;
    }
}
$fn = 'form/captcha.tpl';
$tpl->display($fn);
echo '<hr />' . (microtime(TRUE) - MICROTIME_START);
echo '<hr />';
highlight_file($tpl->_get_compile_path($fn, ''));
echo '<hr />';
highlight_file($tpl->template_dir . $fn);
echo '<hr />';
highlight_file(__FILE__);
Example #2
0
define('MICROTIME_START', microtime(TRUE));
error_reporting(E_ALL);
ini_set('display_errors', 'On');
session_start();
if (!isset($_SESSION['lastrock_action']) || isset($_REQUEST['stop'])) {
    $_SESSION['lastrock_action'] = 'intro';
}
$tpl = new Quicky();
//$tpl->force_compile = TRUE;
//$tpl->compile_check = FALSE;
require_once '../Quicky.form.class.php';
$playform = new Quicky_form('play');
$playform->addElement('btn1', new QButton(array('name' => 'numbtn1')));
$playform->addElement('btn2', new QButton(array('name' => 'numbtn2')));
$playform->addElement('btn3', new QButton(array('name' => 'numbtn3')));
$form = new Quicky_form('startgame');
$form->addElement('num', array('name' => 'num'));
$form->addElement('startbtn', new QButton(array('name' => 'submit')));
if ($_SESSION['lastrock_action'] == 'play') {
    if ($playform->btn1->clicked()) {
        $humantake = 1;
    } elseif ($playform->btn2->clicked()) {
        $humantake = 2;
    } elseif ($playform->btn3->clicked()) {
        $humantake = 3;
    } else {
        $humantake = 0;
    }
    if ($humantake) {
        $_SESSION['lastrock_num'] -= $humantake;
        $_SESSION['lastrock_who'] = TRUE;
Example #3
0
<?php

require_once '../Quicky.class.php';
define('MICROTIME_START', microtime(TRUE));
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$tpl = new Quicky();
//$tpl->force_compile = TRUE;
//$tpl->compile_check = FALSE;
require_once '../Quicky.form.class.php';
$form = new Quicky_form('form1');
$form->addElement('text1', array('name' => 'text1'));
$form->addElement('btn1', new QButton(array('name' => 'submit', 'type' => 'submit')));
if ($form->btn1->clicked()) {
    $form->text1->addFilter('email', 'isn\'t e-mail');
    $form->text1->addFilter(array('format', '~_~'), 'need _');
    $form->_done = $form->_num_of_errors == 0;
}
$fn = 'form/filter.tpl';
$tpl->display($fn);
echo '<hr />' . (microtime(TRUE) - MICROTIME_START);
echo '<hr />';
highlight_file($tpl->_get_compile_path($fn, ''));
echo '<hr />';
highlight_file($tpl->template_dir . $fn);
echo '<hr />';
highlight_file(__FILE__);
Example #4
0
<?php

require_once '../Quicky.class.php';
define('MICROTIME_START', microtime(TRUE));
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$tpl = new Quicky();
$tpl->force_compile = TRUE;
//$tpl->compile_check = FALSE;
require_once '../Quicky.form.class.php';
$form = new Quicky_form('form1');
$form->addElement('text1', array('name' => 'paramtext1'));
$form->addElement('btn1', new QButton(array('name' => 'submit', 'type' => 'submit', 'value' => 'Test!')));
if ($form->btn1->clicked()) {
    if ($form->text1->getValue() != 'Quicky') {
        $form->text1->_errormsg = 'value is n\'t \'Quicky\'';
    } else {
        $form->_done = TRUE;
    }
}
$fn = 'form/index.tpl';
$tpl->display($fn);
echo '<hr />' . (microtime(TRUE) - MICROTIME_START);
echo '<hr />';
highlight_file($tpl->_get_compile_path($fn, ''));
echo '<hr />';
highlight_file($tpl->template_dir . $fn);
echo '<hr />';
highlight_file(__FILE__);
Example #5
0
<?php

require_once '../Quicky.class.php';
define('MICROTIME_START', microtime(TRUE));
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$tpl = new Quicky();
//$tpl->force_compile = TRUE;
//$tpl->compile_check = FALSE;
require_once '../Quicky.form.class.php';
$form = new Quicky_form('bbform');
$form->addElement('mybbarea', new QBBarea(array('name' => 'mybbarea')));
$form->mybbarea->_bbcode->smiles_dir = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'smiles') . DIRECTORY_SEPARATOR;
$form->mybbarea->_bbcode->smiles_url = 'http://' . $_SERVER['HTTP_HOST'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . '/smiles/';
$form->addElement('btn1', new QButton(array('name' => 'submit', 'type' => 'submit', 'value' => 'Show!')));
if ($form->btn1->clicked()) {
    $form->_done = $form->_num_of_errors == 0;
}
$fn = 'form/bbcode.tpl';
$tpl->display($fn);
echo '<hr />' . (microtime(TRUE) - MICROTIME_START);
echo '<hr />';
highlight_file($tpl->_get_compile_path($fn, ''));
echo '<hr />';
highlight_file($tpl->template_dir . $fn);
echo '<hr />';
highlight_file(__FILE__);
Example #6
0
<?php

require_once '../Quicky.class.php';
define('MICROTIME_START', microtime(TRUE));
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$tpl = new Quicky();
//$tpl->force_compile = TRUE;
//$tpl->compile_check = FALSE;
require_once '../Quicky.form.class.php';
$form = new Quicky_form('form1');
$form->addElement('text1', array('title' => 'Textbox 1', 'name' => 'paramtext1'));
$form->addElement('text2', array('title' => 'Textbox 2', 'name' => 'paramtext2'));
$form->addElement('text3', array('title' => 'Textbox 3', 'name' => 'paramtext3'));
$form->addElement('text4', array('title' => 'Textbox 4', 'name' => 'paramtext4'));
$form->addElement('dropdown1', new QDropdown(array('name' => 'mydropdown'), array('One', 'Two', 'Three')));
$form->dropdown1->addElement(array('type' => 'optgroup', 'text' => 'mygroup'));
$form->dropdown1->addElement(array('text' => 'mygroup'));
$form->addElement('box1', new QCheckBox(array('name' => 'box1', 'type' => 'checkbox', 'value' => '1')));
$form->addElement('btn1', new QButton(array('name' => 'submit', 'type' => 'submit', 'value' => 'Test!')));
if ($form->btn1->clicked()) {
    $form->_done = TRUE;
}
$fn = 'form/dynamic.tpl';
$tpl->display($fn);
echo '<hr />' . (microtime(TRUE) - MICROTIME_START);
echo '<hr />';
highlight_file($tpl->_get_compile_path($fn, ''));
echo '<hr />';
highlight_file($tpl->template_dir . $fn);
echo '<hr />';