Location: PHPKode > projects > FeedMeLinks, Social BookmarkingSince2002 > feedmelinks.com/mile-long.php
<%
	# $Id: mile-long.php,v 1.10 2005/01/19 05:34:49 hirokai Exp $

	$page = "recent-kompact";
	include_once( "modules/utils.inc.php" );
	$site = getSiteUrl();

	$MAX_LINKS = 100;
	$MAX_NAME_LENGTH = 35;
%>
<title> Feed Me Links : Recent Links </title>
<base href="<%= $site %>/recent-kompact" />
<% include( "$modules/header.insecure.inc.php" ); %>
<%
		$con_mileLong = mysql_connect();
		mysql_selectdb( getDBName() );

		$qs2 = "SELECT count(*) FROM links;";
		$q2 = mysql_query( $qs2 );
		if( $q2 ) $totalNumLinks = mysql_result($q2,0);
		$qs2 = "SELECT count(*) FROM linksUsers;";
		$q2 = mysql_query( $qs2 );
		if( $q2 ) $totalNumUsers = mysql_result($q2,0);
		echo "<a href=\"$site\"><b>feedmelinks</b></a>: $totalNumLinks total links, ";
		echo "$totalNumUsers users.<br />";
%>
<br />
<center>
last <%= $MAX_LINKS %> links added:
(<a href="/recent-kompact" target="_top" >refresh</a>)
</center>
 &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; . 
<br />
<%

		$qs = "SELECT DISTINCT( url), submitter, groupid, id, createDate, name  from links WHERE isPrivate is NULL GROUP BY url ORDER BY createDate DESC";

		$q = mysql_query( $qs );
		$numRows = $q ? mysql_num_rows($q) : 0;
		if( $numRows ) {
			$i = 0;
			%>
			<table>
			<%
			while ($i < $MAX_LINKS) {
				$id   = mysql_result($q,$i,"ID");
				$name = makeSafeName( mysql_result($q,$i,"name"));
				if( strlen( $name ) > $MAX_NAME_LENGTH )
							$name = substr( $name, 0, $MAX_NAME_LENGTH ) . "...";
				$id   = mysql_result($q,$i,"ID");
				$url = urldecode( mysql_result($q,$i,"url"));
				$submitter = urldecode( mysql_result($q,$i,"submitter"));
				%>
				<tr>
				<td <%= $bg %>>
				<%= makeLinkOut( $id ) %>
					<br />
					&nbsp; &nbsp; added by
					<%= makeUserLink( $submitter ) %>,
					<%= makePermaLink( $id ) %></td>
				</tr>
				<%
				$i++;
			}
			conClose( $con_mileLong );
			%>
			<tr>
			<td <%= $bg %>><br />(<a href="/" title="more...">more recent links...</a>)</td>
			</tr>
			</table>
			<%
		}
%>
 &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; .  &nbsp; . 

<% include( "$modules/footer.inc.php" ); %>
Return current item: FeedMeLinks, Social BookmarkingSince2002