Example #1
0
// --------------------------------
// トップページ
$info = info_list(1, 0, 0, 1, 0);
// TOP情報 -> 0(全て)
$data["info"] = $info[0];
// お知らせ
$data["newinfo"] = get_newinfo();
//
if ($_REQUEST["d"] == "1") {
    echo "<pre>";
    var_dump($data);
    echo "</pre>";
    exit;
}
//
htmltemplate::t_include("top.html", $data);
exit;
// --------------------------------
// お知らせ
function get_newinfo()
{
    global $DB_URI;
    $sql = "select * from info where open=1 and kind=" . INFO_RSS;
    $inst = DBConnection::getConnection($DB_URI);
    $ret = $inst->search_sql($sql);
    $list = array();
    if ($ret["count"]) {
        foreach ($ret["data"] as $val) {
            $item = get_setup(INFO_RSS, $val["info_id"]);
            if ($item["open"]) {
                $item["reg_date"] = $val["reg_date"];
Example #2
0
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
if (!defined('EXPONENT')) {
    exit('');
}
$t = null;
$loc = exponent_core_makeLocation('htmltemplatemodule');
if (isset($_POST['id'])) {
    $t = $db->selectObject('htmltemplate', 'id=' . intval($_POST['id']));
}
if (!$t && exponent_permissions_check('create', $loc) || $t && exponent_permissions_check('edit', $loc)) {
    $t = htmltemplate::update($_POST, $t);
    if (isset($t->id)) {
        $db->updateObject($t, 'htmltemplate');
    } else {
        $db->insertObject($t, 'htmltemplate');
    }
    exponent_flow_redirect();
} else {
    echo SITE_403_HTML;
}
Example #3
0
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
if (!defined('EXPONENT')) {
    exit('');
}
$t = null;
$loc = exponent_core_makeLocation('HTMLTemplateModule');
if (isset($_GET['id'])) {
    $t = $db->selectObject('htmltemplate', 'id=' . intval($_GET['id']));
}
if (!$t && exponent_permissions_check('create', $loc) || $t && exponent_permissions_check('edit', $loc)) {
    if (!defined('SYS_FORMS')) {
        include_once BASE . 'subsystems/forms.php';
    }
    exponent_forms_initialize();
    $form = htmltemplate::form($t);
    $form->meta('module', 'HTMLTemplateModule');
    $form->meta('action', 'save');
    $template = new template('HTMLTemplateModule', '_form_edit', $loc);
    $template->assign('is_edit', isset($t->id) ? 1 : 0);
    $template->assign('form_html', $form->toHTML());
    $template->output();
} else {
    echo SITE_403_HTML;
}