$page_id = $_POST["page_id"];
    $result_t = call_data("page_title", "page", " WHERE page_id='{$page_id}'");
    $row_t = mysql_fetch_array($result_t);
    $result = update("page", "cat_id='{$cat_new}'", " WHERE page_id='{$page_id}'");
    if ($result) {
        $m .= "<p>「{$row_t[0]}」のカテゴリーを変更しました。</p>";
    } else {
        if ($result) {
            $m .= "<p>変更失敗しました。</p>";
        }
    }
    $_SESSION["message"] = $m;
    url_get("index.php");
}
//公開状態の変更
if ($_POST["sub"] == "保存") {
    $state_new = $_POST["state_new"];
    $edit_page_id = $_POST["edit_page_id"];
    $result = update("page", "page_state='{$state_new}'", " WHERE page_id='{$edit_page_id}'");
    $result_t = call_data("page_title", "page", " WHERE page_id='{$edit_page_id}'");
    $row_t = mysql_fetch_array($result_t);
    if ($result) {
        $m .= "<p>「{$row_t[0]}」の公開状態を変更しました。</p>";
    } else {
        if ($result) {
            $m .= "<p>変更失敗しました。</p>";
        }
    }
    $_SESSION["message"] = $m;
    url_get("index.php");
}
Exemple #2
0
<?php

echo <<<NAV

<!-- subContent START -->
        <div id="subContent">

            <div id="navArea">

NAV;
print '<div class="navList">';
print "<h3>カテゴリー</h3>";
print "<ul>";
$result_cat = call_data("cat_id,cat_name", "category", " ORDER BY cat_name");
while ($row_cat = mysql_fetch_array($result_cat)) {
    print "<li><a href='cat.php'>{$row_cat['cat_name']}</a></li>";
}
print "</ul>";
print "</div>";
?>
				<div class="navList">

					<h3>タグクラウド</h3>

					<ul id="tagCloud">

						<li class="level10"><a href="tag.php">タグ10</a></li>
						<li class="level1"><a href="tag.php">タグ1</a></li>
						<li class="level5"><a href="tag.php">タグ5</a></li>
						<li class="level2"><a href="tag.php">タグ2</a></li>
						<li class="level7"><a href="tag.php">タグ7</a></li>
Exemple #3
0
<?php

include "variable.php";
//ページのデータ
$result_page = call_data("*", "page", " ORDER BY page_date DESC");
include "head.php";
echo <<<Main

<body>

<!-- wrapper START -->
<div id="wrapper">

    <!-- HEADER START -->
    <div id="header_innerL">

        <div id="header_innerR">

            <div id="header_inner">

                <div id="discript">
                    <h1><a href="{$site_url}" tabindex="1">{$site_name}</a></h1>
                    <p>{$site_description}</p>
                </div>

                <!--
                <div id="utility">
                    <ul>
                        <li><a href="#">お問い合わせ</a></li>
                        <li id="RSS"><a href="#" tabindex="4">RSSフィード</a></li>
                    </ul>
Exemple #4
0
if (isset($_SESSION["up_img"])) {
    $up_m .= $_SESSION["up_img"];
    $_SESSION["up_img"] = NULL;
    $up_m .= "<p><a href='index.php?page_id={$page_id}'>OK</a></p>";
}
//ページのデータを取得
$retu = "*";
$table = "page";
$rule = " WHERE page_id='{$page_id}'";
//カテゴリーのデータを取得
$result = call_data($retu, $table, $rule);
$row = mysql_fetch_array($result);
$retu_c = "cat_id,cat_name";
$table_c = "category";
$rule_c = " ORDER BY cat_name";
$result_c = call_data($retu_c, $table_c, $rule_c);
?>

<?php 
include "../../common/header.php";
headerArea("「" . $row['page_title'] . "」の編集:SetucoCMS", $row_site, $login_name);
?>

                <!-- topicPath START -->
                <div id="topicPath">
                    <p><a href="../../index.php">トップ</a><img src="../../images/topicPath.gif" width="6" height="11" alt="の中の" /></p>
                    <p><a href="../index.php">ページの編集・削除</a><img src="../../images/topicPath.gif" width="6" height="11" alt="の中の" /></p>
                    <p>「技能五輪全国大会レポート」の編集</p>
                </div>
                <!-- topicpath END -->
<?php

include "../common/lib.php";
//サイトのデータ
$result_site = call_data("*", "site", "");
$row_site = mysql_fetch_array($result_site);
//サイトのid
$site_id = $row_site["site_id"];
//サイトのタイトル
$site_name = $row_site["site_name"];
//サイトのURL
$site_url = $row_site["site_url"];
//サイトの説明
$site_description = $row_site["site_description"];
//サイトのキーワード
$site_keyword = $row_site["site_keyword"];
//サイトの開設日
$site_date = $row_site["site_date"];
//管理者アカウントのデータ
$result_user = call_data("user_name", "user", " WHERE user_id='1'");
$row_user = mysql_fetch_array($result_user);
//管理者アカウント名
$admin_name = $row_user[0];
Exemple #6
0
<?php

include "../common/lib.php";
notLogin();
$login_name = login_name();
$row_site = site_data();
if ($_SESSION["message"]) {
    $m .= $_SESSION["message"];
    $_SESSION["message"] = NULL;
    $m .= "<p><a href='index.php'>OK</a></p>";
}
$result = call_data("*", "goal", "");
$row = mysql_fetch_array($result);
?>

<?php 
include "../common/header.php";
headerArea("更新目標の編集:SetucoCMS", $row_site, $login_name);
?>

                <!-- topicPath START -->
                <div id="topicPath">
                    <p><a href="../index.php">トップ</a><img src="../images/topicPath.gif" width="6" height="11" alt="の中の" /></p>
                    <p>更新目標の編集</p>
                </div>
                <!-- topicpath END -->

                <!-- section START -->
                <div class="section">

                    <div id="topichAreaL">
Exemple #7
0
                    <!-- entry END -->

                    <!-- entry START -->
                    <div class="entry">

                        <div class="entryHead">

                            <h2><span>新着ページ(10件)</span></h2>

                        </div>

                        <div class="entryBody">

                            <ul>
ENTRY;
$result_page = call_data("page_id,page_title,page_state", "page", " ORDER BY page_date DESC");
$i = 0;
while ($row_page = mysql_fetch_array($result_page)) {
    $page_state = $row_page["page_state"];
    $page_id = $row_page["page_id"];
    if ($page_state == 1) {
        print "<li><a href='page.php?page_id={$page_id}'>{$row_page['page_title']}</a></li>";
        $i++;
    }
    if ($i == 10) {
        break;
    }
}
echo <<<ENTRY2
                            </ul>
Exemple #8
0
<?php

$docroot = $_SERVER['DOCUMENT_ROOT'];
include "../common/lib.php";
notLogin("../login.php");
//サイドナビの該当箇所をアクティブにする
$_SESSION["active"] = "site";
$login_name = login_name();
$row_site = site_data();
if ($_SESSION["message"]) {
    $m .= $_SESSION["message"];
    $_SESSION["message"] = NULL;
    $m .= "<p><a href='index.php'>OK</a></p>";
}
$result = call_data("*", "site", "");
$row = mysql_fetch_array($result);
?>

<?php 
include "../common/header.php";
headerArea("サイト情報の編集:SetucoCMS", $row_site, $login_name);
?>

                <!-- topicPath START -->
                <div id="topicPath">
                    <p><a href="../index.php">トップ</a><img src="../images/topicPath.gif" width="6" height="11" alt="の中の" /></p>
                    <p>サイト情報の編集</p>
                </div>
                <!-- topicpath END -->

                <!-- section START -->
Exemple #9
0
$login_name = login_name();
$row_site = site_data();
$m = "";
if (isset($_GET["delete"])) {
    $_SESSION["del_cat_id"] = $_GET["delete"];
    url_get("cat_edit.php");
}
if ($_SESSION["message"]) {
    $m .= $_SESSION["message"];
    $_SESSION["message"] = NULL;
    $m .= "<p><a href='index.php'>OK</a></p>";
}
$retu = "*";
$table = "category";
$rule = " ORDER BY cat_name";
$result = call_data($retu, $table, $rule);
?>

<?php 
include "../common/header.php";
headerArea("カテゴリーの追加・編集・削除:SetucoCMS", $row_site, $login_name);
?>

                <!-- topicPath START -->
                <div id="topicPath">
                    <p><a href="../index.php">トップ</a><img src="../images/topicPath.gif" width="6" height="11" alt="の中の" /></p>
                    <p>カテゴリーの追加・編集・削除</p>
                </div>
                <!-- topicpath END -->

                <!-- section START -->
Exemple #10
0
//偶数・奇数判定に使う変数
$i = 0;
while ($row_page = mysql_fetch_array($result_page)) {
    //ページ作成日時
    $page_date = str_replace("-", "/", $row_page['page_date']);
    //ページID
    $page_id = $row_page["page_id"];
    //タイトル
    $page_title = $row_page["page_title"];
    //カテゴリー
    $cat_id = $row_page["cat_id"];
    $result_cat = call_data("cat_name", "category", " WHERE cat_id='{$cat_id}'");
    $cat_name = mysql_fetch_array($result_cat);
    //制作者
    $user_id = $row_page["user_id"];
    $result_u = call_data("user_name", "user", " WHERE user_id='{$user_id}'");
    $user_name = mysql_fetch_array($result_u);
    //公開状態
    if ($row_page["page_state"] == 0) {
        $page_state = "下書き";
    } else {
        if ($row_page["page_state"] == 1) {
            $page_state = "公開";
        }
    }
    //偶数だったらcontentsListG、奇数だったらcontentsListKをつけて、CSSで背景色を入れる
    $i++;
    if ($i % 2 == 0) {
        print "<dl class='contentsListG'>";
    } else {
        print "<dl class='contentsListK'>";
Exemple #11
0
}
notPost("index.php");
//カテゴリー名変更か、新規追加時のキャンセル
if ($_POST["sub"] == "キャンセル") {
    url_get("index.php");
}
//カテゴリー名変更
if ($_POST["sub"] == "保存") {
    if ($_POST["cat_new"] == "") {
        $m .= "<p>カテゴリー名を空白にはできません。</p>";
        $_SESSION["message"] = $m;
        url_get("index.php");
    }
    $cat_new = htmlspecialchars($_POST["cat_new"], ENT_QUOTES, "UTF-8");
    $cat_no = $_POST["cat_no"];
    $result_c = call_data("cat_name", "category", " WHERE cat_id='{$cat_no}'");
    $row_c = mysql_fetch_array($result_c);
    update("category", "cat_name='{$cat_new}'", " WHERE cat_id='{$cat_no}'");
    $m = "<p>「{$row_c["0"]}」を「{$cat_new}」に変更しました。</p>";
}
//新規追加
if ($_POST["sub"] == "追加") {
    $table = "category";
    $retu = "cat_name";
    //$retu .= ",cat_parent_id";
    $cat_name = htmlspecialchars($_POST["cat_name"], ENT_QUOTES, "UTF-8");
    //$cat_parent_id = $_POST["cat_parent_id"];
    $value = "'{$cat_name}'";
    //$value .= ",'{$cat_parent_id}'";
    $result = add_data($table, $retu, $value);
    if ($result) {
$page_date = htmlspecialchars($_POST["page_date"], ENT_QUOTES, "UTF-8");
$value .= ",'{$page_date}'";
$retu .= ",user_id";
$user_id = $_POST["user_id"];
$value .= ",'{$user_id}'";
$retu .= ",page_state";
if ($_POST["sub"] == "下書きで保存") {
    $value .= ",'0'";
} else {
    if ($_POST["sub"] == "公開して保存") {
        $value .= ",'1'";
    }
}
//データベースにデータをアップ
$result = add_data($table, $retu, $value);
$result_id = call_data("page_id", "page", " WHERE page_title='{$page_title}' AND page_date='{$page_date}' AND user_id='{$user_id}' AND page_text='{$page_text}'");
$row_id = mysql_fetch_array($result_id);
$page_id = $row_id[0];
$row_site = site_data();
$site_url = $row_site["site_url"];
if ($result) {
    $_SESSION["message"] = "<p>「{$page_title}」を作成しました。";
    if ($page_state == 1) {
        $_SESSION["message"] .= "<a href='{$site_url}/page.php?page_id={$page_id}' target='_blank'>ページを確認</a>";
    }
    $_SESSION["message"] .= "</p>";
    $_SESSION["page_title"] = "";
    $_SESSION["page_text"] = "";
    $_SESSION["page_next"] = "";
    url_get("../edit/index.php?page_id={$page_id}");
} else {
Exemple #13
0
}
notPost("index.php");
//タグ名変更か、新規追加時のキャンセル
if ($_POST["sub"] == "キャンセル") {
    url_get("index.php");
}
//タグ名変更
if ($_POST["sub"] == "保存") {
    if ($_POST["tag_new"] == "") {
        $m .= "<p>タグ名を空白にはできません。</p>";
        $_SESSION["message"] = $m;
        url_get("index.php");
    }
    $tag_new = htmlspecialchars($_POST["tag_new"], ENT_QUOTES, "UTF-8");
    $tag_no = $_POST["tag_no"];
    $result_c = call_data("tag_name", "tag", " WHERE tag_id='{$tag_no}'");
    $row_c = mysql_fetch_array($result_c);
    update("tag", "tag_name='{$tag_new}'", " WHERE tag_id='{$tag_no}'");
    $m = "<p>「{$row_c["0"]}」を「{$tag_new}」に変更しました。</p>";
}
//新規追加
if ($_POST["sub"] == "追加") {
    $table = "tag";
    $retu = "tag_name";
    $tag_name = htmlspecialchars($_POST["tag_name"], ENT_QUOTES, "UTF-8");
    $value = "'{$tag_name}'";
    $result = add_data($table, $retu, $value);
    if ($result) {
        $m .= "<p>{$tag_name}を作成しました。</p>";
    } else {
        $m .= "<p>失敗しました。同じタグ名のものがないかご確認ください。</p>";
Exemple #14
0
        <!-- mainContent START -->
        <div id="mainContent">

Main;
$page_title = $row_page["page_title"];
$page_text = $row_page["page_text"];
$page_id = $row_page["page_id"];
//カテゴリー名の取得
$page_cat_no = $row_page["cat_id"];
$result_page_cat = call_data("cat_name", "category", " WHERE cat_id='{$page_cat_no}'");
$row_page_cat = mysql_fetch_array($result_page_cat);
$page_cat = $row_page_cat["0"];
//投稿者名の取得
$page_user_no = $row_page["user_id"];
$result_page_user = call_data("user_name", "user", " WHERE user_id='{$page_user_no}'");
$row_page_user = mysql_fetch_array($result_page_user);
$page_user = $row_page_user["0"];
if (isset($row_page["page_next"])) {
    $page_next = $row_page["page_next"];
}
//ページの投稿日時の取得
$page_date_r = $row_page["page_date"];
$page_date_array = str_replace("-", "/", $page_date_r);
$page_date = substr($page_date_array, 0, 16);
$page_state = $row_page["page_state"];
if ($page_state == 1) {
    echo <<<ENTRY

                    <!-- entry START -->
                    <div class="entry">
Exemple #15
0
function site_data()
{
    $result_site = call_data("*", "site", "");
    $row_site = mysql_fetch_array($result_site);
    return $row_site;
}