$CONFIG['base_url_len'] = strlen(FM_BASEURL);
$OUTPUT['q'] = mysql_query('
SELECT DISTINCT l.xl_15_0, c.xl_4_1209, t.id, t.xfile, t.xoldicon, c.rname, DATE_FORMAT(c.xdate, \'%d.%m.%y\') AS fxdate, DATE_FORMAT(c.xdateend, \'%d.%m.%y\') AS fxdateend, bg.rname AS bgrname
FROM '.DB_PRE.'photos t, '.DB_PRE.'photos_links l, '.DB_PRE.'calendar c, '.DB_PRE.'books bg
WHERE t.id>0 AND t.xparent=0 AND t.xhistory=0 AND t.xshow=0
AND t.id=l.tid AND l.xshow=0 AND l.xl_15_0 NOT IN (2880)
AND l.xl_15_0=c.id AND c.xparent=0 AND c.xhistory=0 AND c.xshow=0 AND c.xl_4_1183 IN (3031)
AND c.xl_4_39=bg.id AND bg.xhistory=0 AND bg.xshow=0
ORDER BY c.xdate DESC, c.xdateend DESC, c.id DESC
');
if ( mysql_num_rows($OUTPUT['q']) > 0 ) {
$OUTPUT['s'] = '';
while ( $OUTPUT['r'] = mysql_fetch_assoc($OUTPUT['q']) ) {
if ( $OUTPUT['r']['fxdate'] != $OUTPUT['r']['fxdateend'] && $OUTPUT['r']['fxdateend'] != '00.00.00' ) {
$OUTPUT['r']['fxdate'] = $OUTPUT['r']['fxdate'].'-'.$OUTPUT['r']['fxdateend'];
}
if ( $OUTPUT['r']['xl_4_1209'] == 1210 ) {
$OUTPUT['r']['rname'] = '
'.$OUTPUT['r']['rname'].'';
}
if ( $OUTPUT['r']['xoldicon'] != '' ) {
$OUTPUT['r']['_xfile'] = $OUTPUT['r']['xoldicon'];
} else {
$OUTPUT['r']['_xfile'] = substr_replace($OUTPUT['r']['xfile'], FM_BASEURL.'_thumbs/', 0, $CONFIG['base_url_len']);
}
$OUTPUT['r']['_size'] = getimagesize($_SERVER['DOCUMENT_ROOT'].'/'.$OUTPUT['r']['_xfile']);
$OUTPUT['r']['_size']['_p'] = round((100-$OUTPUT['r']['_size'][1])/2);
$OUTPUT['a'][$OUTPUT['r']['xl_15_0']]['n'] = $OUTPUT['r']['rname'].' '.$OUTPUT['r']['fxdate'].', '.$OUTPUT['r']['bgrname'];
$OUTPUT['a'][$OUTPUT['r']['xl_15_0']]['a'] .= '
';
}
} mysql_free_result($OUTPUT['q']);
$OUTPUT['s'] = '';
foreach( $OUTPUT['a'] as $val ) {
$OUTPUT['s'] .= '
'.$val['n'].'
'.$val['a'].'
';
}
print $OUTPUT['s'].'';
?>
include 'i_page_bottom.htm';
?>