<?php
defined('_JEXEC') or die( 'Restricted access' );

jimport( 'joomla.application.component.model' );

class KipModelSettings extends JModel
{
	function store(){
		$db		=& JFactory::getDBO();
		$post	= JRequest::get('post',array());
		foreach($post as $k=>$v){
			if(eregi('^((site)|(admin)|(users)_)', $k)){
				$k = str_replace(array('site_', 'admin_', 'users_'), array('site.', 'admin.', 'users.'), $k);
				//if($k=='site.filtering_mode' && $v==1)
				$db->setQuery('
					UPDATE #__kip_settings SET value='.intval($v).' WHERE name='.$db->quote($k).'
				');
				$db->query();
			}
		}
		return true;
	}
	
}
