⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 news.php

📁 还是WEB游戏源码 Darkstep 还是WEB游戏源码 Darkstep
💻 PHP
字号:
<?
include ("_include-config.php");
?>
<html>

<head>
<title>RealCrime.Be Join The Crime Version</title>
<link rel="stylesheet" type="text/css" href="css-v1.css">

</head>

<body>

<?
$max = '15';
$hoeveel = '15';
  echo "<marquee width=90% style=\"cursor: default\" onmouseover=\"this.stop()\" onmouseout=\"this.start()\">";

$sql1 = "SELECT * FROM berichtenbalk ORDER BY id DESC LIMIT $hoeveel"; //ophalen van de berichten
$query1 = mysql_query($sql1);
while ($list = mysql_fetch_object($query1))
{
$naam1 = $list->naam;
$naam1 = ($naam1 == david) ? "<font color=red><b>$naam1</b></font>" : "$naam1";
$bericht1 = $list->bericht;  //stuksje ubb
$bericht1 = htmlspecialchars($bericht1);
        $bericht1		= preg_replace('/(http:\/\/\S+)/','<a href="$1" target=\"_blank\">$1</a>',$bericht1);
        $bericht1		= preg_replace("/\[B\]/", "<b>", $bericht1);
        $bericht1		= preg_replace("/\[\/B\]/", "</b>", $bericht1);
        $bericht1		= preg_replace("/\[b\]/", "<b>", $bericht1);
        $bericht1		= preg_replace("/\[\/b\]/", "</b>", $bericht1);
        $bericht1		= preg_replace("/\[u\]/", "<u>", $bericht1);
        $bericht1		= preg_replace("/\[\/u\]/", "</u>", $bericht1);
        $bericht1		= preg_replace("/\[U\]/", "<u>", $bericht1);
        $bericht1		= preg_replace("/\[\/U\]/", "</u>", $bericht1);
        $bericht1		= preg_replace("/\[i\]/", "<i>", $bericht1);
        $bericht1		= preg_replace("/\[\/i\]/", "</i>", $bericht1);
        $bericht1		= preg_replace("/\[I\]/", "<i>", $bericht1);
        $bericht1		= preg_replace("/\[\/I\]/", "</i>", $bericht1);
        $bericht1		= preg_replace("/\[s\]/", "<s>", $bericht1);
        $bericht1		= preg_replace("/\[\/s\]/", "</s>", $bericht1);
        $bericht1		= preg_replace("/\[S\]/", "<s>", $bericht1);
        $bericht1		= preg_replace("/\[\/S\]/", "</s>", $bericht1);
        $bericht1		= eregi_replace("\\[COLOR=([^\\[]*)\\]([^\\[]*)\\[/COLOR\\]","<font color=\"\\1\">\\2</font>",$bericht1);
        $bericht1		= eregi_replace("\\[URL=([^\\[]*)\\]([^\\[]*)\\[/URL\\]","<a href=\"\\1\" target=\"_blank\">\\2</a>",$bericht1);
        $bericht1		= eregi_replace("\\[color=([^\\[]*)\\]([^\\[]*)\\[/color\\]","<font color=\"\\1\">\\2</font>",$bericht1);
        $bericht1		= eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=\"_blank\">\\2</a>",$bericht1);

        $bericht1		= str_replace(":)", "<img src=\"images/smilies/icon_smile.gif\">", $bericht1);
        $bericht1		= str_replace(":\'(", "<img src=\"images/smilies/icon_cry.gif\">", $bericht1);
        $bericht1		= str_replace(":(", "<img src=\"images/smilies/icon_sad.gif\">", $bericht1);
        $bericht1		= str_replace(";)", "<img src=\"images/smilies/icon_wink.gif\">", $bericht1);
        $bericht1		= str_replace(":s", "<img src=\"images/smilies/icon_confused.gif\">", $bericht1);
        $bericht1		= str_replace(":P", "<img src=\"images/smilies/icon_razz.gif\">", $bericht1);
        $bericht1		= str_replace(":D", "<img src=\"images/smilies/icon_lol.gif\">", $bericht1);
        $bericht1		= str_replace(":S", "<img src=\"images/smilies/icon_confused.gif\">", $bericht1);
        $bericht1		= str_replace(":p", "<img src=\"images/smilies/icon_razz.gif\">", $bericht1);
        $bericht1		= str_replace(":d", "<img src=\"images/smilies/icon_lol.gif\">", $bericht1);
        $bericht1		= str_replace("8)", "<img src=\"images/smilies/icon_cool.gif\">", $bericht1);
        $bericht1		= str_replace(":!:", "<img src=\"images/smilies/icon_exclaim.gif\">", $bericht1);
        $bericht1		= str_replace(":?:", "<img src=\"images/smilies/icon_question.gif\">", $bericht1);
        $bericht1		= str_replace(":o", "<img src=\"images/smilies/icon_surprised.gif\">", $bericht1);
        $bericht1		= str_replace(":arrow:", "<img src=\"images/smilies/icon_arrow.gif\">", $bericht1);
        $bericht1		= str_replace("8|", "<img src=\"images/smilies/icon_eek.gif\">", $bericht1);
        $bericht1		= str_replace(":mad:", "<img src=\"images/smilies/icon_mad.gif\">", $bericht1);
        $bericht1		= str_replace(":twisted:", "<img src=\"images/smilies/icon_twisted.gif\">", $bericht1);
        $bericht1		= str_replace(":|", "<img src=\"images/smilies/icon_neutral.gif\">", $bericht1);

echo "<b>$naam1</b><font color=white>: $bericht1</font> $teken ";
}

echo "</marquee>";
if($data->level >= 50) {
echo "<a target=_blank href=nieuwsschrijven.php>Add message</a>";
}

#### Begin Navigatie code ####
$query = mysql_query("SELECT id FROM nieuws1 ORDER BY id DESC") or die(mysql_error());
$aantal = mysql_num_rows($query);
$aantal/=$max;

if ($aantal == 0) {
    echo "<div align=center>Er is <b>geen nieuws</b>!</div>";
} else {

$nav=$_GET['nav'];
if (empty($nav)) {
    $nav=1;
}
$van=($nav-1)*$max;

if ($nav > ceil($aantal)) {
    $nav=1;
}

for ($i = 1; $i <= ceil($aantal); $i++) {
    if ($nav == $i)
        $navs[$i] = "<b>$i</b>";
    else
        $navs[$i] = "<a href=\"nieuwslezen.php?nav=$i\">$i</a>";
}

$navs= implode(" | ", $navs);

$vorige = ($nav-1) ? "<a href=\"nieuwslezen.php?nav=" . ($nav - 1) . "\">&lt; Vorige</a>" : "";
$volgende = ($nav-ceil($aantal)) ? "<a href=\"nieuwslezen.php?nav=" . ($nav + 1) . "\">Volgende &gt;</a>" : "";

if ($vorige && $volgende) {
    $navigatie = $vorige." | ".$navs ." | ".$volgende;
} else {
    $navigatie = $vorige." | ".$navs." | ".$volgende;
}
#### Einde Navigatie code ####

//Nu gaan we de berichten selecteren
$query=mysql_query("SELECT * FROM nieuws1 ORDER BY id DESC LIMIT $van,$max") or die (mysql_error());

//Nu worden alle berichten weergegeven dmv een while

    while ($obj = mysql_fetch_object($query)) {
    //nl2br() zorgt er voor dat er bij elke enter ook een nieuwe lijn komt
        $obj->bericht=nl2br($obj->bericht);
?>
<table class="gastenboek" width="100%" border="0" cellspacing="0" cellpadding="2">
      <tr>
         <td class="subTitle" width="88%" valign="top">
      Posted by: <b><?=$obj->naam?>  </b>
      Subject: <b><?=$obj->subject?></b>
    </td>
  </tr>
  <tr>
    <td class="mainTxt" valign="top">
      <?=$obj->bericht?>
      <br>

    </td>
  </tr>
</table>
<br>
<?php
    } //Deze loop wordt herhaald tot dat alle berichten zijn weergegeven
}
?>
<br>
<table class="gastenboek" width="100%" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td align="center" height="19" class="subTitle"><?=$navigatie?></td>
  </tr>
</table>
<br>

</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -