<?php
/**
 * @package		Ad Platform
 * @author		Uta Marian - Alexandru ( -uMarian- )
 * @license		http://codecanyon.net/licenses
 * @link		http://www.uta-marian.com
 * @version		Version 1.0
 */
		
class widgets {

	function load ( $ID ) {
		$db = new database;
		$prepare = new prepare;
		
$widgets = $db->Query("SELECT `widget_id`, `widget_name`, `widget_plugin_id`, `widget_var_1`, `widget_var_2`, `widget_var_3`, `widget_position`, `widget_order`, `widget_status`, `plugin_directory` FROM ".DB_PREFIX."widgets inner join plugins on plugins.plugin_id = widgets.widget_plugin_id WHERE widget_position=? and widget_status=? order by widget_order asc","ii",$ID,1);
		
		
if ( empty ( $widgets ) ) {
		echo '';
				} else {
foreach($widgets as $widget) {
	$widget_id = $widget['widget_id'];
	$widget_name = $widget['widget_name'];
	$widget_plugin_id = $widget['widget_plugin_id'];
	$widget_position = $widget['widget_position'];
	$widget_order = $widget['widget_order'];
	$var_1 = $widget['widget_var_1'];
	$var_2 = $widget['widget_var_2'];
	$var_3 = $widget['widget_var_3'];
include(DIR_PLUGINS.$widget['plugin_directory'].'/widgets/widgets.php');	
}
			
			}

}

}
?>