Hjælpe med x antal ord i nyhed
HeyHar virkelig prøvet at implementere et X antal ord script i min kode, men forgæves.
Nogen der lige hurtigt gider kigge på den?
Dennis
<?
if ($side == "") {
?>
</span>
<table width="100%" border="0" class="Main_Text">
<tr>
<td width="17%"> </td>
<td width="51%"><p class="Main_Text"><b>Haiku<span class="style11">Music</span></b></p>
<p class="Main_Text">It is happening right now!<br />
Not so far away – on the continent of Mañana – yet to be discovered.<br />
A young woman - Rhanyais - is picked up by a prince to secure<br />
the bloodline!<br />
<br />
The prince becomes king and looses his mind in the process.<br />
Rhanyais flees with her unborn son and gives birth to Mondo in<br />
an unknown village far away from the capital.<br />
The continent is on the brink of revolution and the captain of the guard<br />
“The Shackadon” joins forces with a scared parliament (Supreme<br />
Council of Mañana) and sieges power. The Shackadon immediately<br />
starts the hunt for Rhanyais and Mondo. The Shackadon is secretly and<br />
passionately in love with the young queen.<br />
<br />
It takes years but eventually Rhanyais is captured, while Mondo<br />
escapes to sleepy coastal city of Sandolin.<br />
Rhanyais gives birth to yet another son Casaval, a gentle vulnerable<br />
kid very unlike his father the dictator Shackadon.<br />
<br />
Mondo is for years unwilling and unable to relate to his so-called “destiny”<br />
but finally chooses to face the task of overthrowing the Shackadon at<br />
the battle of Shackadon Hills.<br />
It is happening right now!<br />
<br />
Not so far away – on the continent of Mañana – yet to be discovered.</p> </td>
<td width="32%" align="right" valign="top"><table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200">
<?php
// include the database configuration and
// open connection to database
include 'library/config.php';
include 'library/opendb.php';
?>
<br>
<br>
<?php
// =======================
// Show guestbook entries
// =======================
// how many guestbook entries to show per page
$rowsPerPage = 5;
// by default we show first page
$pageNum = 1;
// if $_GET['page'] defined, use the value as page number
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
}
// counting the offset ( where to start fetching the entries )
$offset = ($pageNum - 1) * $rowsPerPage;
// prepare the query string
$query = "SELECT id, name, email, url, message, DATE_FORMAT(entry_date, '%d.%m.%Y') ".
"FROM news ".
"ORDER BY id DESC ". // using ORDER BY to show the most current entry first
"LIMIT $offset, $rowsPerPage"; // LIMIT is the core of paging
// execute the query
$result = mysql_query($query) or die('Error, query failed. ' . mysql_error());
// if the guestbook is empty show a message
if(mysql_num_rows($result) == 0)
{
?>
<p><br>
<br>
News table is empty </p>
<?php
}
else
{
// get all guestbook entries
while($row = mysql_fetch_array($result))
{
// list() is a convenient way of assign a list of variables
// from an array values
list($id, $name, $email, $url, $message, $date) = $row;
// change all HTML special characters,
// to prevent some nasty code injection
$name = htmlspecialchars($name);
$message = htmlspecialchars($message);
// convert newline characters ( \n OR \r OR both ) to HTML break tag ( <br> )
$message = nl2br($message);
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="80" align="left">
<?=$name;?> </td>
<td width="131" align="right"><small>
<?=$date;?>
</small></td>
</tr>
<tr>
<td colspan="2">
<?=$message;?>
<?php
// if the visitor input her homepage url show it
if($url != '')
{
// make the url clickable by formatting it as HTML link
$url = "<a href='$url' target='_blank'>$url</a>";
?>
<br>
<?php
}
?> <br />
<img src="dots.gif" width="200" height="1" /> </td>
</tr>
</table>
<br>
<?php
} // end while
// close the database connection since
// we no longer need it
include 'library/closedb.php';
?>
<table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr>
<td align="right" class="text">
<?=$nextLink;?> </td>
</tr>
</table>
<?php
}
?> </td>
</tr>
</table> </td>
</tr>
</table>
<span class="style3">
<?
}
?>