<?php
$display = 10;
if ( $handle = opendir("./Discussion/links/") )
{
while ( ( $file = readdir( $handle ) ) !== false )
{
if ( $file != "." && $file != ".." )
{
$news_array[] = $file;
}
}
closedir( $handle );
}
array_multisort( $news_array, SORT_NUMERIC, SORT_DESC );
array_splice( $news_array, $display );
$num_news = ( count( $news_array ) );
foreach ( $news_array as $val )
{
$news_file = file("./discussion/links/$val");
$date = $news_file[0];
$author = $news_file[1];
$texts = $news_file[2];
$links = isset($news_file[3]) ? $news_file[3] ? '';
$text = stripslashes($texts);
$link = "$links";
$needle = "http://";
$check = strpos($link, $needle);
if($check === false && !empty($link))
{
//if "http://" is not present in $link, prepend it yourself
$correctLink = "http://" . $link;
}
else
{
//the given link was okay
$correctLink = $link;
}
echo "<font color='white'><b>".$date."</b><br>";
echo '<small>Written by: '.$author.'</small><br>';
print "<a href=\"" . $correctLink . "\"><body vlink='yellow'>" . $correctLink . "</a><br>";
print " - ";
echo $text;
echo ' </font><body vlink="#BABABA"><a href="#beginning"><font size="-2" color="#BABABA">Top</font></a><br><br>';
}
?>
Bookmarks