Location: PHPKode > projects > FeedMeLinks, Social BookmarkingSince2002 > feedmelinks.com/modules/view-link.inc.php
<%
	if( $l ) {
		if( is_numeric( $l )) {
			if( ! $u ) {
				include( "$modules/menu-insecure.inc.php" );
				echo "<br />\n";
				echo "<br />\n";
			}
			echo getCommentCSS();
%>
<%
		$showLinks = 0;
		$qs = "SELECT * from links where ID=$l";
		if( $debug )
			echo "(DEBUG: QS: $qs)<br />";
		$q = mysql_query( $qs );
		if( $debug )
			echo "(DEBUG: query success was: $q)<br />";
		if( $q )
			$numRows = mysql_num_rows($q);
		$numGroups = 0;
		if( $q && $numRows ) {
			$private = mysql_result($q,0,"isPrivate");
			if( $debug ) {
				echo "DEBUG: link is " . ( $private ? "private" : "public" ) . ".<br/>";
				echo "DEBUG: url: " . urldecode( mysql_result($q,0,"url")) . "<br/>";
			}
			$user =  urldecode( mysql_result($q,0,"submitter")) ;
			trackReferer( $l, $user, $HTTP_REFERER );

%>
<div class="attention" style="width: 45em;">
<img src="img/this-is-a-<%= $private ? "private-" : "" %>link.png" /><br />
</div>
<%
			if( $user == $u ) {
%>
<div class="linkbox" style="background-color: <%= $private ? getPrivateColor( $u ) : "#C0DEE2" %>; border: 1px solid #578960;">
<%
			} else {
%>
<div class="linkbox" style="background-color: #dddddd; border: 1px solid #aaaaaa;">
<%
			}

			if( !$private || $user == $u ) {
				$groupid = mysql_result($q,$i,"groupid");
				$name =  urldecode( mysql_result($q,0,"name")) ;
				$link =  urldecode( mysql_result($q,0,"url")) ;
				if( $groupid ) {
					$qs2 = "SELECT * from linksGroups WHERE ID = $groupid";
					$q2 = mysql_query( $qs2 );
					$numRows2 = mysql_num_rows($q2);
					if( $numRows2 ) {
						$folder   = urldecode( mysql_result($q2,0,"name"));
						$folderID = urldecode( mysql_result($q2,0,"ID"));
					}
				} else
					$folder = "unnamed";
				$public = 0;
				if( isPublic( $folder )) {
					$folder = makePrettyFolderName( $folder );
					++$public;
				}

				$max = 70;
				if( strlen( $link ) > $max )
					$displayLink = substr( $link, 0, $max ) . "...";
				else
					$displayLink = $link;
				$createDate = formatTS( mysql_result($q,0,"createDate")) ;
				
				$qs3 = "select count(*) from linksMetrics where linkID = $l;";
				$q3 = mysql_query( $qs3 );
				if( $q3 ) 
					$numClicks = mysql_result($q3,0);
%>
	<big>
		<big><b><a style="color: black;" href="/t/<%= $l %>"><%= $name %></a></b></big>
			<small class="subtle">
			<%= $private ? "<a title='click to make this link Public' href='/toggle-private/$l'><img src='/img/lock' border='0' /></a>" : "" %>
			(<%= $numClicks %> <%= $numClicks == 1 ? "click" : "clicks" %>)
			(<a href="<%= $l %>">#permalink</a>)
			</small>
<%
			if( strlen( $name ) > 40 )
				echo "<br /> &nbsp; &nbsp; ";
		
%></big>
		<br />
		<span style="line-height: 2.8em;">
<%
		if( 1 ) {
%>
  <%= insertBigThumb( $link ) %>

<%
	} else {
%>
<%
}
%>
		<big><big>&raquo; <a title="<%= $link %>" href="/t/<%= $l %>"><b><%= $displayLink %></b></a></big></big><br />

<% 
			if( !$private || $user == $u) {
%>
</span>
<br />

Added by <%= $user != $u ? makeUserLink( $user ) : "you" %><%=
$createDate != "today" && $createDate != "yesterday" ? " on" : "," %> <%= $createDate %>.
&nbsp;
<%= getCategoriesForLinkAsHTML( $l, $u, $add_trailing_noun = false, 1 ) %>

<% 
			} 

			if( $user != $u) { 
%>
&nbsp;View <a href="/list-public?who=<%= $user %>"><%= $user %>'s <b>links</b></a>.
<% } %>
	</div>

<% if( getNumSimilarUrls( $link, $l )) { %>

	<div class="linkbox" style="border: 1px solid #bbbbbb; margin-top: 5px;">
		<%= getSimilarlyLinkingUsers( $link, $l, 5 ) %><br />
	</div>

<% } %>

	<div class="linkbox" style="border: 1px solid #bbbbbb; margin-top: 5px;">
	&nbsp; <a accesskey="f" href="/search?q=<%= urlencode( str_replace ( " ", "%", $name) ) %>"><img src="/img/mag-glass.png" height="20" 
	align="middle" border="0"/><u>f</u>ind similar links</a>
	&nbsp;
	&nbsp;

	<% if( !$private && $user != $u ) { %>
	<%= makeStealItLink( $l ) %> 
	<a accesskey="a" href="/g/<%= $l %>"><u>a</u>dd to my links</a>
	&nbsp;
	&nbsp;
	<% } %>

	<% if( $u == $user  ) { %>
	<a accesskey="d" href="javascript:openDelete('<%= $l %>');">
	<img src="img/trash.gif" align="top" border="0" /> 
	<u>d</u>elete this link</a> 
	&nbsp;
	
	<a accesskey="e" href="javascript:openEdit('<%= $l %>');">
	<img src="img/edit.gif" border="0" /> 
	<u>e</u>dit this link</a> 
	<% } %>

	&nbsp; <a accesskey="s" href="javascript:openMailer( '<%= $l %>' );">
	<img src="img/mail" border="0" /> 
	<u>s</u>end to a friend</a>
</div>

<% 
	#getReferers( $l );
	getCommentsForLink( $l, $u, $debug ); 
%>
<% } else { # private link  %>
sadly, this link is private. You may email <%= makeEmailUserLink( $user ) %> to ask for it to be made public.
<% } %>
	</div>

<%
		} else { # end if( link exists )
%>

<big>[<b>SCENE MISSING</b>]</big><br />
<br />
no such link; perhaps it has been deleted?

<%
		} # end else missing link
	} else
		echo "bad link ID";
	}
%>
Return current item: FeedMeLinks, Social BookmarkingSince2002