Пример #1
0
		<p><a href="mailto:charles@hespandjones.co.uk" class="email"><img src="/media/images/email-us.png" alt="email us" /></a></p>
		<p>Telephone: <span class="lg">01904 470256</span></p>
		<p class="copyright">&copy; <?php 
echo site_title;
?>
 <?php 
echo date("Y");
?>
 &nbsp;<br/>
			&nbsp; Website by <a href="http://www.bowhouse.co.uk">www.bowhouse.co.uk</a></p>
	</footer>

</div> <!-- /container -->

<?php 
echo fn::get_footer();
?>

<?php 
foreach (fn('page.scripts') as $__inc) {
    ?>
<script src="<?php 
    echo $__inc;
    ?>
"></script>
<?php 
}
?>

</body>
</html>
Пример #2
0
<body class="<?php 
echo $page['title'];
?>
">

<?php 
include_once "analyticstracking.php";
?>

<div class="bkg-sec color-white text-center banner border-box">
	<div class="l-container">
		<!--<nav>
		  <ul class="nav">
		    <?php 
$lis = fn::get_datas_with_tag('page', 1);
foreach ($lis as $li) {
    ?>
		    <li><a <?php 
    echo is_active($page, $li);
    ?>
 href="<?php 
    echo site_url;
    echo $li['int'];
    ?>
"><?php 
    echo $li['title'];
    ?>
</a></li>
		    <?php 
}
Пример #3
0
<?php

fn('site.header');
?>

<?php 
echo $page['content'];
?>

<ul id="lightSlider">

	<?php 
$medias = fn::get_medias($page['id']);
foreach ($medias as $media) {
    ?>
			<li data-thumb="<?php 
    echo $media['url'];
    ?>
"><img src="<?php 
    echo $media['url'];
    ?>
" alt="<?php 
    echo $media['lookup_title'];
    ?>
" /><?php 
    echo $media['lookup_data'];
    ?>
</li>
	<?php 
}
?>
Пример #4
0
<?php

require_once '_config.php';
$reqs = fn::reqs();
if ($reqs[0] == 'index') {
    fn::redirect(ext);
}
$page1 = fn::get_data('page', $reqs[0]);
if ($reqs[1]) {
    $page2 = fn::get_data('page', $reqs[1]);
}
if ($reqs[2]) {
    $page3 = fn::get_data('page', $reqs[2]);
}
if ($page3) {
    $page = $page3;
} elseif ($page2) {
    $page = $page2;
} else {
    $page = $page1;
}
if ($page && empty($page['template'])) {
    $page['template'] = 'page.php';
}
if (empty($page['meta_title'])) {
    $page['meta_title'] = $page['title'];
}
$base = int . ext . templates;
$real = $base . $page['url'] . '.php';
$temp = $base . $page['template'] . '.php';
$fourohfour = $base . '404.php';
Пример #5
0
 /**
  * 试卷详细信息
  * @param   int|array   $paper_id    试卷id
  * @return  array       $paper_detail
  */
 private static function paperDetail($paper_id)
 {
     if (!$paper_id) {
         return array();
     }
     $db = fn::db();
     $paper_id_str = implode(',', $paper_id);
     $sql = "SELECT e.exam_id, esp.paper_id, e.subject_id, e.grade_id,\n                e.class_id, e.total_score, e.qtype_score, ep.question_score\n                FROM rd_exam e \n                LEFT JOIN rd_exam_subject_paper esp ON e.exam_id = esp.exam_id \n                LEFT JOIN rd_exam_paper ep ON ep.paper_id = esp.paper_id\n                WHERE esp.paper_id IN ({$paper_id_str})";
     $exam = $db->fetchAll($sql);
     if (!$exam) {
         return array();
     }
     $grade_id = $exam[0]['grade_id'];
     $class_id = $exam[0]['class_id'];
     $sql = "SELECT eq.paper_id, q.ques_id, q.type, q.score_factor\n                FROM rd_exam_question eq\n                LEFT JOIN rd_question q ON eq.ques_id=q.ques_id\n                LEFT JOIN rd_relate_class rc ON rc.ques_id = q.ques_id \n                          AND rc.grade_id={$grade_id} AND rc.class_id={$class_id}\n                WHERE eq.paper_id IN ({$paper_id_str}) \n                ORDER BY rc.difficulty DESC,q.ques_id ASC";
     $paper = $db->fetchAll($sql);
     $exam_paper_question = array();
     //考试试卷试题
     foreach ($paper as $item) {
         $exam_paper_question[$item['paper_id']][$item['ques_id']] = $item;
     }
     $paper_detail = array();
     foreach ($exam as $item) {
         if ($item['subject_id'] == 3) {
             $groups = array(1 => array(), 4 => array(), 0 => array(), 5 => array(), 6 => array(), 7 => array(), 2 => array(), 3 => array(), 8 => array(), 9 => array(), 14 => array());
         } else {
             $groups = array(1 => array(), 2 => array(), 3 => array(), 0 => array(), 14 => array());
         }
         $question_score = @json_decode($item['question_score'], true);
         $qtype_score = explode(',', $item['qtype_score']);
         $index = 1;
         $tmp_data = $exam_paper_question[$item['paper_id']];
         $total_score_factor = 0;
         // 题组试题总的分值系数
         $total_score = $item['total_score'];
         //试卷总分
         foreach ($groups as $type => &$group) {
             foreach ($tmp_data as $ques_id => $val) {
                 if ($val['type'] == $type) {
                     $group[$ques_id]['ques_index'] = $index++;
                     if ($val['type'] > 0) {
                         if (isset($question_score[$ques_id]) && $question_score[$ques_id]) {
                             $group[$ques_id]['full_score'] = array_sum($question_score[$ques_id]);
                             $total_score -= $group[$ques_id]['full_score'];
                         } else {
                             $total_score -= $qtype_score[$val['type'] - 1];
                             $group[$ques_id]['full_score'] = $qtype_score[$val['type'] - 1];
                         }
                     }
                     if ($type == 0) {
                         $total_score_factor += $val['score_factor'];
                     }
                 }
             }
         }
         $groups = array_filter($groups);
         if (!empty($groups[0])) {
             foreach ($groups[0] as $ques_id => &$list) {
                 $list['full_score'] = round($total_score * $tmp_data[$ques_id]['score_factor'] / $total_score_factor);
             }
         }
         $paper_detail[$item['paper_id']] = $groups;
         $paper_detail[$item['paper_id']]['question_score'] = $question_score;
     }
     return $paper_detail;
 }
Пример #6
0
function fn()
{
    global $page;
    $args = func_get_args();
    $method = $args[0];
    $opts = array_slice($args, 1);
    //quick methods
    $quick = trim(strtolower(str_replace(array(' ', '_', '-'), array('', '', ''), $method)));
    switch ($quick) {
        case 'load':
        case 'add':
            $key = $opts[0];
            $opts = array_slice($opts, 1);
            fn::add_object($key, $opts);
            return true;
            break;
        case 'isajax':
            return fn::is_ajax();
            break;
        case 'isbh':
        case 'isoffice':
        case 'isbowhouse':
            return bh;
            break;
        case 'page.metatitle':
            return fn::data('page.meta_title', $args[1]);
            break;
        case 'page.metadescription':
            return fn::data('page.meta_description', $args[1]);
            break;
        case 'page.metakeywords':
            return fn::data('page.meta_keywords', $args[1]);
            break;
        case 'page.scripts':
            $scripts = fn::data('page.scripts');
            if (!is_array($scripts)) {
                $scripts = array();
            }
            if ($args[1]) {
                $scripts[] = $args[1];
            }
            fn::data('page.scripts', $scripts);
            return $scripts;
            break;
        case 'page.styles':
            $styles = fn::data('page.styles');
            if (!is_array($styles)) {
                $styles = array();
            }
            if ($args[1]) {
                $styles[] = $args[1];
            }
            fn::data('page.styles', $styles);
            return $styles;
            break;
        case 'site.header':
            require_once int . ext . templates . template . '/header.php';
            return;
            break;
        case 'site.footer':
            require_once int . ext . templates . template . '/footer.php';
            return;
            break;
    }
    $ps = explode('.', $method);
    $newopts = $opts[0];
    return fn::call_object($ps[0], $ps[1], $opts);
}
Пример #7
0
        $email = fn::rci('email', 'email');
        $tel = fn::rci('tel');
        $content = fn::rci('content');
        $surname = fn::rci('surname');
        if ($surname != '') {
            fn::redirect(site_url . '/form-fail');
        }
        $n = '<br />' . n;
        $html = "\n\t\tContact from {$name} ({$email}) via contact form on " . site_title . " website{$n}\n\t\t==================================================={$n}\n\t\t{$n}\n\t\tName: {$name}\n\t\t{$n} {$n}\n\t\tEmail: {$email}\n\t\t{$n} {$n}\n\t\tTel: {$tel}\n\t\t{$n} {$n}\n\t\t{$content} {$n}\n\t\t{$n} {$n}\n\t\t==================================================={$n}\n\t\t{$n} {$n}\n\t\tInfo{$n}\n\t\t========{$n}\n\t\tSent: " . fn::now() . "{$n}\n\t\tIP: {$_SERVER['REMOTE_ADDR']}{$n}\n\t\tRef: {$_SERVER['HTTP_REFERER']}{$n} \t\n\t";
        $arr = array();
        $arr['to_email'] = '*****@*****.**';
        $arr['to_name'] = 'Alan';
        //$arr['to_email'] = '';
        //$arr['to_name'] = 'York City FC Foundation' /*site_title*/;
        $arr['from_email'] = 'noreply@' . str_replace('www.', '', host);
        $arr['from_name'] = $name;
        $arr['reply_to'] = $email;
        $arr['subject'] = 'Contact via contact form on ' . site_title . ' website';
        $arr['plain'] = $html;
        $arr['html'] = $html;
        $sent = fn::send_email($arr);
        if ($sent) {
            $state = 'ok';
        } else {
            $state = 'error';
        }
        $ref = $_SERVER['HTTP_REFERER'];
        fn::redirect($ref . '?&state=' . $state);
        break;
}
exit;
Пример #8
0
    return $ret;
}
${'@at'}->fn('on', fn('_on', array(FALSE, fn::ph(), fn::ph())));
${'@at'}->fn('on!', fn('_on', array(TRUE, fn::ph(), fn::ph())));
function _on($not, $cond, $block)
{
    if ($not === empty($GLOBALS['@' . trim($cond)])) {
        return $GLOBALS['@at']->run($block);
    }
}
// filters
${'@filter:texy'} = fn(array(new Texy(), 'process'), array(fn::ph()));
${'@filter:escape'} = fn('htmlspecialchars', array(fn::ph(), ENT_QUOTES));
${'@filter:date'} = fn('date', array('j. n. Y, H:i:s', fn::ph()));
${'@filter:mailize'} = fn('_mailize', array(fn::ph(), FALSE));
${'@filter:mailto'} = fn('_mailize', array(fn::ph(), TRUE));
function _mailize($email, $mailto = FALSE)
{
    $ret = '';
    if ($mailto) {
        $email = 'mailto:' . $email;
    }
    for ($i = 0, $len = strlen($email); $i < $len; ++$i) {
        $ord = ord($email[$i]);
        if ($ord <= 0x7f && $ord !== 64 && $ord !== 46 && $i % 15 !== 0) {
            $ret .= chr($ord);
            continue;
        }
        if (!$mailto && $i & 1) {
            $ret .= '<!---->';
        }