?PNG
IHDR ? f ??C1 sRGB ?? gAMA ?a pHYs ? ??od GIDATx^LeY?a?("Bh?_????q5k?*:t0A-o??]VkJM??f?8\k2ll1]q????T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
css/comments.css 0000666 00000001604 15047260436 0007707 0 ustar 00 .otBlock.admin { border:1px dashed grey !important; padding : 10px !important; margin-bottom : 0 !important; background : white;}
#show-more-comments {margin : 10px; padding : 10px; border : 1px dotted grey; font : bold 13px normal Arial,Helvatica,sans-serif; text-decoration:none; color : green; clear : left; background : #AAFFAA; display : block;}
.comment-admin {border : 1px dashed grey; padding : 5px;float : left;width : 99%; border-top:0; background : #CCFFCC;}
.comment-admin a { margin : 10px;}
.comm-editor td, .comm-editor th { padding : 5px;}
.comm-editor .cr1 {width : 20%;}
.comm-editor .cr1 input {width : 90px;}
.comm-editor .cr2 {width : 80%;}
.comm-editor .cr2 textarea {width : 380px; height : 150px;}
.comm-posts { background : #FEF1F1; border : 1px solid #D7D7D7;}
.comm-posts th {padding : 5px; font : bold 12px Arial,Helvetica,sans-serif;}
.comm-posts td {padding : 5px;}
js/xfront.js 0000666 00000012100 15047260436 0007043 0 ustar 00 var error_message='Извините, произошла ошибка.';
var comments = new cms_connector('comments');
var comments_xfront = {
'form_id' : 'asform',
'container_id' : 'container_id',
'init' : function(form_id,container_id){
if (typeof form_id == 'string') { this.form_id=form_id; }
if (typeof container_id == 'string') { this.container_id=container_id; }
}
}
function comment_toggle(record_id){
if (!record_id) return false;
var adm_block = $('.comment-admin[rel='+record_id+']');
var enabled=0;
var enblock = $(' > .comm-enabled',adm_block);
if (enblock.size()){
enabled = 1;
} else {
var enblock = $(' > .comm-disabled',adm_block);
}
comments.execute( {'comment_toggle' : { 'record_id' : record_id, 'enabled' : enabled }});
if (comments.result){
enblock.removeClass('comm-enabled');
enblock.removeClass('comm-disabled');
if (comments.result.passed){
var active_checkbox = $('.comm-editor[rel='+record_id+'] input[name=active]');
if (comments.result.active){
enblock.addClass('comm-enabled');
enblock.text('включено');
active_checkbox.attr('checked','checked');
} else {
enblock.text('выключено');
enblock.addClass('comm-disabled');
active_checkbox.removeAttr('checked');
}
} else {alert(error_message);}
} else {alert(error_message);}
return false;
}
function comm_update(record_id){
if (!record_id) return false;
var cform=export_form('comment'+record_id);
comments.execute({'comment_update' : cform});
if (comments.result.passed){
var enblock = $('.comment-admin[rel='+record_id+'] a.comm-enabled');
if (!enblock.size()) { enblock = $('.comment-admin[rel='+record_id+'] a.comm-disabled'); }
enblock.removeClass('comm-enabled');
enblock.removeClass('comm-disabled');
if (cform.active) {
enblock.addClass('comm-enabled');
enblock.text('включено');
} else {
enblock.addClass('comm-disabled');
enblock.text('выключено');
}
var block=$('.comment-container[rel='+record_id+']');
$('.comm-Title span',block).text(cform.Title);
$('.comm-Info ',block).text(cform.Info);
$('.comm-Author span',block).text(cform.Author);
$('.comm-Job span',block).text(cform.Job);
$('.comm-Answer',block).text(cform.Answer);
$('#update-success'+record_id).show();
setTimeout("$('#update-success"+record_id+"').show();$('.comm-editor[rel="+record_id+"]').slideUp();$('.comm-editor[rel="+record_id+"]').removeClass('comm-opened');$('.comm-show-editor[rel="+record_id+"]').text('Редактировать');",3000);
} else {alert(error_message)};
return false;
}
$(function(){
//alert('admin');
$('#show-more-comments').click(function(){
var cform = export_form(comments_xfront.form_id);
var showed = $(this).attr('rel');
cform.showed=showed;
comments.execute({'show_next_comments' : cform});
if (comments.result){
if (comments.result.passed){
if (comments.result.HTML){
$('#'+comments_xfront.container_id).append(comments.result.HTML);
$(this).attr('rel',comments.result.offset);
} else {
$(this).hide();
}
if (comments.result.finished){ $(this).hide(); } // определяет есть ли ещё
} else {alert(error_message);}
} else {alert(error_message);}
return false;
});
$('.comm-show-editor').live('click',function(){
var record_id=$(this) .attr('rel');
var block = $('.comm-editor[rel='+record_id+']');
if (block.hasClass('comm-opened')) {
block.removeClass('comm-opened');
block.slideUp();
$(this).text('Редактировать');
} else {
block.addClass('comm-opened');
block.slideDown();
$(this).text('Свернуть');
}
});
$('.comm-delete').live('click',function(){
var record_id=$(this) .attr('rel');
var block = $('.comment-container[rel='+record_id+']');
//debugger;
comments.execute({'delete_comment': {'id' : record_id}});
if (comments.result){
if (comments.result.deleted){
var offset = parseInt($('#show-more-comments').attr('rel'));
$('#show-more-comments').attr('rel',offset-1);
block.slideUp(1000,function(){
$(this).remove();
});
} else {alert(error_message);}
} else {alert(error_message);}
return false;
});
}); function.inc.php 0000666 00000001532 15047260436 0007666 0 ustar 00 $val) {$$key=$val;}}
if (!$MAIN_COMMENTS_TABLE || !(int)$classID || !(int)$as_object_id) return 0;
$query = "SELECT COUNT(*) AS `count` FROM `Data".$MAIN_COMMENTS_TABLE."` WHERE `module_id`='".((int)$classID)."' AND `record_id`='".((int)$as_object_id)."'";
return (int)SQLSelectOne($query,'count');
}
function get_comments_for($module_id,$record_id){
global $MODULE_VARS;
$config = &$MODULE_VARS['comments'];
if (is_array($config)) {foreach ($config as $key => $val) {$$key=$val;}}
return as_insert_object($MAIN_COMMENTS_DEFAULT_SECTION,$MAIN_COMMENTS_DEFAULT_SOBJECT,"&comments=1&module_id=".$module_id."&record_id=".$record_id);
}
?>
function.ajax.inc.php 0000666 00000027302 15047260436 0010613 0 ustar 00 $val) {$$key=$val;}}
//37.220.8.106
($params['ajaxed']===false) ? $ajaxed=false : $ajaxed = true;
$image = new Securimage();
($params['prefix']) ? $prefix = mysql_real_escape_string($params['prefix']) : $prefix = "as_";
($params['postfix']) ? $postfix = mysql_real_escape_string($params['postfix']) : $postfix = "";
$obj_id=(int)$params['table'];
if (!$obj_id){
$query = "SELECT `Object_ID` FROM `Section_Object` WHERE `Section_ID`='".(int)$params['section']."' LIMIT 1;";
$t=SQLSelectOne($query);
$table = 'Data'.$t[0];
$obj_id=(int)$t[0];
} else {
$table='Data'.$obj_id;
}
$classID=$obj_id;
$object=(int)($params['object']);
$section=(int)$params['section'];
if (!($captcha_id = (int)$params['captcha_id'])) $captcha_id=2;
$backhref = get_section_link($section);
if ( !$section || !$obj_id) {
if ($ajaxed) {
$result['error']=1; return $result;
} else {
$_SESSION['comments_error']=1;
call_fatal_error('Fatal error in callback form.');
}
}
$commentskey=((int)$classID).'_'.((int)$object).'_'.((int)$section);
$object_fields = getObjectInfo($obj_id,array('System_Config','AddCond','AddActionTemplate'));
$lang = get_lang_by_section($section);
if ($object_fields['System_Config']) eval($object_fields['System_Config']);
$code = strtolower(trim(mysql_real_escape_string($params['Code'])));
$error_message = '';
if ($check_captcha) {
if (!$captcha_id || !isset($_SESSION['securimage_code_module']) || !isset($_SESSION['securimage_code_module'][$captcha_id]) || !$code) {
if ($ajaxed) {
$result['error']=9; return $result;
} else {
if ($l_captcha_post_error) $error_message = $l_captcha_post_error;
else $error_message .= '
Wrong captcha!
'; } } if ( $_SESSION['securimage_code_module'][$captcha_id] !== $code) { if ($ajaxed) { $result['error']=2; return $result; } else { if ($l_captcha_post_error) $error_message = $l_captcha_post_error; else $error_message .= 'Wrong captcha code!
'; } } } if ($error_message) { die($error_message); } $record_id=(int)$params['record_id']; if ($record_id) { if (!($table= $MAIN_COMMENTS_TABLE)) { $result['error']=7; return $tmp; } if (!($section= (int)$params['section'])) { $result['error']=8; return $tmp; } $module_id=(int)$params['module_id']; if (!$module_id){ $query = "SELECT `Object_ID`,`Section_Object_ID` FROM `Section_Object` WHERE `Section_ID`='".$section."' LIMIT 1;"; $module_id = (int)SQLSelectOne($query,'Object_ID'); if (!$module_id) {$result['error']=9; return $result;} $params[$prefix.'module_id'.$postfix]=$module_id; $params[$prefix.'record_id'.$postfix]=$record_id; $params['section']=0; } } else { if (!$params['table'] || !$params['object']){ $query = "SELECT `Object_ID`,`Section_Object_ID` FROM `Section_Object` WHERE 1 AND ".($obj_id ? " `Object_ID` = '".$obj_id."' AND " : "")." `Section_ID`='".$section."' LIMIT 1;"; $t= SQLSelectOne($query); $table = 'Data'.$t['Object_ID']; $section_object=(int)$t['Section_Object_ID']; $obj_id=(int)$t['Object_ID']; } else { $table='Data'.$params['table']; $obj_id=(int)$params['table']; $section_object=$params['object']; } } $data = getObjectInitFields($obj_id); $obj_struct = getObjectStruct($obj_id); $datakeys=array_keys($obj_struct); $fields = array(); $prefix='';$postfix=''; $pattern = '/^'.$prefix.'(.*)'.$postfix.'$/'; $censor = array('Dude','Nude','Sex','Video','Anal','Britney','Spears','Porn'); foreach ($params as $param => $value) { preg_match($pattern, $param, $matches); if ($matches[1] && in_array($matches[1],$datakeys)) { $value = trim(xss_clean($value)); foreach ($censor as $cens){ if (substr_count($value,$cens) || substr_count($value,strtoupper($cens)) || substr_count($value,strtolower($cens))){ if ($ajaxed) { $result['error']=300; return $result; } else { unset($_SESSION['securimage_code_module'][$captcha_id]); header('location: http://'.$_SERVER['HTTP_HOST'].$backhref); ; die(); } } } if (!$value && $obj_struct[$matches[1]]['NotNull'] ){ if ($ajaxed) { $result['error']=301; return $result; } else { unset($_SESSION['securimage_code_module'][$captcha_id]); header('location: http://'.$_SERVER['HTTP_HOST'].$backhref); ; die(); } } $data[$matches[1]]=$value; } } if ($obj_struct['Date']['TypeOfData_ID']==8){ $data['Date']=date('Y-m-d H:i:s'); } if (!$premoderation){ $data['active']=1; } if ($module_id && $record_id) { $params['section']=0; $section_object=0; } if($added_id = addRecords($obj_id,array($data),(int)$params['section'],(int)$section_object)) { if ($log_to_cache){ save_to_cache('feedback','log',array('SESSION'=>$_SESSION,'POST'=> $_POST,'GET'=>$_GET, 'ajaxed'=>$ajaxed)); } $result['sent']=1; //if ($check_captcha && !$debug_mode) unset($_SESSION['securimage_code_module'][$captcha_id]); } if ($added_id && !$premoderation){ $result['HTML'] = ParseList($obj_id,$added_id,true,false,null,array('just_added'=>1)); } if ($ajaxed) { return $result; } else { unset($_SESSION['comments'][$commentskey]); $_SESSION['comments'][$feedkey]=array(); $_SESSION['comments'][$feedkey]['sent']=1; header('location: http://'.$_SERVER['HTTP_HOST'].$backhref); ; die(); } return $result; } function clean($params){ unset($_SESSION['comments']); } } class C_comments_admin extends C_comments { function comment_toggle($params){ global $MODULE_VARS; $config = &$MODULE_VARS['comments']; if (is_array($config)) {foreach ($config as $key => $val) {$$key=$val;}} //DebugBreak(); $tmp=array('passed'=>0,'error'=>0); if (!($table= $MAIN_COMMENTS_TABLE)) { $tmp['error']=1; return $tmp; } $record_id = (int)$params['record_id']; $active = (int)$params['enabled']; if (!$record_id) {$tmp['error']=1; return $tmp;} $active = (int)(!$active); SQLExec("UPDATE `Data".$table."` SET `active` = '".$active."' WHERE `Data_ID` = '".$record_id."'; "); $tmp['active']=$active; $tmp['passed']=1; return $tmp; } function show_next_comments($params){ global $MODULE_VARS; $config = &$MODULE_VARS['comments']; if (is_array($config)) {foreach ($config as $key => $val) {$$key=$val;}} $tmp=array('passed'=>1,'error'=>0); if (!($table= $MAIN_COMMENTS_TABLE)) { $tmp['error']=1; return $tmp; } if (!($section= (int)$params['section'])) { $tmp['error']=2; return $tmp; } $sobj=SQLSelectOne("SELECT `Object_ID`, `Section_Object_ID` FROM `Section_Object` WHERE `Section_ID` = '".$section."' LIMIT 1"); if (!$sobj) { $tmp['error']=3; return $tmp;} $showed=(int)$params['showed']; if (!$showed) {$tmp['error']=4; return $tmp;} $obj_info=getObjectInfo($table,'RecordsPerPage'); $as_max_row=(int)$obj_info['RecordsPerPage']; $record_id=$params['record_id']; if ($record_id){ $msection=$MAIN_COMMENTS_DEFAULT_SECTION; $msobj=$MAIN_COMMENTS_DEFAULT_SOBJECT; $tmp['HTML'] = as_insert_object($msection,$msobj,'&comments=1&ajax=1&showed='.$showed.'&module_id='.((int)$sobj['Object_ID']).'&record_id='.$record_id.'&isMainContent=1'); $next_html = as_insert_object($msection,$msobj,'&comments=1&ajax=1&showed='.($showed+$as_max_row).'&module_id='.((int)$sobj['Object_ID']).'&record_id='.$record_id.'&isMainContent=1'); if (!trim($next_html)){ $tmp['finished']=1; } } else { $tmp['HTML'] = as_insert_object($section,$sobj['Section_Object_ID'],'&ajax=1&showed='.$showed.'&isMainContent=1'); $next_html = as_insert_object($section,$sobj['Section_Object_ID'],'&ajax=1&showed='.($showed+$as_max_row).'&isMainContent=1'); if (!trim($next_html)){ $tmp['finished']=1; } } $tmp['offset']=$as_max_row+$showed; $tmp['passed']=1; return $tmp; } function comment_update($params){ global $MODULE_VARS; $config = &$MODULE_VARS['comments']; if (is_array($config)) {foreach ($config as $key => $val) {$$key=$val;}} $tmp = array('passed'=>0,'error'=>0); if (!($table= $MAIN_COMMENTS_TABLE)) { $tmp['error']=1; return $tmp; } if (!($record_id=(int)$params['record_id'])) { $tmp['error']=2; return $tmp;} unset($params['record_id']); unset($params['module_id']); $params['active']=(int)$params['active']; $updated = UpdateRecord($table,$record_id,$params); if ($updated) $tmp['passed']=1; return $tmp; } function delete_comment($params){ if (!$params['id']) return array('error'=>1); global $MODULE_VARS; $config = &$MODULE_VARS['comments']; if (is_array($config)) {foreach ($config as $key => $val) {$$key=$val;}} SQLExec("DELETE FROM `Data".$MAIN_COMMENTS_TABLE."` WHERE `Data_ID` = '".((int)$params['id'])."';"); return array('deleted'=>1); } } if (is_admin()) { $C_comments_admin = new C_comments_admin(); } else { $C_comments = new C_comments(); } ?> index.php 0000666 00000001064 15047260436 0006400 0 ustar 00 //$section = 123; require_once ("../../../cms.conf"); require_once ($INCLUDE_FOLDER."index.php"); require_once('function.ajax.inc.php'); require_once ("../imreg/capcha/securimage.php"); require_once ("../user/function.inc.php"); session_start(); if (false){ global $_SESSION, $_POST, $_GET; $data = load_from_cache('feedback','log'); $conf = current($data); $_SESSION = $conf['SESSION']; $_POST = $conf['POST']; $_GET = $conf['GET']; } $params=$_POST; $params['ajaxed']=false; //DebugBreak(); C_comments::add_comment($params); ?>