<?php
/*
=====================================================
 Скрипт модуля Rss Grabber 3.6.6
 http://grabberok.co.cc/
 Автор: Andersoni
 со Автор: Alex
 Copyright (c) 2009-2010
=====================================================
*/

if(!defined('Rss_Grabber_INSTALL'))
{
  die("Hacking attempt!");
}

	$db_query = array();

	$db_query[] = "CREATE TABLE IF NOT EXISTS " . PREFIX . "_rss_category  (
  `id` int(10) NOT NULL auto_increment,
  `osn` int(10) NOT NULL default '0',
  `title` varchar(250) NOT NULL default '',
  `kanal` tinyint(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
	) TYPE=MyISAM /*!40101 DEFAULT CHARACTER SET " . COLLATE . " COLLATE " . COLLATE . "_general_ci */";

	$db_query[] = "ALTER TABLE " . PREFIX . "_rss ADD `dnast` text NOT NULL";

	$db_query[] = "ALTER TABLE " . PREFIX . "_rss ADD `kategory` text NOT NULL";

	$db_query[] = "ALTER TABLE " . PREFIX . "_rss ADD `symbol` text NOT NULL";

	$db_query[] = "ALTER TABLE " . PREFIX . "_rss ADD `ftags` text NOT NULL";

	$db_query[] = "ALTER TABLE " . PREFIX . "_rss ADD `metatitle` text NOT NULL";

	$db_query[] = "ALTER TABLE " . PREFIX . "_rss ADD `meta_descr` text NOT NULL";

	$db_query[] = "ALTER TABLE " . PREFIX . "_rss ADD `key_words` text NOT NULL";

	$db_query[] = "UPDATE " . PREFIX . "_rss SET `dnast` = '1=1=1=1=1=1=1=1=1=1' ";

	$db_query[] = "ALTER TABLE " . PREFIX . "_rss CHANGE `load_img` `load_img` VARCHAR( 25 ) DEFAULT '0'";

	$db_query[] = "ALTER TABLE " . PREFIX . "_rss ADD `xfields_template` text NOT NULL";

	$db_query[] = "ALTER TABLE " . PREFIX . "_rss ADD `dop_full` varchar(100) NOT NULL";

	$db_query[] = "ALTER TABLE " . PREFIX . "_rss CHANGE `dop_nast` `dop_nast` VARCHAR( 100 ) CHARACTER SET cp1251 COLLATE cp1251_general_ci NOT NULL";
	
	$db_query[] = "ALTER TABLE " . PREFIX . "_rss CHANGE `short_story` `short_story` VARCHAR( 100 ) CHARACTER SET cp1251 COLLATE cp1251_general_ci NOT NULL";

	$rss = $db->query ("SELECT * FROM ".PREFIX ."_rss");
while ($row = $db->get_row ($rss))
{
$dop_nast = explode ('=',$row['dop_nast']);


if ($row['load_img'] == 1)
$hg = 'serv';
elseif ($dop_nast[11] == 1)
	$hg = 'zikuka';
else 
	$hg = 0;

$id = $row['id'];
$dop_nast[14]='';
$dop_nast[11] = '0';
$dop = implode ('=',$dop_nast);
$db->query ("UPDATE ".PREFIX ."_rss SET load_img = '$hg', dop_nast='$dop' WHERE id ='$id'");
}

?>



