Ejemplo n.º 1
0
 static function Write($p1)
 {
     $file_path = SITE_ROOT . 'engine/log.txt';
     $text = htmlspecialchars($p1) . "\r\n";
     $handle = fopen($file_path, "a");
     fwrite($handle, "[" . ToNTime(time()) . "] " . $text);
     fwrite($handle, "=========================================================================================\r\n");
     fclose($handle);
 }
Ejemplo n.º 2
0
<?php

require $_SERVER['DOCUMENT_ROOT'] . '/system.php';
$db = new DB();
$db->connect("NEWS_Launcher");
$query = $db->execute("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 10");
$db->close();
$html = '';
while ($data = $db->fetch_assoc($query)) {
    $html .= '<div class="news-block"><div class="news-title"><a target="_blank" href="/news/id/' . $data['id'] . '/">' . $data['title'] . '</a><p class="date">' . ToNTime($data['date']) . '</p></div>
<div class="news-text">' . $data['text'] . '</div><div class="news-bottom"><p class="left">Автор: <a target="_blank" href="/profile/' . $data['author_id'] . '/">' . IDToLogin($data['author_id']) . '</a></p>
<p class="right"><a target="_blank" href="/news/id/' . $data['id'] . '/">Подробнее...</a></p></div></div>';
}
if (empty($html)) {
    $html = "<center style='color:#FFF'>Новостей нет :c</center>";
}
?>
<!DOCTYPE html>
<html>
<head>
	<title>DarkMine Новости</title>
	<meta charset="utf-8">
	<style type="text/css">
	*{
		margin: 0px;
	}
	a:visited {
    	color: #2980b9;
	}
	a {
    	color: #2980b9;