/ Espada
<?
$sql = sprintf("SELECT a.*,c.m_path FROM %s AS a JOIN %s AS b ON (a.m_id = b.m_parent_id AND (b.m_del = 0 OR b.m_del IS NULL)) JOIN %s AS c ON (b.m_link9 = c.m_id AND (c.m_del = 0 OR c.m_del IS NULL)) WHERE a.m_id = %d AND (a.m_del = 0 OR a.m_del IS NULL)", $tbl_main,$tbl_main,$tbl_main,$m_id);
$query=mysql_query($sql,$db_conn);
$row_category=mysql_fetch_assoc($query);
mysql_free_result($query);
?>
<div class="head_blok_center"><ul><li>Обзоры и тесты</li></ul></div>
<div class="more_content_blok" stlye = "width: 300px;">
<?
$sql = sprintf("SELECT c.*,DATE_FORMAT(c.m_create_time,'%%d.%%m.%%Y') AS m_create_time_ FROM %s AS a JOIN %s AS c ON (a.m_link9 = c.m_parent_id AND c.m_status = 1 AND c.m_link9 = 161990 AND (c.m_del = 0 OR c.m_del IS NULL)) WHERE a.m_parent_id = %d AND (a.m_del = 0 OR a.m_del IS NULL) ORDER BY c.m_create_time DESC", $tbl_main,$tbl_main,$m_id);
$query=mysql_query($sql,$db_conn);
while ($rows=mysql_fetch_assoc($query)) {
$sql = sprintf("SELECT * FROM %s WHERE m_parent_id = %d AND m_code = 'preview_small' AND (m_del = 0 OR m_del IS NULL)", $tbl_main,$rows["m_id"]);
$query_img=mysql_query($sql,$db_conn);
$row_img=mysql_fetch_assoc($query_img);
mysql_free_result($query_img);
printf("<div class=\"slot\"><div class=\"slot_sub\"><img src=\"/%s/%s\" border=\"0\" class=\"img_small\" align=\"left\" alt=\"%s\"><p align=\"justify\"><a href=\"/%s/%s\" title=\"%s\">%s</a><br>%s%s</p></div></div><br>", $row_img["m_path"],$row_img["m_file"],$rows["m_link1"],$rows["m_path"],$rows["m_file"],$rows["m_link1"],$rows["m_link1"],substr($rows["m_add_content"],0,250),(strlen($rows["m_add_content"]) > 200 ? '...' : ''));
}
?>
</div>