вопрос
Здравствуйте.
На сайте установлен интернет-магазин, url думаю не нужен т.к. он ничего не даст.
Я добавил дополнительное поле "SEO текст" для категорий интернет-магазина.
Информация, которую вношу в поле - сохраняется и выводится на сайте.
Пытаюсь подключить к нему BB редактор - тут и проблема.
Подключаю так:
Содержимое файла /inc/include/seotext.php
Редактор выводится и работает:
Но на сайте также BB и выводится, как в редакторе. Т.е. не заменяется на html текст
Полное содержимое файла контроллера категорий
На сайте установлен интернет-магазин, url думаю не нужен т.к. он ничего не даст.
Я добавил дополнительное поле "SEO текст" для категорий интернет-магазина.
Информация, которую вношу в поле - сохраняется и выводится на сайте.
Пытаюсь подключить к нему BB редактор - тут и проблема.
Подключаю так:
include (ENGINE_DIR . '/inc/include/seotext.php');
Содержимое файла /inc/include/seotext.php
<?PHP
/*
=====================================================
DataLife Engine - by SoftNews Media Group
-----------------------------------------------------
http://dle-news.ru/
-----------------------------------------------------
Copyright (c) 2004,2013 SoftNews Media Group
=====================================================
Данный код защищен авторскими правами
=====================================================
Файл: inserttag.php
-----------------------------------------------------
Назначение: bbcodes
=====================================================
*/
if(!defined('DATALIFEENGINE'))
{
die("Hacking attempt!");
}
$i = 0;
$smiles = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr>";
$smilies = explode(",", $config['smilies']);
foreach($smilies as $smile) {
$i++; $smile = trim($smile);
$smiles .= "<td style=\"padding:2px;\" align=\"center\"><a href=\"#\" onClick=\"dle_smiley(':$smile:'); return false;\"><img style=\"border: none;\" alt=\"$smile\" src=\"".$config['http_home_url']."engine/data/emoticons/$smile.gif\" /></a></td>";
if ($i%4 == 0) $smiles .= "</tr><tr>";
}
$smiles .= "</tr></table>";
if ($user_group[$member_id['user_group']]['allow_image_upload']) {
$image_upload = "<div class=\"editor_button\" onclick=\"image_upload()\"><img title=\"$lang[bb_t_up]\" src=\"engine/skins/bbcodes/images/upload.gif\" width=\"23\" height=\"25\" border=\"0\"></div>";
} else $image_upload = "";
if ($mod != "editnews") {
$row['autor'] = $member_id['name'];
}
$p_name = urlencode($row['autor']);
$typograf = "<div id=\"b_typograf\" class=\"editor_button\" onclick=\"tag_typograf(); return false;\"><img title=\"$lang[bb_t_t]\" src=\"engine/skins/bbcodes/images/typograf.gif\" width=\"23\" height=\"25\" border=\"0\"></div>";
$image_align = array ();
$image_align[$config['image_align']] = "selected";
$parse = new ParseFilter( Array (), Array (), 1, 1 );
if ( $config['allow_admin_wysiwyg'] == "yes" ) $parse->allow_code = false;
$seotext = $parse->process( $_POST['seotext'] );
$seotext = $db->safesql( $parse->BB_Parse( $seotext, false ) );
$bb_js = <<<HTML
<SCRIPT type=text/javascript>
<!--
var uagent = navigator.userAgent.toLowerCase();
var is_safari = ( (uagent.indexOf('safari') != -1) || (navigator.vendor == "Apple Computer, Inc.") );
var is_opera = (uagent.indexOf('opera') != -1);
var is_ie = ( (uagent.indexOf('msie') != -1) && (!is_opera) && (!is_safari) );
var is_ie4 = ( (is_ie) && (uagent.indexOf("msie 4.") != -1) );
var is_win = ( (uagent.indexOf("win") != -1) || (uagent.indexOf("16bit") !=- 1) );
var ua_vers = parseInt(navigator.appVersion);
var text_enter_url = "$lang[bb_url]";
var text_enter_size = "$lang[bb_flash]";
var text_enter_flash = "$lang[bb_flash_url]";
var text_enter_page = "$lang[bb_page]";
var text_enter_url_name = "$lang[bb_url_name]";
var text_enter_page_name = "$lang[bb_page_name]";
var text_enter_image = "$lang[bb_image]";
var text_enter_email = "$lang[bb_email]";
var text_enter_list = "$lang[bb_list_item]";
var text_code = "$lang[bb_code]";
var text_quote = "$lang[bb_quote]";
var text_alt_image = "$lang[bb_alt_image]";
var error_no_url = "$lang[bb_no_url]";
var error_no_title = "$lang[bb_no_title]";
var error_no_email = "$lang[bb_no_email]";
var prompt_start = "$lang[bb_prompt_start]";
var img_title = "$lang[bb_img_title]";
var img_align = "{$lang['images_align']}";
var img_align_sel = "<select name='dleimagealign' id='dleimagealign' class='ui-widget-content ui-corner-all'><option value='' {$image_align[0]}>{$lang['opt_sys_no']}</option><option value='left' {$image_align['left']}>{$lang['images_left']}</option><option value='right' {$image_align['right']}>{$lang['images_right']}</option><option value='center' {$image_align['center']}>{$lang['images_center']}</option></select>";
var email_title = "$lang[bb_email_title]";
var dle_prompt = "$lang[p_prompt]";
var bb_t_emo = "{$lang['bb_t_emo']}";
var bb_t_col = "{$lang['bb_t_col']}";
var ie_range_cache = '';
var list_open_tag = '';
var list_close_tag = '';
var listitems = '';
var selField = "seotext";
var bbtags = new Array();
var fombj = document.forms[0];
function setFieldName(which)
{
if (which != selField)
{
selField = which;
}
}
function emoticon(theSmilie)
{
doInsert(" " + theSmilie + " ", "", false);
}
function pagebreak()
{
doInsert("{PAGEBREAK}", "", false);
}
function simpletag(thetag)
{
doInsert("[" + thetag + "]", "[/" + thetag + "]", true);
}
function pagelink()
{
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel = '$lang[bb_bb_page]';
}
DLEprompt(text_enter_page, "1", dle_prompt, function (r) {
var enterURL = r;
DLEprompt(text_enter_page_name, thesel, dle_prompt, function (r) {
doInsert("[page="+enterURL+"]"+r+"[/page]", "", false);
ie_range_cache = null;
});
});
}
function tag_url()
{
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel ='My Webpage';
}
DLEprompt(text_enter_url, "http://", dle_prompt, function (r) {
var enterURL = r;
DLEprompt(text_enter_url_name, thesel, dle_prompt, function (r) {
doInsert("[url="+enterURL+"]"+r+"[/url]", "", false);
ie_range_cache = null;
});
});
}
function tag_leech()
{
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel ='My Webpage';
}
DLEprompt(text_enter_url, "http://", dle_prompt, function (r) {
var enterURL = r;
DLEprompt(text_enter_url_name, thesel, dle_prompt, function (r) {
doInsert("[leech="+enterURL+"]"+r+"[/leech]", "", false);
ie_range_cache = null;
});
});
}
function tag_video()
{
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel ='http://';
}
DLEprompt(text_enter_url, thesel, dle_prompt, function (r) {
doInsert("[video="+r+"]", "", false);
ie_range_cache = null;
});
}
function tag_audio()
{
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel ='http://';
}
DLEprompt(text_enter_url, thesel, dle_prompt, function (r) {
doInsert("[audio="+r+"]", "", false);
ie_range_cache = null;
});
}
function tag_youtube()
{
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel ='http://';
}
DLEprompt(text_enter_url, thesel, dle_prompt, function (r) {
doInsert("[media="+r+"]", "", false);
ie_range_cache = null;
});
}
function tag_flash()
{
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel ='http://';
}
DLEprompt(text_enter_flash, thesel, dle_prompt, function (r) {
var enterURL = r;
DLEprompt(text_enter_size, "425,264", dle_prompt, function (r) {
doInsert("[flash="+r+"]"+enterURL+"[/flash]", "", false);
ie_range_cache = null;
});
});
}
function tag_list(type)
{
list_open_tag = type == 'ol' ? '[ol=1]\\n' : '[list]\\n';
list_close_tag = type == 'ol' ? '[/ol]' : '[/list]';
listitems = '';
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel ='';
}
insert_list( thesel );
}
function insert_list( thesel )
{
DLEprompt(text_enter_list, thesel, dle_prompt, function (r) {
if (r != '') {
listitems += '[*]' + r + '\\n';
insert_list('');
} else {
if( listitems )
{
doInsert(list_open_tag + listitems + list_close_tag, "", false);
ie_range_cache = null;
}
}
}, true);
}
function tag_image()
{
var thesel = get_sel(eval('fombj.'+ selField));
if (!thesel) {
thesel ='http://';
}
DLEimagePrompt(thesel, function (imageurl, imagealt, imagealign) {
var imgoption = "";
if (imagealt != "") {
imgoption = "|"+imagealt;
}
if (imagealign != "" && imagealign != "center") {
imgoption = imagealign+imgoption;
}
if (imgoption != "" ) {
imgoption = "="+imgoption;
}
if (imagealign == "center") {
doInsert("[center][img"+imgoption+"]"+imageurl+"[/img][/center]", "", false);
}
else {
doInsert("[img"+imgoption+"]"+imageurl+"[/img]", "", false);
}
ie_range_cache = null;
});
};
function DLEimagePrompt( d, callback ){
var b = {};
b[dle_act_lang[3]] = function() {
$(this).dialog("close");
};
b[dle_act_lang[2]] = function() {
if ( $("#dle-promt-text").val().length < 1) {
$("#dle-promt-text").addClass('ui-state-error');
} else {
var imageurl = $("#dle-promt-text").val();
var imagealt = $("#dle-image-alt").val();
var imagealign = $("#dleimagealign").val();
$(this).dialog("close");
$("#dlepopup").remove();
if( callback ) callback( imageurl, imagealt, imagealign );
}
};
$("#dlepopup").remove();
$("body").append("<div id='dlepopup' title='" + dle_prompt + "' style='display:none'><br />"+ text_enter_image +"<br /><input type='text' name='dle-promt-text' id='dle-promt-text' class='ui-widget-content ui-corner-all' style='width:97%; padding: .4em;' value='" + d + "'/><br /><br />"+ text_alt_image +"<br /><input type='text' name='dle-image-alt' id='dle-image-alt' class='ui-widget-content ui-corner-all' style='width:97%; padding: .4em;' value=''/><br /><br />"+img_align+" "+img_align_sel+"</div>");
$('#dlepopup').dialog({
autoOpen: true,
width: 500,
buttons: b
});
if (d.length > 0) {
$("#dle-promt-text").select().focus();
} else {
$("#dle-promt-text").focus();
}
};
function tag_email()
{
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel ='';
}
DLEprompt(text_enter_email, "", dle_prompt, function (r) {
var enterURL = r;
DLEprompt(email_title, thesel, dle_prompt, function (r) {
doInsert("[email="+enterURL+"]"+r+"[/email]", "", false);
ie_range_cache = null;
});
});
}
function doInsert(ibTag, ibClsTag, isSingle)
{
var isClose = false;
var obj_ta = eval('fombj.'+ selField);
if ( (ua_vers >= 4) && is_ie && is_win)
{
if (obj_ta.isTextEdit)
{
obj_ta.focus();
var sel = document.selection;
var rng = ie_range_cache ? ie_range_cache : sel.createRange();
rng.colapse;
if((sel.type == "Text" || sel.type == "None") && rng != null)
{
if(ibClsTag != "" && rng.text.length > 0)
ibTag += rng.text + ibClsTag;
else if(isSingle)
ibTag += rng.text + ibClsTag;
rng.text = ibTag;
}
}
else
{
obj_ta.value += ibTag + ibClsTag;
}
rng.select();
ie_range_cache = null;
}
else if ( obj_ta.selectionEnd != null)
{
var ss = obj_ta.selectionStart;
var st = obj_ta.scrollTop;
var es = obj_ta.selectionEnd;
var start = (obj_ta.value).substring(0, ss);
var middle = (obj_ta.value).substring(ss, es);
var end = (obj_ta.value).substring(es, obj_ta.textLength);
if(!isSingle) middle = "";
if (obj_ta.selectionEnd - obj_ta.selectionStart > 0)
{
middle = ibTag + middle + ibClsTag;
}
else
{
middle = ibTag + middle + ibClsTag;
}
obj_ta.value = start + middle + end;
var cpos = ss + (middle.length);
obj_ta.selectionStart = cpos;
obj_ta.selectionEnd = cpos;
obj_ta.scrollTop = st;
}
else
{
obj_ta.value += ibTag + ibClsTag;
}
obj_ta.focus();
return isClose;
}
function ins_color( buttonElement )
{
document.getElementById(selField).focus();
if ( is_ie )
{
document.getElementById(selField).focus();
ie_range_cache = document.selection.createRange();
}
$("#cp").remove();
$("body").append("<div id='cp' title='" + bb_t_col + "' style='display:none'><br /><iframe width=\"154\" height=\"104\" src=\"engine/skins/bbcodes/color.html\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"></iframe></div>");
$('#cp').dialog({
autoOpen: true,
width: 180
});
}
function setColor(color)
{
doInsert("[color=" +color+ "]", "[/color]", true );
$('#cp').dialog("close");
}
function ins_emo( buttonElement )
{
document.getElementById(selField).focus();
if ( is_ie )
{
document.getElementById(selField).focus();
ie_range_cache = document.selection.createRange();
}
$("#dle_emo").remove();
$("body").append("<div id='dle_emo' title='" + bb_t_emo + "' style='display:none'>"+ document.getElementById('dle_emos').innerHTML +"</div>");
var w = '300';
var h = 'auto';
if ( $('#dle_emos').width() >= 450 ) w = '505';
if ( $('#dle_emos').height() > 300 ) h = '340';
$('#dle_emo').dialog({
autoOpen: true,
width: w,
height: h
});
};
function dle_smiley ( text ){
doInsert(' ' + text + ' ', '', false);
$('#dle_emo').dialog("close");
ie_range_cache = null;
};
function image_upload()
{
if ( is_ie )
{
document.getElementById(selField).focus();
ie_range_cache = document.selection.createRange();
}
media_upload ( selField, '{$p_name}', '{$id}', 'no');
}
function insert_font(value, tag)
{
if (value == 0)
{
return;
}
doInsert("[" +tag+ "=" +value+ "]", "[/" +tag+ "]", true );
fombj.bbfont.selectedIndex = 0;
fombj.bbsize.selectedIndex = 0;
}
function tag_typograf()
{
ShowLoading('');
$.post("engine/ajax/typograf.php", { txt: document.getElementById( selField ).value}, function(data){
HideLoading('');
$('#' + selField).val(data);
});
}
function get_sel(obj)
{
if (document.selection)
{
if ( is_ie )
{
document.getElementById(selField).focus();
ie_range_cache = document.selection.createRange();
}
var s = document.selection.createRange();
if (s.text)
{
return s.text;
}
}
else if (typeof(obj.selectionStart)=="number")
{
if (obj.selectionStart!=obj.selectionEnd)
{
var start = obj.selectionStart;
var end = obj.selectionEnd;
return (obj.value.substr(start,end-start));
}
}
return false;
};
-->
</SCRIPT>
HTML;
$bb_panel = <<<HTML
<div style="width:98%; height:50px; border:1px solid #BBB; background-image:url('engine/skins/bbcodes/images/bg.gif');">
<div id="b_b" class="editor_button" onclick="simpletag('b')"><img title="$lang[bb_t_b]" src="engine/skins/bbcodes/images/b.gif" width="23" height="25" border="0"></div>
<div id="b_i" class="editor_button" onclick="simpletag('i')"><img title="$lang[bb_t_i]" src="engine/skins/bbcodes/images/i.gif" width="23" height="25" border="0"></div>
<div id="b_u" class="editor_button" onclick="simpletag('u')"><img title="$lang[bb_t_u]" src="engine/skins/bbcodes/images/u.gif" width="23" height="25" border="0"></div>
<div id="b_s" class="editor_button" onclick="simpletag('s')"><img title="$lang[bb_t_s]" src="engine/skins/bbcodes/images/s.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div class="editor_button" onclick=tag_image()><img title="$lang[bb_b_img]" src="engine/skins/bbcodes/images/image.gif" width="23" height="25" border="0"></div>
{$image_upload}
<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div id="b_emo" class="editor_button" onclick="ins_emo(this);" style="width:33px;" align="center"><img title="$lang[bb_t_emo]" src="engine/skins/bbcodes/images/emo.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div class="editor_button" onclick="tag_url()"><img title="$lang[bb_t_url]" src="engine/skins/bbcodes/images/link.gif" width="23" height="25" border="0"></div>
<div class="editor_button" onclick="tag_leech()"><img title="$lang[bb_t_leech]" src="engine/skins/bbcodes/images/leech.gif" width="23" height="25" border="0"></div>
<div class="editor_button" onclick="tag_email()"><img title="$lang[bb_t_m]" src="engine/skins/bbcodes/images/email.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div class="editor_button" onclick="tag_video()"><img title="$lang[bb_t_video]" src="engine/skins/bbcodes/images/mp.gif" width="23" height="25" border="0"></div>
<div class="editor_button" onclick="tag_audio()"><img title="$lang[bb_t_audio]" src="engine/skins/bbcodes/images/mp3.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div id="b_hide" class="editor_button" onclick="simpletag('hide')"><img title="$lang[bb_t_hide]" src="engine/skins/bbcodes/images/hide.gif" width="23" height="25" border="0"></div>
<div id="b_quote" class="editor_button" onclick="simpletag('quote')"><img title="$lang[bb_t_quote]" src="engine/skins/bbcodes/images/quote.gif" width="23" height="25" border="0"></div>
<div id="b_code" class="editor_button" onclick="simpletag('code')"><img title="$lang[bb_t_code]" src="engine/skins/bbcodes/images/code.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div class="editor_button" onclick="pagebreak()"><img title="$lang[bb_t_br]" src="engine/skins/bbcodes/images/pbreak.gif" width="23" height="25" border="0"></div>
<div class="editor_button" onclick="pagelink()"><img title="$lang[bb_t_p]" src="engine/skins/bbcodes/images/page.gif" width="23" height="25" border="0"></div>
<div><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div class="editor_button" style="padding-top:3px;width:140px;"><select name="bbfont" onchange="insert_font(this.options[this.selectedIndex].value, 'font')"><option value='0'>{$lang['bb_t_font']}</option><option value='Arial'>Arial</option><option value='Arial Black'>Arial Black</option><option value='Century Gothic'>Century Gothic</option><option value='Courier New'>Courier New</option><option value='Georgia'>Georgia</option><option value='Impact'>Impact</option><option value='System'>System</option><option value='Tahoma'>Tahoma</option><option value='Times New Roman'>Times New Roman</option><option value='Verdana'>Verdana</option></select></div>
<div class="editor_button" style="padding-top:3px;width:70px;"><select name="bbsize" onchange="insert_font(this.options[this.selectedIndex].value, 'size')"><option value='0'>{$lang['bb_t_size']}</option><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option></select></div>
<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div id="b_left" class="editor_button" onclick="simpletag('left')"><img title="$lang[bb_t_l]" src="engine/skins/bbcodes/images/l.gif" width="23" height="25" border="0"></div>
<div id="b_center" class="editor_button" onclick="simpletag('center')"><img title="$lang[bb_t_c]" src="engine/skins/bbcodes/images/c.gif" width="23" height="25" border="0"></div>
<div id="b_right"class="editor_button" onclick="simpletag('right')"><img title="$lang[bb_t_r]" src="engine/skins/bbcodes/images/r.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div id="b_color" class="editor_button" onclick="ins_color(this);"><img title="$lang[bb_t_color]" src="engine/skins/bbcodes/images/color.gif" width="23" height="25" border="0"></div>
<div id="b_spoiler" class="editor_button" onclick="simpletag('spoiler')"><img title="$lang[bb_t_spoiler]" src="engine/skins/bbcodes/images/spoiler.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div id="b_flash" class="editor_button" onclick="tag_flash()"><img title="$lang[bb_t_flash]" src="engine/skins/bbcodes/images/flash.gif" width="23" height="25" border="0"></div>
<div id="b_youtube" class="editor_button" onclick="tag_youtube()"><img title="$lang[bb_t_youtube]" src="engine/skins/bbcodes/images/youtube.gif" width="23" height="25" border="0"></div>
{$typograf}
<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div id="b_list" class="editor_button" onclick="tag_list('list')"><img title="$lang[bb_t_list1]" src="engine/skins/bbcodes/images/list.gif" width="23" height="25" border="0"></div>
<div id="b_ol" class="editor_button" onclick="tag_list('ol')"><img title="$lang[bb_t_list2]" src="engine/skins/bbcodes/images/ol.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
</div>
<div id="dle_emos" style="display: none;" title="{$lang['bb_t_emo']}"><div style="overflow: auto;">{$smiles}</div></div>
HTML;
$bb_code = $bb_js.$bb_panel;
?>
Редактор выводится и работает:
Но на сайте также BB и выводится, как в редакторе. Т.е. не заменяется на html текст
Полное содержимое файла контроллера категорий
<?php
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {
die( "Hacking attempt!" );
}
require_once ENGINE_DIR . '/shop.php';
$access=FALSE;
foreach(unserialize(urldecode($sconfig["cat_tovar"])) as $k=>$v)
{
if($v=="all") {
$access=TRUE;break;
} if($v==$member_id['user_group']) {
$access=TRUE;break;
}
}
if($access===FALSE)
msg( "error", $lang_shop['access_denied'], $lang_shop['access_denied_f'] );
require_once ENGINE_DIR . '/modules/shop/classes/functions.shop.php';
include_once ENGINE_DIR . '/classes/parse.class.php';
include_once ENGINE_DIR.'/classes/thumb.class.php';
$result = "";
//Notice
if(isset($_REQUEST['catid']))
$_REQUEST['catid']= intval( $_REQUEST['catid'] );
else
$_REQUEST['catid']=0;
$catid = intval( $_REQUEST['catid'] );
if( ! $user_group[$member_id['user_group']]['admin_categories'] ) {
msg( "error", $lang['index_denied'], $lang['cat_perm'] );
}
function makeDropDown($options,$selected) {
$output = "<select size=1 name=\"sort\">\r\n";
foreach ( $options as $value => $description ) {
$output .= "<option value=\"$value\"";
if( $selected == $value ) {
$output .= " selected ";
}
$output .= ">$description</option>\n";
}
$output .= "</select>";
return $output;
}
function get_sub_cats($id, $subcategory = false) {
global $shop_cat;
$subfound = array ();
if( ! $subcategory ) {
$subcategory = array ();
$subcategory[] = $id;
}
foreach ( $shop_cat as $cats ) {
if( $cats['parentid'] == $id ) {
$subfound[] = $cats['id'];
}
}
foreach ( $subfound as $parentid ) {
$subcategory[] = $parentid;
$subcategory = get_sub_cats( $parentid, $subcategory );
}
return $subcategory;
}
if( $action == "add" ) {
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
die( "Hacking attempt! User not found" );
}
$quotes = array ("\x27", "\x22", "\x60", "\t", "\n", "\r" );
if( $_POST['cat_icon'] == $lang['cat_icon'] ) {
$_POST['cat_icon'] = "";
}
$order = is_numeric($_POST['order']) ? $_POST['order'] : 0;
$cat_name = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['cat_name'] ) ), ENT_QUOTES) );
$cat_icon = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['cat_icon']) ), ENT_QUOTES) );
$alt_cat_name = totranslit( stripslashes( $_POST['alt_cat_name'] ) );
if( ! $cat_name ) {
msg( "error", $lang['cat_error'], $lang['cat_ername'], "javascript:history.go(-1)" );
}
if( ! $alt_cat_name ) {
msg( "error", $lang['cat_error'], $lang['cat_erurl'], "javascript:history.go(-1)" );
}
if ( in_array($_POST['sort'], array("rating", "upprice", "downprice", "nosort")) ) {
$sort = $db->safesql( $_POST['sort'] );
} else $sort = "nosort";
if ( $_POST['category'] > 0)
$category = intval( $_POST['category'] );
else $category = 0;
$meta_title = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['meta_title'] ) ) ) );
$seoh1 = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['seoh1'] ) ) ) );
$seotext = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['seotext'] ) ) ) );
$description = $db->safesql( substr( strip_tags( stripslashes( $_POST['descr'] ) ), 0, 200 ) );
$keywords = $db->safesql( str_replace( $quotes, " ", strip_tags( stripslashes( $_POST['keywords'] ) ) ) );
$sql_result = $db->query( "SELECT alt_name FROM " . PREFIX . "_shopcat" );
while ( $row = $db->get_row( $sql_result ) )
if( $row['alt_name'] == $alt_cat_name ) {
msg( "error", $lang['cat_error'], $lang['cat_eradd'], "?mod=shopcat" );
}
$db->query( "INSERT INTO " . PREFIX . "_shopcat (parentid, name, alt_name, icon, descr, keywords, sort, metatitle, seoh1, seotext, `order`) values ('$category', '$cat_name', '$alt_cat_name', '$cat_icon', '$description', '$keywords', '$sort', '$meta_title', '$seoh1', '$seotext', '$order')" );
@unlink( ENGINE_DIR . '/cache/system/shopcat.php' );
clear_cache();
msg( "info", $lang['cat_addok'], $lang['cat_addok_1'], "?mod=shopcat" );
}
elseif( $action == "remove" ) {
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
die( "Hacking attempt! User not found" );
}
function DeleteSubcategories($parentid) {
global $db;
$subcategories = $db->query( "SELECT id FROM " . PREFIX . "_shopcat WHERE parentid = '$parentid'" );
while ( $subcategory = $db->get_row( $subcategories ) ) {
DeleteSubcategories( $subcategory['id'] );
$db->query( "DELETE FROM " . PREFIX . "_shopcat WHERE id = '" . $subcategory['id'] . "'" );
}
}
if( ! $catid ) {
msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=shopcat" );
}
$row = $db->super_query( "SELECT count(*) as count FROM " . PREFIX . "_tovar WHERE category regexp '[[:<:]]($catid)[[:>:]]'" );
if( $row['count'] ) {
if( is_array( $_REQUEST['new_category'] ) ) {
if( ! in_array( $catid, $new_category ) ) {
$category_list = $db->safesql( htmlspecialchars( strip_tags( stripslashes( implode( ',', $_REQUEST['new_category']))), ENT_QUOTES ) );
$db->query( "UPDATE " . PREFIX . "_tovar set category='$category_list' WHERE category regexp '[[:<:]]($catid)[[:>:]]'" );
$db->query( "DELETE FROM " . PREFIX . "_shopcat WHERE id='$catid'" );
DeleteSubcategories( $catid );
@unlink( ENGINE_DIR . '/cache/system/shopcat.php' );
clear_cache();
msg( "info", $lang['cat_delok'], $lang['cat_delok_1'], "?mod=shopcat" );
}
}
msg( "info", $lang['all_info'], "<form action=\"\" method=\"post\">{$lang['comm_move']} <select name=\"new_category[]\" class=\"cat_select\" align=\"absmiddle\" multiple>" . CategoryTovarSelection( 0, 0 ) . "</select> <input class=\"edit\" type=\"submit\" value=\"{$lang['b_start']}\"></form>", "$PHP_SELF?mod=shopcat" );
} else {
$db->query( "DELETE FROM " . PREFIX . "_shopcat WHERE id='$catid'" );
DeleteSubcategories( $catid );
@unlink( ENGINE_DIR . '/cache/system/shopcat.php' );
clear_cache();
msg( "info", $lang['cat_delok'], $lang['cat_delok_1'], "?mod=shopcat" );
}
}
elseif( $action == "edit" ) {
echoheader( "options", $lang['cat_head'] );
$catid = intval( $_GET['catid'] );
if( ! $catid ) {
msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=shopcat" );
}
$row = $db->super_query( "SELECT * FROM " . PREFIX . "_shopcat WHERE id = '$catid'" );
if( ! $row['id'] ) msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=shopcat" );
$categorylist = CategoryTovarSelection( $row['parentid'], 0 );
$row['name'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['name'] ) );
$row['order'] = is_numeric($row['order']) ? $row['order'] : 0;
$row['metatitle'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['metatitle'] ) );
$row['seoh1'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['seoh1'] ) );
$row['seotext'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['seotext'] ) );
$row['descr'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['descr'] ) );
$row['keywords'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['keywords'] ) );
$row['sort'] = makeDropDown( array ("rating" => "По рейтингу",
"upprice" => "Возрастанию цены",
"downprice" => "Убыванию цены",
"nosort" => "Не сортировать"), $row['sort'],$row['sort']);
echo <<<HTML
<style>
.hardcore { background: #fff; border: 5px solid #EFEFEF; padding: 10px; margin: 6px 4px 4px 2px; height: 30px; overflow: hidden; color: #EFEFEF; position: relative; }
.hardcore:hover { border-color: #DFE8EC; color: #DFE8EC; }
.hardcore a { padding: 6px 12px; margin-right: 10px; border: 2px solid #EFEFEF; background: #FCFCFC; display: block; float: left; font-size: 14px; line-height: 14px; text-decoration: none; }
.hardcore span { padding: 6px 12px; margin-right: 10px; border: 2px solid #F2F2F2; background: #FCFCFC; display: block; float: left; font-size: 14px; line-height: 14px; color: #AFAFAF; }
.hardcore a:hover { border-color: #FFE5B1; background: #FFF6E4; }
.hardcore .active { border-color: #FFE5B1; background: #FFF6E4; color: #D1A656; text-shadow: 1px 1px 0 #fff; }
.hardcore h2 { font-size: 80px; width: 480px; position: absolute; top: -16px; right: -28px; padding: 0; margin: 0; }
.addstation td { padding: 3px 0; }
.addstation td input[type="text"] { margin-bottom: 2px; padding: 2px 2px; }
.small { font-size: 10px; }
.small b { color: #5273BA; }
.submit { padding: 4px 10px 3px; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border: 1px solid #BABABA; cursor: pointer; font-size: 13px; color: #111; margin: 10px 0; text-shadow: 0 1px 0 #fff; background: #fefefe; background: -moz-linear-gradient(top, #fefefe 0%, #f1f1f1 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fefefe), color-stop(100%,#f1f1f1)); background: -webkit-linear-gradient(top, #fefefe 0%,#f1f1f1 100%); background: -o-linear-gradient(top, #fefefe 0%,#f1f1f1 100%); background: -ms-linear-gradient(top, #fefefe 0%,#f1f1f1 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fefefe', endColorstr='#f1f1f1',GradientType=0 ); background: linear-gradient(top, #fefefe 0%,#f1f1f1 100%); }
.submit:hover { background: #fefefe; background: -moz-linear-gradient(top, #fefefe 0%, #E0E0E0 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fefefe), color-stop(100%,#E0E0E0)); background: -webkit-linear-gradient(top, #fefefe 0%,#E0E0E0 100%); background: -o-linear-gradient(top, #fefefe 0%,#E0E0E0 100%); background: -ms-linear-gradient(top, #fefefe 0%,#E0E0E0 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fefefe', endColorstr='#E0E0E0',GradientType=0 ); background: linear-gradient(top, #fefefe 0%,#E0E0E0 100%); }
.submit:active { background: #f1f1f1; background: -moz-linear-gradient(top, #f1f1f1 0%, #fefefe 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f1f1f1), color-stop(100%,#fefefe)); background: -webkit-linear-gradient(top, #f1f1f1 0%,#fefefe 100%); background: -o-linear-gradient(top, #f1f1f1 0%,#fefefe 100%); background: -ms-linear-gradient(top, #f1f1f1 0%,#fefefe 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f1f1f1', endColorstr='#fefefe',GradientType=0 ); background: linear-gradient(top, #f1f1f1 0%,#fefefe 100%); }
tr.bj:hover { background: #F2F2F2; }
sup { color: red; }
label { cursor: pointer; }
</style>
<div class="hardcore"><h2>Магазин</h2>
<a href="$PHP_SELF?mod=optionsshop" >Вернуться в главное меню магазина</a></div><form method="post" action="">
<div style="padding-top:5px;padding-bottom:2px;">
<table width="100%">
<tr>
<td width="4"><img src="engine/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
<td background="engine/skins/images/tl_oo.gif"><img src="engine/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
<td width="6"><img src="engine/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
</tr>
<tr>
<td background="engine/skins/images/tl_lb.gif"><img src="engine/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
<td style="padding:5px;" bgcolor="#FFFFFF">
<table width="100%">
<tr>
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['cat_edit']}</div></td>
</tr>
</table>
<div class="unterline"></div>
<table width="100%">
<tr>
<td width="260" style="padding:4px;">{$lang['cat_name']}</td>
<td><input class="edit" value="{$row['name']}" type="text" name="cat_name"><a href="#" class="hintanchor" onMouseover="showhint('{$lang['hint_catname']}', this, event, '250px')">[?]</a></td>
</tr>
<tr>
<td style="padding:4px;">{$lang['cat_url']}</td>
<td><input class="edit" value="{$row['alt_name']}" type="text" name="alt_cat_name"><a href="#" class="hintanchor" onMouseover="showhint('{$lang['hint_cataltname']}', this, event, '250px')">[?]</a></td>
</tr>
<tr>
<td style="padding:4px;">{$lang['cat_addicon']}</td>
<td><input class="edit" value="{$row['icon']}" type="text" name="cat_icon"><a href="#" class="hintanchor" onMouseover="showhint('{$lang['hint_caticon']}', this, event, '250px')">[?]</a></td>
</tr>
<tr>
<td style="padding:4px;">{$lang['meta_title']}</td>
<td><input type="text" name="meta_title" style="width:345px;" value="{$row['metatitle']}" class="edit"> ({$lang['meta_descr_max']})</td>
</tr>
<tr>
<td style="padding:4px;">{$lang['meta_descr_cat']}</td>
<td><input type="text" name="descr" style="width:345px;" value="{$row['descr']}" class="edit"> ({$lang['meta_descr_max']})</td>
</tr>
<tr>
<td style="padding:4px;">{$lang['meta_keys']}</td>
<td><textarea name="keywords" style="width:345px;height:50px;">{$row['keywords']}</textarea></td>
</tr>
<link rel="stylesheet" type="text/css" href="engine/skins/chosen/chosen.css"/>
<script type="text/javascript" src="engine/skins/chosen/chosen.js"></script>
<tr>
<td style="padding:10px 4px 4px 4px;">H1 Текст</td>
<td><input type="text" name="seoh1" style="width:345px;" value="{$row['seoh1']}" class="edit"></td>
</tr>
<script type="text/javascript" src="engine/ajax/dle_ajax.js"></script>
HTML;
include (ENGINE_DIR . '/inc/include/seotext.php');
echo <<<HTML
<tr>
<td height="29" width="140" style="padding-left:5px;">{$lang_shop["short"]}</td>
<td>
{$bb_code}
<textarea rows="10" style="width:98%; padding:0px;" onclick="setFieldName(this.name)" name="seotext" id="seotext">{$row['seotext']}</textarea>
</td>
</tr>
HTML;
echo <<<HTML
<tr>
<td style="padding:4px;">{$lang['cat_parent']}</td>
<td><select name="parentid" >{$categorylist}</select></td>
</tr>
<tr>
<td style="padding:4px;">{$lang['opt_sys_sort']}</td>
<td>{$row['sort']}</td>
</tr>
<tr>
<td style="padding:4px;">{$lang['cat_order_f']}</td>
<td><input name='order' value="{$row['order']}" /></td>
</tr>
</tr>
<tr>
<td colspan="2"><div class="hr_line"></div></td>
</tr>
<tr>
<td style="padding:4px;"> </td>
<td><input type="submit" class="buttons" value="{$lang['vote_edit']}">
<input type=hidden name=action value=doedit>
<input type="hidden" name="user_hash" value="$dle_login_hash" />
<input type=hidden name=catid value=$row[id]>
</tr>
</table>
</td>
<td background="engine/skins/images/tl_rb.gif"><img src="engine/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
</tr>
<tr>
<td><img src="engine/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
<td background="engine/skins/images/tl_ub.gif"><img src="engine/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
<td><img src="engine/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
</tr>
</table>
</div></form>
HTML;
echofooter();
die();
}
elseif( $action == "doedit" ) {
$quotes = array ("\x27", "\x22", "\x60", "\t", "\n", "\r", '"' );
$order = is_numeric($_POST['order']) ? $_POST['order'] : 0;
$cat_name = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['cat_name'] ) ), ENT_QUOTES) );
$skin_name = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['skin_name']) ), ENT_QUOTES) );
$cat_icon = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['cat_icon']) ), ENT_QUOTES) );
$alt_cat_name = totranslit( stripslashes( $_POST['alt_cat_name'] ) );
$catid = intval( $_POST['catid'] );
$parentid = intval( $_POST['parentid'] );
$meta_title = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['meta_title'] ) ) ) );
$seoh1 = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['seoh1'] ) ) ) );
$seotext = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['seotext'] ) ) ) );
$description = $db->safesql( substr( strip_tags( stripslashes( $_POST['descr'] ) ), 0, 200 ) );
$keywords = $db->safesql( str_replace( $quotes, " ", strip_tags( stripslashes( $_POST['keywords'] ) ) ) );
if ( in_array($_POST['sort'], array("rating", "upprice", "downprice", "nosort")) ) {
$sort = $db->safesql( $_POST['sort'] );
} else $sort = "nosort";
if( ! $catid ) {
msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=shopcat" );
}
if( $cat_name == "" ) {
msg( "error", $lang['cat_error'], $lang['cat_noname'], "javascript:history.go(-1)" );
}
$row = $db->super_query( "SELECT id, alt_name FROM " . PREFIX . "_shopcat WHERE alt_name = '$alt_cat_name'" );
if( $row['id'] and $row['id'] != $catid ) {
msg( "error", $lang['cat_error'], $lang['cat_eradd'], "javascript:history.go(-1)" );
}
if( in_array( $parentid, get_sub_cats( $catid ) ) ) {
msg( "error", $lang['cat_error'], $lang['cat_noparentid'], "$PHP_SELF?mod=shopcat" );
}
$db->query( "UPDATE " . PREFIX . "_shopcat set parentid='$parentid', name='$cat_name', alt_name='$alt_cat_name', icon='$cat_icon', descr='$description', keywords='$keywords', sort='$sort', metatitle='$meta_title', seoh1='$seoh1', seotext='$seotext', `order` = '$order' WHERE id='$catid'" );
@unlink( ENGINE_DIR . '/cache/system/shopcat.php' );
clear_cache();
msg( "info", $lang['cat_editok'], $lang['cat_editok_1'], "$PHP_SELF?mod=shopcat" );
}
echoheader( "options", "Категории для товаров" );
$categorylist = CategoryTovarSelection( 0, 0 );
echo <<<HTML
<style>
.hardcore { background: #fff; border: 5px solid #EFEFEF; padding: 10px; margin: 6px 4px 4px 2px; height: 30px; overflow: hidden; color: #EFEFEF; position: relative; }
.hardcore:hover { border-color: #DFE8EC; color: #DFE8EC; }
.hardcore a { padding: 6px 12px; margin-right: 10px; border: 2px solid #EFEFEF; background: #FCFCFC; display: block; float: left; font-size: 14px; line-height: 14px; text-decoration: none; }
.hardcore span { padding: 6px 12px; margin-right: 10px; border: 2px solid #F2F2F2; background: #FCFCFC; display: block; float: left; font-size: 14px; line-height: 14px; color: #AFAFAF; }
.hardcore a:hover { border-color: #FFE5B1; background: #FFF6E4; }
.hardcore .active { border-color: #FFE5B1; background: #FFF6E4; color: #D1A656; text-shadow: 1px 1px 0 #fff; }
.hardcore h2 { font-size: 80px; width: 480px; position: absolute; top: -16px; right: -28px; padding: 0; margin: 0; }
.addstation td { padding: 3px 0; }
.addstation td input[type="text"] { margin-bottom: 2px; padding: 2px 2px; }
.small { font-size: 10px; }
.small b { color: #5273BA; }
.submit { padding: 4px 10px 3px; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border: 1px solid #BABABA; cursor: pointer; font-size: 13px; color: #111; margin: 10px 0; text-shadow: 0 1px 0 #fff; background: #fefefe; background: -moz-linear-gradient(top, #fefefe 0%, #f1f1f1 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fefefe), color-stop(100%,#f1f1f1)); background: -webkit-linear-gradient(top, #fefefe 0%,#f1f1f1 100%); background: -o-linear-gradient(top, #fefefe 0%,#f1f1f1 100%); background: -ms-linear-gradient(top, #fefefe 0%,#f1f1f1 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fefefe', endColorstr='#f1f1f1',GradientType=0 ); background: linear-gradient(top, #fefefe 0%,#f1f1f1 100%); }
.submit:hover { background: #fefefe; background: -moz-linear-gradient(top, #fefefe 0%, #E0E0E0 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fefefe), color-stop(100%,#E0E0E0)); background: -webkit-linear-gradient(top, #fefefe 0%,#E0E0E0 100%); background: -o-linear-gradient(top, #fefefe 0%,#E0E0E0 100%); background: -ms-linear-gradient(top, #fefefe 0%,#E0E0E0 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fefefe', endColorstr='#E0E0E0',GradientType=0 ); background: linear-gradient(top, #fefefe 0%,#E0E0E0 100%); }
.submit:active { background: #f1f1f1; background: -moz-linear-gradient(top, #f1f1f1 0%, #fefefe 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f1f1f1), color-stop(100%,#fefefe)); background: -webkit-linear-gradient(top, #f1f1f1 0%,#fefefe 100%); background: -o-linear-gradient(top, #f1f1f1 0%,#fefefe 100%); background: -ms-linear-gradient(top, #f1f1f1 0%,#fefefe 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f1f1f1', endColorstr='#fefefe',GradientType=0 ); background: linear-gradient(top, #f1f1f1 0%,#fefefe 100%); }
tr.bj:hover { background: #F2F2F2; }
sup { color: red; }
label { cursor: pointer; }
</style>
<div class="hardcore"><h2>Магазин</h2>
<a href="$PHP_SELF?mod=optionsshop" >Вернуться в главное меню магазина</a></div>
<form method="post" action="">
<div style="padding-top:5px;padding-bottom:2px;">
<table width="100%">
<tr>
<td width="4"><img src="engine/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
<td background="engine/skins/images/tl_oo.gif"><img src="engine/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
<td width="6"><img src="engine/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
</tr>
<tr>
<td background="engine/skins/images/tl_lb.gif"><img src="engine/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
<td style="padding:5px;" bgcolor="#FFFFFF">
<table width="100%">
<tr>
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['cat_add']}</div></td>
</tr>
</table>
<div class="unterline"></div>
<table width="100%">
<tr>
<td width="260" style="padding:4px;">{$lang['cat_name']}</td>
<td><input class="edit" type="text" name="cat_name"><a href="#" class="hintanchor" onMouseover="showhint('{$lang['hint_catname']}', this, event, '250px')">[?]</a></td>
</tr>
<tr>
<td style="padding:4px;">{$lang['cat_url']}</td>
<td><input class="edit" type="text" name="alt_cat_name"><a href="#" class="hintanchor" onMouseover="showhint('{$lang['hint_cataltname']}', this, event, '250px')">[?]</a></td>
</tr>
<tr>
<td style="padding:4px;">{$lang['cat_addicon']}</td>
<td><input class="edit" onFocus="this.select()" value="$lang[cat_icon]" type="text" name="cat_icon"><a href="#" class="hintanchor" onMouseover="showhint('{$lang['hint_caticon']}', this, event, '250px')">[?]</a></td>
</tr>
<t
Ответил: Kane
Найти:
После вставить:
Найти два раза:
Заменить на
include_once ENGINE_DIR . '/classes/parse.class.php';
После вставить:
$parse = new ParseFilter();
Найти два раза:
$seotext = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['seotext'] ) ) ) );
Заменить на
if ( !$user_group[$member_id['user_group']]['allow_html'] ) {
$_POST['seotext'] = strip_tags ($_POST['seotext']);
}
if ( $config['allow_admin_wysiwyg'] ) $parse->allow_code = false;
$seotext = $parse->process( $_POST['seotext'] );
if( $config['allow_admin_wysiwyg'] ) {
$seotext = $db->safesql( $parse->BB_Parse( $seotext ) );
} else {
$seotext = $db->safesql( $parse->BB_Parse( $seotext, false ) );
}