コード例 #1
0
ファイル: search.php プロジェクト: Git-Host/gdxkc-code
include_once 'class.isay.php';
include_once 'function.php';
include_once 'config.php';
include_once 'head.php';
?>
<div class="content">
<div class="search">
<div class="notification">提示 | 可以使用多个关键字搜索,关键字之间用空格分开。</div>
<div class="search_input">
    <input type="text" id="key" onkeydown="searchSubmit()" onkeypress="searchSubmit(event)"/>
	<a class="search_submit" href="javascript:searchSubmit2()"></a>
</div></div>
<?php 
$key = urldecode($_GET['key']);
$keyarray = explode(' ', $key);
$isay = new isay();
$isay->config($server, $user, $password, $db);
if ($isay->connect()) {
    $array = $isay->search($keyarray);
    if ($_GET['page']) {
        $page = $_GET['page'];
    } else {
        $page = 1;
    }
    $totalPage = ceil(count($array) / $eachPage);
    $result = pageItem($page, $eachPage, $array);
    if (!empty($result)) {
        foreach ($result as $item) {
            echo '<div class="content_item">' . ubb2html($item['content']) . '</div>';
            echo '<div class="content_info">';
            echo $item['postime'];
コード例 #2
0
ファイル: delete.php プロジェクト: Git-Host/gdxkc-code
<?php

/**
 * @author gdxkc
 * @copyright 2012
 */
error_reporting(0);
session_start();
if ($_SESSION['logtag'] != 'in') {
    header("location:login.php");
} else {
    include_once 'class.isay.php';
    include_once 'config.php';
    if ($_GET['id']) {
        //删除id
        $id = $_GET['id'];
        $isay = new isay();
        $isay->config($server, $user, $password, $db);
        if ($isay->connect()) {
            if ($isay->deleteItem($id)) {
                header("location:error.php?info=5");
            } else {
                header("location:error.php?info=6");
            }
        } else {
            header("location:error.php?info=1");
        }
    } else {
        header("location:error.php?info=7");
    }
}
コード例 #3
0
ファイル: edit.php プロジェクト: Git-Host/gdxkc-code
<div class="edit">
<div class="content_tool">
    <a href="javascript:void(0)" class="url" onclick="tagUrl()"></a>
    <a href="javascript:void(0)" class="img" onclick="tagImg()"></a>
    <a href="javascript:void(0)" class="t" onclick="tagTag()"></a>
    <a href="javascript:void(0)" class="o" onclick="tagOrange()"></a>
    <a href="javascript:void(0)" class="b" onclick="tagBlue()"></a>
    <a href="javascript:void(0)" class="r" onclick="tagRed()"></a>
    <a href="javascript:void(0)" class="g" onclick="tagGreen()"></a> 
</div>
<div class="edit_textarea">
    <form id="content" action="edit.php?action=edit&id=<?php 
echo $_GET['id'];
?>
" method="post">
    <?php 
if ($id = $_GET['id']) {
    $isay = new isay();
    $isay->config($server, $user, $password, $db);
    if ($isay->connect()) {
        $item = $isay->getItemById($id);
        echo '<textarea id="edit" name="content">' . $item['content'] . '</textarea>';
    }
}
?>
    </form>
</div>
<div class="edit_submit"><a href="javascript:editSubmit()">修改</a></div>
</div>
<?php 
include_once 'foot.php';
コード例 #4
0
ファイル: index.php プロジェクト: Git-Host/gdxkc-code
include_once 'function.php';
include_once 'config.php';
include_once 'head.php';
?>
<div class="search">
<div class="notification"><?php 
echo $notification;
?>
</div>
<div class="search_input">
    <input type="text" id="key" onkeydown="searchSubmit()" onkeypress="searchSubmit(event)"/>
	<a class="search_submit" href="javascript:searchSubmit2()"></a>
</div></div>
<div class="content">
<?php 
$isay = new isay();
$isay->config($server, $user, $password, $db);
if ($isay->connect()) {
    $array = $isay->getAll();
    $_GET['page'] = '';
    if ($_GET['page']) {
        $page = $_GET['page'];
    } else {
        $page = 1;
    }
    $totalPage = ceil(count($array) / $eachPage);
    $result = pageItem($page, $eachPage, $array);
    if (!empty($result)) {
        foreach ($result as $item) {
            echo '<div class="content_item">' . ubb2html($item['content']) . '</div>';
            echo '<div class="content_info">';
コード例 #5
0
ファイル: add.php プロジェクト: Git-Host/gdxkc-code
<?php

/**
 * @author gdxkc
 * @copyright 2012
 */
error_reporting(0);
session_start();
if ($_SESSION['logtag'] != 'in') {
    header("location:login.php");
}
include_once 'class.isay.php';
include_once 'config.php';
if ($_GET['action'] == 'add') {
    if ($content = $_POST['content']) {
        $isay = new isay();
        $isay->config($server, $user, $password, $db);
        if ($isay->connect()) {
            if ($isay->addItem($content)) {
                header("location:error.php?info=3");
            } else {
                header("location:error.php?info=4");
            }
        } else {
            header("location:error.php?info=1");
        }
    } else {
        header("location:error.php?info=2");
    }
}
?>