<?PHP
/*
=====================================================
 DataLife Engine v9.3 - by DLE Farsi Group 
-----------------------------------------------------
 http://datalifeengine.ir/
-----------------------------------------------------
 Copyright (c) 2006,2011 DLE Farsi Group
=====================================================
*/
if(!defined('DATALIFEENGINE')){
	die("Hacking attempt!");
}

$obmen_links = get_vars ( "obmen" );
if (! is_array ( $obmen_links )) {
	$cat_info = array ();
	
	$db->query ( "SELECT * FROM " . PREFIX . "_obmen ORDER BY posit ASC" );
	while ( $row = $db->get_row () ) {
		
		$obmen_links[$row['id']] = array ();
		
		foreach ( $row as $key => $value ) {
			$obmen_links[$row['id']][$key] = stripslashes ( $value );
		}
	
	}
	set_vars ( "obmen", $obmen_links );
	$db->free ();
}

$obmen = "";

foreach($obmen_links as $obmen_link) {
	$link_style = "";
	if ($obmen_link['color'] != '') $link_style .= "color:#" . $obmen_link['color'] . ";";
	if ($obmen_link['bold'] == '1') $link_style .= "font-weight:bold";
	if ($link_style != '') $link_style = " style=\"$link_style\"";

	$link = "<a href=\"{$obmen_link['link']}\" target=\"_blank\" title=\"{$obmen_link['description']}\"{$link_style}>{$obmen_link['title']}</a>";
	$obmen .= "<li>" . $link . "</li>";
}

if ($obmen != "") {
	$obmen_config = unserialize( @file_get_contents( ENGINE_DIR . "/data/obmen.php" ));
	
	if ($obmen_config['showchecked']['3'] == '1') $obmen = '<marquee onmouseover="this.stop()" onmouseout="this.start()" direction="up" scrollAmount="1" style="height:130px" scrolldelay="20">' . $obmen . '</marquee>';
	if ($obmen_config['showchecked']['2'] == '1' && $obmen_config['text']['2'] != '') $obmen .= "\n<div align=justify dir=rtl>{$obmen_config['text']['2']}</div>";
	if ($obmen_config['showchecked']['1'] == '1' && $obmen_config['text']['1'] != '') $obmen = "<div align=justify dir=rtl>{$obmen_config['text']['1']}</div>\n" . $obmen;
}

echo $obmen;

?>