Ejemplo n.º 1
0
Archivo: oop.php Proyecto: 2Choi/1124
<?
class Board{
	public $title, $content , $author, $date;

	function printn($n){
		for($i=1; $i<=$n; $i++)
		{
			echo  "$i";
		}
	}
}
$object = new board;

$object->printn(7);

?>
Ejemplo n.º 2
0
echo "<table border=0 cellpadding=0 cellspacing=0 width=770 ><tr><td class=grey><br>";
$boards = new sql();
$boards->setQuery("select distinct board_id from rex__board");
if ($boards->getRows() > 0) {
    $currentboardname = "";
    echo "<table border=0 cellpadding=5 cellspacing=1 width=100%>";
    for ($i = 0; $i < $boards->getRows(); $i++) {
        $boardname = $boards->getValue("board_id");
        echo "<tr><td class=dgrey><b><a href=index.php?page=community&subpage=board&FORM[boardname]={$boardname} class=black>{$boardname}</a></b></td></tr>";
        if ($FORM[boardname] == $boardname) {
            $currentboardname = $boardname;
        }
        $boards->next();
    }
    echo "</table><br>";
    if ($currentboardname != "") {
        $board = new board();
        $board->setDB(1);
        $board->setTable("rex__board");
        $board->setDocname("index.php");
        $board->addLink("page", "community");
        $board->addLink("subpage", "board");
        $board->setBoardname($currentboardname);
        $board->setUserjoin("rex__user on rex__board.user_id=rex__user.id", "rex__user.login");
        $board->setAdmin();
        echo $board->showBoard();
    }
} else {
    echo "&nbsp;&nbsp;Kein Board wurde eingetragen !<br>";
}
echo "<br></td></tr></table>";
Ejemplo n.º 3
0
    public function get_comment_list()
    {
        $id = $this->metadata['id'];
        $res = mysql_query("select comment,time from board where id='{$id}'");
        echo "<table border=1><tr><td>comment</td><td>time</td>";
        while ($row = mysql_fetch_array($res)) {
            list($comment, $time) = self::board_unpack(array($row['comment'], $row['time']));
            echo "<tr><td>";
            echo $comment;
            echo "</td><td>";
            echo $time;
            echo "</td></tr>";
        }
        echo "</table>";
    }
}
if ($_SESSION) {
    echo "<h2>--- WRITE YOUR COMMENT ---</h2>";
    echo "<form action='' method='post'>";
    echo "comment : <input type='text' name='comment'>";
    echo "<input type='submit' value='add'>";
    echo "</form>";
    if ($_POST) {
        $escape_post = data_escape($_POST);
        $board_obj = new board($escape_post['comment'], 1);
        $board_obj->write_comment_board();
    }
    $board_obj = new board("none", 1);
    $board_obj->displayer();
    echo "<h3><a href='logout.php'>logout</a></h3>";
}
Ejemplo n.º 4
0
            $top = new $this->top();
            $top->process($lev);
        }
    }
}
class admin
{
    protected $power = 2;
    protected $top = 'police';
    public function process($lev)
    {
        if ($lev <= $this->power) {
            echo '管理员账号';
        } else {
            $top = new $this->top();
            $top->process($lev);
        }
    }
}
class police
{
    protected $power;
    protected $top = null;
    public function process($lev)
    {
        echo '抓起来';
    }
}
$lev = rand(1, 3);
$judge = new board();
$judge->process($lev);
Ejemplo n.º 5
0
<?php

$id = "00001";
require_once '../classes/board.class.php';
$board = new board();
echo $board->getJSONBoard();
Ejemplo n.º 6
0
<?php
/*
<Orion, a web development framework for RK.>
Copyright (C) <2011>  <Orion>

This program 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 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
define('IN_APP', true);
require_once('./interfase/common.php');
require_once(ROOT . 'objects/board.php');

$user->init();
$user->setup();

$board = new board();
$board->run();

page_layout('FORUM_INDEX', 'board');