Esempio n. 1
0
function do_html_header($title = '', $script = '', $style = '')
{
    if (!empty($script)) {
        foreach ($script as $item) {
            ?>
		<script type="text/javascript" src="js/<?php 
            echo $item;
            ?>
"></script>
<?php 
        }
    }
    ?>

<html>
<head>
<title> <?php 
    echo $title;
    ?>
</title>
</head>
<body>

<?php 
    if (isset($_SESSION['author'])) {
        $cate = get_category();
        display_category($cate);
    }
}
Esempio n. 2
0
/**
 * Menu List (Contents Navigation)
 */
function xhtml_menu($mode)
{
    global $cd, $cfg, $lang, $add, $menu_list, $admin_dir, $http, $admin, $search_form, $table, $log_table, $info_table, $forum_table, $p_blog_path, $id, $rss_feed, $rss_feed2, $admin_sess_menu, $content_menu, $search_form, $menu_middle, $archive_by_date, $category_menu, $file_type_menu, $recent_entries, $recent_comments, $recent_trackbacks, $css_switch, $rss_button, $rss2_button, $menu_bottom, $plugin;
    require_once $cd . '/include/user_include/menu.inc.php';
    if (isset($_GET['add'])) {
        $add = $_GET['add'];
    }
    $request_uri = $http . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
    // if "ROOT PATH" is not specified yet, make up URI to go to "admin_top.php"
    if ($cfg['root_path'] == '/path/to/p_blog/' || is_null($cfg['root_path'])) {
        $request_uri = $http . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
        $uri = parse_url($request_uri);
        $uri = str_replace('root/root_login.php', 'admin_top.php', $uri);
        $admin_top_uri = $http . '://' . $uri['host'] . $uri['path'];
    } else {
        $admin_top_uri = $p_blog_path . $admin_dir . '/admin_top.php';
    }
    //////////////////// Admin Menu /////////////////////////////
    if ($admin == 'yes') {
        $admin_menu_title = '<h2 class="menu-box">' . '<a href="' . $admin_top_uri . '">' . $lang['admin'] . "</a></h2>\n";
        // Normal Admin
        if (isset($_SESSION['admin_login']) && $_SESSION['admin_login'] != '') {
            $logout = '<div id="logout">' . "\n" . '<a href="' . $http . '://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . $admin_dir . '/login.php?status=logout" accesskey="l">' . $lang['logout'] . "</a>\n</div>\n";
            // Post New Menu
            $admin_menu = '<h3 id="add-new">' . $lang['add_new'] . "</h3>\n" . '<ul class="menu">' . "\n";
            if ($request_uri . '?add=' . $add == $p_blog_path . $admin_dir . '/add.php?add=log') {
                $admin_menu .= '<li class="cur-menu">' . $lang['log'] . "</li>\n" . '<li class="menu"><a href="' . $p_blog_path . $admin_dir . '/add.php?add=bin" class="menu">' . $lang['file'] . "</a></li>\n";
            } elseif ($request_uri . '?add=' . $add == $p_blog_path . $admin_dir . '/add.php?add=bin') {
                $admin_menu .= '<li class="menu">' . '<a href="' . $p_blog_path . $admin_dir . '/add.php?add=log" class="menu">' . $lang['log'] . "</a></li>\n" . '<li class="cur-menu">' . $lang['file'] . "</li>\n";
            } else {
                $admin_menu .= '<li class="menu">' . '<a href="' . $p_blog_path . $admin_dir . '/add.php?add=log" class="menu">' . $lang['log'] . "</a></li>\n" . '<li class="menu">' . '<a href="' . $p_blog_path . $admin_dir . '/add.php?add=bin" class="menu">' . $lang['file'] . "</a></li>\n";
            }
            $admin_menu .= "</ul>\n";
            // Modify / Delete Menu
            $menu_mod_del = '<h3 id="edit">' . $lang['mod_del'] . "</h3>\n";
            // Session User Name
            $session_user = $_SESSION['user_name'];
            $session_class = 'session-on';
            $draft_menu = display_draft_num();
            // Root (MySQL user) Admin
        } elseif (isset($_SESSION['root_admin_login']) && $_SESSION['root_admin_login'] != '') {
            $logout = '<div id="logout">' . '<a href="./root_login.php?status=logout">' . $lang['logout'] . '</a></div>';
            $admin_menu = '';
            $menu_mod_del = '';
            $session_user = $_SESSION['root_user_name'];
            $session_class = 'session-on';
            $draft_menu = '';
            // Out of session...
        } else {
            $logout = '';
            $admin_menu = '';
            $menu_mod_del = '';
            $session_user = $lang['none'];
            $session_class = 'session-off';
            $draft_menu = '';
        }
        // Generate Admin Menu!
        $admin_sess_menu = <<<EOD
{$admin_menu_title}
<div class="menu">
<h2>{$lang['login_user']}</h2>
<p class="{$session_class}">{$session_user}</p>
{$logout}</div>
{$admin_menu}{$draft_menu}{$menu_mod_del}
EOD;
    } else {
        $admin_sess_menu = '';
    }
    //////////////////// Common Menu /////////////////////////////
    // Do not show content menu in Admin entrance
    if (preg_match('/login.php/', $request_uri) || preg_match('/root/', $request_uri)) {
        $content_menu = '';
    } else {
        if (isset($_GET['id'])) {
            $id = addslashes($_GET['id']);
        }
        // Begin Content Menu
        $content_menu = '<div id="content-menu">' . "\n" . '<h2>' . $lang['contents'] . '</h2>' . "\n" . '<ul class="menu">' . "\n";
        // User Defined Menu
        foreach ($menu_list as $key => $value) {
            if (isset($id) && $id != "" && $request_uri . "?id=" . $id == $p_blog_path . preg_replace('/^.\\//', '', $value) || !isset($id) && $request_uri == $p_blog_path . preg_replace('/^.\\//', '', $value) || !isset($id) && preg_match('/.*\\/$/', $value) && $request_uri == $p_blog_path . preg_replace('/^.\\//', '', $value) . 'index.php') {
                $content_menu .= '<li class="cur-menu">' . $key . "</li>\n";
            } elseif (preg_match('/^' . $http . ':\\/\\//', $value)) {
                $content_menu .= '<li class="menu"><a href="' . $value . '" class="menu">' . $key . "</a></li>\n";
            } else {
                $content_menu .= '<li class="menu"><a href="' . $cd . '/' . $value . '" class="menu">' . $key . "</a></li>\n";
            }
        }
        // Forum Menu
        if ($cfg['comment_style'] == '1') {
            if (preg_match('/forum\\/index.php/', $request_uri)) {
                $content_menu .= '<li class="cur-menu">' . $lang['forum'] . "</li>\n";
            } else {
                $content_menu .= '<li class="menu"><a href="' . $cd . '/forum/index.php" class="menu">' . $lang['forum'] . "</a></li>\n";
            }
        }
        // Feedback / Contact Menu
        if ($cfg['use_feedback_form'] == 'yes') {
            if (preg_match('/var\\/feedback\\/index.php/', $request_uri)) {
                $content_menu .= '<li class="cur-menu">' . $lang['feedback'] . "</li>\n";
            } else {
                $content_menu .= '<li class="menu"><a href="' . $cd . '/var/feedback/index.php" class="menu">' . $lang['feedback'] . "</a></li>\n";
            }
        }
        // Help Menu
        if (file_exists($cd . '/var/help/')) {
            if (preg_match('/help\\/index.php/', $request_uri) && empty($id)) {
                $content_menu .= '<li class="cur-menu">' . $lang['help'] . "</li>\n";
            } else {
                $content_menu .= '<li class="menu"><a href="' . $cd . '/var/help/index.php" class="menu">' . $lang['help'] . "</a></li>\n";
            }
        }
        // End Content Menu
        $content_menu .= "</ul>\n</div>\n";
    }
    //////////////////// Archive, Category, Recent Entries, Comments, Trackbacks Menu /////////////////////////////
    if ($mode == 'log') {
        $archive_by_date = archive_by_date($log_table);
        $category_menu = display_category($log_table);
        $file_type_menu = '';
        include_once $cd . '/include/fnc_logs.inc.php';
        $recent_entries = display_recent_entries();
        $recent_comments = display_recent_comments();
        $recent_trackbacks = display_recent_trackbacks();
    } elseif ($mode == 'file') {
        $archive_by_date = archive_by_date($info_table);
        $category_menu = display_category($info_table);
        include_once $cd . '/files/include/fnc_files.inc.php';
        $file_type_menu = display_type_menu();
        $recent_entries = '';
        $recent_comments = '';
        $recent_trackbacks = '';
    } elseif ($mode == 'forum') {
        $archive_by_date = archive_by_date($forum_table);
        $category_menu = '';
        $file_type_menu = '';
        $recent_entries = '';
        $recent_comments = '';
        $recent_trackbacks = '';
    } else {
        $archive_by_date = '';
        $category_menu = '';
        $file_type_menu = '';
        $recent_entries = '';
        $recent_comments = '';
        $recent_trackbacks = '';
    }
    // CSS Switch
    $css_switch = display_css_switch();
    // RSS Feed
    if ($cfg['use_rss'] == 'yes') {
        $rss_id = 'id="rss"' . ($cfg['xml_version'] == '1.1' || $cfg['xml_version'] == '1.1cn' ? '' : ' name="rss"');
        $rss2_id = 'id="rss2"' . ($cfg['xml_version'] == '1.1' || $cfg['xml_version'] == '1.1cn' ? '' : ' name="rss2"');
        $p_blog_path = str_replace('%7E', '~', $p_blog_path);
        if ($request_uri == $p_blog_path . $cfg['top_page']) {
            $rss_button = '<a href="' . $cd . '/rss/recent.php" title="' . $lang['rss_of_this_page'] . '" ' . $rss_id . '>' . $rss_feed . '</a>';
            $rss2_button = '<a href="' . $cd . '/rss/2.0.php" title="' . $lang['rss_of_this_page'] . '" ' . $rss2_id . '>' . $rss_feed2 . '</a>';
        } elseif ($request_uri == $p_blog_path . 'forum/topic.php') {
            $rss_button = '<a href="' . $cd . '/rss/1.0.php?tid=' . sanitize(abs(intval($_GET['tid']))) . '" title="' . $lang['rss_of_this_page'] . '" ' . $rss_id . '>' . $rss_feed . '</a>';
            $rss2_button = '<a href="' . $cd . '/rss/2.0.php?tid=' . sanitize(abs(intval($_GET['tid']))) . '" title="' . $lang['rss_of_this_page'] . '" ' . $rss2_id . '>' . $rss_feed2 . '</a>';
        } elseif ($request_uri == $p_blog_path . 'forum/index.php') {
            $rss_button = '<a href="' . $cd . '/rss/1.0.php?f_index" title="' . $lang['rss_of_this_page'] . '" ' . $rss_id . '>' . $rss_feed . '</a>';
            $rss2_button = '<a href="' . $cd . '/rss/2.0.php?f_index" title="' . $lang['rss_of_this_page'] . '" ' . $rss2_id . '>' . $rss_feed2 . '</a>';
        } elseif ($request_uri == $p_blog_path . 'article.php') {
            $rss_button = '<a href="' . $cd . '/rss/1.0.php?id=' . sanitize(abs(intval($id))) . '" title="' . $lang['rss_of_this_page'] . '" ' . $rss_id . '>' . $rss_feed . '</a>';
            $rss2_button = '<a href="' . $cd . '/rss/2.0.php?id=' . sanitize(abs(intval($id))) . '" title="' . $lang['rss_of_this_page'] . '" ' . $rss2_id . '>' . $rss_feed2 . '</a>';
        } else {
            $rss_button = '';
            $rss2_button = '';
        }
    } else {
        $rss_button = '';
        $rss2_button = '';
    }
    // Load Menu Middle
    if (file_exists($cd . '/include/user_include/menu_middle.inc.php')) {
        require_once $cd . '/include/user_include/menu_middle.inc.php';
    } else {
        $menu_middle = '';
    }
    // Load Menu Bottom
    if (file_exists($cd . '/include/user_include/menu_bottom.inc.php')) {
        require_once $cd . '/include/user_include/menu_bottom.inc.php';
    } else {
        $menu_bottom = '';
    }
}
Esempio n. 3
0
echo "<hr></td></tr>\n";
// search form
echo '<tr><td align="center"><table cellpadding="4" cellspacing="0" border="1" bgcolor="#f8ddb8">';
echo '<tr><td><table cellpadding="0" cellspacing="0">' . "\n";
echo '<form action="search.php" method="get">' . "\n";
echo '<tr><td class="naglowek_maly" align="right" valign="center">Szukaj w Pomocy:</td>' . '<td><input type="text" name="search" size="35"></td>' . '<td><input type="submit" value="Szukaj"></td></tr>' . "\n";
echo '<tr><td align="right" colspan="3">' . '<input type="checkbox" name="in_questions" id="id_q" checked><label for="id_q">w pytaniach</label>' . '<input type="checkbox" name="in_answers" id="id_a" checked><label for="id_a">w odpowiedziach</label>' . '</td></tr>' . "\n";
echo "</form>\n</tr>";
echo "</table></td></tr></table>\n</td></tr>\n";
// end of search form
echo '<tr><td class="naglowek"><br>Spis tre¶ci:</td></tr>' . "\n";
echo '<tr><td><table cellpadding="5" cellspacing="0">' . "\n";
// open category table
// FOR EACH CATEGORY
foreach ($categories as $cat_id => $cat_label) {
    display_category($cat_id, $cat_label);
}
echo "</table></td></tr>\n";
echo "</table>\n";
display_document_footer();
/*******************************************************

					WRAPPING FUNCTIONS

*******************************************************/
function display_category($cat_id, $cat_label)
{
    $is_selected = $cat_id == $_GET['category_id'];
    // DISPLAY CATEGORY NUMBER AND LABEL
    echo '<tr><td valign="top" class="help_category">' . $cat_id . '.</td><td><a href="' . ($is_selected ? '' : '?category_id=' . $cat_id . '#go_category') . '" class="help_category">' . htmlspecialchars($cat_label) . '</a>';
    if (is_admin()) {
Esempio n. 4
0
				border-color: black;
			}
			.category
			{
			}
		</style>
	</head>
	<body>
		<div id="navbar">
			<img src="img/navbar.jpg" alt="navbar" />
			<a href="item.php"><img id="item" src="img/item.jpg" alt="[]" /></a>
			<span id=item_number><?php 
echo $_SESSION['panier'];
?>
</span>
		</div>
		<div id="menu">
			<form id="login" action="login.php" method="post">
				Identifiant: <input type=text name=login placeholder="login" value=""><br>
				Mot de passe: <input type=password name=passwd placeholder="*************" value=""><br>
				<input type=submit name=submit value="OK"><br>
			</form>
			<div id=category_list>
				<?php 
display_category();
?>
			</div>
		</div>
	</body>
</html>