<?php
/*
	DevSaver Web Framework
	Copyright (c) 2013-2016 DevSaver. 
	All rights reserved.
		web:  www.devsaver.com
		mail: support@devsaver.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_code LIKE '%s'" , array($code["code"])))) {
				$this->db->QueryInsert(
					$this->tables["plugin:shortcodes"],
					array(
						"shortcode_status"	=> "1",
						"shortcode_code"	=> $code["code"],
						"shortcode_sample"	=> $code["sample"],
						"shortcode_replace"	=> $code["replace"],
						"shortcode_nested"	=> $code["nested"],
						"shortcode_device"	=> "1,2,3",
						"shortcode_note"	=> $code["note"],
						"shortcode_type"	=> $code["type"],
						"shortcode_multi_replace" => $code["multi"],
						"shortcode_multi"	=> $code["multi"] ? "1" : "0",
					)
				);
			}
			
		}
		
	}
	
?>