<?php
   /* ----------------------------------------------------------------------- *
    *	Created by nick-on                                                    *
    *	icq: 834361, nick-on@mail.ru, http://nick-on.ru, http://4dle.ru       *
    * ----------------------------------------------------------------------- */
	set_time_limit( 0 );
	define ( "DATALIFEENGINE", true );
  	define ( "ROOT_DIR", dirname ( __FILE__ ));
  	define ( "ENGINE_DIR", ROOT_DIR . "/engine/" );
    require_once ROOT_DIR . '/engine/classes/mysql.php';
  	require_once ROOT_DIR . '/engine/data/config.php';
  	require_once ROOT_DIR . '/engine/data/dbconfig.php';
  	require_once ROOT_DIR . '/engine/classes/parse.class.php';
    $sql_result = $db->query ( "SELECT * FROM " . PREFIX . "_post" );
    $parse = new ParseFilter(Array(), Array(), 1, 1);
    while ( $row = $db->get_row ( $sql_result ))
    {
    	$short_story = $parse->decodeBBCodes( $row['short_story'], false );
    	$full_story  = $parse->decodeBBCodes( $row['full_story'],  false );
    	$short_story = str_replace ( "[thumb]", "[img]", $short_story );
    	$full_story  = str_replace ( "[thumb]", "[img]", $full_story );
     	$short_story = str_replace ( "[/thumb]", "[/img]", $short_story );
     	$full_story	 = str_replace ( "[/thumb]", "[/img]", $full_story );
      	$short_story = $db->safesql ( $parse->BB_Parse( $parse->process( $short_story ), false));
      	$full_story	 = $db->safesql ( $parse->BB_Parse( $parse->process( $full_story ), false));
      	$db->query ( "UPDATE " . PREFIX . "_post SET short_story = '{$short_story}', full_story = '{$full_story}' WHERE id = '{$row['id']}'" );
    }
    $db->free();
?>