вопрос
В спойлере код от модуля Profile Reviews v 1.33 (Стена). Почему то в браузере от google не работают кнопки bbcode, не происходит ни каких действий... Не появляются всплывающие окна, не вставляются смайлы. В Opera и Мазиле все работает.
<?php
define("ENGINE_DIR", "../..");
define("DATALIFEENGINE", true);
include (ENGINE_DIR . "/modules/wall/config.php");
if ($reviews_cg["AllowModOn"] != "off") {
@session_start();
@error_reporting(7);
@ini_set("display_errors", true);
@ini_set("html_errors", true);
define("ROOT_DIR", "../../..");
require_once (ENGINE_DIR . "/data/config.php");
require_once (ROOT_DIR . "/language/" . $config['langs'] . "/website.lng");
require_once (ROOT_DIR . "/language/" . $config['langs'] . "/wall.lng");
require_once (ENGINE_DIR . "/classes/mysql.php");
require_once (ENGINE_DIR . "/data/dbconfig.php");
require_once (ENGINE_DIR . "/modules/functions.php");
require_once (ENGINE_DIR . "/modules/sitelogin.php");
require_once ENGINE_DIR . '/classes/parse.class.php';
$_REQUEST['skin'] = totranslit($_REQUEST['skin'], false, false);
$Skin = (@is_dir(ROOT_DIR . "/templates/" . $_REQUEST['skin']) && $_REQUEST['skin']) ? $_REQUEST['skin'] : $config['skin'];
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
@header("Content-type: text/html; charset=" . $config['charset']);
@header("pragma-cache: no-cache");
$chat_cfg['format_date'] = "j F Y";
function ShowDateUr($format, $time_add)
{
global $langdate, $config, $lang;
$today = strtotime(date("Y-m-d.", time() + ($config['date_adjust'] * 60)));
if ($time_add > $today) return $lang['lang_wall_15'] . date("H:i:s", $time_add);
elseif ($time_add > ($today - 86400)) return $lang["lang_wall_16"] . date("H:i:s", $time_add);
else return @strtr(@date($format, $time_add), $langdate);
}
function close_tags($content)
{
$position = 0;
$open_tags = array();
$ignored_tags = array(
'br',
'hr',
'+',
'img'
);
while (($position = strpos($content, '<', $position)) !== false)
{
if (preg_match("|^<(/?)([a-z\d]+)\b[^>]*>|i", substr($content, $position), $match)) {
$tag = strtolower($match[2]);
if (in_array($tag, $ignored_tags) == false) {
if (isset($match[1]) and $match[1] == '') {
if (isset($open_tags[$tag])) $open_tags[$tag]++;
else $open_tags[$tag] = 1;
}
if (isset($match[1]) and $match[1] == '/') {
if (isset($open_tags[$tag])) $open_tags[$tag]--;
}
}
$position += strlen($match[0]);
}
else $position++;
}
foreach ($open_tags as $tag => $count_not_closed)
{
$content .= str_repeat("</{$tag}>", $count_not_closed);
}
return $content;
}
if ($_POST['ajaxur'] == 1) {
if (!function_exists("CharsetConvert")) {
function CharsetConvert($text, $to = "auto")
{
global $config;
if (version_compare($config['version_id'], "7.5", "<")) return convert_unicode($text);
$text = stripslashes($text);
$charset = mb_detect_encoding($text, "utf-8,windows-1251");
if ($to == "auto") $to = $config['charset'];
if ($charset != $to && $to != "") $text = iconv($charset, $to . "//IGNORE", $text);
return $text;
}
}
if (!$is_logged) die($lang["lang_wall_1"]);
$UserID = intval($member_id['user_id']);
$UserName = stripslashes($member_id['name']);
if ($_POST['add'] == 1) {
$text = trim(htmlspecialchars(CharsetConvert(stripslashes($_POST['text']))));
if ($reviews_cg['AllowSpam'] == "on" && $member_id['user_group'] != 1) {
$whiteList=explode(", ", $reviews_cg['TrueSite']);
preg_match_all( "#(?<!\])\bhttp://([^\s\[<]+)#i", $text, $links, PREG_PATTERN_ORDER );
$badLinks = array();
foreach( $links[1] as $key => $link ) {
foreach( $whiteList as $whiteLink ) {
$hasBad = strpos( str_replace( 'www.', '', $link ), $whiteLink ) !== 0 ? true : false;
if( !$hasBad ) break;
}
if( $hasBad ) $badLinks[] = $links[0][$key];
}
if(count( $badLinks ) > 0){
die($lang["lang_wall_8"]);
}
}
if ($reviews_cg['AllowFlud'] == "on" && $member_id['user_group'] != 1) {
if (strlen($text) < $reviews_cg['MinReviewText']) die($lang["lang_wall_2"]);
if (isset($_COOKIE['time']) && ($_COOKIE['time'] - time() < 15)) die($lang["lang_wall_3"]);
setcookie('time', time(), time() + 15);
}
if (strlen($text) > $reviews_cg['MaxReviewText']) die($lang["lang_wall_4"]);
$AddUserID = intval($_POST['user_id']);
if (!$AddUserID) die($lang["lang_wall_5"]);
if (($UserID == $AddUserID) && $reviews_cg['AllowAddMyProfile'] !== 'on') die($lang["lang_wall_6"]);
if ($reviews_cg['AllowManyAdd'] !== 'on') {
$query = $db->query("SELECT `id` FROM " . PREFIX . "_user_reviews WHERE `user_id`='{$AddUserID}' AND `author_id`='{$UserID}'");
if ($db->num_rows($query) > 0) die($lang["lang_wall_7"]);
}
$textin = $db->safesql($text);
$userGroup = $user_group[$member_id['user_group']]['group_name'];
$GroupPre = $user_group[$member_id['user_group']]['group_prefix'];
$GroupSuf = $user_group[$member_id['user_group']]['group_suffix'];
$date = date("Y-m-d H:i:s", (time() + ($config['date_adjust'] * 60)));
$SqlUserName = $db->safesql($UserName);
$ava = $db->super_query("SELECT foto FROM " . USERPREFIX . "_users WHERE name = '{$SqlUserName}'");
$photo = $ava['foto'];
$db->query("INSERT INTO " . PREFIX . "_user_reviews (`text`,`user_id`,`author`,`author_id`,`date`) VALUES ('{$textin}','{$AddUserID}','{$SqlUserName}','{$UserID}','{$date}')");
$id = $db->insert_id();
$parse = new ParseFilter;
$text = $parse->BB_Parse($text, false);
$textm = $db->safesql($text);
if (($UserID == $AddUserID) || ($reviews_cg['AllowPm'] == 'off')) {
}
else
{
$timese = time() + ($config['date_adjust'] * 60);
$cthozamen = array(
"{br}",
"{hr}",
"[quote]",
"[/quote]",
"[b]",
"[/b]",
"[i]",
"[/i]",
"[u]",
"[/u]"
);
$nacthozamen = array(
"<br />",
"<hr />",
"<!--QuoteBegin--><div class=\"quote\"><!--QuoteEBegin-->",
"<!--QuoteEnd--></div><!--QuoteEEnd-->",
"<b>",
"</b>",
"<i>",
"</i>",
"<u>",
"</u>"
);
$massage = str_replace($cthozamen, $nacthozamen, $reviews_cg['AllowPmMassage']);
$massage = str_replace("{text}", close_tags($textm), $massage);
$themem = $reviews_cg["AllowPmTheme"];
$db->query("INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) VALUES ('$themem', '$massage', '$AddUserID', '$UserName', '$timese', 'no', 'inbox')");
$db->query("UPDATE " . USERPREFIX . "_users set pm_all=pm_all+1, pm_unread=pm_unread+1 WHERE user_id='$AddUserID'");
$db->free();
}
echo ("ok!");
}
elseif ($_POST['del'] == 1)
{
$id = intval($_POST['id']);
$DelUserID = intval($_POST['user_id']);
$author_id = intval($_POST['author_id']);
if (!$id) die($lang["lang_wall_9"]);
if (!$UserID) die($lang["lang_wall_9"]);
if($member_id['user_group'] != 1 && (($UserID != $DelUserID && $reviews_cg['AllowDelReview'] !== 'on') || ($author_id != $UserID && $reviews_cg['AllowDelPersonalReview'] !== 'on'))) die($lang["lang_wall_10"]);
$db->query("DELETE FROM " . PREFIX . "_user_reviews WHERE `user_id`='{$DelUserID}' AND `id`='{$id}' LIMIT 1");
$db->free();
die("ok!");
}
elseif ($_POST['edits'] == 1)
{
$id = intval($_POST['id']);
$EditUserID = intval($_POST['user_id']);
$author_id = intval($_POST['author_id']);
if (!$id) die($lang["lang_wall_9"]);
if (!$UserID) die($lang["lang_wall_9"]);
if ( ($member_id['user_group'] != 1) && (($reviews_cg['AllowEditPersonalReview'] !== 'on') || ($author_id != $UserID))) die($lang["lang_wall_31"]);
$edittest = $db->super_query("SELECT id, text FROM " . PREFIX . "_user_reviews WHERE id='{$id}'");
$textedit = $edittest["text"];
$db->free();
die($textedit);
}
elseif ($_POST['editsave'] == 1)
{
$id = intval($_POST['id']);
$text = trim(htmlspecialchars(CharsetConvert(stripslashes($_POST['text']))));
if ($reviews_cg['AllowSpam'] == "on" && $member_id['user_group'] != 1) {
$whiteList=explode(", ", $reviews_cg['TrueSite']);
preg_match_all( "#(?<!\])\bhttp://([^\s\[<]+)#i", $text, $links, PREG_PATTERN_ORDER );
$badLinks = array();
foreach( $links[1] as $key => $link ) {
foreach( $whiteList as $whiteLink ) {
$hasBad = strpos( str_replace( 'www.', '', $link ), $whiteLink ) !== 0 ? true : false;
if( !$hasBad ) break;
}
if( $hasBad ) $badLinks[] = $links[0][$key];
}
if(count( $badLinks ) > 0){
die($lang["lang_wall_8"]);
}
}
if (strlen($text) > $reviews_cg['MaxReviewText']) die($lang["lang_wall_4"]);
$textin = $db->safesql($text);
$EditUserID = intval($_POST['user_id']);
$author_id = intval($_POST['author_id']);
if (!$id) die($lang["lang_wall_9"]);
if (!$UserID) die($lang["lang_wall_9"]);
if ( ($member_id['user_group'] != 1) && (($reviews_cg['AllowEditPersonalReview'] !== 'on') || ($author_id != $UserID))) die($lang["lang_wall_31"]);
$db->query("UPDATE " . PREFIX . "_user_reviews SET text='{$textin}' WHERE id='{$id}'");
$parse = new ParseFilter;
$textm = $parse->BB_Parse($text, false);
$textedit = close_tags($textm);
$textedit = str_replace("{THEME}", "/templates/{$Skin}", $textedit);
$db->free();
die($textedit);
} elseif ($_POST['getuserers'] == 1)
{
$user_ider = $_POST['user_id'];
$lolasde = $db->super_query("SELECT name FROM " . PREFIX . "_users WHERE user_id=$user_ider");
$db->free();
die ($lolasde['name']);
} elseif ($_POST['repa'] == 1)
die();
}
if (!defined("DATALIFEENGINE")) die("Прямой доступ");
function GlobalUser()
{
global $row;
return $row;
}
$row = GlobalUser();
$AllowAdd = 'off';
if ((($row['user_id'] != $member_id['user_id']) || $reviews_cg['AllowAddMyProfile'] === 'on') && $is_logged) $AllowAdd = 'on';
$UserNameER = stripslashes($member_id['name']);
function LoadJs($CountReviews = 0)
{
global $row, $lang, $member_id, $reviews_cg;
$navi=<<<HTML
<script type="text/javascript">
function page(page){
ShowLoading( "" );
$(".ReviwsList").fadeOut();
$.post("", { page: page, user_id: {$row[user_id]}, pager: "1" }, function( data ){
HideLoading( "" );
if($(".ReviwsList").html(data)){
editbuttun();
setTimeout(function() { image_sizer() }, 500);
$.scrollTo(".ReviwsList" , {duration:1000});
}
$(".ReviwsList").fadeIn();
$.post("", { paginator: "1", page: page }, function( data ){
if(data){
$(".pagination").html(data);
}
}, "html" );
}, "html" );
}
</script>
HTML;
$naviguest=<<<HTML
<script type="text/javascript">
function page(page){
ShowLoading( "" );
$(".ReviwsList").fadeOut();
$.post("", { page: page, user_id: {$row[user_id]}, pager: "1" }, function( data ){
HideLoading( "" );
if($(".ReviwsList").html(data)){
setTimeout(function() { image_sizer() }, 500);
$.scrollTo(".ReviwsList" , {duration:1000});
}
$(".ReviwsList").fadeIn();
$.post("", { paginator: "1", page: page }, function( data ){
if(data){
$(".pagination").html(data);
}
}, "html" );
}, "html" );
}
$(window).load(function() {
image_sizer();
});
</script>
HTML;
$ajax = <<< HTML
<script type="text/javascript">
function editbuttun(){
$("div.Review").hover(
function() {
$(".otv" ,this).stop().animate({"opacity": "0.7"}, "slow");
},
function() {
$(".otv" ,this).stop().animate({"opacity": "0"}, "fast");
});
}
var CountReviews = {$CountReviews};
var lang_18 = "{$lang[lang_wall_18]}";
var lang_17 = "{$lang[lang_wall_17]}";
function DelUserReviews( id, author_id, pagere){
var Quest = confirm(lang_17);
if( Quest )
{
ShowLoading( "" );
$(".ReviwsList").fadeOut();
$.post("", { id: id, user_id: {$row[user_id]}, author_id: author_id, del: "1", ajaxur: "1"}, function( data ){
if(data.search('ok!') == -1){
$(".ReviwsList").fadeIn();
HideLoading( "" );
$.flash_error(data , 5 );
document.getElementById( "comments" ).value = "";
} else {
HideLoading( "" );
page(pagere);
}
}, "html");
}
}
function AddUserReviews(){
var Text = document.getElementById( "comments" ).value;
if( !Text )
{
$.flash_error(lang_18 , 5 );
return false;
}
ShowLoading( "" );
$.post("", { user_id: {$row[user_id]}, add: "1", ajaxur: "1", text: Text },
function( data ){
HideLoading( "" );
document.getElementById( "comments" ).value = "";
if(data.search('ok!') == -1){
$.flash_error(data , 5 );
document.getElementById( "comments" ).value = "";
} else {
$.post("", { user_id: {$row[user_id]}, testajax: "1" },function( datas ){
page("1");
}, "html" );
$("#berrors").html("");
document.getElementById( "comments" ).value = "";
}
CountReviews++;
}, "html" );
}
</script>
HTML;
$noguesthead = <<<HTML
<script type="text/javascript">function ans_w(a){var b=document.getElementById("comments");$("textarea#comments").focus();b.value+=""+a+", "};</script>
HTML;
if ($member_id['user_id'] != 0) {
$header = $navi . $header . $noguesthead . $ajax;
} else {
$header = $naviguest;
}
return $header;
}
if ($_POST["testajax"] == "1" || $_POST["pager"] == "1") {
$ProfileUserID = $_POST['user_id'];
} else {
$ProfileUserID = $row['user_id'];
}
$query = $db->query("SELECT rewiews.* FROM " . PREFIX . "_user_reviews AS rewiews WHERE rewiews.user_id='{$ProfileUserID}'");
$CountReviews = $db->num_rows($query);
if ($CountReviews > 0) {
$parse = new ParseFilter;
$posts = $db->num_rows($query);
$page = $_POST['page'];
$num = $reviews_cg['PostPerPage'];
$total = intval(($posts - 1) / $num) + 1;
$page = intval($page);
if (empty($page) or $page < 0) $page = 1;
if ($page > $total) $page = $total;
$start = $page * $num - $num;
$query = $db->query("SELECT rewiews.*, users.foto, users.lastdate, users.user_group FROM " . PREFIX . "_user_reviews AS rewiews, " . PREFIX . "_users AS users WHERE rewiews.user_id='{$ProfileUserID}' AND users.user_id=rewiews.author_id ORDER BY `date` DESC LIMIT $start, $num");
while ($Review = $db->get_row($query))
{
$id = $Review['id'];
$text = $parse->BB_Parse($Review['text'], false);
$author = htmlspecialchars($Review['author']);
$author_id = intval($Review['author_id']);
$photo = $Review['foto'];
if ($photo == null) {
$tpl->set("{photo}", "/templates/{$Skin}/images/noavatar.png");
}
else
{
$tpl->set("{photo}", "/uploads/fotos/" . $photo);
}
$tpl->Load_Template("userreviews/userinfo.reviews.list.tpl");
$tpl->copy_template = "<div id=\"Review_{$id}\" class=\"Review\">" . $tpl->copy_template . "</div>";
$userGroup = $user_group[$Review['user_group']]['group_name'];
$GroupPre = $user_group[$Review['user_group']]['group_prefix'];
$GroupSuf = $user_group[$Review['user_group']]['group_suffix'];
$tpl->set("{author}", "<a href=\"/user/{$author}/\" onclick=\"ShowProfile('" . urlencode($author) . "', '/user/" . urlencode($author) . "');return false\">{$author}</a>");
$tpl->set("{author:id}", $author_id);
$tpl->set("{author:name}", $author);
$tpl->set("{group}", $userGroup);
$tpl->set("[wrap]", $GroupPre);
$tpl->set("[/wrap]", $GroupSuf);
if (($author_id == $member_id['user_id']) || ($member_id['user_id'] == 0)) {
$tpl->set_block("'\\[ans\\](.*?)\\[/ans\\]'si", "");
}
else
{
$tpl->set("[ans]", "<a onclick=\"ans_w( '{$author}');\">");
$tpl->set("[/ans]", "</a>");
}
if (isset($member_id['user_id'])) $text = preg_replace("'\[hide\](.*?)\[/hide\]'si", "\\1", $text);
else
{
$hide_info = $lang['lang_wall_24'];
$text = preg_replace("'\[hide\](.*?)\[/hide\]'si", "<div class=\"quote\">" . $hide_info . "</div>", $text);
}
$text=wordwrap($text, 60, "\n", 1);
$tpl->set("{text}", close_tags($text));
$tpl->set("{date}", ShowDateUr($chat_cfg['format_date'], strtotime($Review['date'])));
$tpl->set("{id}", $id);
if (((($author_id == $member_id['user_id'] && $reviews_cg['AllowDelReview'] === 'on') || ($reviews_cg['AllowDelPersonalReview'] === 'on' && $member_id['user_id']==$ProfileUserID)) || $member_id['user_group'] == 1) && $is_logged) {
$tpl->set("[del]", "<a href=\"javascript:void(0)\" onclick=\"DelUserReviews( '{$id}', '{$author_id}', '{$page}' );return false\">");
$tpl->set("[/del]", "</a>");
}else{
$tpl->set_block("'\\[del\\](.*?)\\[/del\\]'si", "");
}
$tpl->compile("ReviewsList");
$tpl->clear();
}
}
else
{
$tpl->result['ReviewsList'] = "<div id=\"berrors\" style=\"text-align:center\">{$reviews_cg['LangNoReviews']}</div>";
}
if ($_POST['testajax'] == "1" || $_POST['pager'] == "1") {
$tpl->result['ReviewsList'] = str_replace("{THEME}", "/templates/{$Skin}", $tpl->result['ReviewsList']);
die($tpl->result['ReviewsList']);
}
$keysand = <<<HTML
<script language="javascript" type="text/javascript">
$(window).load(function() {
$("textarea[name='comments']").keypress(function(event) {
if((event.ctrlKey) && ((event.keyCode == 0xA)||(event.keyCode == 0xD))) {
AddUserReviews();
}
});
});
</script>
HTML;
if ($reviews_cg["AllowEnter"] == "off" && $member_id['user_id'] != 0) $keysand = "";
$tpl->Load_Template("userreviews/userinfo.reviews.tpl");
$tpl->copy_template = LoadJs($CountReviews). $keysand . $tpl->copy_template;
$tpl->set("{reviews}", "<div id=\"UserReviews\">{$tpl->result['ReviewsList']}</div>");
$tpl->set('{CountReviews}', $CountReviews);
$tpl->set('{editor}', $bb_code);
if ($AllowAdd === 'on') {
$tpl->set("[add]", "<div id=\"AddReviewForm\">");
$tpl->set("[/add]", "</div>");
}
else
{
$tpl->set_block("'\\[add\\](.*?)\\[/add\\]'si", "");
}
if ($CountReviews > $num) {
if ($_POST['paginator'] == "1") {
$page = $_POST['page'];
} else {
$page = 1;
}
if ($page != 1 && $page != 2 && $page != 3) $pervpage = '<li><a href="#" onclick="page(\'1\');return false">1</a></li> <li><a href="#" onclick="page(\'2\');return false">2</a></li> <li class="dot">..</li>';
if ($page != $total) $nextpage = '<li><a href="#" onclick=\'page("' . $total . '");return false\'>' . $lang['lang_wall_28'] . '</a></li>';
if ($page - 2 > 0 && $page != 4) $page2left = '<li><a href="#" onclick="page(\' ' . ($page - 2) . ' \');return false">' . ($page - 2) . '</a></li>';
if ($page - 1 > 0) $page1left = '<li><a href="#" onclick="page(\' ' . ($page - 1) . ' \');return false">' . ($page - 1) . '</a></li>';
if ($page + 2 <= $total) $page2right = '<li><a href="#" onclick="page(\' ' . ($page + 2) . ' \');return false">' . ($page + 2) . '</a></li>';
if ($page + 1 <= $total) $page1right = '<li><a href="#" onclick="page(\' ' . ($page + 1) . ' \');return false">' . ($page + 1) . '</a></li>';
$tpl->set("{page}", "<li class='detail-s'>" . $lang['lang_wall_25'] . " " . $page . " " . $lang['lang_wall_26'] . " " . $total . "</li>" . $pervpage . $page2left . $page1left . '<li><a class="current">' . $page . '</a></li>' . $page1right . $page2right . $nextpage);
if ($_POST['paginator'] == "1") {
die("<li class='detail-s'>" . $lang['lang_wall_25'] . " " . $page . " " . $lang['lang_wall_26'] . " " . $total . "</li>" . $pervpage . $page2left . $page1left . '<li><a class="current">' . $page . '</a></li>' . $page1right . $page2right . $nextpage);
}
}
else
{
if ($_POST['paginator'] == "1") {
die(' ');
}
$tpl->set("{page}", " ");
}
define("ROOT_DIR", "../../..");
$Skin = "templates/" . $config['skin'];
$i = 0;
$url_link = "<div class=\"bbcode b-url south\" title=\"$lang[bb_t_url]\" onclick=\"tag_url()\">url</div>";
$image_link = "<div class=\"bbcode b-img south\" title=\"$lang[bb_b_img]\" onclick=\"tag_image()\">img</div>";
$editor = <<<HTML
<div class="bbcode-editor">
<div class="bbcode b-i" onclick="simpletag('i')">i</div>
<div class="bbcode b-u" onclick="simpletag('u')">u</div>
<div class="bbcode b-s" onclick="simpletag('s')">s</div>
<ul id="nav">
<li><div class="bbcode b-emo"></div>
<ul>
<li>
<div class="emo-cod" id="emo-cod-3"><a href="#" onclick="dle_smiley(':1:');return false" class="e01">01</a><a href="#" onclick="dle_smiley(':2:');return false" class="e02">02</a><a href="#" onclick="dle_smiley(':3:');return false" class="e03">03</a><a href="#" onclick="dle_smiley(':4:');return false" class="e04">04</a><a href="#" onclick="dle_smiley(':5:');return false" class="e05">05</a><a href="#" onclick="dle_smiley(':6:');return false" class="e06">06</a><a href="#" onclick="dle_smiley(':7:');return false" class="e07">07</a><a href="#" onclick="dle_smiley(':8:');return false" class="e08">08</a><a href="#" onclick="dle_smiley(':9:');return false" class="e09">09</a><a href="#" onclick="dle_smiley(':10:');return false" class="e10">10</a><a href="#" onclick="dle_smiley(':11:');return false" class="e11">11</a><a href="#" onclick="dle_smiley(':12:');return false" class="e12">12</a><a href="#" onclick="dle_smiley(':13:');return false" class="e13">13</a><a href="#" onclick="dle_smiley(':14:');return false" class="e14">14</a><a href="#" onclick="dle_smiley(':15:');return false" class="e15">15</a><a href="#" onclick="dle_smiley(':16:');return false" class="e16">16</a><a href="#" onclick="dle_smiley(':17:');return false" class="e17">17</a><a href="#" onclick="dle_smiley(':18:');return false" class="e18">18</a><a href="#" onclick="dle_smiley(':19:');return false" class="e19">19</a><a href="#" onclick="dle_smiley(':20:');return false" class="e20">20</a></div></li></ul></li></ul>
{$url_link}
{$image_link}
<div class="bbcode b-youtube south" title="$lang[bb_t_youtube]" onclick="tag_youtube()">youtube</div>
<div class="flash"></div></div>
<textarea placeholder="%user-s% введите ваше сообщение..." class="animated-1" maxlength="{$reviews_cg["MaxReviewText"]}" onclick="setNewField('comments', document.getElementById( 'userinfo' ))" name="comments" id="comments"></textarea>
<div style="padding:4px 0 10px 0"><a href="#" class="bbcodes" onclick="AddUserReviews();return false">Отправить</a><div style="float:right">Осталось <span id="charsLeft"></span> символов</div></div>
HTML;
if ($member_id['user_id'] == 0) $editor = <<<HTML
HTML;
$startform = "comments";
$addform = " document.getElementById( 'userinfo' ) ";
$image_align = array();
$image_align[$config['image_align']] = "selected";
$bb_code = <<<HTML
<script language="javascript" type="text/javascript">
<!--
var text_enter_url = "$lang[bb_url]";
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 img_title = "$lang[bb_img_title]";
var email_title = "$lang[bb_email_title]";
var image_align = "{$config['image_align']}";
var text_alt_image = "{$lang['bb_alt_image']}";
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['images_none']}</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 selField = "{$startform}";
var fombj = {$addform};
function image_upload()
{
window.open('{$config['http_home_url']}engine/images.php?area=' + selField + '&add_id={$add_id}', '_Addimage', 'toolbar=0,location=0,status=0, left=0, top=0, menubar=0,scrollbars=yes,resizable=0,width=640,height=550');
}
-->
</script>
<script type="text/javascript" src="/engine/classes/js/bbcodes.js"></script>
{$editor}
HTML;
if ($_POST["testajax"] == "1") {
die ($tpl->result['ReviewsList']);
}
$headers = <<<HTML
<script src="/engine/classes/min/index.php?charset=windows-1251&f=/templates/Default/js/notice_jquery.js,/templates/Default/js/jquery.hoverIntent.minified.js,/templates/Default/js/jquery.scrollTo-min.js&8"></script>
<link rel="stylesheet" href="/engine/classes/min/index.php?f=/templates/Default/style/7.css&8"/>
<script type="text/javascript">
<!--
$(document).ready(function(){
var value = $('textarea[name="comments"]').attr('value') || '';
var initLength = Math.max((value ? ({$reviews_cg[MaxReviewText]} - value.length) : {$reviews_cg[MaxReviewText]}),0);
$('#charsLeft').html(initLength.toString());
$('textarea[name="comments"]').keyup(function(){
var value = $(this).attr('value') || '';
var lengthToGo = Math.max(({$reviews_cg[MaxReviewText]} - value.length),0);
$('#charsLeft').html(lengthToGo.toString());
});
});
-->
</script>
HTML;
$tpl->set("{editor}", $bb_code);
$tpl->set("{header}", $headers);
$tpl->compile("result");
$tpl->clear();
$red_group = array(1);
if ($ProfileUserID == $member_id['user_id'] || in_array($member_id['user_group'], $red_group)) {
echo $tpl->result['result'];
} else {
echo '<form method="post" name="userinfo" id="userinfo" enctype="multipart/form-data" action="">' . $tpl->result['result'] . '</form>';
}
}
?>