This commit is contained in:
3err0
2019-05-18 13:46:03 +08:00
commit 55e0adfa17
707 changed files with 55878 additions and 0 deletions
+75
View File
@@ -0,0 +1,75 @@
<?php
@error_reporting( 7 );
@ini_set( 'display_errors', true );
@ini_set( 'html_errors', false );
@session_start();
define( 'DATALIFEENGINE', true );
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR . '/data/config.php';
require_once SYSTEM_DIR . '/classes/mysql.php';
require_once SYSTEM_DIR . '/data/dbconfig.php';
require_once SYSTEM_DIR . '/modules/functions.php';
require_once SYSTEM_DIR . '/classes/templates.class.php';
$_REQUEST['skin'] = totranslit($_REQUEST['skin'], false, false);
if( ! @is_dir( ROOT_DIR . '/templates/' . $_REQUEST['skin'] ) ) {die( "Hacking attempt!" );}
$user_group = $cache->get( "usergroup" );
if( ! $user_group ) {
$user_group = array ();
$db->query( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" );
while ( $row = $db->get_row() ) {$user_group[$row['id']] = array ();
foreach ( $row as $key => $value ) {$user_group[$row['id']][$key] = stripslashes($value);}
}
$cache->set( "usergroup", $user_group );
$db->free();
}
@include_once ROOT_DIR . '/language/' . $config['langs'] . '/website.lng';
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
require_once SYSTEM_DIR . '/modules/sitelogin.php';
$tpl = new dle_template( );
$tpl->dir = ROOT_DIR . '/templates/' . $_REQUEST['skin'];
define( 'TEMPLATE_DIR', $tpl->dir );
$ajax_adds = true;
$_POST['name'] = convert_unicode( $_POST['name'], $config['charset'] );
$_POST['mail'] = convert_unicode( $_POST['mail'], $config['charset'] );
$_POST['comments'] = convert_unicode( $_POST['comments'], $config['charset'] );
require_once SYSTEM_DIR . '/modules/addcomments.php';
if( $CN_HALT != TRUE ) {
include_once SYSTEM_DIR . '/classes/comments.class.php';
$comments = new Comments( $db, 1, 1 );
$comments->query = "SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, date, autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, rating, " . USERPREFIX . "_users.email, news_num, comm_num, user_group, signature, foto, repa, repa_mod, repa_off FROM " . PREFIX . "_comments LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id WHERE " . PREFIX . "_comments.post_id = '$post_id' order by id DESC";
$comments->build_comments('ajax');
} $clear_value = "form.comments.value = '';";
if( $CN_HALT ) {
$stop = implode( '<br /><br />', $stop );
$tpl->result['content'] = "<script language=\"JavaScript\" type=\"text/javascript\">\nvar form = document.getElementById('dle-comments-form');\n";
if( ! $where_approve ) $tpl->result['content'] .= "{$clear_value}";
$tpl->result['content'] .= "\n alert ('" . $stop . "');\n var timeval = new Date().getTime();\n
\n </script>";
} else {
$tpl->result['content'] = "<div id=\"blind-animation\" style=\"display:none\">".$tpl->result['content']."<div>";
$tpl->result['content'] .= <<<HTML
<script language='JavaScript' type="text/javascript">
var timeval = new Date().getTime();
var form = document.getElementById('dle-comments-form');
{$clear_value}
</script>
HTML;
}
$tpl->result['content'] = str_replace( '{THEME}', $config['http_home_url'] . 'templates/' . $_REQUEST['skin'], $tpl->result['content'] );
@header( "Content-type: text/html; charset=" . $config['charset'] );
echo $tpl->result['content'];
?>
+134
View File
@@ -0,0 +1,134 @@
<?PHP
if(!defined('DATALIFEENGINE'))
{
die("Hacking attempt!");
}
if ($addtype == "addnews") {
$addform = "document.ajaxnews".$id;
$startform = "dleeditnews".$id;
$code = <<<HTML
<div style="width:99%; height:50px; border:1px solid #BBB; background-image:url('{THEME}/bbcodes/images/bg.gif');">
<div id="b_b" class="editor_button" onclick="simpletag('b')"><img title="$lang[bb_t_b]" src="{THEME}/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="{THEME}/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="{THEME}/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="{THEME}/bbcodes/images/s.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="{THEME}/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="{THEME}/bbcodes/images/image.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="{THEME}/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="{THEME}/bbcodes/images/link.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="{THEME}/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div class="editor_button" onclick="tag_email()"><img title="$lang[bb_t_m]" src="{THEME}/bbcodes/images/email.gif" width="23" height="25" border="0"></div>
<div class="editor_button" onclick="tag_video()"><img title="$lang[bb_t_video]" src="{THEME}/bbcodes/images/mp.gif" width="23" height="25" border="0"></div>
<div class="editor_button" onclick="tag_audio()"><img src="{THEME}/bbcodes/images/mp3.gif" width="23" height="25" border="0"></div>
<div id="b_hide" class="editor_button" onclick="simpletag('hide')"><img title="$lang[bb_t_hide]" src="{THEME}/bbcodes/images/hide.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="{THEME}/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div id="b_color" class="editor_button" onclick="ins_color();"><img src="{THEME}/bbcodes/images/color.gif" width="23" height="25" border="0"></div>
<div id="b_spoiler" class="editor_button" onclick="spoiler()"><img src="{THEME}/bbcodes/images/spoiler.gif" width="23" height="25" border="0"></div>
<div class="editor_button" onclick="tag_kp()"><img title="Ðåéòèíã ÊèíîÏîèñêà" src="{THEME}/bbcodes/rating.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="{THEME}/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div class="editor_button" onclick="tag_flash()"><img src="{THEME}/bbcodes/images/flash.gif" width="23" height="25" border="0" alt="" /></div>
<div class="editbclose" onclick="closeall()"><img title="$lang[bb_t_cl]" src="{THEME}/bbcodes/images/close.gif" width="23" height="25" border="0"></div>
<div class="editor_button_brk"><img src="{THEME}/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div class="editor_button" style="padding-top:4px;width:120px;"><select name="bbfont" class="editor_button" 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:4px;width:65px;"><select name="bbsize" class="editor_button" 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="{THEME}/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="{THEME}/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="{THEME}/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="{THEME}/bbcodes/images/r.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="{THEME}/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div id="b_quote" class="editor_button" onclick="simpletag('quote')"><img title="$lang[bb_t_quote]" src="{THEME}/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="{THEME}/bbcodes/images/code.gif" width="23" height="25" border="0"></div>
<div class="editor_button">&nbsp;<img src="{THEME}/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
<div class="editor_button" onclick="tag_media()"><img src="{THEME}/bbcodes/images/youtube.gif" width="23" height="25" border="0" alt="" /></div>
<div class="editor_button"><img src="{THEME}/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
</div>
<iframe width="154" height="104" id="cp" src="{THEME}/bbcodes/color.html" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; display: none; position: absolute;"></iframe>
HTML;
}
else {
$addform = "document.ajaxcomments".$id;
$startform = "dleeditcomments".$id;
if ($user_group[$member_id['user_group']]['allow_url'])
{
$url_link = "<div class=\"editor_button\" onclick=\"tag_url()\"><img title=\"$lang[bb_t_url]\" src=\"{THEME}/bbcodes/images/link.gif\" width=\"23\" height=\"25\" border=\"0\"></div>";
}
else {$url_link = "";}
if ($user_group[$member_id['user_group']]['allow_image'])
{
$image_link = "<div class=\"editor_button\" onclick=tag_image()><img title=\"$lang[bb_b_img]\" src=\"{THEME}/bbcodes/images/image.gif\" width=\"23\" height=\"25\" border=\"0\"></div>";
}
else $image_link = "";
$code = <<<HTML
<div style="width:99%; height:25px; border:1px solid #BBB; background-image:url('{THEME}/bbcodes/images/bg.gif')">
<div id="b_b" class="editor_button" onclick="simpletag('b')"><img title="$lang[bb_t_b]" src="{THEME}/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="{THEME}/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="{THEME}/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="{THEME}/bbcodes/images/s.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="{THEME}/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="{THEME}/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="{THEME}/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="{THEME}/bbcodes/images/r.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="{THEME}/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
{$url_link}
{$image_link}
<div class="editor_button" onclick="tag_email()"><img title="$lang[bb_t_m]" src="{THEME}/bbcodes/images/email.gif" width="23" height="25" border="0"></div>
<div id="b_color" class="editor_button" onclick="ins_color();"><img src="{THEME}/bbcodes/images/color.gif" width="23" height="25" border="0"></div>
<div class="editor_button"><img src="{THEME}/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="{THEME}/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="{THEME}/bbcodes/images/quote.gif" width="23" height="25" border="0"></div>
<div id="b_spoiler" class="editor_button" onclick="spoiler();"><img src="{THEME}/bbcodes/images/spoiler.gif" width="23" height="25" border="0"></div>
</div>
<iframe width="154" height="104" id="cp" src="{THEME}/bbcodes/color.html" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; display: none; position: absolute;"></iframe>
<div id="dle_emo" style="visibility:hidden; display: none; position: absolute; width:255px; height: 235px; overflow: auto; border: 1px solid #BBB; background:#E9E8F2;filter: alpha(opacity=95, enabled=1) progid:DXImageTransform.Microsoft.Shadow(color=#CACACA,direction=135,strength=3);">{$output}</div>
HTML;
}
$script_code = @file_get_contents(SYSTEM_DIR."/ajax/bbcodes.js");
$script_code .= <<<HTML
-->
</SCRIPT>
HTML;
$bb_code = <<<HTML
<SCRIPT type=text/javascript>
<!--
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_code = "$lang[bb_code]";
var text_quote = "$lang[bb_quote]";
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 email_title = "$lang[bb_email_title]";
var text_pages = "$lang[bb_bb_page]";
var image_align = "{$config['image_align']}";
var selField = "{$startform}";
var fombj = {$addform};
{$script_code}
{$code}
HTML;
$bb_code = str_replace ("{THEME}", $config['http_home_url']."system/skins", $bb_code);
?>
+340
View File
@@ -0,0 +1,340 @@
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 ie_range_cache = '';
var bbtags = new Array();
function setFieldName(which)
{
if (which != selField)
{
selField = which;
}
};
function ins_smile ( text ){
doInsert(' ' + text + ' ', '', false);
ie_range_cache = null;
};
function simpletag(thetag)
{
doInsert("[" + thetag + "]", "[/" + thetag + "]", true);
}
function tag_url()
{
var FoundErrors = '';
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel ='My Webpage';
}
var enterURL = prompt(text_enter_url, "http://");
var enterTITLE = prompt(text_enter_url_name, thesel);
if (!enterURL) {
FoundErrors += " " + error_no_url;
}
if (!enterTITLE) {
FoundErrors += " " + error_no_title;
}
if (FoundErrors) {
alert("Error!"+FoundErrors);
return;
}
doInsert("[url="+enterURL+"]"+enterTITLE+"[/url]", "", false);
};
function tag_kp(){var a="",b="";(b=ua_vers>=4&&is_ie&&is_win?document.selection.createRange().text:"")||(b="");(b=prompt("Insert Kinopoisk ID",b))||(a+=" "+error_no_url);a?alert("Error!"+a):doInsert("[center][kp="+b+"][/center]","",false)}
function tag_game(){var a="",b="";(b=ua_vers>=4&&is_ie&&is_win?document.selection.createRange().text:"")||(b="");(b=prompt("Insert Game ID",b))||(a+=" "+error_no_url);a?alert("Error!"+a):doInsert("[center][game="+b+"][/center]","",false)}
function tag_media()
{
var FoundErrors = '';
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel ='http://';
}
var enterURL = prompt(text_enter_url, thesel);
if (!enterURL) {
FoundErrors += " " + error_no_url;
}
if (FoundErrors) {
alert("Error!"+FoundErrors);
return;
}
doInsert("[media="+enterURL+"]", "", false);
};
function tag_flash()
{
var FoundErrors = '';
var enterURL = prompt(text_enter_flash, "http://");
var size = prompt(text_enter_size, "425,264");
if (!enterURL) {
FoundErrors += " " + error_no_url;
}
if (FoundErrors) {
alert("Error!"+FoundErrors);
return;
}
doInsert("[flash="+size+"]"+enterURL+"[/flash]", "", false);
};
function tag_image()
{
var FoundErrors = '';
var enterURL = prompt(text_enter_image, "http://");
var Title = prompt(img_title, image_align);
if (!enterURL) {
FoundErrors += " " + error_no_url;
}
if (FoundErrors) {
alert("Error!"+FoundErrors);
return;
}
if (Title == "")
{
doInsert("[img]"+enterURL+"[/img]", "", false);
}
else {
if (Title == "center") {
doInsert("[center][img]"+enterURL+"[/img][/center]", "", false);
}
else {
doInsert("[img="+Title+"]"+enterURL+"[/img]", "", false);
}
}
};
function tag_video()
{
var FoundErrors = '';
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel ='http://';
}
var enterURL = prompt(text_enter_url, thesel);
if (!enterURL) {
FoundErrors += " " + error_no_url;
}
if (FoundErrors) {
alert("Error!"+FoundErrors);
return;
}
doInsert("[video="+enterURL+"]", "", false);
};
function tag_audio()
{
var FoundErrors = '';
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel ='http://';
}
var enterURL = prompt(text_enter_url, thesel);
if (!enterURL) {
FoundErrors += " " + error_no_url;
}
if (FoundErrors) {
alert("Error!"+FoundErrors);
return;
}
doInsert("[audio="+enterURL+"]", "", false);
};
function tag_email()
{
var emailAddress = prompt(text_enter_email, "");
if (!emailAddress) {
alert(error_no_email);
return;
}
var thesel = get_sel(eval('fombj.'+ selField))
if (!thesel) {
thesel ='';
}
var Title = prompt(email_title, thesel);
if (!Title) Title = emailAddress;
doInsert("[email="+emailAddress+"]"+Title+"[/email]", "", false);
};
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 )
{
var ss = obj_ta.selectionStart;
var st = obj_ta.scrollTop;
var es = obj_ta.selectionEnd;
if (es <= 2)
{
es = obj_ta.textLength;
}
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 (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='Öâåò' style='display:none'><br /><iframe width=\"154\" height=\"104\" src=\"" + dle_root + "templates/" + dle_skin + "/bbcodes/color.html\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"></iframe></div>");
$('#cp').dialog({
autoOpen: true,
dialogClass: "modalfixed",
width: 180
});
$('.modalfixed.ui-dialog').css({position:"fixed"});
$('#cp').dialog( "option", "position", ['0','0'] );
};
function setColor(color)
{
doInsert("[color=" +color+ "]", "[/color]", true );
$('#cp').dialog("close");
};
function insert_font(value, tag)
{
if (value == 0)
{
return;
}
doInsert("[" +tag+ "=" +value+ "]", "[/" +tag+ "]", true );
fombj.bbfont.selectedIndex = 0;
fombj.bbsize.selectedIndex = 0;
};
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;
};
function b_hide_n() {var FoundErrors = '';var b_hide_n = prompt("Êàêîé õàéä ïîñòàâèòü?",100); if (!b_hide_n){FoundErrors += " ";} if(FoundErrors){alert("îøèáêà!"+FoundErrors);return;} doInsert("[hide="+b_hide_n+"][/hide]", "", false); }
function spoiler() {var FoundErrors = '';var spoiler = prompt("Ââåäèòå íàçâàíèå ñïîéëåðà"); if (!spoiler){FoundErrors += " ";} if(FoundErrors){alert("îøèáêà!"+FoundErrors);return;} doInsert("[spoiler="+spoiler+"][/spoiler]", "", false); }
+46
View File
@@ -0,0 +1,46 @@
<?php
@session_start();
@error_reporting(7);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
define('DATALIFEENGINE', true);
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
require_once SYSTEM_DIR . '/data/config.php';
require_once SYSTEM_DIR . '/classes/mysql.php';
require_once SYSTEM_DIR . '/data/dbconfig.php';
require_once SYSTEM_DIR . '/modules/functions.php';
@header("Content-type: text/html; charset=windows-1251");
$cat_info = $cache->get("category");
if (!$cat_info){
$cat_info = array ();
$db->query("SELECT * FROM " . PREFIX . "_category ORDER BY posi ASC");
while ($row = $db->get_row())
{
$cat_info[$row['id']] = array ();
foreach ($row as $key => $value)
{
$cat_info[$row['id']][$key] = stripslashes($value);
}
}
$cache->set("category", $cat_info);
$db->free();
}
$adon = $_REQUEST['adon'];
$geta = get_sub_cats($adon);
if ($cat_info[$geta]['parentid'] == '0')
{
$retng = '<select name="catlist[]"><option value="' . $adon . '">Ïîäêàòåãîðèé íåò</option></select>';
}
else
{
$retng = CategoryNewsSelectiod($adon);
}
echo $retng;
?>
+58
View File
@@ -0,0 +1,58 @@
<?php
@error_reporting(7);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
@session_start();
define('DATALIFEENGINE', true);
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR.'/data/config.php';
require_once SYSTEM_DIR.'/classes/mysql.php';
require_once SYSTEM_DIR.'/data/dbconfig.php';
require_once SYSTEM_DIR.'/data/chat.config.php';
require_once SYSTEM_DIR.'/modules/chat/chat.class.php';
require_once SYSTEM_DIR.'/modules/functions.php';
$user_group = $cache->get("usergroup");
if (!$user_group) {
$user_group = array ();
$db->query("SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC");
while($row = $db->get_row()){
$user_group[$row['id']] = array ();
foreach ($row as $key => $value)
{
$user_group[$row['id']][$key] = $value;
}
}
$cache->set ("usergroup", $user_group);
$db->free();
}
include_once ROOT_DIR.'/language/'.$config['langs'].'/website.lng';
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
$refresh = intval($_REQUEST['refresh']);
$m_id = intval($_REQUEST['mdelete']);
require_once SYSTEM_DIR.'/modules/sitelogin.php';
$chat = new Chat();
if ($m_id != 0 && $refresh && ($member_id['user_group'] == 1 || $member_id['user_group'] == 2)){
$db->query("DELETE FROM ".PREFIX."_chat WHERE id = $m_id");
$cache->del('minichat');
}
$mcadd['message'] = addslashes(convert_unicode($_POST['message'], $config['charset']));
@header("HTTP/1.1 200 OK");
@header("Cache-Control: no-cache, must-revalidate, max-age=0");
@header("Expires: 0");
@header("Pragma: no-cache");
@header( "Content-type: text/html; charset=" . $config['charset'] );
require_once SYSTEM_DIR.'/modules/chat/addmess.php';
echo $chat->GetContent($chatconfig, $member_id, $config);
?>
+246
View File
@@ -0,0 +1,246 @@
<?php
@session_start();
@error_reporting(7);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
define('DATALIFEENGINE', true);
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR.'/data/config.php';
require_once SYSTEM_DIR.'/classes/mysql.php';
require_once SYSTEM_DIR.'/data/dbconfig.php';
require_once SYSTEM_DIR.'/inc/include/functions.inc.php';
$selected_language = $config['langs'];
if (isset( $_COOKIE['selected_language'] )) {
$_COOKIE['selected_language'] = trim(totranslit( $_COOKIE['selected_language'], false, false ));
if ($_COOKIE['selected_language'] != "" AND @is_dir ( ROOT_DIR . '/language/' . $_COOKIE['selected_language'] )) {
$selected_language = $_COOKIE['selected_language'];
}
}
require_once ROOT_DIR.'/language/'.$selected_language.'/adminpanel.lng';
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
require_once SYSTEM_DIR.'/modules/sitelogin.php';
if(($member_id['user_group'] != 1)) {die ("error");}
if ($_REQUEST['user_hash'] == "" OR $_REQUEST['user_hash'] != $dle_login_hash) {
die ("error");
}
if ($_REQUEST['step'] == 10) {
$_REQUEST['step'] = 11;
$db->query("TRUNCATE TABLE " . USERPREFIX . "_lostdb");
$db->query("TRUNCATE TABLE " . PREFIX . "_com_logs");
$db->query("TRUNCATE TABLE " . PREFIX . "_poll_log");
}
if ($_REQUEST['step'] == 8) {
$_REQUEST['step'] = 9;
$db->query("TRUNCATE TABLE " . USERPREFIX . "_pm");
$db->query("UPDATE " . USERPREFIX . "_users set pm_all='0', pm_unread='0'");
}
if ($_REQUEST['step'] == 6) {
$_REQUEST['step'] = 7;
$sql = $db->query("SELECT name, user_id, news_num, comm_num FROM " . USERPREFIX . "_users");
while($row = $db->get_row($sql)){
$posts = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_post WHERE autor = '{$row['name']}'");
$comms = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_comments WHERE user_id = '{$row['user_id']}'");
if (($posts['count'] != $row['news_num']) OR ($comms['count'] != $row['comm_num']))
$db->query("UPDATE " . USERPREFIX . "_users set news_num={$posts['count']}, comm_num={$comms['count']} where user_id='{$row['user_id']}'");
}
$db->free ($sql);
}
if ($_REQUEST['step'] == 4) {
if ((@strtotime($_REQUEST['date']) === -1) OR (trim($_REQUEST['date']) == ""))
$_REQUEST['step'] = 3;
else {
$_REQUEST['step'] = 5;
$sql = $db->query("SELECT COUNT(*) as count, post_id FROM " . PREFIX . "_comments WHERE date < '{$_REQUEST['date']}' GROUP BY post_id");
while($row = $db->get_row($sql)){
$db->query("UPDATE " . PREFIX . "_post set comm_num=comm_num-{$row['count']} where id='{$row['post_id']}'");
}
$db->query("DELETE FROM " . PREFIX . "_comments WHERE date < '{$_REQUEST['date']}'");
$db->free ($sql);
$cache->clear();
}
}
if ($_REQUEST['step'] == 2) {
if ((@strtotime($_REQUEST['date']) === -1) OR (trim($_REQUEST['date']) == ""))
$_REQUEST['step'] = 1;
else {
$_REQUEST['step'] = 3;
$sql = $db->query("SELECT id FROM " . PREFIX . "_post WHERE date < '{$_REQUEST['date']}'");
while($row = $db->get_row($sql)){
$db->query("DELETE FROM " . PREFIX . "_comments WHERE post_id='{$row['id']}'");
$db->query("DELETE FROM " . PREFIX . "_files WHERE news_id = '{$row['id']}'");
$db->query("DELETE FROM " . PREFIX . "_poll WHERE news_id = '{$row['id']}'");
$db->query("DELETE FROM " . PREFIX . "_poll_log WHERE news_id = '{$row['id']}'");
$db->query("DELETE FROM " . PREFIX . "_tags WHERE news_id = '{$row['id']}'" );
$getfiles = $db->query("SELECT onserver FROM " . PREFIX . "_files WHERE news_id = '{$row['id']}'");
while($file = $db->get_row($getfiles)){
@unlink(ROOT_DIR."/uploads/files/".$file['onserver']);
}
$db->free ($getfiles);
$image = $db->super_query("SELECT images FROM " . PREFIX . "_images where news_id = '{$row['id']}'");
$listimages = explode("|||", $image['images']);
if ($image['images'] != "")
foreach ($listimages as $dataimages) {
$url_image = explode("/", $dataimages);
if (count($url_image) == 2) {
$folder_prefix = $url_image[0]."/";
$dataimages = $url_image[1];
} else {
$folder_prefix = "";
$dataimages = $url_image[0];
}
@unlink(ROOT_DIR."/uploads/posts/".$folder_prefix.$dataimages);
@unlink(ROOT_DIR."/uploads/posts/".$folder_prefix."thumbs/".$dataimages);
}
$db->query("DELETE FROM " . PREFIX . "_images WHERE news_id = '{$row['id']}'");
}
$db->query("DELETE FROM " . PREFIX . "_post WHERE date < '{$_REQUEST['date']}'");
$db->free ($sql);
$cache->clear();
}
}
if ($_REQUEST['step'] == 11) {
$rs = $db->query("SHOW TABLE STATUS FROM `".DBNAME."`");
while ($r = $db->get_array($rs)) {
$db->query("OPTIMIZE TABLE ". $r['Name']);
}
$db->free ($rs);
$db->query("SHOW TABLE STATUS FROM `".DBNAME."`");
$mysql_size = 0;
while ($r = $db->get_array()) {
if (strpos($r['Name'], PREFIX."_") !== false)
$mysql_size += $r['Data_length'] + $r['Index_length'] ;
}
$lang['clean_finish'] = str_replace ('{db-alt}', '<font color="red">'.mksize($_REQUEST['size']).'</font>', $lang['clean_finish']);
$lang['clean_finish'] = str_replace ('{db-new}', '<font color="red">'.mksize($mysql_size).'</font>', $lang['clean_finish']);
$lang['clean_finish'] = str_replace ('{db-compare}', '<font color="red">'.mksize($_REQUEST['size'] - $mysql_size).'</font>', $lang['clean_finish']);
$buffer = <<<HTML
<br />{$lang['clean_finish']}
<br /><br />
HTML;
}
if ($_REQUEST['step'] == 9) {
$buffer = <<<HTML
<br />{$lang['clean_logs']}
<br /><br /><font color="red"><span id="status"></span></font><br /><br />
<input id = "next_button" onclick="start_clean('10', '{$_REQUEST['size']}'); return false;" class="buttons" style="width:100px;" type="button" value="{$lang['edit_next']}">&nbsp;
<input id = "skip_button" onclick="start_clean('11', '{$_REQUEST['size']}'); return false;" class="buttons" style="width:150px;" type="button" value="{$lang['clean_skip']}">
HTML;
}
if ($_REQUEST['step'] == 7) {
$buffer = <<<HTML
<br />{$lang['clean_pm']}
<br /><br /><font color="red"><span id="status"></span></font><br /><br />
<input id = "next_button" onclick="start_clean('8', '{$_REQUEST['size']}'); return false;" class="buttons" style="width:100px;" type="button" value="{$lang['edit_next']}">&nbsp;
<input id = "skip_button" onclick="start_clean('9', '{$_REQUEST['size']}'); return false;" class="buttons" style="width:150px;" type="button" value="{$lang['clean_skip']}">
HTML;
}
if ($_REQUEST['step'] == 5) {
$buffer = <<<HTML
<br />{$lang['clean_users']}
<br /><br /><font color="red"><span id="status"></span></font><br /><br />
<input id = "next_button" onclick="start_clean('6', '{$_REQUEST['size']}'); return false;" class="buttons" style="width:100px;" type="button" value="{$lang['edit_next']}">&nbsp;
<input id = "skip_button" onclick="start_clean('7', '{$_REQUEST['size']}'); return false;" class="buttons" style="width:150px;" type="button" value="{$lang['clean_skip']}">
HTML;
}
if ($_REQUEST['step'] == 3) {
$buffer = <<<HTML
<br />{$lang['clean_comments']}<br /><br />{$lang['addnews_date']}&nbsp;<input type="text" name="date" id="f_date_c" size="20" class=edit>
<img src="system/skins/images/img.gif" align="absmiddle" id="f_trigger_c" style="cursor: pointer; border: 0" />
<script type="text/javascript">
Calendar.setup({
inputField : "f_date_c", // id of the input field
ifFormat : "%Y-%m-%d", // format of the input field
button : "f_trigger_c", // trigger for the calendar (button ID)
align : "Br", // alignment
singleClick : true
});
</script>
<br /><br /><font color="red"><span id="status"></span></font><br /><br />
<input id = "next_button" onclick="start_clean('4', '{$_REQUEST['size']}'); return false;" class="buttons" style="width:100px;" type="button" value="{$lang['edit_next']}">&nbsp;
<input id = "skip_button" onclick="start_clean('5', '{$_REQUEST['size']}'); return false;" class="buttons" style="width:150px;" type="button" value="{$lang['clean_skip']}">
HTML;
}
if ($_REQUEST['step'] == 1) {
$buffer = <<<HTML
<br />{$lang['clean_news']}<br /><br />{$lang['addnews_date']}&nbsp;<input type="text" name="date" id="f_date_c" size="20" class=edit>
<img src="system/skins/images/img.gif" align="absmiddle" id="f_trigger_c" style="cursor: pointer; border: 0" />
<script type="text/javascript">
Calendar.setup({
inputField : "f_date_c", // id of the input field
ifFormat : "%Y-%m-%d", // format of the input field
button : "f_trigger_c", // trigger for the calendar (button ID)
align : "Br", // alignment
singleClick : true
});
</script>
<br /><br /><font color="red"><span id="status"></span></font><br /><br />
<input id = "next_button" onclick="start_clean('2', '{$_REQUEST['size']}'); return false;" class="buttons" style="width:100px;" type="button" value="{$lang['edit_next']}">&nbsp;
<input id = "skip_button" onclick="start_clean('3', '{$_REQUEST['size']}'); return false;" class="buttons" style="width:150px;" type="button" value="{$lang['clean_skip']}">
HTML;
}
@header("Content-type: text/css; charset=".$config['charset']);
echo $buffer;
?>
+51
View File
@@ -0,0 +1,51 @@
<?php
@session_start();
@error_reporting(7);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
define('DATALIFEENGINE', true);
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR.'/data/config.php';
require_once SYSTEM_DIR.'/classes/mysql.php';
require_once SYSTEM_DIR.'/data/dbconfig.php';
require_once SYSTEM_DIR.'/modules/functions.php';
require_once SYSTEM_DIR.'/modules/sitelogin.php';
if( !$is_logged ) die( "error" );
$id = intval( $_REQUEST['commid'] );
if( ! $id ) die( "error" );
$user_group = $cache->get( "usergroup" );
if( ! $user_group ) {$user_group = array ();
$db->query( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" );
while ( $row = $db->get_row() ) {$user_group[$row['id']] = array ();
foreach ( $row as $key => $value ) {$user_group[$row['id']][$key] = stripslashes($value);}
}
$cache->set( "usergroup", $user_group );
$db->free();
}
$row = $db->super_query("SELECT * FROM " . PREFIX . "_comments where id = '$id'");
$author = $row['autor'];
$is_reg = $row['is_register'];
$post_id = $row['post_id'];
if ($row['id'] AND $post_id){
$have_perm = false;
if (($member_id['user_id'] == $row['user_id'] and $row['is_register'] and $user_group[$member_id['user_group']]['allow_delc']) or $member_id['user_group'] == '1' or $user_group[$member_id['user_group']]['del_allc'] ) $have_perm = true;
//if ( $user_group[$member_id['user_group']]['edit_limit'] AND (($row['date'] + ($user_group[$member_id['user_group']]['edit_limit'] * 60)) < $_TIME) ) {$have_perm = false;} Îãðàíè÷åíèå íà óäàëåíèå êîììåíòîâ äíåì ïîçæå
if($have_perm){
$db->query("DELETE FROM " . PREFIX . "_comments where id = '$id'");
if ($is_reg) $author = $db->safesql($author); {$db->query("UPDATE " . USERPREFIX . "_users set comm_num=comm_num-1 where name ='$author'");}
$db->query("UPDATE " . PREFIX . "_post set comm_num=comm_num-1 where id='$post_id'") ;
$cache->clear( array( 'news_', 'comments-last', 'comm_'.$post_id, 'full_'.$post_id ) );
@header( "Content-type: text/html; charset=" . $config['charset'] );
echo "<div class=\"block2 line_center\"><b>Êîììåíòàðèé ïîä óíèêàëüíûì íîìåðîì: $id, áûë óñïåøíî óäàë¸í èç áàçû.</b></div>";
} else die( "error" );
} else die( "error" );
?>
+146
View File
@@ -0,0 +1,146 @@
<?php
@session_start();
@error_reporting( 7 );
@ini_set( 'display_errors', true );
@ini_set( 'html_errors', false );
define( 'DATALIFEENGINE', true );
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR . '/data/config.php';
require_once SYSTEM_DIR . '/classes/mysql.php';
require_once SYSTEM_DIR . '/data/dbconfig.php';
if( $_COOKIE['dle_skin'] ) {
if( @is_dir( ROOT_DIR . '/templates/' . $_COOKIE['dle_skin'] ) ) {
$config['skin'] = $_COOKIE['dle_skin'];
}
}
include_once ROOT_DIR . '/language/' . $config['langs'] . '/website.lng';
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
require_once SYSTEM_DIR . '/modules/functions.php';
require_once SYSTEM_DIR . '/classes/parse.class.php';
require_once SYSTEM_DIR . '/modules/sitelogin.php';
$area = totranslit($_REQUEST['area'], true, false);
if ( !$area) $area = "news";
$allowed_areas = array(
'news' => array (
'comments_table' => 'comments',
),
'ajax' => array (
'comments_table' => 'comments',
),
'lastcomments' => array (
'comments_table' => 'comments',
),
);
if (! is_array($allowed_areas[$area]) ) die( "error" );
$parse = new ParseFilter( );
$parse->safe_mode = true;
if( ! $is_logged ) die( "error" );
$id = intval( $_REQUEST['id'] );
if( ! $id ) die( "error" );
$user_group = $cache->get( "usergroup" );
if( ! $user_group ) {$user_group = array ();
$db->query( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" );
while ( $row = $db->get_row() ) {$user_group[$row['id']] = array ();
foreach ( $row as $key => $value ) {$user_group[$row['id']][$key] = stripslashes($value);}
}
$cache->set( "usergroup", $user_group );
$db->free();
}
$parse->allow_url = $user_group[$member_id['user_group']]['allow_url'];
$parse->allow_image = $user_group[$member_id['user_group']]['allow_image'];
if( $_REQUEST['action'] == "edit" ) {
$row = $db->super_query( "SELECT id, text, is_register, autor FROM " . PREFIX . "_{$allowed_areas[$area]['comments_table']} where id = '$id'" );
if( $id != $row['id'] ) die( "error" );
$have_perm = 0;
if( $is_logged and (($member_id['name'] == $row['autor'] and $row['is_register'] and $user_group[$member_id['user_group']]['allow_editc']) or $user_group[$member_id['user_group']]['edit_allc']) ) {
$have_perm = 1;
}
if( ! $have_perm ) die( "error" );
include_once SYSTEM_DIR . '/ajax/bbcode.php';
$comm_txt = $parse->decodeBBCodes( $row['text'], false );
$buffer = <<<HTML
<form name="ajaxcomments{$id}" id="ajaxcomments{$id}" metod="post" action="">
<div class="editor">
{$bb_code}
<textarea name="dleeditcomments{$id}" id="dleeditcomments{$id}" onclick="setNewField(this.name, document.ajaxcomments{$id})" style="width:99%; height:150px; border:1px solid #E0E0E0">{$comm_txt}</textarea><br>
<div align="right" style="width:99%;padding-top:5px;"><input class=bbcodes title="$lang[bb_t_apply]" type=button onclick="ajax_save_comm_edit('{$id}', '{$area}'); return false;" value="$lang[bb_b_apply]">
<input class=bbcodes title="$lang[bb_t_cancel]" type=button onclick="ajax_cancel_comm_edit('{$id}'); return false;" value="$lang[bb_b_cancel]">
</div></div>
</form>
HTML;
} elseif( $_REQUEST['action'] == "save" ) {
$row = $db->super_query( "SELECT id, post_id, text, is_register, autor FROM " . PREFIX . "_{$allowed_areas[$area]['comments_table']} where id = '$id'" );
if( $id != $row['id'] ) die( "error" );
$have_perm = 0;
if( $is_logged AND (($member_id['name'] == $row['autor'] AND $row['is_register'] AND $user_group[$member_id['user_group']]['allow_editc']) OR $user_group[$member_id['user_group']]['edit_allc']) ) {
$have_perm = 1;
}
if( ! $have_perm ) die( "error" );
$use_html = false;
$comm_txt = trim( $parse->BB_Parse( $parse->process( convert_unicode( $_POST['comm_txt'], $config['charset'] ) ), $use_html ) );
if( $parse->not_allowed_tags ) {die( "error" );}
if( $parse->not_allowed_text ) {die( "error" );}
if( strlen( $comm_txt ) > $config['comments_maxlen'] ) {die( "error" );}
if( $comm_txt == "" ) {die( "error" );}
//* Àâòîïåðåíîñ äëèííûõ ñëîâ
if( intval( $config['auto_wrap'] ) ) {
$comm_txt = preg_split( '((>)|(<))', $comm_txt, - 1, PREG_SPLIT_DELIM_CAPTURE );
$n = count( $comm_txt );
for($i = 0; $i < $n; $i ++) {
if( $comm_txt[$i] == "<" ) {
$i ++;
continue;
}
$comm_txt[$i] = preg_replace( "#([^\s\n\r]{" . intval( $config['auto_wrap'] ) . "})#i", "\\1<br />", $comm_txt[$i] );
}
$comm_txt = join( "", $comm_txt );
}
$comm_update = $db->safesql( $comm_txt );
$db->query( "UPDATE " . PREFIX . "_{$allowed_areas[$area]['comments_table']} set text='$comm_update' where id = '$id'" );
$comm_txt = preg_replace( "'\[hide\](.*?)\[/hide\]'si", "\\1", $comm_txt );
$comm_txt = preg_replace ( "'\[hide=(.*?)\](.*?)\[/hide\]'sie",'comm_hide($1,"\\2")',$comm_txt);
$buffer = stripslashes( $comm_txt );
$cache->clear( 'comm_'.$row['post_id'] );
} else
die( "error" );
$db->close();
@header( "Content-type: text/html; charset=" . $config['charset'] );
echo $buffer;
?>
+53
View File
@@ -0,0 +1,53 @@
<?php
@session_start();
@error_reporting( 7 );
@ini_set( 'display_errors', true );
@ini_set( 'html_errors', false );
define( 'DATALIFEENGINE', true );
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR . '/data/config.php';
require_once SYSTEM_DIR . '/classes/mysql.php';
require_once SYSTEM_DIR . '/data/dbconfig.php';
require_once SYSTEM_DIR . '/modules/functions.php';
$_REQUEST['skin'] = totranslit($_REQUEST['skin'], false, false);
if( ! @is_dir( ROOT_DIR . '/templates/' . $_REQUEST['skin'] ) ) {die( "Hacking attempt!" );} else {$config['skin'] = $_REQUEST['skin'];}
include_once ROOT_DIR . '/language/' . $config['langs'] . '/website.lng';
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
require_once SYSTEM_DIR . '/modules/sitelogin.php';
if( ! $is_logged ) die( "error" );
$id = intval( $_REQUEST['fav_id'] );
if( ! $id ) die( "error" );
if( $_REQUEST['action'] == "plus" ) {
$error = "";
$list = explode( ",", $member_id['favorites'] );
foreach ( $list as $daten ) {if( $daten == $id ) $error = "stop";}
if( $error != "stop" ) {
$list[] = $id;
$favorites = implode( ",", $list );
if( $member_id['favorites'] == "" ) $favorites = $id;
$member_id['favorites'] = $favorites;
$db->query( "UPDATE " . USERPREFIX . "_users set favorites='$favorites' where user_id = '$member_id[user_id]'" );
}
$buffer = "<img src=\"" . $config['http_home_url'] . "templates/{$config['skin']}/images/del_fav.png\" onclick=\"doFavorites('" . $id . "', 'minus'); return false;\" title=\"" . $lang['news_minfav'] . "\" style=\"vertical-align: middle;border: none;\" />";
} elseif( $_REQUEST['action'] == "minus" ) {
$list = explode( ",", $member_id['favorites'] );
$i = 0;
foreach ( $list as $daten ) {if( $daten == $id ) unset( $list[$i] ); $i ++;}
if( count( $list ) ) $member_id['favorites'] = $db->safesql(implode( ",", $list )); else $member_id['favorites'] = "";
$db->query( "UPDATE " . USERPREFIX . "_users set favorites='$member_id[favorites]' where user_id = '$member_id[user_id]'" );
$buffer = "<img src=\"" . $config['http_home_url'] . "templates/{$config['skin']}/images/add_fav.png\" onclick=\"doFavorites('" . $id . "', 'plus'); return false;\" title=\"" . $lang['news_addfav'] . "\" style=\"vertical-align: middle;border: none;\" />";
} else die( "error" );
$db->close();
@header( "Content-type: text/html; charset=" . $config['charset'] );
echo $buffer;
?>
+38
View File
@@ -0,0 +1,38 @@
<?php
@session_start();
@error_reporting( 7 );
@ini_set( 'display_errors', true );
@ini_set( 'html_errors', false );
define( 'DATALIFEENGINE', true );
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR . '/data/config.php';
require_once SYSTEM_DIR . '/classes/mysql.php';
require_once SYSTEM_DIR . '/data/dbconfig.php';
require_once SYSTEM_DIR . '/modules/functions.php';
require_once SYSTEM_DIR . '/modules/sitelogin.php';
if( ! $is_logged ) die( "error" );
$title = $db->safesql( trim( convert_unicode( $_POST['title'], $config['charset'] ) ) );
if( $title == "" ) die();
$buffer = "";
$id = intval( $_POST['id'] );
if( $id ) $where = " AND id != '" . $id . "'"; else $where = "";
$db->query( "SELECT id, title, date, alt_name, MATCH (title, short_story) AGAINST ('$title') as score FROM " . PREFIX . "_post WHERE MATCH (title, short_story) AGAINST ('$title') AND approve='1'" . $where . " ORDER BY score DESC, date DESC LIMIT 5" );
while ( $related = $db->get_row() ) {
$related['date'] = strtotime( $related['date'] );
$news_date = date( 'd-m-Y', $related['date'] );
$full_link = $config['http_home_url'] . $related['id'] . "-" . $related['alt_name'] . ".html";
$buffer .= "<div style=\"padding:2px;\">{$news_date} - <a href=\"".$full_link."\" target=\"_blank\">".stripslashes($related['title'])."</a></div>";
}
$db->close();
@header( "Content-type: text/html; charset=" . $config['charset'] );
if( $buffer ) echo "<div style=\"width:600px; background: #ffc;border:1px solid #9E9E9E;padding: 5px;margin-top: 7px;margin-right: 10px;\">" . $buffer . "</div>";
else echo "<div style=\"width:542px;background: #ffc;border:1px solid #9E9E9E;padding: 5px;margin-top: 7px;margin-right: 10px;\">Ïîõîæèõ íîâîñòåé íå íàéäåíî.</div>";
?>
+35
View File
@@ -0,0 +1,35 @@
<?php
@session_start();
@error_reporting(7);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
define('DATALIFEENGINE', true);
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR.'/data/config.php';
require_once SYSTEM_DIR.'/classes/mysql.php';
require_once SYSTEM_DIR.'/data/dbconfig.php';
require_once ROOT_DIR.'/language/'.$config['langs'].'/adminpanel.lng';
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
require_once SYSTEM_DIR.'/inc/include/functions.inc.php';
require_once SYSTEM_DIR.'/classes/parse.class.php';
$parse = new ParseFilter();
$full_story = $parse->BB_Parse($parse->process(convert_unicode($_REQUEST['full_txt'], $config['charset'])), false);
$short_story = $parse->BB_Parse($parse->process(convert_unicode($_REQUEST['short_txt'], $config['charset'])), false);
if ($full_story) $metatags = create_metatags ($full_story);
else $metatags = create_metatags ($short_story);
$metatags['description'] = trim($metatags['description']);
$metatags['keywords'] = trim($metatags['keywords']);
@header( "Content-type: text/html; charset=" . $config['charset'] );
if ($_REQUEST['key'] == 1) echo stripslashes($metatags['description']);
else echo stripslashes($metatags['keywords']);
?>
+196
View File
@@ -0,0 +1,196 @@
<?php
@session_start();
@error_reporting(7);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
define('DATALIFEENGINE', true);
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR.'/data/config.php';
require_once SYSTEM_DIR.'/classes/mysql.php';
require_once SYSTEM_DIR.'/data/dbconfig.php';
require_once ROOT_DIR.'/language/'.$config['langs'].'/website.lng';
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
require_once SYSTEM_DIR.'/modules/functions.php';
$user_group = $cache->get ( "usergroup" );
if (! $user_group) {
$user_group = array ();
$db->query ( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" );
while ( $row = $db->get_row () ) {
$user_group[$row['id']] = array ();
foreach ( $row as $key => $value ) {
$user_group[$row['id']][$key] = $value;
}}
$cache->set ( "usergroup", $user_group );
$db->free ();
}
require_once SYSTEM_DIR.'/modules/sitelogin.php';
if (!$is_logged OR $member_id['user_group'] != 1) die ("error");
$startfrom = intval($_POST['startfrom']);
if ($_POST['empfanger'] != "all") $empfanger = intval($_POST['empfanger']);
$type = $_POST['type'];
$a_mail = intval($_POST['a_mail']);
$limit = intval($_POST['limit']);
$step = 0;
$title = convert_unicode($_POST['title'], $config['charset']);
$message = convert_unicode($_POST['message'], $config['charset']);
$find = array ('/data:/i', '/about:/i', '/vbscript:/i', '/onclick/i', '/onload/i', '/onunload/i', '/onabort/i', '/onerror/i', '/onblur/i', '/onchange/i', '/onfocus/i', '/onreset/i', '/onsubmit/i', '/ondblclick/i', '/onkeydown/i', '/onkeypress/i', '/onkeyup/i', '/onmousedown/i', '/onmouseup/i', '/onmouseover/i', '/onmouseout/i', '/onselect/i', '/javascript/i', '/javascript/i' );
$replace = array ("d&#097;ta:", "&#097;bout:", "vbscript<b></b>:", "&#111;nclick", "&#111;nload", "&#111;nunload", "&#111;nabort", "&#111;nerror", "&#111;nblur", "&#111;nchange", "&#111;nfocus", "&#111;nreset", "&#111;nsubmit", "&#111;ndblclick", "&#111;nkeydown", "&#111;nkeypress", "&#111;nkeyup", "&#111;nmousedown", "&#111;nmouseup", "&#111;nmouseover", "&#111;nmouseout", "&#111;nselect", "j&#097;vascript" );
$message = preg_replace( $find, $replace, $message );
$message = preg_replace( "#<iframe#i", "&lt;iframe", $message );
$message = preg_replace( "#<script#i", "&lt;script", $message );
$message = str_replace( "<?", "&lt;?", $message );
$message = str_replace( "?>", "?&gt;", $message );
if (!$title OR !$message OR !$limit) die ("error");
if ($type == "pm") {
$time = time()+($config['date_adjust']*60);
$title = $db->safesql($title);
$message = $db->safesql($message);
if ($empfanger != "all")
$result = $db->query("SELECT user_id, name, fullname FROM " . USERPREFIX . "_users where user_group = '$empfanger' LIMIT ".$startfrom.",".$limit);
else
$result = $db->query("SELECT user_id, name, fullname FROM " . USERPREFIX . "_users LIMIT ".$startfrom.",".$limit);
while($row = $db->get_row($result))
{
if ( $row['fullname'] )
$message_send = str_replace("{%user%}", $row['fullname'], $message);
else
$message_send = str_replace("{%user%}", $row['name'], $message);
$db->query("INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values ('$title', '$message_send', '$row[user_id]', '$member_id[name]', '$time', 'no', 'inbox')");
$db->query("UPDATE " . USERPREFIX . "_users set pm_all=pm_all+1, pm_unread=pm_unread+1 where user_id='$row[user_id]'");
$step++;
}
$db->free($result);
}
elseif ($type == "email") {
$message = stripslashes( $message );
$title = stripslashes( $title );
$message = <<<HTML
<html><title>{$title}</title>
<meta content="text/html; charset={$config['charset']}" http-equiv=Content-Type>
<style type="text/css">
html,body{
font-size: 11px;
font-family: verdana;
}
a:active,
a:visited,
a:link {
color: #4b719e;
text-decoration:none;
}
a:hover {
color: #4b719e;
text-decoration: underline;
}
</style>
<body>
{$message}
</body>
</html>
HTML;
include_once SYSTEM_DIR.'/classes/mail.class.php';
$mail = new dle_mail ($config, true);
$where = array();
if ($empfanger != "all") $where[] = "user_group = '{$empfanger}'";
if ($a_mail) $where[] = "allow_mail = '1'";
if (count($where)) $where = " WHERE ".implode (" AND ", $where);
else $where = "";
if ($config['mail_bcc']) {
$limit = $limit * 6;
$i = 0;
$h_mail = array();
$bcc = array();
$db->query("SELECT email FROM " . USERPREFIX . "_users".$where." LIMIT ".$startfrom.",".$limit);
$db->close();
while($row = $db->get_row())
{
if ($i == 0) { $h_mail[$t] = $row['email'];}
else {$bcc[$t][] = $row['email'];}
$i++;
if ($i == 6) {
$i=0;
$t++;
}
$step++;
}
$db->free();
foreach ($h_mail as $key => $email) {
$mail->bcc = $bcc[$key];
$message_send = str_replace("{%user%}", $lang['nl_info_2'], $message);
$mail->send ($email, $title, $message_send);
}
}
else
{
$db->query("SELECT email, name, fullname FROM " . USERPREFIX . "_users".$where." LIMIT ".$startfrom.",".$limit);
$db->close();
while($row = $db->get_row())
{
if ( $row['fullname'] )
$message_send = str_replace("{%user%}", $row['fullname'], $message);
else
$message_send = str_replace("{%user%}", $row['name'], $message);
$mail->send ($row['email'], $title, $message_send);
$step++;
}
$db->free();
}
}
else
{
die ("error");
}
$count = $startfrom + $step;
$buffer = "{\"status\": \"ok\",\"count\": {$count}}";
@header( "Content-type: text/html; charset=" . $config['charset'] );
echo $buffer;
?>
+95
View File
@@ -0,0 +1,95 @@
<?php
@session_start();
error_reporting(7);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
define('DATALIFEENGINE', true);
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR.'/data/config.php';
require_once SYSTEM_DIR.'/classes/mysql.php';
require_once SYSTEM_DIR.'/data/dbconfig.php';
if ($_COOKIE['dle_skin']) {if (@is_dir(ROOT_DIR.'/templates/'.$_COOKIE['dle_skin'])){$config['skin'] = $_COOKIE['dle_skin'];}}
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
require_once SYSTEM_DIR.'/modules/functions.php';
require_once SYSTEM_DIR.'/modules/sitelogin.php';
require_once SYSTEM_DIR.'/classes/templates.class.php';
$tpl = new dle_template;
$tpl->dir = ROOT_DIR.'/templates/'.$config['skin'];;
define('TEMPLATE_DIR', $tpl->dir);
$id = intval($_REQUEST['news_id']);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// "Íà÷àëî" Ïîêàç êðàòêîãî ñîäåðæàíèÿ
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if($_REQUEST['action'] == "plus")
{
$result = $db->query("SELECT * FROM ".PREFIX."_post WHERE id='{$id}'");
$row = $db->get_row($result);
$tpl->load_template('newslist/newslist.tpl');
/* Äåëàåì ìèíóñ ìåñòî ïëþ÷à */
$tpl->set('{spoiler}',"<img style=\"cursor: pointer;\" src=\"/templates/{$config['skin']}/images/newslist_minus.gif\" onclick=\"newslist('".$row['id']."', 'minus'); return false;\" align=\"absmiddle\" border=\"0\" title=\"Óáðàòü êðàòêîå ñîäåðæàíèå ñòàòüè\"></div>");
$tpl->set("{story}", stripslashes($row['short_story']));
$tpl->set("{title}", stripslashes($row['title']));
$date_news = strtotime($row['date']);
$link = $config['http_home_url'].$row['id']."-".$row['alt_name'].".html";
$tpl->set("{link}", $link);
if(isset($_GET['author'])){$autor = "<a href=\"/user/".$row['autor']."/\">".stripcslashes($row['autor'])."</a>";}else{$autor = "<a href=\"/newslist/".$category."/author/".$row['autor']."/\">".stripcslashes($row['autor'])."</a>";}
$tpl->set("{author}", $autor);
if($is_logged){$tpl->set("[hide]", "");$tpl->set("[/hide]", "");}
else{$tpl->set_block("'\\[hide\\](.*?)\\[/hide\\]'si","<div class=\"quote\">Ñêðûòûé òåêñò, íåîáõîäèìà àâòîðèçàöèÿ.</div>");}
$tpl->set("{rating}", $row['rating']);
$date = date("d.m.Y",strtotime($row['date']));
$tpl->set("{date}", $date);
$tpl->set("[ajax]", "");
$tpl->set("[/ajax]", "");
$tpl->set_block("'\\[not-ajax\\](.*?)\\[/not-ajax\\]'si","");
$tpl->set("{coments}", $row['comm_num']);
$tpl->set("{prosmotr}", $row['news_read']);
$tpl->set('{THEME}', $config['http_home_url'].'templates/'.$config['skin']);
$tpl->compile('newslistspoiler');
@header( "Content-type: text/html; charset=" . $config['charset'] );
echo $tpl->result['newslistspoiler'];
}elseif($_REQUEST['action'] == "minus"){
$result = $db->query("SELECT * FROM ".PREFIX."_post WHERE id='{$id}'");
$row = $db->get_row($result);
$tpl->load_template('newslist/newslist.tpl');
$tpl->set('{spoiler}',"<img style=\"cursor: pointer;\" src=\"/templates/{$config['skin']}/images/newslist_plus.gif\" onclick=\"newslist('".$row['id']."', 'plus'); return false;\" align=\"absmiddle\" border=\"0\" title=\"Ïîêàçàòü êðàòêîå ñîäåðæàíèå ñòàòüè\"></div>");
$tpl->set("{story}", "");
$tpl->set("{title}", stripslashes($row['title']));
$date_news = strtotime($row['date']);
$link = $config['http_home_url'].$row['id']."-".$row['alt_name'].".html";
$tpl->set("{link}", $link);
if($row['approve'] == 1){$moder = "<font color =\"green\">Äà</a>";}else{$moder = "<font color =\"red\">Íåò</a>";}
if(isset($_GET['author'])){$autor = "<a href=\"/user/".$row['autor']."/\">".stripcslashes($row['autor'])."</a>";}else{$autor = "<a href=\"/newslist/".$category."/author/".$row['autor']."/\">".stripcslashes($row['autor'])."</a>";}
$tpl->set("{author}", $autor);
$tpl->set("{rating}", $row['rating']);
$date = date("d.m.Y",strtotime($row['date']));
$tpl->set("{date}", $date);
$tpl->set_block("'\\[ajax\\](.*?)\\[/ajax\\]'si","");
$tpl->set("[not-ajax]", "");
$tpl->set("[/not-ajax]", "");
$tpl->set("{coments}", $row['comm_num']);
$tpl->set("{prosmotr}", $row['news_read']);
$tpl->set('{THEME}', $config['http_home_url'].'templates/'.$config['skin']);
$tpl->compile('newslistspoiler');
@header( "Content-type: text/html; charset=" . $config['charset'] );
echo $tpl->result['newslistspoiler'];
}
?>
+162
View File
@@ -0,0 +1,162 @@
<?php
@session_start();
@error_reporting( E_ALL ^ E_NOTICE );
@ini_set( 'display_errors', true );
@ini_set( 'html_errors', false );
@ini_set( 'error_reporting', E_ALL ^ E_NOTICE );
define( 'DATALIFEENGINE', true );
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR . '/data/config.php';
require_once SYSTEM_DIR . '/classes/mysql.php';
require_once SYSTEM_DIR . '/data/dbconfig.php';
require_once SYSTEM_DIR . '/modules/functions.php';
$user_group = $cache->get( "usergroup" );
if( ! $user_group ) {$user_group = array ();
$db->query( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" );
while ( $row = $db->get_row() ) {$user_group[$row['id']] = array ();
foreach ( $row as $key => $value ) {$user_group[$row['id']][$key] = stripslashes($value);}
}
$cache->set( "usergroup", $user_group );
$db->free();
}
require_once SYSTEM_DIR . '/modules/sitelogin.php';
function votes($all, $ansid) {
$data = array ();
$alldata = array ();
if( $all != "" ) {
$all = explode( "|", $all );
foreach ( $all as $vote ) {
list ( $answerid, $answervalue ) = explode( ":", $vote );
$data[$answerid] = intval( $answervalue );
}
}
foreach ( $ansid as $id ) {
$data[$id] ++;
}
foreach ( $data as $key => $value ) {
$alldata[] = intval( $key ) . ":" . intval( $value );
}
$alldata = implode( "|", $alldata );
return $alldata;
}
function get_votes($all) {
$data = array ();
if( $all != "" ) {
$all = explode( "|", $all );
foreach ( $all as $vote ) {
list ( $answerid, $answervalue ) = explode( ":", $vote );
$data[$answerid] = intval( $answervalue );
}
}
return $data;
}
$news_id = intval( $_REQUEST['news_id'] );
$answers = explode( " ", trim( $_REQUEST['answer'] ) );
$buffer = "";
$vote_skin = trim(totranslit( $_REQUEST['vote_skin'], false, false));
$_IP = $db->safesql( $_SERVER['REMOTE_ADDR'] );
if( $is_logged ) $log_id = intval( $member_id['user_id'] );
else $log_id = $_IP;
$poll = $db->super_query( "SELECT * FROM " . PREFIX . "_poll WHERE news_id = '{$news_id}'" );
$log = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_poll_log WHERE news_id = '{$news_id}' AND member ='{$log_id}'" );
if( $log['count'] and $_REQUEST['action'] != "list" ) $_REQUEST['action'] = "results";
if($_REQUEST['action'] != "list" AND !$user_group[$member_id['user_group']]['allow_poll']) $_REQUEST['action'] = "results";
$votes = "";
if( $_REQUEST['action'] == "vote" ) {
$votes = votes( $poll['answer'], $answers );
$db->query( "UPDATE " . PREFIX . "_poll set answer='$votes', votes=votes+" . count( $answers ) . " WHERE news_id = '{$news_id}'" );
$db->query( "INSERT INTO " . PREFIX . "_poll_log (news_id, member) VALUES('{$news_id}', '$log_id')" );
$_REQUEST['action'] = "results";
}
if( $_REQUEST['action'] == "results" ) {
if( $votes == "" ) {
$votes = $poll['answer'];
$allcount = $poll['votes'];
} else {
$allcount = count( $answers ) + $poll['votes'];
}
$answer = get_votes( $votes );
$body = explode( "<br />", stripslashes( $poll['body'] ) );
$pn = 0;
for($i = 0; $i < sizeof( $body ); $i ++) {
$num = $answer[$i];
if( ! $num ) $num = 0;
++ $pn;
if( $pn > 5 ) $pn = 1;
if( $allcount != 0 ) $proc = (100 * $num) / $allcount;
else $proc = 0;
$proc = round( $proc, 2 );
$buffer .= <<<HTML
{$body[$i]} - {$num} ({$proc}%)<br />
<img src="{$config['http_home_url']}templates/{$vote_skin}/images/poll{$pn}.gif" height="10" width="{$proc}%" style="border:1px solid black;" alt="" /><br />
HTML;
}
} elseif( $_REQUEST['action'] == "list" ) {
$body = explode( "<br />", stripslashes( $poll['body'] ) );
if( ! $poll['multiple'] ) {
for($v = 0; $v < sizeof( $body ); $v ++) {
if( ! $v ) $sel = "checked";
else $sel = "";
$buffer .= <<<HTML
<div><input name="dle_poll_votes" type="radio" $sel value="{$v}" /> {$body[$v]}</div>
HTML;
}
} else {
for($v = 0; $v < sizeof( $body ); $v ++) {
$buffer .= <<<HTML
<div><input name="dle_poll_votes[]" type="checkbox" value="{$v}" /> {$body[$v]}</div>
HTML;
}
}
} else
die( "error" );
@header( "Content-type: text/html; charset=" . $config['charset'] );
echo $buffer;
?>
+73
View File
@@ -0,0 +1,73 @@
<?php
@session_start();
@error_reporting( 7 );
@ini_set( 'display_errors', true );
@ini_set( 'html_errors', false );
define( 'DATALIFEENGINE', true );
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
$go_rate = intval( $_REQUEST['go_rate'] );
$id = intval( $_REQUEST['id'] );
$type = intval( $_REQUEST['type'] );
if( $go_rate > 1 or $go_rate < -1 ) $go_rate = 0;
if( ! $go_rate or ! $id ) die( "Hacking attempt!" );
include SYSTEM_DIR . '/data/config.php';
require_once SYSTEM_DIR . '/classes/mysql.php';
require_once SYSTEM_DIR . '/data/dbconfig.php';
require_once SYSTEM_DIR . '/modules/functions.php';
$_REQUEST['skin'] = totranslit($_REQUEST['skin'], false, false);
if( $_REQUEST['skin'] ) {if( @is_dir( ROOT_DIR . '/templates/' . $_REQUEST['skin'] ) ) {$config['skin'] = $_REQUEST['skin'];
} else {die( "Hacking attempt!" );}}
include_once ROOT_DIR . '/language/' . $config['langs'] . '/website.lng';
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
$user_group = $cache->get( "usergroup" );
if( ! $user_group ) {$user_group = array ();
$db->query( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" );
while ( $row = $db->get_row() ) {$user_group[$row['id']] = array ();
foreach ( $row as $key => $value ) {$user_group[$row['id']][$key] = stripslashes($value);}
}
$cache->set( "usergroup", $user_group );
$db->free();
}
require_once SYSTEM_DIR . '/modules/sitelogin.php';
if( ! $user_group[$member_id['user_group']]['allow_rating'] ) die( "Hacking attempt!" );
$_IP = $db->safesql( $_SERVER['REMOTE_ADDR'] );
$member_id['name'] = $db->safesql($member_id['name']);
if( $is_logged ) $where = "member = '{$member_id['name']}'"; else $where = "ip ='{$_IP}'";
$row = $db->super_query( "SELECT type_id FROM " . PREFIX . "_rate where type_id ='$id' AND {$where} AND type='$type'" );
if( ! $row['type_id'] AND count( explode( ".", $_IP ) ) == 4 ) {
if($type==1)$db->query( "UPDATE " . PREFIX . "_post set rating=rating+'$go_rate' where id ='$id'" );
else $db->query("UPDATE " . PREFIX . "_comments set rating=rating+'$go_rate' where id ='$id'");
if ($db->get_affected_rows()){
if( $is_logged ) $user_name = $member_id['name']; else $user_name = "anonymous";
$rate_date = time() + (0 * 60);
$db->query( "INSERT INTO " . PREFIX . "_rate (type_id, ip, member, date, rating, type) values ('$id', '$_IP', '$user_name', '$rate_date', '$go_rate', '$type')" );
$cache->clear( array('news_', 'comm_', 'rss') );
}}
if($type==1){
$row = $db->super_query( "SELECT id, rating FROM " . PREFIX . "_post where id ='$id'" );
$buffer = ShortRating( $row['id'], $row['rating'], false );
}else{
$row = $db->super_query("SELECT * FROM " . PREFIX . "_comments where id ='$id'");
$buffer = CommRating($row['id'], $row['rating'], false);
}
$db->close();
@header( "Content-type: text/html; charset=" . $config['charset'] );
echo $buffer;
?>
+124
View File
@@ -0,0 +1,124 @@
<?php
@session_start();
@error_reporting ( E_ALL ^ E_WARNING ^ E_NOTICE );
@ini_set ( 'display_errors', true );
@ini_set ( 'html_errors', false );
@ini_set ( 'error_reporting', E_ALL ^ E_WARNING ^ E_NOTICE );
define('DATALIFEENGINE', true);
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR.'/data/config.php';
require_once SYSTEM_DIR.'/classes/mysql.php';
require_once SYSTEM_DIR.'/data/dbconfig.php';
require_once SYSTEM_DIR.'/inc/include/functions.inc.php';
require_once SYSTEM_DIR.'/modules/sitelogin.php';
if(($member_id['user_group'] != 1)) {die ("error");}
$user_group = $cache->get( "usergroup" );
if( ! $user_group ) {
$user_group = array ();
$db->query( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" );
while ( $row = $db->get_row() ) {
$user_group[$row['id']] = array ();
foreach ( $row as $key => $value ) {
$user_group[$row['id']][$key] = stripslashes($value);
}
}
$cache->set( "usergroup", $user_group );
$db->free();
}
if ($_REQUEST['user_hash'] == "" OR $_REQUEST['user_hash'] != $dle_login_hash) {die ("error");}
require_once ROOT_DIR.'/language/'.$config['langs'].'/adminpanel.lng';
include_once SYSTEM_DIR . '/classes/parse.class.php';
@header("Content-type: text/html; charset=".$config['charset']);
$startfrom = intval($_POST['startfrom']);
$buffer = "";
$step = 0;
if ( intval( $config['tag_img_width'] ) ) $count_per_step = 5; else $count_per_step = 50;
if($_POST['area'] == "forum" ){
$parse = new ParseFilter(Array(), Array(), 1, 1);
$result = $db->query("SELECT pid, post_text FROM " . PREFIX . "_forum_posts LIMIT ".$startfrom.", ".$count_per_step);
while($row = $db->get_row($result)){
$row['post_text'] = $parse->decodeBBCodes($row['post_text'], false);
$post_text = $parse->process($row['post_text']);
$post_text = $db->safesql($parse->BB_Parse($post_text, true));
$db->query( "UPDATE " . PREFIX . "_forum_posts SET post_text='$post_text' WHERE pid='{$row['pid']}'" );
$step++;
}
$rebuildcount = $startfrom + $step;
$buffer = "{\"status\": \"ok\",\"rebuildcount\": {$rebuildcount}}";
echo $buffer;
} elseif ($_POST['area'] == "comments" ) {
$commparse = new ParseFilter( );
//$commparse->safe_mode = true;
$result = $db->query("SELECT id, text FROM " . PREFIX . "_comments LIMIT ".$startfrom.", ".$count_per_step);
while($row = $db->get_row($result)){
$row['text'] = $commparse->decodeBBCodes( $row['text'], false );
$text = $commparse->process( $row['text'] );
$text = $db->safesql($commparse->BB_Parse( $text, false ));
$db->query( "UPDATE " . PREFIX . "_comments SET text='$text' WHERE id='{$row['id']}'" );
$step++;
}
$rebuildcount = $startfrom + $step;
$buffer = "{\"status\": \"ok\",\"rebuildcount\": {$rebuildcount}}";
echo $buffer;
} elseif ($_POST['area'] == "static" ) {
$parse = new ParseFilter( Array (), Array (), 1, 1 );
$result = $db->query("SELECT id, template FROM " . PREFIX . "_static LIMIT ".$startfrom.", ".$count_per_step);
while($row = $db->get_row($result)){
$row['template'] = $parse->decodeBBCodes( $row['template'], false );
$template = $parse->process( $row['template'] );
$template = $db->safesql($parse->BB_Parse( $template, true ));
$db->query( "UPDATE " . PREFIX . "_static SET template='$template' WHERE id='{$row['id']}'" );
$step++;
}
$rebuildcount = $startfrom + $step;
$buffer = "{\"status\": \"ok\",\"rebuildcount\": {$rebuildcount}}";
echo $buffer;
} else {
$parse = new ParseFilter( Array (), Array (), 1, 1 );
$result = $db->query("SELECT id, short_story, full_story, title FROM " . PREFIX . "_post LIMIT ".$startfrom.", ".$count_per_step);
while($row = $db->get_row($result)){
$row['short_story'] = $parse->decodeBBCodes( $row['short_story'], false );
$row['full_story'] = $parse->decodeBBCodes( $row['full_story'], false );
$short_story = $parse->process( $row['short_story'] );
$full_story = $parse->process( $row['full_story'] );
$full_story = $db->safesql( $parse->BB_Parse( $row['full_story'], false ) );
$short_story = $db->safesql( $parse->BB_Parse( $row['short_story'], false ) );
$db->query( "UPDATE " . PREFIX . "_post SET short_story='$short_story', full_story='$full_story' WHERE id='{$row['id']}'" );
$step++;
}
$cache->clear();
$rebuildcount = $startfrom + $step;
$buffer = "{\"status\": \"ok\",\"rebuildcount\": {$rebuildcount}}";
echo $buffer;
}
?>
+73
View File
@@ -0,0 +1,73 @@
<?php
@error_reporting(7);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
define('DATALIFEENGINE', true);
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR.'/data/config.php';
require_once SYSTEM_DIR.'/classes/mysql.php';
require_once SYSTEM_DIR.'/data/dbconfig.php';
require_once SYSTEM_DIR . '/modules/functions.php';
include_once ROOT_DIR.'/language/'.$config['langs'].'/website.lng';
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
require_once SYSTEM_DIR.'/modules/functions.php';
require_once SYSTEM_DIR.'/classes/parse.class.php';
$parse = new ParseFilter();
function check_name($name)
{
global $lang, $db, $banned_info;
$stop = '';
if (strlen($name) > 20){$stop .= $lang['reg_err_3'];}
if (preg_match("/[\||\'|\<|\>|\[|\]|\"|\!|\?|\$|\@|\/|\\\|\&\~\*\{\+]/",$name)){$stop .= $lang['reg_err_4'];}
if (empty($name)){$stop .= $lang['reg_err_7'];}
if (strpos( strtolower ($name) , '.php' ) !== false) {$stop .= $lang['reg_err_4'];}
if (count($banned_info['name'])) foreach($banned_info['name'] as $banned){
$banned['name'] = str_replace( '\*', '.*' , preg_quote($banned['name'], "#") );
if ( $banned['name'] AND preg_match( "#^{$banned['name']}$#i", $name ) ) {
if ($banned['descr']) {$lang['reg_err_21'] = str_replace("{descr}", $lang['reg_err_22'], $lang['reg_err_21']); $lang['reg_err_21'] = str_replace("{descr}", $banned['descr'], $lang['reg_err_21']);
} else $lang['reg_err_21'] = str_replace("{descr}", "", $lang['reg_err_21']);
$stop .= $lang['reg_err_21'];
}}
if (!$stop){
$replace_word = array ('e' => '[eå¸]', 'r' => '[rã]', 't' => '[tò]', 'y' => '[yó]','u' => '[uè]','i' => '[i1l!]','o' => '[oî0]','p' => '[pð]','a' => '[aà]','s' => '[s5]','w' => 'w','q' => 'q','d' => 'd','f' => 'f','g' => '[gä]','h' => '[hí]','j' => 'j','k' => '[kê]','l' => '[l1i!]','z' => 'z','x' => '[xõ%]','c' => '[cñ]','v' => '[vuè]','b' => '[bâü]','n' => '[nïë]','m' => '[mì]','é' => '[éèu]','ö' => 'ö','ó' => '[óy]','å' => '[åe¸]','í' => '[íh]','ã' => '[ãr]','ø' => '[øwù]','ù' => '[ùwø]','ç' => '[ç3ý]','õ' => '[õx%]','ú' => '[úü]','ô' => 'ô','û' => '(û|ü[i1l!]?)','â' => '[âb]','à' => '[àa]','ï' => '[ïn]','ð' => '[ðp]','î' => '[îo0]','ë' => '[ën]','ä' => 'ä','æ' => 'æ','ý' => '[ý3ç]','ÿ' => '[ÿ]','÷' => '[÷4]','ñ' => '[ñc]','ì' => '[ìm]','è' => '[èué]','ò' => '[òt]','ü' => '[üb]','á' => '[á6]','þ' => '(þ|[!1il][oî0])','¸' => '[¸åe]','1' => '[1il!]','2' => '2','3' => '[3çý]','4' => '[4÷]','5' => '[5s]','6' => '[6á]','7' => '7','8' => '8','9' => '9','0' => '[0îo]','_' => '_','#' => '#','%' => '[%x]','^' => '[^~]','(' => '[(]',')' => '[)]','=' => '=','.' => '[.]','-' => '-','[' => '[\[]');
$name=strtolower($name);
$search_name=strtr($name, $replace_word);
$db->query ("SELECT name FROM " . USERPREFIX . "_users WHERE LOWER(name) REGEXP '[[:<:]]{$search_name}[[:>:]]' OR name = '$name'");
if ($db->num_rows() > 0){$stop .= $lang['reg_err_20'];}
}
if (!$stop) return false; else return $stop;
}
$banned_info = $cache->get ("banned");
if (!is_array($banned_info)) {$banned_info = array ();
$db->query("SELECT * FROM " . USERPREFIX . "_banned");
while($row = $db->get_row()){
if ($row['users_id']) {$banned_info['users_id'][$row['users_id']] = array('users_id' => $row['users_id'], 'descr' => stripslashes($row['descr']), 'date' => $row['date']);
} else {if (count(explode(".", $row['ip'])) == 4) $banned_info['ip'][$row['ip']] = array('ip' => $row['ip'], 'descr' => stripslashes($row['descr']), 'date' => $row['date']);
elseif (strpos( $row['ip'], "@" ) !== false) $banned_info['email'][$row['ip']] = array('email' => $row['ip'], 'descr' => stripslashes($row['descr']), 'date' => $row['date']);
else $banned_info['name'][$row['ip']] = array('name' => $row['ip'], 'descr' => stripslashes($row['descr']), 'date' => $row['date']);
}}
$cache->set ("banned", $banned_info);
$db->free();
}
$name = $db->safesql(trim(htmlspecialchars($parse->process(convert_unicode($_POST['name'], $config['charset'])))));
$name = preg_replace('#\s+#i', ' ', $name);
$allow = check_name($name);
if (!$allow)$buffer = "<font color=\"green\">".$lang['reg_ok_ajax']."</font>";
else $buffer = "<font color=\"red\">".$allow."</font>";
@header("Content-type: text/html; charset=".$config['charset']);
echo $buffer;
?>
+135
View File
@@ -0,0 +1,135 @@
<?php
@error_reporting(7);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
@session_start();
define( 'DATALIFEENGINE', true );
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR.'/data/config.php';
include SYSTEM_DIR.'/data/repa.php';
require_once SYSTEM_DIR . '/classes/mysql.php';
require_once SYSTEM_DIR . '/data/dbconfig.php';
require_once SYSTEM_DIR . '/modules/functions.php';
$_REQUEST['skin'] = totranslit($_REQUEST['skin'], false, false);
if( ! @is_dir( ROOT_DIR . '/templates/' . $_REQUEST['skin'] ) ) {die( "Hacking attempt!" );}
$user_group = $cache->get( "usergroup" );
if( ! $user_group ) {
$user_group = array ();
$db->query( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" );
while ( $row = $db->get_row() ) {
$user_group[$row['id']] = array ();
foreach ( $row as $key => $value ) {
$user_group[$row['id']][$key] = $value;
}}
$cache->set( "usergroup", $user_group );
$db->free();
}
include_once ROOT_DIR . '/language/' . $config['langs'] . '/website.lng';
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
require_once SYSTEM_DIR . '/modules/sitelogin.php';
$action = intval($_POST['action']);
$user_id = intval($_POST['user_id']);
$url = $db->safesql( $_SERVER['HTTP_REFERER'] );
$cause = $db->safesql(convert_unicode(strip_tags($_POST['cause'], "\x3c\x61\x3e\x2c\x3c\x62\x3e\x2c\x3c\x69\x3e\x2c\x3c\x62\x72\x3e"), $config['charset']));
$time = time() + ($config['date_adjust'] * 60);
$access = true;
if ($is_logged){
$row = $db->super_query("SELECT user_id, name, user_group, repa, repa_mod, reg_date, repa_off FROM " . PREFIX . "_users WHERE user_id = '$user_id'");
if ($row['user_id'] != $user_id) $access = false;
$nowis = time()+($config['date_adjust']*60);
$r_date = $member_id['reg_date'];
$period = $nowis - $r_date;
if ($row['repa_off'] == 1) $access = false;
if ($period < $repa_cf['bl_period']*43200) $access = false;
if ($member_id['r_freeze']) $access = false;
if ($user_id == $member_id['user_id']) $access = false;
if( $member_id['repa'] < $repa_cf['repa_stop_change_min']) $access = false;
if ($action == 1 OR $action == 0)
{
$author = $member_id['name'];
$get_date = date ("Y-m-d H:i:s");
$date = $get_date;
$from_page = $url;
if ($access)
{
if ($action == 1)
{
$how = $row['repa'] + 1;
$v = "1";
$repa_mod_mas = explode ("|", $row['repa_mod']);
$repa_mod_mas[0] = $repa_mod_mas[0] + 1;
$what = "ïîâûñèë";
}else{
$how = $row['repa'] - 1;
$v = "-1";
$repa_mod_mas = explode ("|", $row['repa_mod']);
$repa_mod_mas[1] = $repa_mod_mas[1] - 1;
$what = "ïîíèçèë";
}
$repa_mod = $repa_mod_mas[0]."|".$repa_mod_mas[1];
if($row['user_group'] == 4 AND $row['repa'] + 1 >= $repa_cf['num_repa_group']) $group = "user_group = '".$repa_cf['move_grouplevel']."',";
$db->query("UPDATE " . USERPREFIX . "_users SET $group repa ='$how', repa_mod='$repa_mod' WHERE `name` = '$row[name]'");
$db->query("INSERT INTO " . USERPREFIX . "_reputation (how, date, author, komu, text, url_page) VALUES ('$v', '$date', '$author', '$row[name]', '$cause', '$from_page')");
if ($repa_cf['repa_ban'] AND $row['banned'] != "yes")
{
if (($row['repa'] + $v) <= $repa_cf['repa_ban_num'] OR $row['repa'] == $repa_cf['repa_ban_num'])
{
$this_time = $repa_cf['repa_ban_days'] ? $_TIME + ($repa_cf['repa_ban_days'] * 60 * 60 * 24) : 0;
$db->query( "UPDATE " . USERPREFIX . "_users SET banned='yes' WHERE user_id = '{$row[user_id]}'" );
$db->query( "INSERT INTO " . USERPREFIX . "_banned (users_id, descr, date, days, ip) values ('$row[user_id]', '$repa_cf[repa_ban_desc]', '$this_time', '$repa_cf[repa_ban_days]', '')" );
$cache->delete('banned.php');
}
}
if($repa_cf['msgs_status'] == 'yes'){
$whois = "<a href=\"".$config['http_home_url']."user/".urlencode($member_id['name'])."\">".$member_id['name']."</a>";
$izvestie = $repa_cf['msgs_template'];
$izvestie = str_replace('{%kto%}', $whois, $izvestie);
$izvestie = str_replace('{%what%}', $what, $izvestie);
$izvestie = str_replace('{%text%}', $cause, $izvestie);
$db->query("INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values ('Âàì èçìåíèëè ðåïóòàöèþ', '$izvestie', '$row[user_id]', '$member_id[name]', '$time', 'no', 'inbox')");
$db->query("UPDATE " . USERPREFIX . "_users set pm_all=pm_all+1, pm_unread=pm_unread+1 where user_id='$row[user_id]'");
}
$db->free();
$repa_type = "(<font color=green><b>".$repa_mod_mas[0]."</b></font><b>|</b><font color=red><b>".$repa_mod_mas[1]."</b></font>)";
$buffer = "<a href=\"".$config['http_home_url']."user/reputation/".urlencode($row['name'])."/\">".$repa_type."</a>";
$cache->clear( 'comm_' );
}
}
if (!$access){
$repa_mod_mas = explode ("|", $row['repa_mod']);
$repa_type = "(<font color=green><b>".$repa_mod_mas[0]."</b></font><b>|</b><font color=red><b>".$repa_mod_mas[1]."</b></font>)";
$buffer = "<a href=\"".$config['http_home_url']."user/reputation/".urlencode($row['name'])."/\">".$repa_type."</a>";
}
}
$db->close();
@header( "Content-type: text/html; charset=" . $config['charset'] );
echo $buffer;
?>
+50
View File
@@ -0,0 +1,50 @@
<?
@session_start();
@error_reporting(7);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
define('DATALIFEENGINE', true);
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR.'/data/config.php';
require_once SYSTEM_DIR.'/classes/mysql.php';
require_once SYSTEM_DIR.'/data/dbconfig.php';
require_once SYSTEM_DIR.'/modules/functions.php';
require_once SYSTEM_DIR.'/modules/sitelogin.php';
if( !$is_logged ) die( "error" );
$news_id = intval( $_REQUEST['news_id'] );
if( !$news_id ) die( "error" );
$subscribe = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_subscribe WHERE news_id=$news_id AND user_id=$member_id[user_id]");
if($subscribe['count'] == 0 ){
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
srand( ( double ) microtime() * 1000000 );
$s_hash = "";
for($i = 0; $i < 5; $i ++) {$s_hash .= $salt{rand( 0, 33 )};}
$s_hash = md5($s_hash);
$db->query( "INSERT INTO " . PREFIX . "_subscribe (user_id, name, email, news_id, hash) values ('{$member_id['user_id']}', '{$member_id['name']}', '{$member_id['email']}', '{$news_id}', '{$s_hash}')" );
$buffer = "<a href=\"#\" onclick=\"comm_Subscribe('" . $news_id . "'); return false;\"/>Îòïèñàòüñÿ</a>";
} else {
$db->query( "DELETE FROM " . PREFIX . "_subscribe WHERE news_id=$news_id AND user_id=$member_id[user_id]");
$buffer = "<a href=\"#\" onclick=\"comm_Subscribe('" . $news_id . "'); return false;\"/>Ïîäïèñàòüñÿ</a>";
}
$db->close();
@header( "Content-type: text/html; charset=" . $config['charset'] );
echo $buffer;
/*case "unsubscribe" :
$_GET['post_id'] = intval ($_GET['post_id']);
$_GET['user_id'] = intval ($_GET['user_id']);
if ($_GET['post_id'] AND $_GET['user_id'] AND $_GET['hash']) {
$row = $db->super_query( "SELECT hash FROM " . PREFIX . "_subscribe WHERE news_id='{$_GET['post_id']}' AND user_id='{$_GET['user_id']}'" );
if ($row['hash'] AND $row['hash'] == $_GET['hash']) {
$db->query( "DELETE FROM " . PREFIX . "_subscribe WHERE news_id='{$_GET['post_id']}' AND user_id='{$_GET['user_id']}'" );
msgbox( $lang['all_info'], $lang['unsubscribe_ok']);
} else {msgbox( $lang['all_info'], $lang['unsubscribe_err']);}
} else {msgbox( $lang['all_info'], $lang['unsubscribe_err']);}
break;*/
?>
+41
View File
@@ -0,0 +1,41 @@
<?
@session_start();
@error_reporting( 7 );
@ini_set( 'display_errors', true );
@ini_set( 'html_errors', false );
define( 'DATALIFEENGINE', true );
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR . '/data/config.php';
require_once SYSTEM_DIR . '/classes/mysql.php';
require_once SYSTEM_DIR . '/data/dbconfig.php';
require_once SYSTEM_DIR . '/modules/functions.php';
ini_set('default_socket_timeout', 3);
$id = intval($_REQUEST['id']);
if(!$id) die('error');
$row = $db->super_query("SELECT onserver FROM " . PREFIX . "_torrents WHERE id='{$id}'");
if( !$content ){
require_once SYSTEM_DIR . '/classes/torrent.class.php';
$FilesTorrent = new Torrent(ROOT_DIR.'/uploads/torrents/'.$row['onserver']);
$content = $FilesTorrent->content();
}
foreach ($content as $cx => $v) {
$count_filesx = count($content);
$ssdx = mksize($v);
// Êîäèðîâêà win1251 (CP1251)
$cx = iconv("UTF-8", $config['charset'], $cx );
$torrent_filesx .= "<tr>
<td align='left' bgcolor='#ffffff'>{$cx}</td>
<td align='left' bgcolor='#ffffff'>{$ssdx} / ({$v})</td>
</tr>";
}
@header("Content-type: text/html; charset={$config['charset']}");
echo "<table width='95%' cellpadding='1' cellspacing='1' class='tor' align='center'><thead><td>Ôàéë</td><td align=\"center\">Ðàçìåð</td></thead>" . $torrent_filesx . "</table>";
?>
+31
View File
@@ -0,0 +1,31 @@
<?php
@session_start();
@error_reporting(7);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
define('DATALIFEENGINE', true);
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR . '/data/config.php';
require_once SYSTEM_DIR.'/classes/mysql.php';
require_once SYSTEM_DIR.'/data/dbconfig.php';
require_once SYSTEM_DIR . '/modules/functions.php';
$content = <<<HTML
<iframe id="_AddUpload" src="{$open_url}" frameborder="0" width="100%" height="220px"></iframe>
<div class="highslide-footer"><div><span class="highslide-resize"><span></span></span></div></div>
HTML;
@header( "Content-type: text/html; charset=" . $config['charset'] );
@header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
@header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . " GMT" );
@header( "Cache-Control: no-store, no-cache, must-revalidate" );
@header( "Cache-Control: post-check=0, pre-check=0", false );
@header( "Pragma: no-cache" );
echo "<div id='upload_form' title='Çàãðóçêà ôàéëîâ' style='display:none'>$content</div>";
?>
+254
View File
@@ -0,0 +1,254 @@
<?php
@error_reporting( E_ALL ^ E_NOTICE );
@ini_set( 'display_errors', true );
@ini_set( 'html_errors', false );
@ini_set( 'error_reporting', E_ALL ^ E_NOTICE );
define( 'DATALIFEENGINE', true );
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
if( isset( $_POST["PHPSESSID"] ) ) {
session_id( $_POST["PHPSESSID"] );
}
session_start();
function msg_error($message, $code = 500) {
if ($code == 401) header( "HTTP/1.1 401 Unauthorized" );
elseif($code == 403) header( "HTTP/1.1 403 Forbidden" );
elseif($code == 405) header( "HTTP/1.1 405 Method Not Allowed" );
else header( "HTTP/1.1 500 Internal Server Error" );
echo $message;
exit( 0 );
}
if( ! isset( $_FILES['Filedata'] ) || ! is_uploaded_file( $_FILES['Filedata']['tmp_name'] ) || $_FILES['Filedata']['error'] != 0 ) {
msg_error( "There was a problem with the upload", 405 );
}
require_once SYSTEM_DIR . '/data/config.php';
require_once SYSTEM_DIR . '/classes/mysql.php';
require_once SYSTEM_DIR . '/data/dbconfig.php';
require_once SYSTEM_DIR . '/inc/include/functions.inc.php';
$user_group = $cache->get( "usergroup" );
if( ! $user_group ) {$user_group = array ();
$db->query( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" );
while ( $row = $db->get_row() ) {$user_group[$row['id']] = array ();
foreach ( $row as $key => $value ) {$user_group[$row['id']][$key] = stripslashes($value);}
}
$cache->set( "usergroup", $user_group );
$db->free();
}
require_once SYSTEM_DIR . '/modules/sitelogin.php';
if( ! $is_logged ) {msg_error( "Not Logged", 401 );}
if( ! $user_group[$member_id['user_group']]['allow_image_upload'] ) {msg_error( "Not Allowed", 401 );}
$allowed_extensions = array ("gif", "jpg", "png", "jpe", "jpeg" );
$allowed_files = explode( ',', strtolower( $config['files_type'] ) );
if( intval( $_REQUEST['news_id'] ) ) $news_id = intval( $_REQUEST['news_id'] ); else $news_id = 0;
if( isset( $_REQUEST['area'] ) ) $area = totranslit( $_REQUEST['area'] ); else $area = "";
if( isset( $_REQUEST['author'] ) ) $author = @$db->safesql( strip_tags( convert_unicode($_REQUEST['author'], $config['charset'] ) ) ); else $author = "";
if ( !$author ) $author = $member_id['name'];
//if( $member_id['user_group'] < 4 ) {
$config['max_image'] = $_POST['t_size'] ? $_POST['t_size'] : $config['max_image'];
$_POST['t_seite'] = intval( $_POST['t_seite'] );
$config['allow_watermark'] = intval( $_POST['make_watermark'] ) ? "yes" : "no";
$_POST['make_thumb'] = true;
//} else {$_POST['t_seite'] = 0;$_POST['make_thumb'] = true;}
$thumb_size = $config['max_image'];
$thumb_size = explode ("x", $thumb_size);
if ( count($thumb_size) == 2) {
$thumb_size = intval($thumb_size[0]) . "x" . intval($thumb_size[1]);
} else {
$thumb_size = intval( $thumb_size[0] );
}
$config['max_image'] = $thumb_size;
if (@ini_get( 'safe_mode' ) == 1)
define( 'FOLDER_PREFIX', "" );
else
define( 'FOLDER_PREFIX', date( "Y-m" ) );
if( ! is_dir( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX ) ) {
@mkdir( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX, 0777 );
@chmod( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX, 0777 );
@mkdir( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX . "/thumbs", 0777 );
@chmod( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX . "/thumbs", 0777 );
}
if( ! is_dir( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX ) ) {
msg_error( "/uploads/posts/" . FOLDER_PREFIX . "/ cannot created.", 403 );
}
$upload_path = ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX . "/";
$file_prefix = time() + rand( 1, 100 );
$file_prefix .= "_";
$image = $_FILES['Filedata']['tmp_name'];
$image_name = $_FILES['Filedata']['name'];
$image_size = $_FILES['Filedata']['size'];
$img_name_arr = explode( ".", $image_name );
$type = totranslit( end( $img_name_arr ) );
$curr_key = key( $img_name_arr );
unset( $img_name_arr[$curr_key] );
$image_name = totranslit( convert_unicode( implode( ".", $img_name_arr ), $config['charset'] ) ) . "." . $type;
$image_name = str_replace( "..", ".", $image_name );
if( stripos ( $image_name, "php" ) !== false ) die("Hacking attempt!");
if( stripos ( $image_name, "phtml" ) !== false ) die("Hacking attempt!");
if( stripos ( $image_name, ".htaccess" ) !== false ) die("Hacking attempt!");
if( $config['files_allow'] == "yes" and $user_group[$member_id['user_group']]['allow_file_upload'] and in_array( strtolower( $type ), $allowed_files ) ) {
if( intval( $config['max_file_size'] ) and $image_size > ($config['max_file_size'] * 1024) ) {
msg_error( "File too big", 403 );
}
if( move_uploaded_file( $image, ROOT_DIR . "/uploads/files/" . $file_prefix . $image_name ) ) {
@chmod( ROOT_DIR . "/uploads/files/" . $file_prefix . $image_name, 0666 );
$added_time = time() + ($config['date_adjust'] * 60);
if( $area == "template" ) {
$db->query( "INSERT INTO " . PREFIX . "_static_files (static_id, author, date, name, onserver) values ('$news_id', '{$author}', '$added_time', '$image_name', '{$file_prefix}{$image_name}')" );
} else {
$db->query( "INSERT INTO " . PREFIX . "_files (news_id, name, onserver, author, date) values ('$news_id', '$image_name', '{$file_prefix}{$image_name}', '{$author}', '$added_time')" );
}
$db->close();
echo ("Ok");
} else {
msg_error( "Upload Error", 403 );
}
} elseif( in_array( strtolower( $type ), $allowed_extensions ) and $user_group[$member_id['user_group']]['allow_image_upload'] ) {
if( file_exists( $upload_path . $image_name ) ) {
msg_error( "Image exist", 500 );
} elseif( $image_size > ($config['max_up_size'] * 1024) and ! $config['max_up_side'] ) {
msg_error( "Image too big", 500 );
}
if( @move_uploaded_file( $image, $upload_path . $file_prefix . $image_name ) ) {
@chmod( $upload_path . $file_prefix . $image_name, 0666 );
if( $area != "template" ) {
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_images where author = '{$author}' AND news_id = '$news_id'" );
if( ! $row['count'] ) {
$added_time = time() + ($config['date_adjust'] * 60);
$inserts = FOLDER_PREFIX . "/" . $file_prefix . $image_name;
$db->query( "INSERT INTO " . PREFIX . "_images (images, author, news_id, date) values ('$inserts', '{$author}', '$news_id', '$added_time')" );
} else {
$row = $db->super_query( "SELECT images FROM " . PREFIX . "_images where author = '{$author}' AND news_id = '$news_id'" );
if( $row['images'] == "" ) $listimages = array ();
else $listimages = explode( "|||", $row['images'] );
foreach ( $listimages as $dataimages ) {
if( $dataimages == FOLDER_PREFIX . "/" . $file_prefix . $image_name ) $error_image = "stop";
}
if( $error_image != "stop" ) {
$listimages[] = FOLDER_PREFIX . "/" . $file_prefix . $image_name;
$row['images'] = implode( "|||", $listimages );
$db->query( "UPDATE " . PREFIX . "_images set images='{$row['images']}' where author = '{$author}' AND news_id = '$news_id'" );
}
}
}
if( $area == "template" ) {
$added_time = time() + ($config['date_adjust'] * 60);
$inserts = FOLDER_PREFIX . "/" . $file_prefix . $image_name;
$db->query( "INSERT INTO " . PREFIX . "_static_files (static_id, author, date, name) values ('$news_id', '{$author}', '$added_time', '$inserts')" );
}
include_once SYSTEM_DIR . '/classes/thumb.class.php';
$thumb = new thumbnail( $upload_path . $file_prefix . $image_name );
if( $_POST['make_thumb'] ) {
if( $thumb->size_auto( $config['max_image'], $_POST['t_seite'] ) ) {
$thumb->jpeg_quality( $config['jpeg_quality'] );
if( $config['allow_watermark'] == "yes" ) $thumb->insert_watermark( $config['max_watermark'] );
$thumb->save( $upload_path . "thumbs/" . $file_prefix . $image_name );
@chmod( $upload_path . "thumbs/" . $file_prefix . $image_name, 0666 );
}
}
if( $config['allow_watermark'] == "yes" or $config['max_up_side'] ) {
$thumb = new thumbnail( $upload_path . $file_prefix . $image_name );
$thumb->jpeg_quality( $config['jpeg_quality'] );
if( $config['max_up_side'] ) $thumb->size_auto( $config['max_up_side'] );
if( $config['allow_watermark'] == "yes" ) $thumb->insert_watermark( $config['max_watermark'] );
$thumb->save( $upload_path . $file_prefix . $image_name );
}
$db->close();
echo ("Ok");
} else {
msg_error( "Upload Error", 403 );
}
} else {
msg_error( "Not Allowed Type", 403 );
}
?>
+32
View File
@@ -0,0 +1,32 @@
<?php
@session_start();
@error_reporting(7);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
define('DATALIFEENGINE', true);
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -12 ) );
define( 'SYSTEM_DIR', ROOT_DIR . '/system' );
include SYSTEM_DIR . '/data/config.php';
require_once SYSTEM_DIR.'/classes/mysql.php';
require_once SYSTEM_DIR.'/data/dbconfig.php';
require_once SYSTEM_DIR . '/modules/functions.php';
$id = intval( $_REQUEST['id'] );
if( ! $id ) die( "error" );
$result = $db->query("SELECT * FROM `". PREFIX ."_rate` WHERE `type_id` = '$id' AND type = 1 ORDER BY `id`");
$list ="<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"userstop\">";
$list .="<thead><td>User</td><td align=\"center\">#</td></thead>";
while ($row = $db->get_row($result))
{
$list .="<tr><td><a href=".$config['http_home_url']."user/".urlencode($row['member'])." target=_blank/>".$row['member']."</a></td><td>".$row['rating']."</td></tr>";
}
$list .="</table>";
$db->free();
@header( "Content-type: text/html; charset=" . $config['charset'] );
echo "<div id='voted-list' title='Ñòàòèñòèêà ãîëîñîâàíèÿ' style='display:none'>$list</div>";
?>