Location: PHPKode > projects > eBlog > friends.php
<?php

/**************************************************************************
 *                                                                        *
 *                                                                        *
 *         Solution: eBlog                                                *
 *          Release: 1.7                                                  *
 *             File: friends.php                                          *
 *               By: Emuci inc.                                           *
 *          Website: http://www.emuci.com                                 *
 *        Copyright: (C) 2010 Emcui inc.                                  *
 *                                                                        *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *                                                                        *
 *   This script is NOT freeware and is subjected to Emuci terms of use   *
 *   located in the docs folder.                                          *
 *                                                                        *
 *                                                                        *
 *************************************************************************/



include_once 'includes/global.php';
		
$defaultTemplate = $template;
$copyrights = "&copy; " . date("Y") . " " . $lang_admin_globalRights1;

	
$tree_map = $lang_blog_MyFriends;	

$equalWidth = 100/$topicsPP;

$conn = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname);

$query  = "SELECT * FROM eblog_friends ORDER BY id DESC";
$result = mysql_query($query);
$counter = 0;
$cellCounter = 1;
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
	$cellCounter++;
	
	$rowID = $row['id'];
	$rowName = $row['name'];
	$rowURL = $row['url'];
	$rowIcon = $row['icon'];
	$lengthX = strlen($rowIcon);
	$rowIcon = substr($rowIcon, 3, $lengthX);			
	$friends_list = $friends_list . "<td  width=\"$equalWidth\" valign=\"top\"><a href=\"$rowURL\" target=\"_blank\"><img src=\"$rowIcon\" border=\"$bw\" title=\"$rowName\"></a>";	
	if($cellCounter > $topicPR)
		{
			$friends_list = $friends_list ."</td></tr><tr>";
			$cellCounter = 1;
		}
		else
		{
			$friends_list = $friends_list . "</td>";
		};
	
	$counter++;
}

if($counter < 1)
$friends_list = $lang_admin_noFriends;
else
$friends_list = "<table border=\"0\" cellpadding=\"7\" cellspacing=\"0\"><tr>".$friends_list . "</table>";	

mysql_close($conn);
	
	
$static_value = array ($blog_dir, $blog_windows_encoding, $friends_list);
$static_name = array ("{blog_dir}","{blog_windows_encoding}","{friends_list}");
$file = $new_template->load_template ("templates/$defaultTemplate/friends.html");
$template = $new_template->replace_static($static_name, $static_value, $file);

echo $template;



?>
Return current item: eBlog