Esempio n. 1
0
<?php

include_once 'database.php';
$id = $_GET['id'];
if (isset($_POST['add_news'])) {
    if (isset($_POST['newstype']) && isset($_POST['title']) && isset($_POST['info'])) {
        $id = $_GET['id'];
        $type = $_POST['newstype'];
        $title = $_POST['title'];
        $info = $_POST['info'];
        $link = $_POST['link'];
        editnews($id, $type, $title, $info, $link);
        header("Location:index.php?page=news");
    }
}
$n = getnews($id);
?>

<html>
<head><title>PH directory - Add news</title></head>
<body>
	<h2>Edit News</h2>
	<form method="post" class="form-horizontal">
		<div class="form-group">
			<label id="form-label">News no. <?php 
echo $id;
?>
</label><br>
			<label id="form-label">Type</label>
			<select name="newstype" class="form-control" required>
				<?php 
Esempio n. 2
0
<?php

session_start();
require_once 'php/db.php';
require_once 'php/function.php';
$news = getnews($_GET['p']);
?>
<!DOCTYPE html>
<html lang="zh-TW">
	<head>
		<meta charset="utf-8">
		<title>日月潭釣友網</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="description" content="">
		<meta name="author" content="">
		<!-- Le styles -->
		<!-- TODO: make sure bootstrap.min.css points to BootTheme generated file
		-->
		<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
		<style type="text/css">
			body {
				background-image: url("img/lake.jpg");
				background-size: 1500px 1500px;
				padding-top: 60px;
				padding-bottom: 40px;
			}
			.sidebar-nav {
				padding: 9px 0;
			}
			img {
				border: 2px solid white;
Esempio n. 3
0
    }
    if ($rows != 0) {
        $j = 0;
        while ($j < $rows) {
            //lets fetch our prayer request from the database.
            $row = db_fetch_array($result);
            $postedby = getuser($row['posted_by']);
            //lets insert the prayerrequest into our working copy of this template.
            $WORK = insert_into_template($NEWS, "{NEWSTITLE}", stripslashes($row['news_title']));
            $WORK = insert_into_template($WORK, "{TEASER}", stripslashes($row['teaser']));
            $WORK = insert_into_template($WORK, "{NEWSID}", $row['id']);
            $WORK = insert_into_template($WORK, "{POSTEDBY}", $postedby);
            $WORK = insert_into_template($WORK, "{BYLINE}", $row['byline']);
            $WORK = insert_into_template($WORK, "{CATEGORY}", getcatname($row['category']));
            $WORK = insert_into_template($WORK, "{DATE}", date("m/d/Y", $row['date']));
            $j++;
            //now lets add this request to the CONTENT.
            $CONTENT .= $WORK;
        }
    } else {
        $CONTENT .= "There are no active news items at this time.<BR>\r\n";
    }
    //when we output this lets make sure that the output is stripped of any template elements that are not used.
    return striptemplate($CONTENT);
}
//===Main code================================================================
//check to see if the user is logged in.
//start main code here.
$MOD['title'] = "News";
$MOD['content'] = getnews($perpage);
Esempio n. 4
0
function exec_News($app, $params)
{
    $navigation = navigation();
    $app->set('navigation', $navigation);
    $newsarray = getnews(1);
    $news = "";
    if (isset($newsarray[$_GET['id']])) {
        $content = "<div class=\"newsitem\">\n                      <h2>{$newsarray[$_GET['id']]['title']}</h2>\n                      <span class=\"date\">{$newsarray[$_GET['id']]['date']}</span>\n                      <p>{$newsarray[$_GET['id']]['body']}</p>\n                    </div>";
    } else {
        $content = "<div class=\"error\">News item could not be found.</div>";
    }
    $app->set('content', $content);
    $app->render('1col.php');
}
Esempio n. 5
0
<?php

session_start();
require_once '../php/db.php';
require_once '../php/function.php';
$data = getnews($_GET['id']);
?>
<!DOCTYPE html>
<html lang="zh-TW">
	<head>
		<meta charset="utf-8">

		<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
		Remove this if you use the .htaccess -->
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

		<title>新聞編輯</title>
		<meta name="description" content="">
		<meta name="author" content="kevin">

		<meta name="viewport" content="width=device-width; initial-scale=1.0">

		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
		<link rel="stylesheet" href="../css/style.css">
	</head>

	<body>
		<?php 
if (isset($_SESSION['is_mlogin']) && $_SESSION['is_mlogin'] == TRUE) {
    ?>