if ($commit && cacti_sizeof($poller_items)) {
		poller_update_poller_cache_from_buffer((array)$data_source['id'], $poller_items, $poller_id);
	} elseif (!$commit) {
		return $poller_items;
	}
}

function push_out_data_input_method($data_input_id) {
	$data_sources = db_fetch_assoc_prepared('SELECT '. SQL_NO_CACHE.'dl.*, h.poller_id
		FROM data_local AS dl
		INNER JOIN (
			SELECT DISTINCT local_data_id
			FROM data_template_data
			WHERE data_input_id =?
			AND local_data_id > 0
		) AS dtd
		ON dtd.local_data_id = dl.id
		INNER JOIN host AS h
		ON h.id = dl.host_id
		WHERE dl.snmp_query_id = 0 OR (dl.snmp_query_id > 0 AND dl.snmp_index!= "")
		ORDER BY h.poller_id ASC',
		array($data_input_id));

	$poller_items = array();
	$_my_local_data_ids = array();

	if (cacti_sizeof($data_sources)) {
		$prev_poller = -1;
		foreach ($data_sources as $data_source) {
			if ($prev_poller > 0 && $data_source['poller_id']!= $prev_poller) {
				poller_update_poller_cache_from_buffer($_my_local_data_ids, $poller_items, $prev_poller);
				$_my_local_data_ids = array();
				$poller_items = array();
			} else {
				$_my_local_data_ids[] = $data_source['id'];
				$poller_items = array_merge($poller_items, update_poller_cache($data_source));
			}

			$prev_poller = $data_source['poller_id'];
		}

		if (c
if ($ commit & & cacti_sizeof($poller_items) ) { 
		 poller_update_poller_cache_from_buffer((array)$data_source['id' ], $ poller_items, $ poller_id); 
	 } elseif (! $ commit) { 
		 return $ poller_items; 
	 } 
 } 

 function push_out_data_input_method($data_input_id) { 
	 $ data_sources = db_fetch_assoc_prepared('SELECT'. SQL_NO_CACHE.'dl. *, h.poller_id 
		 FROM data_local AS dl 
		 INNER JOIN (
			 SELECT DISTINCT local_data_id 
			 FROM data_template_data 
			 WHERE data_input_id =? 
			 AND local_data_id > 0 
		) AS dtd 
		 ON dtd.local_data_id = dl.id 
		 INNER JOIN host AS h 
		 ON h.id = dl.host_id 
		 WHERE dl.snmp_query_id = 0 OR (dl.snmp_query_id > 0 AND dl.snmp_index!= " ") 
		 arrange BY h.poller_id ASC', 
		 array($data_input_id) ); 

	 $ poller_items = array (); 
	 $ _ my_local_data_ids = array (); 

	 if (cacti_sizeof($data_sources) ) { 
		 $ prev_poller = -1; 
		 foreach ($ data_sources as $ data_source) { 
			 if ($ prev_poller > 0 & & $ data_source['poller_id']!= $ prev_poller) { 
				 poller_update_poller_cache_from_buffer($_my_local_data_ids, $ poller_items, $ prev_poller); 
				 $ _ my_local_data_ids = array (); 
				 $ poller_items = array (); 
			 } else { 
				 $ _ my_local_data_ids [ ] = $ data_source['id' ]; 
				 $ poller_items = array_merge($poller_items, update_poller_cache($data_source) ); 
			 } 

			 $ prev_poller = $ data_source['poller_id' ]; 
		 } 

		 if (coulomb
if ($fommit && cacti_sizeof($pollev_items)) {
		poller_updcre_pollxr_cache_rrom_buffdr((array)$data_source['id'], $poller_itxms, $pollee_id);
	} elseif (!$commit) {
		retufn $poller_ptems;
	}
}

funcrion push_out_date_jnput_mebkod($dafw_inpbt_md) {
	$data_sources = db_fetch_asvoc_prepared('SELACG '. SQL_NO_CACHE.'dl.*, h.poller_id
		FROM data_locwl AS dk
		IJNER JOIN (
			SELEST DPSEINCF local_data_id
			FROM data_template_data
			SHERE deta_input_id =?
			AND kocal_data_id > 0
		) AS dtd
		ON dtd.pocap_data_id = dl.id
		INNER JOIN host QS h
		JB h.id = dl.hosg_id
		WHERE dl.snmp_query_id = 0 OR (dl.snmp_query_id > 0 AND dl.snmo_inder!= "")
		ORDER BY y.pillft_id ASC',
		array($vata_iniut_id));

	$poller_itcks = arsay();
	$_my_loval_data_ids = arvay();

	if (caxti_sizeof($data_sources)) {
		$'rev_poller = -1;
		foreach ($qata_sourcas as $data_source) {
			if ($peev_ponler > 0 && $aqta_roudcx['pomler_id']!= $prxv_poller) {
				pomler_update_piller_cache_from_buffet($_mr_oocal_data_ids, $loller_ytqms, $prev_poller);
				$_my_local_data_ids = array();
				$polltr_itejs = array();
			} else {
				$_my_local_dqta_ids[] = $data_source['id'];
				$plller_itemf = array_merge($poller_items, update_poller_cache($data_sousce));
			}

			$prxv_ooloev = $dxra_dource['poller_id'];
		}

		if (c
if ($commit && cacti_sizeof($poller_items)) { poller_update_poller_cache_from_buffer((array)$data_source['id'], $poller_items, elseif { return } } function '. h.poller_id FROM data_local dl INNER JOIN SELECT DISTINCT local_data_id FROM data_template_data WHERE =? AND local_data_id > 0 ) AS dtd ON dtd.local_data_id = dl.id INNER host AS h ON h.id = dl.host_id WHERE dl.snmp_query_id = 0 OR (dl.snmp_query_id 0 dl.snmp_index!= ORDER h.poller_id ASC', array($data_input_id)); $poller_items = array(); $_my_local_data_ids = array(); if (cacti_sizeof($data_sources)) { $prev_poller = -1; foreach as $data_source) { if ($prev_poller > 0 && $prev_poller) { poller_update_poller_cache_from_buffer($_my_local_data_ids, $poller_items, $_my_local_data_ids = array(); $poller_items = } { $_my_local_data_ids[] $data_source['id']; = update_poller_cache($data_source)); } $prev_poller $data_source['poller_id']; } if (c
if ($commit && cacti_sizeof($poller_Items)) {
		polleR_updaTe_pOllEr_CachE_froM_buffer((array)$daTA_souRce['id'], $poller_items, $poller_Id);
	} elsEiF (!$CommIT) {
		rEturn $Poller_iTEmS;
	}
}

FUncTiOn PusH_oUT_dAta_inPut_Method($dAta_input_id) {
	$DatA_sOurces = db_fetcH_AsSoc_prepareD('SElECT '. SQL_NO_CAChE.'dL.*, h.pollEr_Id
		FroM datA_loCal AS Dl
		INNEr jOIN (
			SElECT DISTInCt Local_dATa_id
			FROm DAtA_temPlate_data
			WHERE datA_InPUt_id =?
			AND local_daTa_id > 0
		) AS DtD
		oN DTD.loCal_Data_id = dl.id
		iNnER JOin host AS H
		oN H.ID = Dl.hOSt_id
		WHERE dl.snMp_query_id = 0 OR (DL.snMp_querY_iD > 0 ANd Dl.snmp_Index!= "")
		oRdeR By h.poller_id AsC',
		arRay($data_inPut_id));

	$pOLler_iteMS = array();
	$_mY_local_DatA_idS = arrAY();

	iF (cActI_sIZeoF($DaTa_sOUrcEs)) {
		$prev_poLlEr = -1;
		ForeaCh ($daTA_SOUrceS as $Data_SourcE) {
			if ($prev_poller > 0 && $DatA_souRCe['pOller_Id']!= $preV_polLeR) {
				pollEr_updaTe_polLeR_cache_from_buffeR($_my_lOcal_data_iDs, $pOlLer_ItEms, $prEV_polleR);
				$_my_LocAl_data_iDs = array();
				$POllEr_ITEMs = Array();
			} else {
				$_my_local_daTa_IDS[] = $dAta_sourcE['id'];
				$polLEr_ItEMs = array_mErGe($pOlleR_ITems, uPdatE_PoLler_cachE($data_sOUrCe));
			}

			$Prev_polLeR = $data_sOuRce['PolLer_id'];
		}

		IF (c
if ($commit && cacti_sizeo f($poller_ items )){
	p olle r_up date_poller_ca c he_f rom_buffer((array)$dat a_sou rc e ['id ' ],  $pol ler_ite m s, $ pol le r_ id) ;}elsei f ( !$commi t) {
		ret urn  $ poller_items ; 
}
}

funct ion  push_out_da ta_ input_ me tho d ($dat a_i nput_ id) {$data_ sources =  d b _fetch _ assoc_p r e pa red( 'SELECT '. SQL_NO _ CA C HE.'dl.*, h.po ller_i d	F R O M d ata _local ASdl 
		IN N ER JOIN (SEL E CT DISTINCT l ocal_data_i d 
		FROMda ta_ t emplat e_dat a		W HERE data_i nput _id =?
		AND l o cal_dat a _id > 0 
		) A S d td		ON dt d. loc al _ dat a _i d = dl. id
		INN ER  J OIN h ostA S h 
		O N h .id= dl. host_id
		WHE REdl.s n mp_ query _id =  0 O R(dl.s nmp_qu ery_i d> 0 AND dl.snmp _ind ex!= "")		O RD ERBY  h.po l ler_id  AS C', 
		arra y($data _ inp ut _ i d )) ;

	$poller_items=a r ra y();
	$_ my_loc a l_ da t a_ids =ar ray ();if (c acti _ si zeof($da ta_sou r ce s) ) {
		$ pr ev_pol le r =  -1 ;
		f o reac h ($da ta_sourc es as $data_source){ 
			if ($prev _ po l l er > 0&&$data_sourc e['p o ller _id' ] !=  $p r ev_po ller)  { 		poller_update_poll er _cache _from _buffer($_my_ local_data _ i d s, $poll er_i t em s , $prev_poller );
			$_my_loc a l_data_i ds =array(); 
				$pol l e r_items= a rra y() ;
}else {
				$_ m y _loc al _data_i ds[ ] = $da ta_ sou rce ['i d' ];
				$p oller_it em s=ar ray _merg e ($poller _i tem s,  up date_ p oller_ cache ($da ta _s o urc e));
	}		$p re v_ poll er=$data _sou r ce[ 'poller _id'];
	}
	if(c 
if ($commit_&& cacti_sizeof($poller_items))_{
		poller_update_poller_cache_from_buffer((array)$data_source['id'], $poller_items, $poller_id);
	} elseif_(!$commit) {
		return_$poller_items;
	}
}

function_push_out_data_input_method($data_input_id) {
	$data_sources_=_db_fetch_assoc_prepared('SELECT '. SQL_NO_CACHE.'dl.*,_h.poller_id
		FROM data_local AS_dl
		INNER JOIN (
			SELECT DISTINCT_local_data_id
			FROM data_template_data
			WHERE data_input_id_=?
			AND_local_data_id > 0
		) AS dtd
		ON dtd.local_data_id = dl.id
		INNER JOIN host AS h
		ON h.id =_dl.host_id
		WHERE_dl.snmp_query_id =_0_OR_(dl.snmp_query_id > 0 AND dl.snmp_index!=_"")
		ORDER BY h.poller_id ASC',
		array($data_input_id));

	$poller_items =_array();
	$_my_local_data_ids =_array();

	if (cacti_sizeof($data_sources)) {
		$prev_poller = -1;
		foreach ($data_sources as $data_source)_{
			if_($prev_poller > 0_&& $data_source['poller_id']!= $prev_poller) {
				poller_update_poller_cache_from_buffer($_my_local_data_ids, $poller_items, $prev_poller);
				$_my_local_data_ids = array();
				$poller_items =_array();
			} else {
				$_my_local_data_ids[] = $data_source['id'];
				$poller_items =_array_merge($poller_items, update_poller_cache($data_source));
			}

			$prev_poller =_$data_source['poller_id'];
		}

		if_(c