Каким функциями php воспользоваться чтобы разэкранировать кавычки и переносы строк коротая обычная cms хранила данные в mysql.
Текст взял из дампа и пытаюсь привести текст в нормальный вид учитывай форматирование.
Или может есть какие-нибудь сервесы online ?
Вот кусочек дампа:
Спойлер (Отобразить)
INSERT INTO `module_templates` VALUES ('News','summarySample','{if $pagecount > 1} {* нумерация страниц *}\r\n <div class=\"newsSummaryPagination\">\r\n {if $pagenumber > 1}\r\n {$firstpage} {$prevpage} \r\n {/if}\r\n {$pagetext} {$pagenumber} {$oftext} {$pagecount}\r\n {if $pagenumber < $pagecount}\r\n {$nextpage} {$lastpage}\r\n {/if}\r\n </div>\r\n{/if}\r\n\r\n{foreach from=$items item=entry}\r\n <div class=\"newsSummatyBlock\" style=\"background-color:{cycle values=\'#E6FFCE,#F5FFCA\'}\">\r\n <div class=\"newsSummaryHead\">\r\n <h1 class=\"newsSummaryTitle\">\r\n <a href=\"{$entry->moreurl}\" title=\"{$entry->title|cms_escape:htmlall}\">{$entry->title|cms_escape}</a>\r\n </h1>\r\n <div class=\"newsSummaryInfo\">\r\n {if $entry->postdate}\r\n Дата: {$entry->postdate|cms_date_format}\r\n {/if}\r\n {if $entry->author}\r\n <br>{$author_label} {$entry->author}\r\n {/if}\r\n </div>\r\n </div>\r\n <div class=\"newsSummaryText\">\r\n {if $entry->summary}\r\n {eval var=$entry->summary}\r\n {$entry->morelink}...\r\n {else if $entry->content}\r\n {eval var=$entry->content}\r\n {/if}\r\n </div>\r\n </div>\r\n{/foreach}\r\n<div style=\"clear:both\"></div>','2012-10-24 07:13:08','2012-11-01 05:22:13'),('News','summarySummary_Simplex','{strip}\n\n<!-- .news-summary wrapper -->\n<article class=\'news-summary\'>\n<span class=\'heading\'><span>News</span></span>\n <ul class=\'category-list cf\'>\n {foreach from=$cats item=\'node\'}\n {if $node.depth > $node.prevdepth}\n {repeat string=\'<ul>\' times=$node.depth-$node.prevdepth}\n {elseif $node.depth < $node.prevdepth}\n {repeat string=\'</li></ul>\' times=$node.prevdepth-$node.depth}\n </li>\n {elseif $node.index > 0}</li>\n {/if}\n <li{if $node.index == 0} class=\'first\'{/if}>\n {if $node.count > 0}\n <a href=\'{$node.url}\'>{$node.news_category_name}</a>{else}<span>{$node.news_category_name} </span>{/if}\n {/foreach}\n {repeat string=\'</li></ul>\' times=$node.depth-1}</li>\n </ul>\n {foreach from=$items item=\'entry\'}\n <!-- .news-article (wrapping each article) -->\n <section class=\'news-article\'>\n <header>\n <h2><a href=\'{$entry->moreurl}\' title=\'{$entry->title|cms_escape:htmlall}\'>{$entry->title|cms_escape}</a></h2>\n <div class=\'meta cf\'>\n <time class=\'date\' datetime=\'{$entry->postdate|date_format:\'%Y-%m-%d\'}\'>\n <span class=\'day\'> {$entry->postdate|date_format:\'%d\'} </span>\n <span class=\'month\'> {$entry->postdate|date_format:\'%b\'} </span>\n </time>\n <span class=\'author\'> {$author_label} {$entry->author} </span>\n <span class=\'category\'> {$category_label} {$entry->category}</span>\n </div>\n </header>\n {if $entry->summary}\n <p>{eval var=$entry->summary|strip_tags}</p>\n <span class=\'more\'>{$entry->morelink} ?</span>\n {else if $entry->content}\n <p>{eval var=$entry->content|strip_tags}</p>\n {/if}\n </section>\n <!-- .news-article //-->\n {/foreach}\n <!-- news pagination -->\n {if $pagecount > 1}\n <span class=\'paginate\'>\n {if $pagenumber > 1}\n {$firstpage} {$prevpage}\n {/if}\n {$pagetext} {$pagenumber} {$oftext} {$pagecount}\n {if $pagenumber < $pagecount}\n {$nextpage} {$lastpage}\n {/if}\n </span>\n {/if}\n</article>\n<!-- .news-summary //-->\n\n{/strip}','2012-10-24 07:13:08','2012-10-24 07:13:08'),('News','detailSample','{* News module entry object reference:\n ------------------------------\n In previous versions of News the \'object\' returned in $entry was quite simple, and a <pre>{$entry|@print_r}</pre> would output all of the available data\n This has changed in News 2.12, the object is not quite as \'simple\' as it was in previous versions, and that method will no longer work. Hence, below\n you will find a referennce to the available data.\n\n ====\n news_article Object Reference\n ====\n\n Members:\n --\n Members can be displayed by the following syntax: {$entry->membername} or assigned to another smarty variable using {assign var=\'foo\' value=$entry->membername}.\n\n The following members are available in the entry array:\n \n id (integer) = The unique article id.\n author_id (integer) = The userid of the author who created the article. This value may be negative to indicate an FEU userid.\n title (string) = The title of the article.\n summary (text) = The summary text (may be empty or unset).\n extra (string) = The \"extra\" data associated with the article (may be empty or unset).\n news_url (string) = The url segment associated with this article (may be empty or unset).\n postdate (string) = A string representing the news article post date. You may filter this through cms_date_format for different display possibilities.\n startdate (string) = A string representing the date the article should begin to appear. (may be empty or unset)\n enddate (string) = A string representing the date the article should stop appearing on the site (may be empty or unset).\n category_id (integer) = The unique id of the hierarchy level where this article resides (may be empty or unset)\n status (string) = either \'draft\' or \'published\' indicating the status of this article.\n author (string) = The username of the original author of the article. If the article was created by frontend submission, this will attempt to retrieve the username from the FEU module.\n authorname (string) = The full name of the original author of the website. Only applicable if article was created by an administrator and that information exists in the administrators profile.\n category (string) = The name of the category that this article is associated with.\n canonical (string) = A full URL (prettified) to this articles detail view using defaults if necessary.\n fields (associative) = An associative array of field objects, representing the fields, and their values for this article. See the information below on the field object definition. In past versions of News this was a simple array, now it is an associative one.\n customfieldsbyname = (deprecated) - A synonym for the \'fields\' member\n fieldsbyname = (deprecated) - A synonym for the \'fields\' member\n useexp (integer) = A flag indicating wether this article is using the expiry information.\n file_location (string) = A url containing the location where files attached the article are stored... the field value should be appended to this url.\n \n\n ====\n news_field Object Reference\n ====\n The news_field object contains data about the fields and their values that are associated with a particular news article.\n\n Members:\n --------\n id (integer) = The id of the field definition\n name (string) = The name of the field\n type (string) = The type of field\n max_length (integer) = The maximum length of the field (applicable only to text fields)\n item_order (integer) = The order of the field\n public (integer) = A flag indicating wether the field is public or not\n value (mixed) = The value of the field.\n\n\n ====\n Below, you will find the normal detail template information. Modify this template as desired.\n*}\n\n{* set a canonical variable that can be used in the head section if process_whole_template is false in the config.php *}\n{if isset($entry->canonical)}\n {assign var=\'canonical\' value=$entry->canonical}\n{/if}\n\n{if $entry->postdate}\n <div id=\"NewsPostDetailDate\">\n {$entry->postdate|cms_date_format}\n </div>\n{/if}\n<h3 id=\"NewsPostDetailTitle\">{$entry->title|cms_escape:htmlall}</h3>\n\n<hr id=\"NewsPostDetailHorizRule\" />\n\n{if $entry->summary}\n <div id=\"NewsPostDetailSummary\">\n <strong>\n {eval var=$entry->summary}\n </strong>\n </div>\n{/if}\n\n{if $entry->category}\n <div id=\"NewsPostDetailCategory\">\n {$category_label} {$entry->category}\n </div>\n{/if}\n{if $entry->author}\n <div id=\"NewsPostDetailAuthor\">\n {$author_label} {$entry->author}\n </div>\n{/if}\n\n<div id=\"NewsPostDetailContent\">\n {eval var=$entry->content}\n</div>\n\n{if $entry->extra}\n <div id=\"NewsPostDetailExtra\">\n {$extra_label} {$entry->extra}\n </div>\n{/if}\n\n{if $return_url != \"\"}\n<div id=\"NewsPostDetailReturnLink\">{$return_url}{if $category_name != \'\'} - {$category_link}{/if}</div>\n{/if}\n\n{if isset($entry->fields)}\n {foreach from=$entry->fields item=\'field\'}\n <div class=\"NewsDetailField\">\n {if $field->type == \'file\'}\n {* this template assumes that every file uploaded is an image of some sort, because News doesn\'t distinguish *}\n <img src=\"{$entry->file_location}/{$field->value}\"/>\n {else}\n {$field->name}: {eval var=$field->value}\n {/if}\n </div>\n {/foreach}\n{/if}\n','2012-10-24 07:13:08','2012-10-24 07:13:08'),('News','detailSimplex_Detail','{* set a canonical variable that can be used in the head section if process_whole_template is false in the config.php *}\n{if isset($entry->canonical)}\n {assign var=\'canonical\' value=$entry->canonical}\n{/if}\n\n<h2>{$entry->title|cms_escape:htmlall}</h2>\n{if $entry->summary}\n {eval var=$entry->summary}\n{/if}\n {eval var=$entry->content}\n{if $entry->extra}\n {$extra_label} {$entry->extra}\n{/if}\n{if $return_url != \"\"}\n <br />\n <span class=\'back\'>? {$return_url}{if $category_name != \'\'} - {$category_link}{/if}</span>\n{/if}\n\n{if isset($entry->fields)}\n {foreach from=$entry->fields item=\'field\'}\n <div>\n {if $field->type == \'file\'}\n {* this template assumes that every file uploaded is an image of some sort, because News doesn\'t distinguish *}\n <img src=\'{$entry->file_location}/{$field->value}\' alt=\'\' />\n {else}\n {$field->name}: {eval var=$field->value}\n {/if}\n </div>\n {/foreach}\n{/if}\n <footer class=\'news-meta\'>\n {if $entry->postdate}\n {$entry->postdate|cms_date_format}\n {/if}\n {if $entry->category}\n <strong>{$category_label}</strong> {$entry->category}\n {/if}\n {if $entry->author}\n <strong>{$author_label}</strong> {$entry->author}\n {/if}\n </footer>','2012-10-24 07:13:08','2012-10-24 07:13:08'),('News','formSample','{* original form template *}\r\n{if isset($error)}\r\n <h3><font color=\"red\">{$error}</font></h3>\r\n{else}\r\n {if isset($message)}\r\n <h3>{$message}</h3>\r\n {/if}\r\n{/if}\r\n{$startform}\r\n <div class=\"pageoverflow\">\r\n <p class=\"pagetext\">*{$titletext}:</p>\r\n <p class=\"pageinput\">{$inputtitle}</p>\r\n </div>\r\n <div class=\"pageoverflow\">\r\n <p class=\"pagetext\">{$categorytext}:</p>\r\n <p class=\"pageinput\">{$inputcategory}</p>\r\n </div>\r\n{if !isset($hide_summary_field) or $hide_summary_field == 0}\r\n <div class=\"pageoverflow\">\r\n <p class=\"pagetext\">{$summarytext}:</p>\r\n <p class=\"pageinput\">{$inputsummary}</p>\r\n </div>\r\n{/if}\r\n <div class=\"pageoverflow\">\r\n <p class=\"pagetext\">*{$contenttext}:</p>\r\n <p class=\"pageinput\">{$inputcontent}</p>\r\n </div>\r\n <div class=\"pageoverflow\">\r\n <p class=\"pagetext\">{$extratext}:</p>\r\n <p class=\"pageinput\">{$inputextra}</p>\r\n </div>\r\n <div class=\"pageoverflow\">\r\n <p class=\"pagetext\">{$startdatetext}:</p>\r\n <p class=\"pageinput\">{html_select_date prefix=$startdateprefix time=$startdate end_year=\"+15\"} {html_select_time prefix=$startdateprefix time=$startdate}</p>\r\n </div>\r\n <div class=\"pageoverflow\">\r\n <p class=\"pagetext\">{$enddatetext}:</p>\r\n <p class=\"pageinput\">{html_select_date prefix=$enddateprefix time=$enddate end_year=\"+15\"} {html_select_time prefix=$enddateprefix time=$enddate}</p>\r\n </div>\r\n {if isset($customfields)}\r\n {foreach from=$customfields item=\'onefield\'}\r\n <div class=\"pageoverflow\">\r\n <p class=\"pagetext\">{$onefield->name}:</p>\r\n <p class=\"pageinput\">{$onefield->field}</p>\r\n </div>\r\n {/foreach}\r\n {/if}\r\n <div class=\"pageoverflow\">\r\n <p class=\"pagetext\"> </p>\r\n <p class=\"pageinput\">{$hidden}{$submit}{$cancel}</p>\r\n </div>\r\n{$endform}\r\n','2012-10-24 07:13:08','2012-10-28 22:55:15'),('News','browsecatSample','{if $count > 0}\r\n <ul class=\"list1\">\r\n {foreach from=$cats item=node}\r\n {if $node.depth > $node.prevdepth}\r\n {repeat string=\"<ul>\" times=$node.depth-$node.prevdepth}\r\n {elseif $node.depth < $node.prevdepth}\r\n {repeat string=\"</li></ul>\" times=$node.prevdepth-$node.depth}\r\n </li>\r\n {elseif $node.index > 0}\r\n </li>\r\n {/if}\r\n <li class=\"newscategory\">\r\n {if $node.count > 0}\r\n <a href=\"{$node.url}\">{$node.news_category_name}</a> ({$node.count}){else}<span>{$node.news_category_name} (0)</span>\r\n {/if}\r\n {/foreach}\r\n {repeat string=\"</li></ul>\" times=$node.depth-1}\r\n </li>\r\n </ul>\r\n{/if}','2012-10-24 07:13:08','2012-10-29 04:44:44'),('News','email_template','A new news article has been posted to your website. The details are as follows:\r\nTitle: {$title}\r\nIP Address: {$ipaddress}\r\nSummary: {$summary|strip_tags}\r\nPost Date: {$postdate|date_format}\r\nStart Date: {$startdate|date_format}\r\nEnd Date: {$enddate|date_format}\r\n','2012-10-24 07:13:09','2012-10-29 04:33:02'),('MenuManager','MENU_rispa','{* parent -- True, если данный узел является родителем выбранной в данный момент страницы.\r\n current -- True, если данный узел является выбранной в данный момент страницей.\r\n depth -- Глубина (уровень) данного узла в текущем меню.\r\n prevdepth -- Глубина (уровень) узла, непосредственно предшествующего данному. *}\r\n\r\n{assign var=\'number_of_levels\' value=10000}\r\n{if isset($menuparams.number_of_levels)}\r\n {assign var=\'number_of_levels\' value=$menuparams.number_of_levels}\r\n{/if}\r\n\r\n{if $count > 0}\r\n <ul id=\"mainmenu\">\r\n {foreach from=$nodelist item=node}\r\n {if $node->depth > $node->prevdepth}\r\n {repeat string=\"<ul id=\'submenu\'>\" times=$node->depth-$node->prevdepth}\r\n {elseif $node->depth < $node->prevdepth}\r\n {repeat string=\"</li></ul>\" times=$node->prevdepth-$node->depth}\r\n </li>\r\n {elseif $node->index > 0} \r\n </li>\r\n {/if}\r\n\r\n {if $node->parent == true or $node->current == true}\r\n <li><a href=\"{$node->url}\" title=\"{$node->titleattribute}\">{$node->menutext}</a> {* первый пункт меню *}\r\n {elseif $node->children_exist == true and $node->depth < $number_of_levels and $node->type != \'sectionheader\' and $node->type != \'separator\'}\r\n <li><a style=\"white-space:nowrap\" href=\"{$node->url}\" title=\"{$node->titleattribute}\">{$node->menutext}</a> {* выпадалка меню и ссылка *}\r\n {elseif $node->current == true}\r\n <!-- <li class=\"currentpage\">{$node->menutext} -->\r\n {elseif $node->type == \'sectionheader\'}\r\n <!-- <li class=\"sectionheader\">{$node->menutext} -->\r\n {elseif $node->type == \'separator\'}\r\n <!-- <li style=\"list-style-type: none;\"> -->\r\n {else}\r\n <li><a href=\"{$node->url}\" title=\"{$node->titleattribute}\">{$node->menutext}</a>\r\n {/if}\r\n {/foreach}\r\n {repeat string=\"</li></ul>\" times=$node->depth-1}</li>\r\n </ul>\r\n{/if}','2012-10-24 07:45:36','2012-10-28 04:53:07');