<?php
/*
	Stempora Web Framework
	Copyright (c) 2002-2014 Stempora. 
	All rights reserved.
		web:  www.stempora.com
		mail: support@stempora.com				
*/



	$conf = new CConfig("modules/shortcodes/updates/codes.xml");
	if (is_array($conf->vars["shortcodes"]["shortcode"])) {

		foreach ($conf->vars["shortcodes"]["shortcode"] as $key => $code) {

			//check if the code exists 
			if (!is_array($this->db->QFetchArray("SELECT * FROM {$this->tables['plugin:shortcodes']} WHERE shortcode_pattern LIKE '%s'" , array($code["pattern"])))) {
				$this->db->QueryInsert(
					$this->tables["plugin:shortcodes"],
					array(
						"shortcode_status"	=> "1",
						"shortcode_pattern"	=> $code["pattern"],
						"shortcode_sample"	=> $code["sample"],
						"shortcode_replace"	=> $code["replace"],
						"shortcode_multi"	=> $code["multiline"],
						"shortcode_device"	=> "1,2,3",
						"shortcode_note"	=> $code["note"],
					)
				);
			}
			
		}
		
	}
	
?>