예제 #1
0
if ($session_status == 'on') {
    if (isset($_POST['draft'], $_POST['id'], $_POST['bin_mod']) && intval($_POST['draft']) == 0) {
        $id = $_POST['id'];
        $bin_mod = $_POST['bin_mod'];
        $sql = 'UPDATE ' . $info_table . " SET `draft` = '0', `bin_mod` = '" . $bin_mod . "' WHERE `id` = '" . $id . "'";
        $res = mysql_query($sql) or die("<h2>MySQL error</h2> " . mysql_errno() . " : " . mysql_error());
        if ($res) {
            $contents = '<div class="section">' . "\n" . '<h2 class="archive-title">' . $lang['file_published'] . "</h2>\n" . "</div>\n";
        }
        // Next, pull out the data and display the preview.
        $sql = 'SELECT ' . "`id`, `bin_title`, `bintype`, `binname`, `binsize`, `bindate`, " . "DATE_FORMAT(`bin_mod`, '%Y-%m-%d %T') as `bin_mod`, `bin_category`, `bincomment`, `bin_count`, `draft`" . ' FROM ' . $info_table . " WHERE `id` = '{$id}'";
        $res = mysql_query($sql);
        $row = mysql_fetch_array($res);
        // Generate XHTML
        $row = convert_to_utf8($row);
        format_date($row_name = 'bindate');
        $title_date = $formatted_date;
        $contents .= '<div class="section">' . "\n" . '<h2 class="date-title">' . $title_date . "</h2>\n";
        $contents .= display_binary_box($row);
        $contents .= file_uploaded();
        $contents .= "</div><!-- End .section -->\n";
        xhtml_output('');
    } else {
        // if user auth failed...
        header('Location: ' . $http . '://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'index.php');
        exit;
    }
} else {
    header('Location: ' . $http . '://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'index.php');
    exit;
}
예제 #2
0
파일: category.php 프로젝트: kaz6120/P_BLOG
                $section_content = '<h2 class="date-title">' . $title_date . "</h2>\n";
                do {
                    format_date($row_name = 'bindate');
                    $tmp_date = $formatted_date;
                    if ($title_date != $tmp_date) {
                        $title_date = $tmp_date;
                        $section_content .= '</div><!-- End .section -->' . "\n\n" . '<div class="section">' . "\n" . '<h2 class="date-title">' . $title_date . "</h2>\n";
                    }
                    $row = convert_to_utf8($row);
                    $section_content .= display_binary_box($row, $data_table);
                } while ($row = mysql_fetch_array($res));
            } else {
                $section_content = '';
                while ($row = mysql_fetch_array($res)) {
                    $row = convert_to_utf8($row);
                    $section_content .= display_binary_box($row, $data_table);
                }
            }
        } else {
            $flip_link = '';
            $section_content = '<h2>' . $lang['no_matches'] . "</h2>";
        }
    }
} else {
    $hit_result = '';
    $flip_link = '';
    $section_content = '<h2>' . $lang['category'] . "</h2>\n" . '<p>' . $lang['status_idle'] . "</p>\n";
}
$contents = <<<EOD
{$hit_result}
<div class="section">
예제 #3
0
 * Check Uploaded File
 *
 * $Id: admin/bin_check.php, 2005/01/07 16:52:50 Exp $
 */
$cd = '..';
require_once $cd . '/include/config.inc.php';
require_once $cd . '/include/fnc_error_msgs.inc.php';
require_once $cd . '/include/http_headers.inc.php';
require_once $cd . '/include/fnc_individual.inc.php';
require_once $cd . '/files/include/fnc_files.inc.php';
require_once './include/fnc_admin.inc.php';
session_control();
// switch blog mode and binary mode
if ($session_status == 'on') {
    if (isset($_REQUEST['id']) && $_REQUEST['id'] !== NULL) {
        $id = $_REQUEST['id'];
        $sql = "SELECT " . "`id`, `bin_title`, `bintype`, `binname`, `binsize`, `bindate`, " . "DATE_FORMAT(`bin_mod`,'%Y-%m-%d %T') as `bin_mod`, `bin_category`, `bincomment`, `bin_count`, `draft`" . ' FROM ' . $info_table . " WHERE `id` = '{$id}'";
        $res = mysql_query($sql);
        $row = mysql_fetch_array($res);
        $row = convert_to_utf8($row);
        $contents = '<div class="section">' . "\n<h2>" . $lang['file'] . ' ID : ' . $id . "</h2>\n";
        $contents .= display_binary_box($row, $cfg['show_md5'], $data_table);
        $contents .= "</div>\n";
    } else {
        $contents = display_by_id_form('article');
    }
    xhtml_output('');
} else {
    header('Location: ' . $http . '://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'index.php');
    exit;
}
예제 #4
0
파일: article.php 프로젝트: kaz6120/P_BLOG
            $row_prev = convert_to_utf8($row_prev);
            $next_title = htmlspecialchars(preg_replace('/&quot;/', '"', strip_tags($row_next['bin_title'])));
            $prev_title = htmlspecialchars(preg_replace('/&quot;/', '"', strip_tags($row_prev['bin_title'])));
            $next_entry = <<<EOD
<p class="flip-link">
<span class="prev"><a href="./article.php?id={$row_prev['id']}" title="&quot;{$prev_title}&quot;">{$lang['prev']}</a></span>
<span class="next"><a href="./article.php?id={$row_next['id']}" title="&quot;{$next_title}&quot;">{$lang['next']}</a></span>
</p>
EOD;
        }
    } else {
        $next_entry = '';
    }
    if ($row) {
        $row = convert_to_utf8($row);
        $binary_box = display_binary_box($row);
        $contents = <<<EOD
<div class="section">
{$next_entry}
<h2>{$lang['file']} ID : {$id}</h2>
{$binary_box}
</div>
EOD;
    } else {
        header('Location: ' . $http . '://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'var/index.php?id=error404');
        exit;
    }
} else {
    $id_form = display_by_id_form('article_bin');
    $contents = <<<EOD
<div class="section">