0) {
$rec_group = sql_fetch_array($query_group);
$nowDate = @date("Y-m-d");
$sql_right = "
SELECT banner.banner_id AS banner_id, image, link, description$fieldLang AS description
FROM banner
WHERE banner_group_id = '".$banner_group_id."'
AND banner.enable = 1
AND start_date <= '" . $nowDate . "'
AND stop_date >= '" . $nowDate . "'
";
if ($rec_group['sort_by'] == 'Random')
$sql_right .= "
ORDER BY RAND()
";
else
$sql_right .= "
ORDER BY rank
";
if ($showLimitBanner > 0) {
$sql_right .= "
LIMIT 0, " . $showLimitBanner . "
";
}
$query_right = sql_query($sql_right);
if (sql_num_rows($query_right) > 0) {
while ($rec_right = sql_fetch_array($query_right)) {
$thisPath = $configWebsiteName.'uploads/banner/'.$rec_right['image'];
if ( $rec_right['image'] != '' ) {
echo ' ';
$a_exists_side_left[] = $rec_right['banner_id'];
$counter++;
$link = '';
$linkToOutSite = false;
if ($rec_right['link'] != '') {
if (preg_match('/http:\/\//i', $rec_right['link']))
$rec_right['link'] = str_ireplace('http://', '', $rec_right['link']);
$link = $rec_right['link'];
$linkToOutSite = true;
} // end if ($rec['link'] != '') {
if ($rec_group['banner_type'] == 'Text') {
if ($link != '') {
if ($linkToOutSite)
echo '';
else
echo '';
} // end if ($link != '') {
echo $rec_right['description'];
if ($link != '')
echo '';
} elseif ($rec_group['banner_type'] == 'Banner') { // end if ($rec_group['banner_type'] == 'Text') {
if ( $rec_right['image'] != '' ) {
$thisPath = 'uploads/banner/' . $rec_right['image'];
$aSize = @getimagesize($thisPath);
$width = $rec_group['banner_width'];
$height = $rec_group['banner_height'];
$aSize[0] = ((int)$aSize[0] > $width)?$width:(int)$aSize[0];
$aSize[1] = ((int)$aSize[1] > $height)?$height:(int)$aSize[1];
$aType = explode(".",$rec_right['image']);
$stype = $aType[count($aType)-1];
if ($stype == 'html') {
?>
';
} else { // end if ($link == '') {
if ($linkToOutSite)
echo '';
else
echo '';
echo ' |