Location: PHPKode > projects > FeedMeLinks, Social BookmarkingSince2002 > import/present-clean-pre-flight-input.inc.php
<%

	# 5. display the links to be imported by looping over LINKS.READY
	#  (with a link & tag count), and showing all the links with any
	#  duplicates in gray, and let the user OK the import. (remind them
	#  that all these links will be private by default.)

	$links = open_user_file_for_read( $config->get_deduped_links_cache_file_name() );
	$tags = open_user_file_for_read( $config->get_deduped_tags_cache_file_name() );

	$num_links = 0;
	$num_tags = 0;

	ob_start();

%>
<div id="newLinks" class="box">
	<div class="subhead">
		new tags to be created:
	</div>
<%
	for( $i = 0; $i < $ts; $i++ ) {
		$line = rtrim( $tags[$i] );
		if( substr( $line, 0, 2 ) == "X " ) {
			$tag = preg_replace( "/^X /", "", $line );
			echo row_wrap( " <span class='subtle'>Ignoring duplicate tag $tag</span>", ($i % 2 == 0) ? 1 : 0 );
		} else {
			++$num_tags;
			echo row_wrap( " <span style='color: #FF6600;'>$line</span>", ($i % 2 == 0) ? 1 : 0 );
		}
		echo "</div>\n";
	}
%>
</div>

<div id="newLinks" class="box">
	<div class="subhead">
		new favorites to be imported:
	</div>
<%
	for( $i = 0; $i < $ls; $i++ ) {
		$line = rtrim( $links[$i] );
		$l = preg_split( "/$delimeter/", $line );
		$url = $l[0];
		$name = $l[1];
		if( substr( $line, 0, 2 ) == "X " ) {
			$url = getCompactString( preg_replace( "/^X /", "", $url ), 48);
			echo row_wrap( " <span class='subtle'>Ignoring duplicate $url</span>", ($i % 2 == 0) ? 1 : 0 );
		} else {
			++$num_links;
			$url = getCompactString( $url, 48 );
			echo row_wrap( " <span style='color: #FF6600;'>$url</span>", ($i % 2 == 0) ? 1 : 0 );
		}
		echo "</div>\n";
	}
%>
</div>
<%
	$html = ob_get_clean();
%>

<center>
	<img src="/img/import-header.gif" alt="" />
	<br />
	<img style="margin-top: 35px;" name="step" src="/img/import-step-2.gif" alt="" />
<br />
</center>

<%
	shout( "Ready to Import?", "Our link-importing robot found <b>$num_links new links</b> and <b>$num_tags new tags</b> to create. If the links below look correct, <b>scroll to the bottom of the list and click <u>Import</u></b>. <p/>Because you are importing a batch of potentially personal favorites, these links <b>will&nbsp;not</b> be publicly viewable on Feed Me Links until you mark them public. (Remember, nothing will be added until you scroll down and click <b>Import</b>)" );

	echo $html;
	
	tell( "Look OK?", "Let's do it!
	<p/>
	<input type='button' class='default button' value='Import' onClick=\"location.href='/import/processing?num_links=$num_links&num_tags=$num_tags';\" />
	<input type='button' class='button' value='Cancel' onClick=\"location.href='/';\" />
	" );

%>


Return current item: FeedMeLinks, Social BookmarkingSince2002