message
398
system/inc/addnews.php
Normal file
@@ -0,0 +1,398 @@
|
||||
<?PHP
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {die( "Hacking attempt!" );}
|
||||
|
||||
if( ! $user_group[$member_id['user_group']]['admin_addnews'] ) {msg( "error", $lang['index_denied'], $lang['index_denied'] );}
|
||||
|
||||
if( $action == "addnews" ) {
|
||||
echoheader( "addnews", $lang['addnews'] );
|
||||
$id= "";
|
||||
|
||||
echo "
|
||||
<SCRIPT LANGUAGE=\"JavaScript\">
|
||||
function preview(){";
|
||||
|
||||
echo "if(document.addnews.short_story.value == '' || document.addnews.title.value == ''){ alert('$lang[addnews_alert]'); }
|
||||
else{
|
||||
dd=window.open('','prv','height=400,width=750,resizable=1,scrollbars=1')
|
||||
document.addnews.mod.value='preview';document.addnews.target='prv'
|
||||
document.addnews.submit();dd.focus()
|
||||
setTimeout(\"document.addnews.mod.value='addnews';document.addnews.target='_self'\",500)
|
||||
}}
|
||||
|
||||
function auto_keywords ( key ){
|
||||
var short_txt = document.getElementById('short_story').value;
|
||||
var full_txt = document.getElementById('full_story').value;
|
||||
ShowLoading('');
|
||||
$.post(\"system/ajax/keywords.php\", { short_txt: short_txt, full_txt: full_txt, key: key }, function(data){
|
||||
HideLoading('');
|
||||
if (key == 1) { $('#autodescr').val(data); }
|
||||
else { $('#keywords').val(data); }
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function find_relates ( )
|
||||
{
|
||||
var title = document.getElementById('title').value;
|
||||
ShowLoading('');
|
||||
$.post('system/ajax/find_relates.php', { title: title }, function(data){
|
||||
HideLoading('');
|
||||
$('#related_news').html(data);
|
||||
});
|
||||
return false;
|
||||
};
|
||||
</SCRIPT>";
|
||||
|
||||
echo "<form method=post enctype=\"multipart/form-data\" name=\"addnews\" id=\"addnews\" onsubmit=\"if(document.addnews.title.value == '' || document.addnews.short_story.value == ''){DLEalert('$lang[addnews_alert]', '$lang[p_info]');return false}\" action=\"$PHP_SELF\">";
|
||||
|
||||
$categories_list = CategoryNewsSelection( 0, 0 );
|
||||
if( $config['allow_multi_category'] ) $category_multiple = "class=\"cat_select\" multiple"; else $category_multiple = "";
|
||||
|
||||
echo <<<HTML
|
||||
<!-- calendar stylesheet -->
|
||||
<link rel="stylesheet" type="text/css" media="all" href="system/skins/calendar-blue.css" title="win2k-cold-1" />
|
||||
<script type="text/javascript" src="system/skins/calendar.js"></script>
|
||||
<script type="text/javascript" src="system/skins/tabs.js"></script>
|
||||
<div id='loading-layer' style='display:none;font-family: Verdana;font-size: 11px;width:200px;height:50px;background:#FFF;padding:10px;text-align:center;border:1px solid #000'><div style='font-weight:bold' id='loading-layer-text'>{$lang['ajax_info']}</div><br /><img src='system/ajax/loading.gif' border='0' /></div>
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['addnews_news']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="unterline"></div>
|
||||
<div id="dle_tabView1">
|
||||
|
||||
<div class="dle_aTab" style="display:none;">
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="140" height="29" style="padding-left:5px;">{$lang['addnews_title']}</td>
|
||||
<td><input class="edit" type="text" size="55" name="title" id="title"> <input class="edit" type="button" onClick="find_relates(); return false;" style="width:160px;" value="{$lang['b_find_related']}"> <a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_title]}', this, event, '220px')">[?]</a><span id="related_news"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="29" style="padding-left:5px;">{$lang['addnews_date']}</td>
|
||||
<td><input type="text" name="newdate" 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" title="{$lang['edit_ecal']}"/> <input type="checkbox" name="allow_date" value="yes" checked> {$lang['edit_jdate']}<a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_calendar]}', this, event, '320px')">[?]</a>
|
||||
<script type="text/javascript">
|
||||
Calendar.setup({
|
||||
inputField : "f_date_c", // id of the input field
|
||||
ifFormat : "%Y-%m-%d %H:%M", // format of the input field
|
||||
button : "f_trigger_c", // trigger for the calendar (button ID)
|
||||
align : "Br", // alignment
|
||||
timeFormat : "24",
|
||||
showsTime : true,
|
||||
singleClick : true
|
||||
});
|
||||
</script></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="29" style="padding-left:5px;">{$lang['addnews_cat']}</td>
|
||||
<td><select name="category[]" id="category" onchange="onCategoryChange(this.value)" $category_multiple>
|
||||
{$categories_list}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="hr_line"></div>
|
||||
<table width="100%">
|
||||
HTML;
|
||||
include (SYSTEM_DIR . '/inc/include/inserttag.php');
|
||||
|
||||
echo <<<HTML
|
||||
<tr>
|
||||
<td height="29" width="140" style="padding-left:5px;">{$lang['addnews_short']}<br /><input class=bbcodes style="width: 30px;" onclick="document.addnews.short_story.rows += 5;" type=button value=" + "> <input class=bbcodes style="width: 30px;" onclick="document.addnews.short_story.rows -= 5;" type=button value=" - "></td>
|
||||
<td>{$bb_code}<textarea rows="13" style="width:98%; padding:0px;" onclick="setFieldName(this.name)" name="short_story" id="short_story"></textarea>
|
||||
</td></tr>
|
||||
HTML;
|
||||
|
||||
echo <<<HTML
|
||||
<tr>
|
||||
<td height="29" style="padding-left:5px;">{$lang['addnews_full']}<br /><span class="navigation">({$lang['addnews_alt']})</span><br /><input class=bbcodes style="width: 30px;" onclick="document.addnews.full_story.rows += 5;" type=button value=" + "> <input class=bbcodes style="width: 30px;" onclick="document.addnews.full_story.rows -= 5;" type=button value=" - "></td>
|
||||
<td><textarea rows="16" onclick="setFieldName(this.name)" name="full_story" id="full_story" style="width:98%;"></textarea>
|
||||
</td></tr>
|
||||
HTML;
|
||||
|
||||
include (SYSTEM_DIR . '/inc/newsimg/addimg.php');
|
||||
|
||||
if( $user_group[$member_id['user_group']]['allow_fixed']) $fix_input = "<input type=\"checkbox\" name=\"news_fixed\" value=\"1\"> $lang[addnews_fix]";
|
||||
if( $user_group[$member_id['user_group']]['allow_main'] ) $main_input = "<input type=\"checkbox\" name=\"allow_main\" value=\"1\" checked> {$lang['addnews_main']}";
|
||||
|
||||
echo <<<HTML
|
||||
<tr>
|
||||
<td colspan="2"><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="29" style="padding-left:5px;">{$lang['addnews_option']}</td>
|
||||
<td><input type="checkbox" name="approve" value="1" checked> {$lang['addnews_mod']}<br /><br />
|
||||
|
||||
{$main_input} <input type="checkbox" name="allow_comm" value="1" checked> {$lang['addnews_comm']}<br />
|
||||
<input type="checkbox" name="allow_rating" value="1" checked> {$lang['addnews_allow_rate']} {$fix_input}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
echo <<<HTML
|
||||
<div class="dle_aTab" style="display:none;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="140" style="padding:4px;">{$lang['v_ftitle']}</td>
|
||||
<td ><input type="text" class="edit" name="vote_title" style="width:350px"><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_ftitle]}', this, event, '250px')">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['vote_title']}</td>
|
||||
<td><input type="text" class="edit" name="frage" style="width:350px"><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_vtitle]}', this, event, '250px')">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">$lang[vote_body]<br /><span class="navigation">$lang[vote_str_1]</span></td>
|
||||
<td><textarea rows="10" style="width:350px;" name="vote_body"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;"> </td>
|
||||
<td><input type="checkbox" name="allow_m_vote" value="1"> {$lang['v_multi']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="navigation">{$lang['v_info']}</div>
|
||||
</div>
|
||||
|
||||
<div class="dle_aTab" style="display:none;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="140" height="29" style="padding-left:5px;">URL Ñàéòà</td>
|
||||
<td><input type="text" name="remote_addr" size="55" class="edit"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="140" height="29" style="padding-left:5px;">{$lang['addnews_url']}</td>
|
||||
<td><input type="text" name="alt_name" size="55" class="edit"><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_url]}', this, event, '300px')">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="140" height="29" style="padding-left:5px;">{$lang['addnews_tags']}</td>
|
||||
<td><input type="text" name="tags" size="55" class="edit"><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_tags]}', this, event, '300px')">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>{$lang['add_metatags']}<a href="#" class="hintanchor" onMouseover="showhint('{$lang['hint_metas']}', this, event, '220px')">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="29" style="padding-left:5px;">{$lang['meta_title']}</td>
|
||||
<td><input type="text" name="meta_title" style="width:388px;" class="edit"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="29" style="padding-left:5px;">{$lang['meta_descr']}</td>
|
||||
<td><input type="text" name="descr" id="autodescr" style="width:388px;" class="edit"> ({$lang['meta_descr_max']})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="29" style="padding-left:5px;">{$lang['meta_keys']}</td>
|
||||
<td><textarea name="keywords" id='keywords' style="width:388px;height:70px;"></textarea><br />
|
||||
<input onClick="auto_keywords(1)" type="button" class="buttons" value="{$lang['btn_descr']}" style="width:170px;">
|
||||
<input onClick="auto_keywords(2)" type="button" class="buttons" value="{$lang['btn_keyword']}" style="width:210px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="dle_aTab" style="display:none;">
|
||||
|
||||
<table width="100%">
|
||||
HTML;
|
||||
|
||||
if( $member_id['user_group'] < 3 ) {
|
||||
foreach ( $user_group as $group ) {
|
||||
if( $group['id'] > 1 ) {
|
||||
echo <<<HTML
|
||||
<tr>
|
||||
<td width="150" style="padding:4px;">{$group['group_name']}</td>
|
||||
<td><select name="group_extra[{$group['id']}]">
|
||||
<option value="0">{$lang['ng_group']}</option>
|
||||
<option value="1">{$lang['ng_read']}</option>
|
||||
<option value="2">{$lang['ng_all']}</option>
|
||||
<option value="3">{$lang['ng_denied']}</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
HTML;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
echo <<<HTML
|
||||
<tr>
|
||||
<td style="padding:4px;"><br />{$lang['tabs_not']}</br /><br /></td>
|
||||
</tr>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
<tr>
|
||||
<td colspan="2"><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="navigation">{$lang['tabs_g_info']}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
echo <<<HTML
|
||||
<div style="padding-left:150px;padding-top:5px;padding-bottom:5px;">
|
||||
<input type="submit" class="buttons" value="{$lang['btn_send']}" style="width:100px;">
|
||||
<input onClick="preview()" type="button" class="buttons" value="{$lang['btn_preview']}" style="width:100px;">
|
||||
<input type=hidden name=mod value=addnews>
|
||||
<input type=hidden name=action value=doaddnews>
|
||||
<input type="hidden" name="user_hash" value="$dle_login_hash" />
|
||||
</div>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
<script type="text/javascript">
|
||||
initTabs('dle_tabView1',Array('{$lang['tabs_news']}','{$lang['tabs_vote']}','{$lang['tabs_extra']}','{$lang['tabs_perm']}'),0, '100%');
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
|
||||
} // ********************************************************************************
|
||||
// Do add News
|
||||
// ********************************************************************************
|
||||
elseif( $action == "doaddnews" ) {
|
||||
include_once SYSTEM_DIR . '/classes/parse.class.php';
|
||||
$parse = new ParseFilter( Array (), Array (), 1, 1 );
|
||||
|
||||
$allow_comm = isset( $_POST['allow_comm'] ) ? intval( $_POST['allow_comm'] ) : 0;
|
||||
$allow_main = isset( $_POST['allow_main'] ) ? intval( $_POST['allow_main'] ) : 0;
|
||||
$approve = isset( $_POST['approve'] ) ? intval( $_POST['approve'] ) : 0;
|
||||
$allow_rating = isset( $_POST['allow_rating'] ) ? intval( $_POST['allow_rating'] ) : 0;
|
||||
$news_fixed = isset( $_POST['news_fixed'] ) ? intval( $_POST['news_fixed'] ) : 0;
|
||||
$category = $_POST['category'];
|
||||
if( ! count( $category ) ) {
|
||||
$category = array ();
|
||||
$category[] = '0';
|
||||
}
|
||||
$category_list = array();
|
||||
foreach ( $category as $value ) {$category_list[] = intval($value);}
|
||||
$category_list = $db->safesql( implode( ',', $category ) );
|
||||
$allow_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] );
|
||||
foreach ( $category as $selected ) {
|
||||
if( $allow_list[0] != "all" and ! in_array( $selected, $allow_list ) and $member_id['user_group'] != "1" ) $approve = 0;
|
||||
}
|
||||
|
||||
if( !$user_group[$member_id['user_group']]['moderation'] ) $approve = 0;
|
||||
$title = $parse->process( trim( strip_tags ($_POST['title']) ) );
|
||||
|
||||
$full_story = $parse->process( $_POST['full_story'] );
|
||||
$short_story = $parse->process( $_POST['short_story'] );
|
||||
$full_story = $db->safesql( $parse->BB_Parse( $full_story, false ) );
|
||||
$short_story = $db->safesql( $parse->BB_Parse( $short_story, false ) );
|
||||
|
||||
if( $parse->not_allowed_text ) {
|
||||
msg( "error", $lang['addnews_error'], $lang['news_err_39'], "javascript:history.go(-1)" );
|
||||
}
|
||||
|
||||
$alt_name = $_POST['alt_name'];
|
||||
$remote_addr = $_POST['remote_addr'];
|
||||
|
||||
if( trim( $alt_name ) == "" or ! $alt_name ) $alt_name = totranslit( stripslashes( $title ), true, false );
|
||||
else $alt_name = totranslit( stripslashes( $alt_name ), true, false );
|
||||
|
||||
$title = $db->safesql( $title );
|
||||
|
||||
$metatags = create_metatags( $short_story . $full_story );
|
||||
|
||||
if( preg_match( "/[\||\'|\<|\>|\"|\!|\?|\$|\@|\/|\\\|\&\~\*\+]/", $_POST['tags'] ) ) $_POST['tags'] = "";
|
||||
else $_POST['tags'] = $db->safesql( htmlspecialchars( strip_tags( stripslashes( trim( $_POST['tags'] ) ) ), ENT_QUOTES ) );
|
||||
|
||||
if ( $_POST['tags'] ) {
|
||||
$temp_array = array();
|
||||
$tags_array = array();
|
||||
$temp_array = explode (",", $_POST['tags']);
|
||||
if (count($temp_array)) {foreach ( $temp_array as $value ) {if( trim($value) ) $tags_array[] = trim( $value );}}
|
||||
if ( count($tags_array) ) $_POST['tags'] = implode(", ", $tags_array); else $_POST['tags'] = "";
|
||||
}
|
||||
|
||||
// îáðàáîòêà îïðîñà
|
||||
if( trim( $_POST['vote_title'] != "" ) ) {
|
||||
$add_vote = 1;
|
||||
$vote_title = trim( $db->safesql( $parse->process( $_POST['vote_title'] ) ) );
|
||||
$frage = trim( $db->safesql( $parse->process( $_POST['frage'] ) ) );
|
||||
$vote_body = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['vote_body'] ), false ) );
|
||||
$allow_m_vote = intval( $_POST['allow_m_vote'] );
|
||||
} else $add_vote = 0;
|
||||
|
||||
// îáðàáîòêà äîñòóïà
|
||||
if( $member_id['user_group'] < 3 ) {
|
||||
$group_regel = array ();
|
||||
foreach ( $_POST['group_extra'] as $key => $value ) {if( $value ) $group_regel[] = intval( $key ) . ':' . intval( $value );}
|
||||
if( count( $group_regel ) ) $group_regel = implode( "||", $group_regel );
|
||||
else $group_regel = "";
|
||||
} else $group_regel = '';
|
||||
|
||||
// Îáðàáîòêà äàòû è âðåìåíè
|
||||
$added_time = time() + ($config['date_adjust'] * 60);
|
||||
$newdate = $_POST['newdate'];
|
||||
|
||||
if( $_POST['allow_date'] != "yes" ) {
|
||||
if( (($newsdate = strtotime( $newdate )) === - 1) or !$newsdate ) {msg( "error", $lang['addnews_error'], $lang['addnews_erdate'], "javascript:history.go(-1)" );
|
||||
} else {$thistime = date( "Y-m-d H:i:s", $newsdate );}
|
||||
if( ! intval( $config['no_date'] ) and $newsdate > $added_time ) {$thistime = date( "Y-m-d H:i:s", $added_time );}
|
||||
} else $thistime = date( "Y-m-d H:i:s", $added_time );
|
||||
////////////////////////////
|
||||
|
||||
|
||||
if( trim( $title ) == "") {msg( "error", $lang['addnews_error'], $lang['addnews_alert'], "javascript:history.go(-1)" );}
|
||||
if( strlen( $title ) > 255 ) {msg( "error", $lang['addnews_error'], $lang['addnews_error'], "javascript:history.go(-1)" );}
|
||||
|
||||
$db->query( "INSERT INTO " . PREFIX . "_post (date, autor, short_story, full_story, title, descr, keywords, category, alt_name, allow_comm, approve, allow_main, fixed, allow_rate, votes, access, remote_addr, tags, metatitle) values ('$thistime', '{$member_id['name']}', '$short_story', '$full_story', '$title', '{$metatags['description']}', '{$metatags['keywords']}', '$category_list', '$alt_name', '$allow_comm', '$approve', '$allow_main', '$news_fixed', '$allow_rating', '$add_vote', '$group_regel', '$remote_addr', '{$_POST['tags']}', '{$metatags['title']}')" );
|
||||
|
||||
$row = $db->insert_id();
|
||||
|
||||
include (system_DIR . '/inc/newsimg/doaddimg.php');
|
||||
|
||||
if( $add_vote ) {
|
||||
$db->query( "INSERT INTO " . PREFIX . "_poll (news_id, title, frage, body, votes, multiple) VALUES('{$row}', '$vote_title', '$frage', '$vote_body', 0, '$allow_m_vote')" );
|
||||
}
|
||||
|
||||
if( $_POST['tags'] != "" and $approve ) {
|
||||
$tags = array ();
|
||||
$_POST['tags'] = explode( ",", $_POST['tags'] );
|
||||
foreach ( $_POST['tags'] as $value ) {$tags[] = "('" . $row . "', '" . trim( $value ) . "')";}
|
||||
$tags = implode( ", ", $tags );
|
||||
$db->query( "INSERT INTO " . PREFIX . "_tags (news_id, tag) VALUES " . $tags );
|
||||
}
|
||||
|
||||
$db->query( "UPDATE " . PREFIX . "_images set news_id='{$row}' where author = '{$member_id['name']}' AND news_id = '0'" );
|
||||
$db->query( "UPDATE " . PREFIX . "_torrents set news_id='{$row}' where author = '{$member_id['name']}' AND news_id = '0'" );
|
||||
$db->query( "UPDATE " . PREFIX . "_files set news_id='{$row}' where author = '{$member_id['name']}' AND news_id = '0'" );
|
||||
$db->query( "UPDATE " . USERPREFIX . "_users set news_num=news_num+1 where user_id='{$member_id['user_id']}'" );
|
||||
|
||||
$cache->clear();
|
||||
|
||||
msg( "info", $lang['addnews_ok'], $lang['addnews_ok_1'] . " \"" . stripslashes( stripslashes( $title ) ) . "\" " . $lang['addnews_ok_2'] );
|
||||
}
|
||||
?>
|
||||
192
system/inc/blockip.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {die( "Hacking attempt!" );}
|
||||
if( ! $user_group[$member_id['user_group']]['admin_blockip'] ) {msg( "error", $lang['index_denied'], $lang['index_denied'] );}
|
||||
|
||||
if( isset( $_REQUEST['ip_add'] ) ) $ip_add = $db->safesql( htmlspecialchars( strip_tags( trim( $_REQUEST['ip_add'] ) ) ) ); else $ip_add = "";
|
||||
if( isset( $_REQUEST['ip'] ) ) $ip = htmlspecialchars( strip_tags( trim( $_REQUEST['ip'] ) ) ); else $ip = "";
|
||||
if( isset( $_REQUEST['id'] ) ) $id = intval( $_REQUEST['id'] ); else $id = 0;
|
||||
|
||||
if( $action == "add" ) {
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );}
|
||||
include_once SYSTEM_DIR . '/classes/parse.class.php';
|
||||
|
||||
$parse = new ParseFilter( );
|
||||
$parse->safe_mode = true;
|
||||
$banned_descr = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['descr'] ), false ) );
|
||||
|
||||
if( (trim( $_POST['date'] ) == "") or (($_POST['date'] = strtotime( $_POST['date'] )) === - 1) ) {
|
||||
$this_time = 0;
|
||||
$days = 0;
|
||||
} else {
|
||||
$this_time = $_POST['date'];
|
||||
$days = 1;
|
||||
}
|
||||
|
||||
if( ! $ip_add ) {msg( "error", $lang['ip_error'], $lang['ip_error'], "$PHP_SELF?mod=blockip" );}
|
||||
|
||||
$row = $db->super_query( "SELECT id FROM " . PREFIX . "_banned WHERE ip ='$ip_add'" );
|
||||
|
||||
if ( $row['id'] ) {msg( "error", $lang['ip_error_1'], $lang['ip_error_1'], "$PHP_SELF?mod=blockip" );}
|
||||
$db->query( "INSERT INTO " . USERPREFIX . "_banned (descr, date, days, ip) values ('$banned_descr', '$this_time', '$days', '$ip_add')" );
|
||||
$cache->delete('banned.php');
|
||||
|
||||
} elseif( $action == "delete" ) {
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );}
|
||||
|
||||
if( ! $id ) {msg( "error", $lang['ip_error'], $lang['ip_error'], "$PHP_SELF?mod=blockip" );}
|
||||
|
||||
$db->query( "DELETE FROM " . USERPREFIX . "_banned WHERE id = '$id'" );
|
||||
$cache->delete('banned.php' );
|
||||
}
|
||||
|
||||
echoheader( "", "" );
|
||||
|
||||
echo <<<HTML
|
||||
<link rel="stylesheet" type="text/css" media="all" href="system/skins/calendar-blue.css" title="win2k-cold-1" />
|
||||
<script type="text/javascript" src="system/skins/calendar.js"></script>
|
||||
<form action="" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['ip_add']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" colspan="2">{$lang['ip_example']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" width="160">{$lang['ip_type']}</td>
|
||||
<td style="padding:2px;" width="100%"><input class="edit" style="width:250px;" type="text" name="ip_add" value="{$ip}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" width="160" nowrap>{$lang['ban_date']}</td>
|
||||
<td style="padding:2px;"><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" title="{$lang['edit_ecal']}"/>
|
||||
<script type="text/javascript">
|
||||
Calendar.setup({
|
||||
inputField : "f_date_c", // id of the input field
|
||||
ifFormat : "%Y-%m-%d %H:%M", // format of the input field
|
||||
button : "f_trigger_c", // trigger for the calendar (button ID)
|
||||
align : "Br", // alignment
|
||||
timeFormat : "24",
|
||||
showsTime : true,
|
||||
singleClick : true
|
||||
});
|
||||
</script></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;">{$lang['ban_descr']}</td>
|
||||
<td style="padding:2px;">{$lang['ip_add_descr']} <textarea class="edit" style="width:250px;height:70px;" name="descr"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"> </td>
|
||||
<td style="padding:2px;"><input type="submit" value="{$lang['user_save']}" class="edit"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<input type="hidden" name="action" value="add">
|
||||
<input type="hidden" name="user_hash" value="$dle_login_hash">
|
||||
</form>
|
||||
HTML;
|
||||
|
||||
echo <<<HTML
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['ip_list']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="200" style="padding:2px;"> </td>
|
||||
<td width="190">{$lang['ban_date']}</td>
|
||||
<td width="250">{$lang['ban_descr']}</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr><td colspan="4"><div class="hr_line"></div></td></tr>
|
||||
HTML;
|
||||
|
||||
$db->query( "SELECT * FROM " . USERPREFIX . "_banned WHERE users_id = '0' ORDER BY id DESC" );
|
||||
|
||||
$i = 0;
|
||||
while ( $row = $db->get_row() ) {
|
||||
$i ++;
|
||||
|
||||
if( $row['date'] ) $endban = langdate( "j M Y H:i", $row['date'] );
|
||||
else $endban = $lang['banned_info'];
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
<td style=\"padding:3px\">
|
||||
{$row['ip']}
|
||||
</td>
|
||||
<td style=\"padding:3px\">
|
||||
{$endban}
|
||||
</td>
|
||||
<td style=\"padding:3px\">
|
||||
" . stripslashes( $row['descr'] ) . "
|
||||
</td>
|
||||
<td>
|
||||
[<a href=\"$PHP_SELF?mod=blockip&action=delete&id={$row['id']}&user_hash={$dle_login_hash}\">{$lang['ip_unblock']}</a>]</td>
|
||||
</tr>
|
||||
</tr><tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=4></td></tr>
|
||||
";
|
||||
}
|
||||
|
||||
if( $i == 0 ) {
|
||||
echo "<tr>
|
||||
<td height=\"18\" colspan=\"4\">
|
||||
<p align=\"center\"><br><b>$lang[ip_empty]<br><br></b>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
?>
|
||||
518
system/inc/categories.php
Normal file
@@ -0,0 +1,518 @@
|
||||
<?PHP
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
|
||||
$result = "";
|
||||
$catid = intval( $_REQUEST['catid'] );
|
||||
|
||||
if( ! $user_group[$member_id['user_group']]['admin_categories'] ) {msg( "error", $lang['index_denied'], $lang['cat_perm'] );}
|
||||
|
||||
function get_sub_cats($id, $subcategory = false) {
|
||||
global $cat_info;
|
||||
$subfound = array ();
|
||||
|
||||
if( ! $subcategory ) {
|
||||
$subcategory = array ();
|
||||
$subcategory[] = $id;
|
||||
}
|
||||
|
||||
foreach ( $cat_info as $cats ) {
|
||||
if( $cats['parentid'] == $id ) {
|
||||
$subfound[] = $cats['id'];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $subfound as $parentid ) {
|
||||
$subcategory[] = $parentid;
|
||||
$subcategory = get_sub_cats( $parentid, $subcategory );
|
||||
}
|
||||
return $subcategory;
|
||||
}
|
||||
|
||||
if( $_REQUEST['action'] == 'sort' ) {
|
||||
|
||||
foreach ( $_POST["posi"] as $id => $posi ) {
|
||||
if( $posi != "" ) {
|
||||
$posi = intval( $posi );
|
||||
$id = intval( $id );
|
||||
$db->query( "UPDATE " . PREFIX . "_category SET posi='{$posi}' WHERE id = '{$id}'" );
|
||||
}
|
||||
}
|
||||
$cache->delete('category.php');
|
||||
header( "Location:$PHP_SELF?mod=categories" );
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Äîáàâëåíèå êàòåãîðèè
|
||||
// ********************************************************************************
|
||||
if( $action == "add" ) {
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );}
|
||||
|
||||
$quotes = array ("\x27", "\x22", "\x60", "\t", "\n", "\r" );
|
||||
|
||||
$cat_name = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['cat_name'] ) ), ENT_QUOTES) );
|
||||
$alt_cat_name = totranslit( stripslashes( $_POST['alt_cat_name'] ), true, false );
|
||||
|
||||
if( ! $cat_name ) {msg( "error", $lang['cat_error'], $lang['cat_ername'], "javascript:history.go(-1)" );}
|
||||
if( ! $alt_cat_name ) {msg( "error", $lang['cat_error'], $lang['cat_erurl'], "javascript:history.go(-1)" );}
|
||||
|
||||
if ( in_array($_POST['news_sort'], array("date", "rating", "news_read", "title")) ) {
|
||||
$news_sort = $db->safesql( $_POST['news_sort'] );
|
||||
} else $news_sort = "";
|
||||
|
||||
if ( in_array($_POST['news_msort'], array("ASC", "DESC")) ) {
|
||||
$news_msort = $db->safesql( $_POST['news_msort'] );
|
||||
} else $news_msort = "";
|
||||
|
||||
if ( $_POST['news_number'] > 0) $news_number = intval( $_POST['news_number'] ); else $news_number = 0;
|
||||
if ( $_POST['category'] > 0) $category = intval( $_POST['category'] ); else $category = 0;
|
||||
|
||||
$meta_title = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['meta_title'] ) ) ) );
|
||||
$description = $db->safesql( substr( strip_tags( stripslashes( $_POST['descr'] ) ), 0, 200 ) );
|
||||
$keywords = $db->safesql( str_replace( $quotes, " ", strip_tags( stripslashes( $_POST['keywords'] ) ) ) );
|
||||
|
||||
$row = $db->super_query( "SELECT alt_name FROM " . PREFIX . "_category WHERE alt_name ='{$alt_cat_name}'" );
|
||||
if( $row['alt_name'] ) {msg( "error", $lang['cat_error'], $lang['cat_eradd'], "?mod=categories" );}
|
||||
|
||||
$db->query( "INSERT INTO " . PREFIX . "_category (parentid, name, alt_name, descr, keywords, news_sort, news_msort, news_number, metatitle) values ('$category', '$cat_name', '$alt_cat_name', '$description', '$keywords', '$news_sort', '$news_msort', '$news_number', '$meta_title')" );
|
||||
|
||||
$cache->delete('category.php');
|
||||
$cache->clear();
|
||||
|
||||
msg( "info", $lang['cat_addok'], $lang['cat_addok_1'], "?mod=categories" );
|
||||
|
||||
}
|
||||
// ********************************************************************************
|
||||
// Óäàëåíèå êàòåãîðèè
|
||||
// ********************************************************************************
|
||||
elseif( $action == "remove" ) {
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );}
|
||||
|
||||
function DeleteSubcategories($parentid) {
|
||||
global $db;
|
||||
|
||||
$subcategories = $db->query( "SELECT id FROM " . PREFIX . "_category WHERE parentid = '$parentid'" );
|
||||
while ( $subcategory = $db->get_row( $subcategories ) ) {
|
||||
DeleteSubcategories( $subcategory['id'] );
|
||||
$db->query( "DELETE FROM " . PREFIX . "_category WHERE id = '" . $subcategory['id'] . "'" );
|
||||
}
|
||||
}
|
||||
|
||||
if( ! $catid ) {
|
||||
msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=categories" );
|
||||
}
|
||||
|
||||
$row = $db->super_query( "SELECT count(*) as count FROM " . PREFIX . "_post WHERE category regexp '[[:<:]]($catid)[[:>:]]'" );
|
||||
|
||||
if( $row['count'] ) {
|
||||
if( is_array( $_REQUEST['new_category'] ) ) {
|
||||
if( ! in_array( $catid, $new_category ) ) {
|
||||
$category_list = $db->safesql( htmlspecialchars( strip_tags( stripslashes( implode( ',', $_REQUEST['new_category']))), ENT_QUOTES ) );
|
||||
$db->query( "UPDATE " . PREFIX . "_post set category='$category_list' WHERE category regexp '[[:<:]]($catid)[[:>:]]'" );
|
||||
$db->query( "DELETE FROM " . PREFIX . "_category WHERE id='$catid'" );
|
||||
DeleteSubcategories( $catid );
|
||||
$cache->delete('category.php');
|
||||
$cache->clear();
|
||||
msg( "info", $lang['cat_delok'], $lang['cat_delok_1'], "?mod=categories" );
|
||||
}
|
||||
}
|
||||
msg( "info", $lang['all_info'], "<form action=\"\" method=\"post\">{$lang['comm_move']} <select name=\"new_category[]\" class=\"cat_select\" align=\"absmiddle\" multiple>" . CategoryNewsSelection( 0, 0 ) . "</select> <input class=\"edit\" type=\"submit\" value=\"{$lang['b_start']}\"></form>", "$PHP_SELF?mod=categories" );
|
||||
} else {
|
||||
|
||||
$db->query( "DELETE FROM " . PREFIX . "_category WHERE id='$catid'" );
|
||||
DeleteSubcategories( $catid );
|
||||
$cache->delete('category.php' );
|
||||
$cache->clear();
|
||||
msg( "info", $lang['cat_delok'], $lang['cat_delok_1'], "?mod=categories" );
|
||||
}
|
||||
}
|
||||
// ********************************************************************************
|
||||
// Ðåäàêòèðîâàíèå êàòåãîðèè
|
||||
// ********************************************************************************
|
||||
elseif( $action == "edit" ) {
|
||||
echoheader( "options", $lang['cat_head'] );
|
||||
|
||||
$catid = intval( $_GET['catid'] );
|
||||
|
||||
if( ! $catid ) {msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=categories" );}
|
||||
$row = $db->super_query( "SELECT * FROM " . PREFIX . "_category WHERE id = '$catid'" );
|
||||
if( ! $row['id'] ) msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=categories" );
|
||||
|
||||
$categorylist = CategoryNewsSelection( $row['parentid'], 0 );
|
||||
|
||||
$row['name'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['name'] ) );
|
||||
$row['metatitle'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['metatitle'] ) );
|
||||
$row['descr'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['descr'] ) );
|
||||
$row['keywords'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['keywords'] ) );
|
||||
|
||||
$row['news_sort'] = makeDropDown( array ("" => $lang['sys_global'], "date" => $lang['opt_sys_sdate'], "rating" => $lang['opt_sys_srate'], "news_read" => $lang['opt_sys_sview'], "title" => $lang['opt_sys_salph'] ), "news_sort", $row['news_sort'] );
|
||||
$row['news_msort'] = makeDropDown( array ("" => $lang['sys_global'], "DESC" => $lang['opt_sys_mminus'], "ASC" => $lang['opt_sys_mplus'] ), "news_msort", $row['news_msort'] );
|
||||
|
||||
echo <<<HTML
|
||||
<form method="post" action="">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['cat_edit']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="260" style="padding:4px;">{$lang['cat_name']}</td>
|
||||
<td><input class="edit" value="{$row['name']}" type="text" name="cat_name"><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_catname]}', this, event, '250px')">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['cat_url']}</td>
|
||||
<td><input class="edit" value="{$row['alt_name']}" type="text" name="alt_cat_name"><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_cataltname]}', this, event, '250px')">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['meta_title']}</td>
|
||||
<td><input type="text" name="meta_title" style="width:345px;" value="{$row['metatitle']}" class="edit"> ({$lang['meta_descr_max']})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['meta_descr_cat']}</td>
|
||||
<td><input type="text" name="descr" style="width:345px;" value="{$row['descr']}" class="edit"> ({$lang['meta_descr_max']})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['meta_keys']}</td>
|
||||
<td><textarea name="keywords" style="width:345px;height:50px;">{$row['keywords']}</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['cat_parent']}</td>
|
||||
<td><select name="parentid" >{$categorylist}</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['opt_sys_sort']}</td>
|
||||
<td>{$row['news_sort']}</td>
|
||||
</tr>
|
||||
<td style="padding:4px;">{$lang['opt_sys_msort']}</td>
|
||||
<td>{$row['news_msort']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['opt_sys_newc']}</td>
|
||||
<td><input class="edit" type="text" name="news_number" value="{$row['news_number']}"><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_news_number]}', this, event, '250px')">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;"> </td>
|
||||
<td><input type="submit" class="buttons" value="{$lang['vote_edit']}">
|
||||
<input type=hidden name=action value=doedit>
|
||||
<input type="hidden" name="user_hash" value="$dle_login_hash" />
|
||||
<input type=hidden name=catid value=$row[id]>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
die();
|
||||
|
||||
}
|
||||
// ********************************************************************************
|
||||
// Çàïèñü îòðåäàêòèðîâàííîé êàòåãîðèè
|
||||
// ********************************************************************************
|
||||
elseif( $action == "doedit" ) {
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );}
|
||||
|
||||
$quotes = array ("\x27", "\x22", "\x60", "\t", "\n", "\r", '"' );
|
||||
|
||||
$cat_name = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['cat_name'] ) ), ENT_QUOTES) );
|
||||
$alt_cat_name = totranslit( stripslashes( $_POST['alt_cat_name'] ), true, false );
|
||||
|
||||
$catid = intval( $_POST['catid'] );
|
||||
$parentid = intval( $_POST['parentid'] );
|
||||
|
||||
$meta_title = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['meta_title'] ) ) ) );
|
||||
$description = $db->safesql( substr( strip_tags( stripslashes( $_POST['descr'] ) ), 0, 200 ) );
|
||||
$keywords = $db->safesql( str_replace( $quotes, " ", strip_tags( stripslashes( $_POST['keywords'] ) ) ) );
|
||||
|
||||
if ( in_array($_POST['news_sort'], array("date", "rating", "news_read", "title")) ) {
|
||||
$news_sort = $db->safesql( $_POST['news_sort'] );
|
||||
} else $news_sort = "";
|
||||
|
||||
if ( in_array($_POST['news_msort'], array("ASC", "DESC")) ) {
|
||||
$news_msort = $db->safesql( $_POST['news_msort'] );
|
||||
} else $news_msort = "";
|
||||
|
||||
if ( $_POST['news_number'] > 0)$news_number = intval( $_POST['news_number'] ); else $news_number = 0;
|
||||
if( ! $catid ) {msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=categories" );}
|
||||
if( $cat_name == "" ) {msg( "error", $lang['cat_error'], $lang['cat_noname'], "javascript:history.go(-1)" );}
|
||||
|
||||
$row = $db->super_query( "SELECT id, alt_name FROM " . PREFIX . "_category WHERE alt_name = '$alt_cat_name'" );
|
||||
|
||||
if( $row['id'] and $row['id'] != $catid ) {
|
||||
msg( "error", $lang['cat_error'], $lang['cat_eradd'], "javascript:history.go(-1)" );
|
||||
}
|
||||
|
||||
if( in_array( $parentid, get_sub_cats( $catid ) ) ) {
|
||||
msg( "error", $lang['cat_error'], $lang['cat_noparentid'], "$PHP_SELF?mod=categories" );
|
||||
}
|
||||
|
||||
$db->query( "UPDATE " . PREFIX . "_category set parentid='$parentid', name='$cat_name', alt_name='$alt_cat_name', descr='$description', keywords='$keywords', news_sort='$news_sort', news_msort='$news_msort', news_number='$news_number', metatitle='$meta_title' WHERE id='$catid'" );
|
||||
|
||||
$cache->delete('category.php' );
|
||||
$cache->clear();
|
||||
|
||||
msg( "info", $lang['cat_editok'], $lang['cat_editok_1'], "$PHP_SELF?mod=categories" );
|
||||
}
|
||||
// ********************************************************************************
|
||||
// List all Categories
|
||||
// ********************************************************************************
|
||||
echoheader( "options", $lang['cat_head'] );
|
||||
|
||||
$categorylist = CategoryNewsSelection( 0, 0 );
|
||||
|
||||
echo <<<HTML
|
||||
<form method="post" action="">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['cat_add']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="260" style="padding:4px;">{$lang['cat_name']}</td>
|
||||
<td><input class="edit" type="text" name="cat_name"><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_catname]}', this, event, '250px')">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['cat_url']}</td>
|
||||
<td><input class="edit" type="text" name="alt_cat_name"><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_cataltname]}', this, event, '250px')">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['meta_title']}</td>
|
||||
<td><input type="text" name="meta_title" style="width:345px;" class="edit"> ({$lang['meta_descr_max']})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['meta_descr_cat']}</td>
|
||||
<td><input type="text" name="descr" style="width:345px;" class="edit"> ({$lang['meta_descr_max']})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['meta_keys']}</td>
|
||||
<td><textarea name="keywords" style="width:345px;height:50px;"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['cat_parent']}</td>
|
||||
<td><select name="category" >{$categorylist}</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['opt_sys_sort']}</td>
|
||||
<td><select size=1 name="news_sort">
|
||||
<option value="" selected >{$lang['sys_global']}</option>
|
||||
<option value="date">{$lang['opt_sys_sdate']}</option>
|
||||
<option value="rating">{$lang['opt_sys_srate']}</option>
|
||||
<option value="news_read">{$lang['opt_sys_sview']}</option>
|
||||
<option value="title">{$lang['opt_sys_salph']}</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<td style="padding:4px;">{$lang['opt_sys_msort']}</td>
|
||||
<td><select size=1 name="news_msort">
|
||||
<option value="" selected >{$lang['sys_global']}</option>
|
||||
<option value="DESC">{$lang['opt_sys_mminus']}</option>
|
||||
<option value="ASC">{$lang['opt_sys_mplus']}</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['opt_sys_newc']}</td>
|
||||
<td><input class="edit" type="text" name="news_number"><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_news_number]}', this, event, '250px')">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;"> </td>
|
||||
<td><input type="submit" class="buttons" value="{$lang['vote_new']}">
|
||||
<input type=hidden name=mod value=categories>
|
||||
<input type="hidden" name="user_hash" value="$dle_login_hash" />
|
||||
<input type=hidden name=action value=add></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
if( ! count( $cat_info ) ) {
|
||||
|
||||
echo <<<HTML
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['cat_list']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td height="100" align="center">{$lang['cat_nocat']}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
} else {
|
||||
|
||||
function DisplayCategories($parentid = 0, $sublevelmarker = '') {
|
||||
global $lang, $cat_info, $config, $dle_login_hash;
|
||||
|
||||
// start table
|
||||
if( $parentid == 0 ) {
|
||||
|
||||
echo <<<HTML
|
||||
<form method="post" action="">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['stat_all']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">ID</td>
|
||||
<td style="padding:2px;">Position</td>
|
||||
<td>{$lang['cat_cat']}</td>
|
||||
<td>{$lang['cat_url']}</td>
|
||||
<td width="120">{$lang['cat_action']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8"><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
HTML;
|
||||
|
||||
} else {
|
||||
$sublevelmarker .= '--';
|
||||
}
|
||||
|
||||
if( count( $cat_info ) ) {
|
||||
|
||||
foreach ( $cat_info as $cats ) {
|
||||
if( $cats['parentid'] == $parentid ) $root_category[] = $cats['id'];
|
||||
}
|
||||
|
||||
if( count( $root_category ) ) {
|
||||
|
||||
foreach ( $root_category as $id ) {
|
||||
|
||||
$category_name = $cat[$id];
|
||||
|
||||
if( $config['allow_alt_url'] == "yes" ) $link = "<a class=\"list\" href=\"" . $config['http_home_url'] . get_url( $id ) . "/\" target=\"_blank\">" . stripslashes( $cat_info[$id]['name'] ) . "</a>";
|
||||
else $link = "<a class=\"list\" href=\"{$config['http_home_url']}index.php?do=cat&category=" . $cat_info[$id]['alt_name'] . "\" target=\"_blank\">" . stripslashes( $cat_info[$id]['name'] ) . "</a>";
|
||||
|
||||
echo "<tr>
|
||||
<td height=\"14\"> <b>" . $cat_info[$id]['id'] . "</b></td>
|
||||
<td height=\"20\"><input class=\"edit\" type=\"text\" size=\"5\" name=\"posi[{$cat_info[$id]['id']}]\" maxlength=\"5\" value=\"{$cat_info[$id]['posi']}\"></td>
|
||||
<td> $sublevelmarker " . $link . "</td>
|
||||
<td>";
|
||||
if( $cat_info[$id]['alt_name'] != "" ) {
|
||||
echo $cat_info[$id]['alt_name'];
|
||||
} else {
|
||||
echo "---";
|
||||
}
|
||||
echo "</td>
|
||||
<td class=\"list\"><nobr>[<a href=\"?mod=categories&action=edit&catid=" . $cat_info[$id]['id'] . "\">$lang[cat_ed]</a>] [<a class=maintitle href=\"?mod=categories&user_hash=" . $dle_login_hash . "&action=remove&catid=" . $cat_info[$id]['id'] . "\">$lang[cat_del]</a>]</nobr></td>
|
||||
</tr>
|
||||
<tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=8></td></tr>";
|
||||
|
||||
DisplayCategories( $id, $sublevelmarker );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// end table
|
||||
if( $parentid == 0 ) {
|
||||
|
||||
echo <<<HTML
|
||||
<tr>
|
||||
<td colspan="8" style="padding:5px;"><input type=hidden name=action value=sort><input type="submit" id="posi" class="edit" value="$lang[cat_posi]" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
DisplayCategories();
|
||||
}
|
||||
|
||||
echofooter();
|
||||
?>
|
||||
476
system/inc/chat.php
Normal file
@@ -0,0 +1,476 @@
|
||||
<?PHP
|
||||
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
require_once (ROOT_DIR . '/system/data/chat.config.php');
|
||||
require_once ROOT_DIR.'/language/'.$config['langs'].'/chat.lng';
|
||||
|
||||
include(SYSTEM_DIR.'/classes/parse.class.php');
|
||||
|
||||
$parse = new ParseFilter(Array(), Array(), 1, 1);
|
||||
|
||||
|
||||
function reset_url($url) {
|
||||
$value = str_replace("http://", "", $url);
|
||||
$value = str_replace("www.", "", $value);
|
||||
$value = explode("/", $value);
|
||||
$value = reset($value);
|
||||
return $value;
|
||||
}
|
||||
|
||||
function showmcRow($title="", $description="", $field="") {
|
||||
global $chatconfig;
|
||||
echo"<tr>
|
||||
<td style=\"padding:4px\" class=\"option\">
|
||||
<b>$title</b><br /><span class=small>$description</span>
|
||||
<td width=394 align=middle >
|
||||
$field
|
||||
</tr><tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=2></td></tr>";
|
||||
$bg = ""; $i++;
|
||||
}
|
||||
|
||||
function makemcDropDown($options, $name, $selected) {
|
||||
$output = "<select name=\"$name\">\r\n";
|
||||
foreach($options as $value=>$description)
|
||||
{
|
||||
$output .= "<option value=\"$value\"";
|
||||
if($selected == $value){ $output .= " selected "; }
|
||||
$output .= ">$description</option>\n";
|
||||
}
|
||||
$output .= "</select>";
|
||||
return $output;
|
||||
}
|
||||
|
||||
function chatmenu () {
|
||||
global $lang_mc;
|
||||
echo <<<HTML
|
||||
<div style="padding-top:5px;padding-bottom:2px;"><table width="100%">
|
||||
<tr><td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td></tr>
|
||||
<tr><td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%"><tr><td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang_mc['mchatc']}</div></td></tr>
|
||||
</table><div class="unterline"></div>
|
||||
<table width="100%"><tr><td style="padding:2px;">
|
||||
<table style="text-align:center;" width="100%" height="35px">
|
||||
<tr style="vertical-align:middle;" >
|
||||
<td class=tableborder><a href="$PHP_SELF?mod=chat">Ãëàâíàÿ</a></td>
|
||||
<td class=tableborder><a href="$PHP_SELF?mod=chat&action=configs">Íàñòðîéêè</a></td>
|
||||
<td class=tableborder><a href="$PHP_SELF?mod=chat&action=trun">×èñòêà ÷àòà</a></td>
|
||||
<td class=tableborder><a href="$PHP_SELF?mod=chat&action=color">Color Íèêà</a></td>
|
||||
</tr></table></td></tr></table></td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td></tr>
|
||||
<tr><td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr></table></div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
if (isset($url)) {
|
||||
$url = rawurldecode($_GET['url']);
|
||||
$url = @base64_decode($url);
|
||||
$url = str_replace("&" , "&", $url);
|
||||
|
||||
$_SERVER['HTTP_REFERER'] = reset_url($_SERVER['HTTP_REFERER']);
|
||||
$_SERVER['HTTP_HOST'] = reset_url($_SERVER['HTTP_HOST']);
|
||||
|
||||
if (($_SERVER['HTTP_HOST'] != $_SERVER['HTTP_REFERER']) OR $url == "") { @header('Location: /index.php'); die ("Access denied!!!<br /><br />Please visit <a href=\"/index.php\">{$_SERVER['HTTP_HOST']}</a>"); }
|
||||
@header('Location: '.$url);
|
||||
die ("Link Redirect:<br /><br />Please click <a href=\"{$url}\">here.</a>");
|
||||
}
|
||||
|
||||
if ($action == ""){
|
||||
echoheader("chat", $lang['opt_mchatc']);
|
||||
chatmenu ();
|
||||
if(!intval($chat_per_page)){ $chat_per_page = 30; }
|
||||
|
||||
if (!isset($start_from)) $start_from = 0;
|
||||
|
||||
if(!$user_group[$member_db[1]]['allow_all_edit'] AND $member_db[1] != 1) $author = $member_db[2];
|
||||
|
||||
$sql = "SELECT * FROM " . PREFIX . "_chat ORDER BY date DESC LIMIT $start_from,$chat_per_page";
|
||||
$db->query($sql);
|
||||
if($start_from == "0"){ $start_from = ""; }
|
||||
$i = $start_from;
|
||||
$entries_showed = 0;
|
||||
$entries = "";
|
||||
while($row = $db->get_array()){ $i++;
|
||||
|
||||
$itemdate = date($chatconfig['timestampa'],strtotime($row['date']));
|
||||
$row['message'] = $parse->BB_Parse($parse->process(urldecode(stripcslashes($row['message']))));
|
||||
|
||||
$entries .= "<tr><td class=\"list\" style=\"padding:4px;\">$itemdate - ";
|
||||
$entries .= "<a title='$lang[edit_act]' class=\"list\" href=\"$PHP_SELF?mod=chat&action=messedit&id=$row[0]\">".$row['message']."</a>";
|
||||
$entries .= "<td class=\"list\"><a class=list href=\"?mod=editusers&action=list&search=yes&search_name=".$row['name']."\">".$row['name']."</a>
|
||||
<td align=center><input name=\"selected_mess[]\" value=\"{$row['id']}\" type='checkbox'></tr>
|
||||
<tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=6></td></tr>";
|
||||
$entries_showed ++;
|
||||
if($i >= $chat_per_page + $start_from){ break; }
|
||||
}
|
||||
$query_count = "SELECT COUNT(*) as count from " . PREFIX . "_chat";
|
||||
$result_count = $db->super_query($query_count);
|
||||
$all_count = $result_count['count'];
|
||||
|
||||
echo <<<JSCRIPT
|
||||
<script language='JavaScript' type="text/javascript">
|
||||
<!--
|
||||
function ckeck_uncheck_all() {
|
||||
var frm = document.editnews;
|
||||
for (var i=0;i<frm.elements.length;i++) {
|
||||
var elmnt = frm.elements[i];
|
||||
if (elmnt.type=='checkbox') {
|
||||
if(frm.master_box.checked == true){ elmnt.checked=false; }
|
||||
else{ elmnt.checked=true; }
|
||||
}
|
||||
}
|
||||
if(frm.master_box.checked == true){ frm.master_box.checked = false; }
|
||||
else{ frm.master_box.checked = true; }
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
JSCRIPT;
|
||||
|
||||
echo<<<HTML
|
||||
<form action="" method="post" name="editnews">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%"><tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td></tr>
|
||||
<tr><td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF"><table width="100%"><tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang_mc['mc_main']}</div></td>
|
||||
</tr></table><div class="unterline"></div>
|
||||
<table width="100%"><tr><td><table width=100%><tr>
|
||||
<td> Ñîîáùåíèå
|
||||
<td width=70>{$lang['edit_autor']}
|
||||
<td width=10 align="center"><input type="checkbox" name="master_box" title="{$lang['edit_selall']}" onclick="javascript:ckeck_uncheck_all()">
|
||||
</tr><tr><td colspan="6"><div class="hr_line"></div></td></tr>
|
||||
{$entries}
|
||||
<tr><td colspan="6"><div class="hr_line"></div></td></tr>
|
||||
HTML;
|
||||
|
||||
$npp_nav ="";
|
||||
|
||||
if($start_from > 0)
|
||||
{
|
||||
$previous = $start_from - $chat_per_page;
|
||||
$npp_nav .= "<a href=\"$PHP_SELF?mod=chat&start_from=$previous&chat_per_page=$chat_per_page\"><< $lang[edit_prev]</a>";
|
||||
}
|
||||
if($all_count > $chat_per_page){
|
||||
$npp_nav .= " [ ";
|
||||
$enpages_count = @ceil($all_count/$chat_per_page);
|
||||
$enpages_start_from = 0;
|
||||
$enpages = "";
|
||||
for($j=1;$j<=$enpages_count;$j++){
|
||||
if($enpages_start_from != $start_from){ $enpages .= "<a class=maintitle href=\"$PHP_SELF?mod=chat&start_from=$enpages_start_from&chat_per_page=$chat_per_page\">$j</a> "; }
|
||||
else{ $enpages .= "<span class=navigation> $j </span>"; }
|
||||
$enpages_start_from += $chat_per_page;
|
||||
}
|
||||
$npp_nav .= $enpages;
|
||||
$npp_nav .= " ] ";
|
||||
}
|
||||
if($all_count > $i)
|
||||
{
|
||||
$how_next = $all_count - $i;
|
||||
if($how_next > $chat_per_page){ $how_next = $chat_per_page; }
|
||||
$npp_nav .= "<a href=\"$PHP_SELF?mod=chat&start_from=$i&chat_per_page=$chat_per_page\">$lang[edit_next] $how_next >></a>";
|
||||
}
|
||||
if($entries_showed != 0){
|
||||
echo<<<HTML
|
||||
<tr><td>$npp_nav</td><td colspan=5 align="right" valign="top">
|
||||
<select name=action>
|
||||
<option value="">{$lang['edit_selact']}</option>
|
||||
<option value="mess_del">{$lang['edit_seldel']}</option>
|
||||
</select>
|
||||
<input type=hidden name=mod value="chat">
|
||||
<input class="buttons" type="submit" value="{$lang['b_start']}">
|
||||
</tr>
|
||||
HTML;
|
||||
}
|
||||
|
||||
echo<<<HTML
|
||||
</table></td>
|
||||
</tr></table></td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td></tr><tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td></tr>
|
||||
</table></div></form>
|
||||
HTML;
|
||||
|
||||
echo <<<HTML
|
||||
<form action="$PHP_SELF?mod=chat" method="post" name="options_bar">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%"><tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td></tr>
|
||||
<tr><td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF"><table width="100%">
|
||||
<tr><td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang_mc['mc_stat']} <b>{$entries_showed}</b> {$lang_mc['mc_stat1']} <b>{$all_count}</b></div></td>
|
||||
</tr></table><div class="unterline"></div>
|
||||
<table width="100%"><tr><td width="150" style="padding:5px;">{$lang_mc['mc_mess_page']}</td>
|
||||
<td ><input class="edit" style="text-align: center" name="chat_per_page" value="{$chat_per_page}" type="text" size="3"></td>
|
||||
</tr></table></td><td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr><tr><td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td></tr></table>
|
||||
</div></form>
|
||||
HTML;
|
||||
echofooter();
|
||||
///--- Íàñòðîéêà ñêðèïòà ---///
|
||||
}elseif ($action == "configs"){
|
||||
echoheader("chat", $lang_mc['mc_conf']);
|
||||
chatmenu ();
|
||||
echo <<<HTML
|
||||
<form action="" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%"><tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr><tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%"><tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang_mc['mc_conf']}</div></td>
|
||||
</tr></table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
HTML;
|
||||
|
||||
showmcRow($lang_mc['mc_guest'], $lang_mc['mc_guestc'], makemcDropDown(array("yes"=>$lang['opt_sys_yes'],"no"=>$lang['opt_sys_no']), "save_con[guest]", "{$chatconfig['guest']}"));
|
||||
showmcRow($lang_mc['mc_showdate'], $lang_mc['mc_showdatec'], makemcDropDown(array("yes"=>$lang['opt_sys_yes'],"no"=>$lang['opt_sys_no']), "save_con[show_date]", "{$chatconfig['show_date']}"));
|
||||
showmcRow($lang_mc['mc_limitb'], $lang_mc['mc_limitbc'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[limit]' value=\"{$chatconfig['limit']}\" size=10>");
|
||||
showmcRow($lang_mc['mc_limit'], $lang_mc['mc_limitc'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[messlimit]' value=\"{$chatconfig['messlimit']}\" size=10>");
|
||||
showmcRow($lang_mc['mc_sc'], $lang_mc['mc_sc'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[smiles_columns]' value=\"{$chatconfig['smiles_columns']}\" size=10>");
|
||||
showmcRow($lang_mc['mc_timestamp'], "<a onClick=\"javascript:Help('date')\" class=main href=\"#\">$lang[opt_sys_and]</a>", "<input class=edit type=text style=\"text-align: center;\" name='save_con[timestamp]' value='{$chatconfig['timestamp']}' size=40>");
|
||||
showmcRow($lang_mc['mc_timestampa'], "<a onClick=\"javascript:Help('date')\" class=main href=\"#\">$lang[opt_sys_and]</a>", "<input class=edit type=text style=\"text-align: center;\" name='save_con[timestampa]' value='{$chatconfig['timestampa']}' size=40>");
|
||||
showmcRow($lang_mc['mc_smail'], $lang_mc['mc_smailb'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[smilep]' value=\"{$chatconfig['smilep']}\" size=40>");
|
||||
showmcRow($lang_mc['mc_refresh'], $lang_mc['mc_refreshc'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[refresh]' value=\"{$chatconfig['refresh']}\" size=10>");
|
||||
showmcRow($lang['opt_sys_aw'], $lang['opt_sys_awd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[auto_wrap]' value=\"{$chatconfig['auto_wrap']}\" size=10>");
|
||||
showmcRow($lang_mc['mc_colornik'], $lang_mc['mc_colornikc'], makemcDropDown(array("yes"=>$lang['opt_sys_yes'],"no"=>$lang['opt_sys_no']), "save_con[color_nik]", "{$chatconfig['color_nik']}"));
|
||||
|
||||
echo <<<HTML
|
||||
<tr><td style="padding-top:10px; padding-bottom:10px;padding-right:10px;">
|
||||
<input type=hidden name=mod value=chat>
|
||||
<input type=hidden name=action value=dosaveconfigs>
|
||||
<input type="submit" class="buttons" value="{$lang['user_save']}"></td>
|
||||
</tr></table></td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr><tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr></table></div></form>
|
||||
HTML;
|
||||
echofooter();
|
||||
///--- Íàñòðîéêà ñêðèïòà end ---///
|
||||
|
||||
///--- ×èñòêà ÷àòà ---///
|
||||
}elseif ($action == "trun"){
|
||||
echoheader("chat", $lang_mc['mc_trunñ']);
|
||||
chatmenu ();
|
||||
echo <<<HTML
|
||||
<form action="" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%"><tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr><tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%"><tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang_mc['mc_trunñ']}</div></td>
|
||||
</tr></table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr align="center">
|
||||
<td style="padding-top:10px; padding-bottom:10px;padding-right:10px;">{$lang_mc['mc_trun']}</td></tr>
|
||||
<tr align="center">
|
||||
<td style="padding-top:10px; padding-bottom:10px;padding-right:10px;">
|
||||
<input class=bbcodes type=submit value=" $lang[mass_yes] "> <input type=button class=bbcodes value=" $lang[mass_no] " onclick="javascript:document.location='$PHP_SELF?mod=chat'">
|
||||
<input type=hidden name=action value=dotrun>
|
||||
<input type=hidden name=mod value=chat></td>
|
||||
</tr></table></td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr><tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr></table></div></form>
|
||||
HTML;
|
||||
echofooter();
|
||||
}
|
||||
///--- ×èñòêà ÷àòà end ---///
|
||||
|
||||
elseif($action == "mess_del"){
|
||||
echoheader("chat", $lang_mc['chatc']);
|
||||
echo <<<HTML
|
||||
<form action="{$PHP_SELF}" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%"><tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr><tr><td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF"><table width="100%">
|
||||
<tr><td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['mass_head']}</div></td>
|
||||
</tr></table><div class="unterline"></div>
|
||||
<table width="100%"><tr><td style="padding:2px;" height="100" align="center">{$lang_mc['mass_confirm']}
|
||||
HTML;
|
||||
|
||||
echo "(<b>".count($selected_mess)."</b>) ñîîáùåíèÿ<br><br>
|
||||
<input class=bbcodes type=submit value=\" $lang[mass_yes] \"> <input type=button class=bbcodes value=\" $lang[mass_no] \" onclick=\"javascript:document.location='$PHP_SELF?mod=chat'\">
|
||||
<input type=hidden name=action value=\"do_mess_del\">
|
||||
<input type=hidden name=mod value=\"chat\">";
|
||||
foreach($selected_mess as $id){
|
||||
echo "<input type=hidden name=selected_mess[] value=\"$id\">\n";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</tr></table></td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td></tr>
|
||||
<tr><td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr></table></div></form>
|
||||
HTML;
|
||||
echofooter();
|
||||
exit;
|
||||
///--- Add Message end ---///
|
||||
}elseif($action == "messedit"){
|
||||
echoheader("chat", $lang_mc['chatc']);
|
||||
chatmenu ();
|
||||
$row = $db->super_query("SELECT * FROM " . PREFIX . "_chat WHERE id = '$id'");
|
||||
$messtext = $parse->decodeBBCodes($row['message']);
|
||||
echo <<<HTML
|
||||
<form action="" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;"><table width="100%"><tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td></tr>
|
||||
<tr><td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF"><table width="100%"><tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang_mc['mc_addmssa']}</div></td>
|
||||
</tr></table><div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
|
||||
include(SYSTEM_DIR.'/inc/include/inserttag.php');
|
||||
|
||||
echo <<<HTML
|
||||
<tr><td style="padding-left:2px;">{$bb_code}<textarea style="width:98%; height:100px;" name="aeditmess" id="aeditmess" onclick=setFieldName(this.name)>{$messtext}</textarea><script type=text/javascript>var selField = "template";</script></td></tr>
|
||||
HTML;
|
||||
|
||||
echo <<<HTML
|
||||
<tr><td colspan="2"><div class="hr_line"></div></td></tr><tr><td>
|
||||
<input type="submit" value="{$lang['user_save']}" class="buttons">
|
||||
<input type=hidden name=action value=do_mess_edit>
|
||||
<input type=hidden name=mod value=chat>
|
||||
<br><br></td></tr></table>
|
||||
</td><td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td></tr><tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr></table></div></form>
|
||||
HTML;
|
||||
echofooter();
|
||||
}elseif($action == "color"){
|
||||
echoheader("chat", $lang_mc['chatc']);
|
||||
chatmenu ();
|
||||
echo <<<HTML
|
||||
<form action="" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%"><tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr><tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%"><tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">Color Íèêà</div></td>
|
||||
</tr></table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
HTML;
|
||||
|
||||
showmcRow('1:', $lang_mc['mc_color1'], "<input type=text style='text-align: center;' size=10 class=edit name='save_con[color1]' value='{$chatconfig['color1']}'>", "");
|
||||
showmcRow('2:', $lang_mc['mc_color2'], "<input type=text style='text-align: center;' size=10 class=edit name='save_con[color2]' value='{$chatconfig['color2']}'>", "");
|
||||
showmcRow('3:', $lang_mc['mc_color3'], "<input type=text style='text-align: center;' size=10 class=edit name='save_con[color3]' value='{$chatconfig['color3']}'>", "");
|
||||
|
||||
echo <<<HTML
|
||||
<tr><td style="padding-top:10px; padding-bottom:10px;padding-right:10px;">
|
||||
|
||||
<input type=hidden name=mod value=chat>
|
||||
<input type=hidden name=action value=dosaveconfigs>
|
||||
<input type="submit" class="buttons" value="{$lang['user_save']}"></td>
|
||||
</tr></table></td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr><tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr></table></div></form>
|
||||
HTML;
|
||||
echofooter();
|
||||
}elseif($action == "do_mess_edit"){
|
||||
$aeditmess = $db->safesql($parse->BB_Parse(parse_mcsmiles($parse->process($_POST['aeditmess']))));
|
||||
$result = $db->query("UPDATE " . PREFIX . "_chat SET message='$aeditmess' WHERE id='$id'");
|
||||
@header("Location: $PHP_SELF?mod=chat");
|
||||
}elseif($action == "do_mess_del"){
|
||||
$deleted_message = 0;
|
||||
foreach ($selected_mess as $id){
|
||||
$id = intval($id);
|
||||
$db->query("DELETE FROM " . PREFIX . "_chat WHERE id='$id'");
|
||||
$deleted_message ++;
|
||||
$db->free(); }
|
||||
if(count($selected_mess) == $deleted_message){ msg("info", $lang['word_ldel'], $lang_mc['mc_mess_delok'], "$PHP_SELF?mod=chat"); }
|
||||
else{ msg("error", $lang_mc['mc_mess_notok'], "$deleted_message $lang[mass_i] ".count($selected_mess)." $lang[mass_notok_1]", "$PHP_SELF?mod=chat"); }
|
||||
}elseif($action == "doaddmess") {
|
||||
$amess = $db->safesql($parse->BB_Parse(parse_mcsmiles($parse->process($_POST['amess']))));
|
||||
$name = "Admin";
|
||||
$ip = $db->safesql($_SERVER['REMOTE_ADDR']);
|
||||
$date = date ("Y-m-d H:i:s", time()+($config['date_adjust']*60));
|
||||
|
||||
if ($amess == "") msg("error",$lang['static_err'],$lang['static_err_1'], "javascript:history.go(-1)");
|
||||
|
||||
$db->query("INSERT INTO ".PREFIX."_chat (name, message, date, ip, `mgroup`, user_id) VALUES ('$name', '$amess', '$date', '$ip', '', '')");
|
||||
header("Location: $PHP_SELF?mod=chat&action=doaddmessok");
|
||||
}elseif($action == "doaddmessok"){
|
||||
msg("info", $lang_mc['mc_addmssok'], "$lang[mc_addmssok]<br /><br /><a href=$PHP_SELF?mod=chat>$lang[db_prev]</a>");
|
||||
}elseif($action == "dotrun") {
|
||||
$db->query("TRUNCATE " . PREFIX . "_chat");
|
||||
header("Location: $PHP_SELF?mod=chat");
|
||||
}elseif($action == "dosaveconfigs")
|
||||
{
|
||||
$find[] = "'\r'";
|
||||
$replace[] = "";
|
||||
$find[] = "'\n'";
|
||||
$replace[] = "";
|
||||
|
||||
$save_con = $save_con + $chatconfig;
|
||||
|
||||
if($member_id['user_group'] != 1){ msg("error", $lang_p['opt_denied'], $lang_p['opt_denied']); }
|
||||
$handler = fopen(SYSTEM_DIR.'/data/chat.config.php', "w");
|
||||
fwrite($handler, "<?PHP \n\n//Chat Configurations\n\n\$chatconfig = array (\n\n");
|
||||
foreach($save_con as $name => $value)
|
||||
{
|
||||
$value=trim(stripslashes ($value));
|
||||
$value=htmlspecialchars ($value, ENT_QUOTES);
|
||||
$value = preg_replace($find,$replace,$value);
|
||||
fwrite($handler, "'{$name}' => \"{$value}\",\n\n");
|
||||
}
|
||||
fwrite($handler, ");\n\n?>");
|
||||
fclose($handler);
|
||||
|
||||
$cache->clear();
|
||||
msg("info", $lang['opt_sysok'], "$lang[opt_sysok_1]<br /><br /><a href=$PHP_SELF?mod=chat&action=configs>$lang[db_prev]</a>");
|
||||
}
|
||||
?>
|
||||
101
system/inc/clean.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
if($member_id['user_group'] != 1){ msg("error", $lang['addnews_denied'], $lang['db_denied']); }
|
||||
|
||||
$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'] ;
|
||||
}
|
||||
$db->free();
|
||||
|
||||
$lang['clean_all'] = str_replace ('{datenbank}', '<font color="red">'.mksize($mysql_size).'</font>', $lang['clean_all']);
|
||||
|
||||
echoheader("", "");
|
||||
|
||||
echo <<<HTML
|
||||
<script type="text/javascript" src="system/ajax/dle_ajax.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
function start_clean ( step, size ){
|
||||
|
||||
document.getElementById( 'status' ).innerHTML = '{$lang['ajax_info']}';
|
||||
|
||||
var ajax = new dle_ajax();
|
||||
|
||||
var varsString = "step=" + step;
|
||||
|
||||
if (document.getElementById( 'f_date_c' )) {
|
||||
ajax.setVar("date", document.getElementById( 'f_date_c' ).value );
|
||||
}
|
||||
|
||||
if (document.getElementById( 'next_button' )) {
|
||||
document.getElementById( 'next_button' ).disabled = true;
|
||||
}
|
||||
if (document.getElementById( 'skip_button' )) {
|
||||
document.getElementById( 'skip_button' ).disabled = true;
|
||||
}
|
||||
|
||||
ajax.setVar("size", size);
|
||||
ajax.setVar("user_hash", "{$dle_login_hash}");
|
||||
|
||||
ajax.requestFile = "system/ajax/clean.php";
|
||||
ajax.execute = true;
|
||||
ajax.element = 'main_box';
|
||||
ajax.method = 'GET';
|
||||
|
||||
ajax.sendAJAX(varsString);
|
||||
|
||||
return false;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<link rel="stylesheet" type="text/css" media="all" href="system/skins/calendar-blue.css" title="win2k-cold-1" />
|
||||
<script type="text/javascript" src="system/skins/calendar.js"></script>
|
||||
<script type="text/javascript" src="system/skins/calendar-en.js"></script>
|
||||
<script type="text/javascript" src="system/skins/calendar-setup.js"></script>
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['clean_title']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">
|
||||
<div id="main_box"><br />{$lang['clean_all']}<br /><br /><font color="red"><span id="status"></span></font><br /><br />
|
||||
<input id = "next_button" onclick="start_clean('1', '{$mysql_size}'); return false;" class="buttons" style="width:100px;" type="button" value="{$lang['edit_next']}">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
|
||||
echofooter();
|
||||
?>
|
||||
1292
system/inc/editnews.php
Normal file
1287
system/inc/editusers.php
Normal file
188
system/inc/email.php
Normal file
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
|
||||
if( $member_id['user_group'] != 1 ) {
|
||||
msg( "error", $lang['addnews_denied'], $lang['db_denied'] );
|
||||
}
|
||||
|
||||
if( $action == "save" ) {
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
|
||||
|
||||
die( "Hacking attempt! User not found" );
|
||||
|
||||
}
|
||||
|
||||
$find = array ("'<'", "'>'" );
|
||||
$replace = array ("<", ">" );
|
||||
|
||||
$reg_mail_text = preg_replace( $find, $replace, $db->safesql( $_POST['reg_mail_text'] ) );
|
||||
$feed_mail_text = preg_replace( $find, $replace, $db->safesql( $_POST['feed_mail_text'] ) );
|
||||
$lost_mail_text = preg_replace( $find, $replace, $db->safesql( $_POST['lost_mail_text'] ) );
|
||||
$new_news_text = preg_replace( $find, $replace, $db->safesql( $_POST['new_news_text'] ) );
|
||||
$news_mailv_text = preg_replace( $find,$replace, $db->safesql( $_POST['news_mailv_text'] ) );
|
||||
$news_mailn_text = preg_replace( $find,$replace, $db->safesql( $_POST['news_mailn_text'] ) );
|
||||
$new_comments_text = preg_replace( $find, $replace, $db->safesql( $_POST['new_comments_text'] ) );
|
||||
|
||||
$db->query( "UPDATE " . PREFIX . "_email set template='$reg_mail_text' where name='reg_mail'" );
|
||||
$db->query( "UPDATE " . PREFIX . "_email set template='$feed_mail_text' where name='feed_mail'" );
|
||||
$db->query( "UPDATE " . PREFIX . "_email set template='$lost_mail_text' where name='lost_mail'" );
|
||||
$db->query( "UPDATE " . PREFIX . "_email set template='$new_news_text' where name='new_news'" );
|
||||
$db->query( "UPDATE " . PREFIX . "_email set template='$news_mailv_text' where name='news_mailv'" );
|
||||
$db->query( "UPDATE " . PREFIX . "_email set template='$news_mailn_text' where name='news_mailn'" );
|
||||
$db->query( "UPDATE " . PREFIX . "_email set template='$new_comments_text' where name='comments'" );
|
||||
$db->query( "UPDATE " . PREFIX . "_email set template='$new_pm_text' where name='pm'" );
|
||||
|
||||
msg( "info", $lang['mail_addok'], $lang['mail_addok_1'], "?mod=email" );
|
||||
|
||||
} else {
|
||||
|
||||
echoheader( "home", $lang['db_info'] );
|
||||
|
||||
$db->query( "SELECT name, template FROM " . PREFIX . "_email" );
|
||||
|
||||
while ( $row = $db->get_row() ) {
|
||||
$$row['name'] = stripslashes( $row['template'] );
|
||||
}
|
||||
$db->free();
|
||||
|
||||
echo <<<HTML
|
||||
<form action="$PHP_SELF?mod=email&action=save" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['mail_info']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">{$lang['mail_reg_info']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"><textarea rows="15" style="width:650px;" name="reg_mail_text">{$reg_mail}</textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['mail_info_1']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">{$lang['mail_feed_info']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"><textarea rows="15" style="width:650px;" name="feed_mail_text">{$feed_mail}</textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['mail_info_2']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">{$lang['mail_lost_info']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"><textarea rows="15" style="width:650px;" name="lost_mail_text">{$lost_mail}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">Íàñòðîéêà åæåäíåûíõ E-Mail ñîîáùåíèé (øàïêà, âåðõ)</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">Ìîæíî èñïîëüçîâàòü BB - êîäû è HTML</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"><textarea rows="15" style="width:650px;" name="news_mailv_text">{$news_mailv}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">Íàñòðîéêà åæåäíåûíõ E-Mail ñîîáùåíèé (íèç)</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">Ìîæíî èñïîëüçîâàòü BB - êîäû è HTML</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"><textarea rows="15" style="width:650px;" name="news_mailn_text">{$news_mailn}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['mail_info_4']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">{$lang['mail_comm_info']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"><textarea rows="15" style="width:650px;" name="new_comments_text">{$comments}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['mail_info_6']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">{$lang['mail_pm_info']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"><textarea rows="15" style="width:650px;" name="new_pm_text">{$pm}</textarea>
|
||||
<br /><br /> <input type="submit" value="{$lang['user_save']}" class="buttons"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="user_hash" value="$dle_login_hash" />
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
}
|
||||
?>
|
||||
1498
system/inc/files.php
Normal file
5
system/inc/forum.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
include SYSTEM_DIR.'/inc/forum/forum.php';
|
||||
|
||||
?>
|
||||
82
system/inc/forum/email.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/*
|
||||
=====================================================
|
||||
DLE Forum - by DLE Files Group
|
||||
-----------------------------------------------------
|
||||
http://dle-files.ru/
|
||||
-----------------------------------------------------
|
||||
File: email.php
|
||||
=====================================================
|
||||
Copyright (c) 2008,2010 DLE Files Group
|
||||
=====================================================
|
||||
*/
|
||||
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
if ($subaction == "save")
|
||||
{
|
||||
$find = array("'<'", "'>'",);
|
||||
|
||||
$replace = array("<", ">",);
|
||||
|
||||
$subscription_text = preg_replace($find,$replace, $db->safesql($_POST['subscription_text']));
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_email set template='$subscription_text' where name='subscription_text'");
|
||||
|
||||
$frend_text = preg_replace($find,$replace, $db->safesql($_POST['frend_text']));
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_email set template='$frend_text' where name='frend_text'");
|
||||
|
||||
|
||||
$report_text = preg_replace($find,$replace, $db->safesql($_POST['report_text']));
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_email set template='$report_text' where name='report_text'");
|
||||
|
||||
$new_topic = preg_replace($find,$replace, $db->safesql($_POST['new_topic']));
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_email set template='$new_topic' where name='new_topic'");
|
||||
|
||||
|
||||
msg("info",$f_lg['email_ok'], $f_lg['email_ok2'], "?mod=forum");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$db->query("SELECT name, template FROM " . PREFIX . "_forum_email");
|
||||
|
||||
while($row = $db->get_row())
|
||||
{
|
||||
$$row['name'] = stripslashes($row['template']);
|
||||
}
|
||||
|
||||
$db->free();
|
||||
|
||||
echo_top();
|
||||
|
||||
echo "<form action=\"$PHP_SELF?mod=forum&action=email&subaction=save\" method=\"post\">";
|
||||
|
||||
echo_title($f_lg['mail_subscr']);
|
||||
|
||||
echo_mail("subscription_text", $subscription_text, $f_lg['mail_subscr_']);
|
||||
|
||||
echo_title($f_lg['mail_new_topic']);
|
||||
|
||||
echo_mail("new_topic", $new_topic, $f_lg['mail_new_topic_']);
|
||||
|
||||
echo_title($f_lg['mail_frend']);
|
||||
|
||||
echo_mail("frend_text", $frend_text, $f_lg['mail_frend_']);
|
||||
|
||||
echo_title($f_lg['mail_report']);
|
||||
|
||||
echo_mail("report_text", $report_text, $f_lg['mail_report_']);
|
||||
|
||||
echo "<br /><input type=\"submit\" class=\"buttons\" value=\"{$f_lg['button_save']}\"></form>";
|
||||
|
||||
echo_bottom();
|
||||
}
|
||||
|
||||
?>
|
||||
367
system/inc/forum/form.php
Normal file
@@ -0,0 +1,367 @@
|
||||
<?php
|
||||
/*
|
||||
=====================================================
|
||||
DLE Forum - by DLE Files Group
|
||||
-----------------------------------------------------
|
||||
http://dle-files.ru/
|
||||
-----------------------------------------------------
|
||||
File: form.php
|
||||
=====================================================
|
||||
Copyright (c) 2008,2010 DLE Files Group
|
||||
=====================================================
|
||||
*/
|
||||
|
||||
function echo_category($type, $name = false, $sid = false){
|
||||
global $f_lg;
|
||||
|
||||
if ($type == "new")
|
||||
{
|
||||
$act = "category_add";
|
||||
$button = $f_lg['button_add'];
|
||||
}
|
||||
|
||||
if ($type == "edit")
|
||||
{
|
||||
$act = "category_save&sid={$sid}";
|
||||
$button = $f_lg['button_edit'];
|
||||
}
|
||||
|
||||
echo "<form method=\"post\" action=\"$PHP_SELF?mod=forum&action=$act\">
|
||||
<table border=\"0\" width=\"100%\">
|
||||
<tr>
|
||||
<td width=\"260\">{$f_lg['cat_name']}</td>
|
||||
<td><input class=\"edit\" type=\"text\" name=\"name\" value=\"$name\" size=\"27\"></td></tr>
|
||||
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>
|
||||
<tr>
|
||||
<td width=\"260\"> </td>
|
||||
<td><input type=\"submit\" class=\"buttons\" value=\"{$button}\"></td></tr>
|
||||
</table></form>";
|
||||
}
|
||||
|
||||
function echo_forum($type, $id = false, $sub_id = false){
|
||||
global $db, $f_lg, $user_group, $category_list, $forum_list, $sub_id;
|
||||
|
||||
if ($type == "new")
|
||||
{
|
||||
$act = "forum_add";
|
||||
|
||||
$button = $f_lg['button_add'];
|
||||
|
||||
category_list($id);
|
||||
|
||||
forum_list($sub_id);
|
||||
|
||||
$access_forum = access_forum($user_group, '0');
|
||||
|
||||
$f_form['postcount'] = 1;
|
||||
}
|
||||
|
||||
if ($type == "edit")
|
||||
{
|
||||
include(SYSTEM_DIR.'/classes/parse.class.php');
|
||||
|
||||
$parse = new ParseFilter();
|
||||
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_forums WHERE id = '$id'");
|
||||
|
||||
while ($row = $db->get_row($result))
|
||||
{
|
||||
$f_form['name'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['name']));
|
||||
$f_form['description'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['description']));
|
||||
$f_form['password'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['password']));
|
||||
|
||||
$f_form['rules_name'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['rules_title']));
|
||||
|
||||
$f_form['rules'] = $parse->decodeBBCodes($row['rules'], false);
|
||||
|
||||
$f_form['icon'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['icon']));
|
||||
|
||||
$sel_id = $row['main_id'];
|
||||
|
||||
$forum_id = $row['id'];
|
||||
|
||||
$parentid = $row['parentid'];
|
||||
|
||||
$f_form['postcount'] = $row['postcount'];
|
||||
|
||||
$f_form['fixpost'] = $row['fixpost'];
|
||||
|
||||
$f_form['banner'] = stripslashes($row['banner']);
|
||||
|
||||
$f_form['q_reply'] = intval($row['q_reply']);
|
||||
|
||||
$f_form['i_edit'] = intval($row['i_edit']);
|
||||
}
|
||||
|
||||
$act = "forum_save&id=$forum_id";
|
||||
|
||||
$button = $f_lg['button_edit'];
|
||||
|
||||
category_list($sel_id);
|
||||
|
||||
forum_list($parentid);
|
||||
|
||||
$access_forum = access_forum($user_group, $forum_id);
|
||||
}
|
||||
|
||||
echo "<form method=\"post\" action=\"$PHP_SELF?mod=forum&action=$act\">
|
||||
<fieldset><legend class=\"quick\"><strong>{$f_lg['forum_mset']}</strong></legend><br />
|
||||
<table border=\"0\" width=\"100%\">
|
||||
<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_name']}</b></td>
|
||||
<td><input class=\"edit\" type=\"text\" name=\"name\" value=\"{$f_form['name']}\" size=\"27\"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_descr']}</b></td>
|
||||
<td><TEXTAREA name=\"description\" rows=4 cols=60>{$f_form['description']}</TEXTAREA></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_icon']}</b></td>
|
||||
<td><input class=\"edit\" type=\"text\" name=\"icon\" value=\"{$f_form['icon']}\" size=\"27\"><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$f_lg[forum_icon_hint]}', this, event, '250px')\">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['password']}</b></td>
|
||||
<td><input class=\"edit\" type=\"text\" name=\"password\" value=\"{$f_form['password']}\" size=\"27\"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_cat']}</b></td>
|
||||
<td><SELECT name=\"main_id\">{$category_list}</SELECT></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_for']}</b></td>
|
||||
<td><SELECT name=\"parentid\">{$forum_list}</SELECT></td>
|
||||
</tr>
|
||||
<tr><td colspan=\"2\"></td></tr></table></fieldset><br />
|
||||
|
||||
<fieldset><legend class=\"quick\"><strong>{$f_lg['forum_posts_conf']}</strong></legend><br />
|
||||
<table border=\"0\" width=\"100%\">
|
||||
<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_postcount']}</b></td>
|
||||
<td>".makeDropDown(array("1"=>$f_lg['yes'],"0"=>$f_lg['no']), "postcount", $f_form['postcount'])."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_fixpost']}</b></td>
|
||||
<td>".makeDropDown(array("1"=>$f_lg['yes'],"0"=>$f_lg['no']), "fixpost", $f_form['fixpost'])."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_q_reply']}</b></td>
|
||||
<td>".makeDropDown(array("1"=>$f_lg['yes'],"0"=>$f_lg['no']), "q_reply", $f_form['q_reply'])."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_i_edit']}</b></td>
|
||||
<td>".makeDropDown(array("1"=>$f_lg['yes'],"0"=>$f_lg['no']), "i_edit", $f_form['i_edit'])."</td>
|
||||
</tr>
|
||||
<tr><td colspan=\"2\"></td></tr></table>
|
||||
</fieldset><br />
|
||||
|
||||
<fieldset><legend class=\"quick\"><strong>{$f_lg['forum_rules']}</strong></legend><br />
|
||||
<table border=\"0\" width=\"100%\">
|
||||
<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_rules1']}</b></td>
|
||||
<td><input class=\"edit\" type=\"text\" name=\"rules_name\" value=\"{$f_form['rules_name']}\" size=\"27\"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_rules2']}</b></td>
|
||||
<td><TEXTAREA name=\"rules\" rows=10 cols=60>{$f_form['rules']}</TEXTAREA></td>
|
||||
</tr>
|
||||
<tr><td colspan=\"2\"></td></tr></table>
|
||||
</fieldset><br />
|
||||
|
||||
<fieldset><legend class=\"quick\"><strong>{$f_lg['forum_banner']}</strong></legend><br />
|
||||
<table border=\"0\" width=\"100%\">
|
||||
<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_banner2']}</b></td>
|
||||
<td><TEXTAREA name=\"banner\" rows=10 cols=60>{$f_form['banner']}</TEXTAREA></td>
|
||||
</tr>
|
||||
<tr><td colspan=\"2\"></td></tr></table>
|
||||
</fieldset><br />
|
||||
|
||||
<fieldset><legend class=\"quick\"><strong>{$f_lg['forum_access']}</strong></legend><br />{$access_forum}</fieldset>
|
||||
<table border=\"0\" width=\"100%\">
|
||||
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>
|
||||
<tr>
|
||||
<td width=\"260\"> </td>
|
||||
<td><input type=\"submit\" class=\"buttons\" value=\"{$button}\"></td></tr>
|
||||
</table></form>";
|
||||
}
|
||||
|
||||
|
||||
function echo_rank($type, $id = false){
|
||||
global $db, $f_lg;
|
||||
|
||||
if ($type == "new")
|
||||
{
|
||||
$act = "rank_add";
|
||||
$button = $f_lg['button_add'];
|
||||
}
|
||||
|
||||
if ($type == "edit")
|
||||
{
|
||||
$act = "rank_save&id=$id";
|
||||
$button = $f_lg['button_edit'];
|
||||
|
||||
$result = $db->super_query("SELECT * FROM " . PREFIX . "_forum_titles WHERE id = '$id'");
|
||||
|
||||
$t_name = $result['title'];
|
||||
|
||||
$t_posts = $result['posts'];
|
||||
|
||||
$t_pips = $result['pips'];
|
||||
}
|
||||
|
||||
echo "<form method=\"post\" action=\"$PHP_SELF?mod=forum&action=$act\">
|
||||
<table border=\"0\" width=\"100%\">
|
||||
<tr>
|
||||
<td width=\"260\">{$f_lg['titles_nname']}</td>
|
||||
<td><input class=\"edit\" type=\"text\" name=\"t_name\" value=\"$t_name\" size=\"27\"></td></tr>
|
||||
<tr>
|
||||
<td width=\"260\">{$f_lg['titles_npost']}</td>
|
||||
<td><input class=\"edit\" type=\"text\" name=\"t_posts\" value=\"$t_posts\" size=\"27\"></td></tr>
|
||||
<tr>
|
||||
<td width=\"260\">{$f_lg['titles_npips']}</td>
|
||||
<td><input class=\"edit\" type=\"text\" name=\"t_pips\" value=\"$t_pips\" size=\"27\"></td></tr>
|
||||
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>
|
||||
<tr>
|
||||
<td width=\"260\"> </td>
|
||||
<td><input type=\"submit\" class=\"buttons\" value=\"{$button}\"></td></tr>
|
||||
</table></form>";
|
||||
}
|
||||
|
||||
if(!defined('DLE_FORUM')){ exit; }
|
||||
|
||||
function echo_mail($name, $text, $description)
|
||||
{
|
||||
echo "<table width=\"100%\">
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$description}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\"><textarea rows=\"15\" style=\"width:650px;\" name=\"{$name}\">{$text}</textarea></td>
|
||||
</tr>
|
||||
</table>";
|
||||
}
|
||||
|
||||
function echo_rank_style ()
|
||||
{
|
||||
global $config;
|
||||
$style = <<<HTML
|
||||
<style type="text/css" media="all">
|
||||
.rank {
|
||||
|
||||
width: 85px;
|
||||
|
||||
height: 16px;
|
||||
|
||||
}
|
||||
|
||||
.unit-rank {
|
||||
|
||||
list-style: none;
|
||||
|
||||
margin: 0px;
|
||||
|
||||
padding: 0px;
|
||||
|
||||
width: 85px;
|
||||
|
||||
height: 16px;
|
||||
|
||||
position: relative;
|
||||
|
||||
background-image: url('{THEME}/forum/images/rating.gif');
|
||||
|
||||
background-position: top left;
|
||||
|
||||
background-repeat: repeat-x;
|
||||
|
||||
}
|
||||
|
||||
.unit-rank li {
|
||||
|
||||
text-indent: -90000px;
|
||||
|
||||
padding: 0px;
|
||||
|
||||
margin: 0px;
|
||||
|
||||
float: left;
|
||||
|
||||
}
|
||||
|
||||
.unit-rank li a {
|
||||
|
||||
display: block;
|
||||
|
||||
width: 17px;
|
||||
|
||||
height: 16px;
|
||||
|
||||
text-decoration: none;
|
||||
|
||||
text-indent: -9000px;
|
||||
|
||||
z-index: 17;
|
||||
|
||||
position: absolute;
|
||||
|
||||
padding: 0px;
|
||||
|
||||
}
|
||||
|
||||
.unit-rank li a:hover {
|
||||
|
||||
background-image: url('{THEME}/forum/images/rating.gif');
|
||||
|
||||
background-position: left center;
|
||||
|
||||
z-index: 2;
|
||||
|
||||
left: 0px;
|
||||
|
||||
}
|
||||
|
||||
.unit-rank a.r1-unit { left: 0px; }
|
||||
|
||||
.unit-rank a.r1-unit:hover { width: 17px; }
|
||||
|
||||
.unit-rank a.r2-unit { left: 17px; }
|
||||
|
||||
.unit-rank a.r2-unit:hover { width: 34px; }
|
||||
|
||||
.unit-rank a.r3-unit { left: 34px; }
|
||||
|
||||
.unit-rank a.r3-unit:hover { width: 51px; }
|
||||
|
||||
.unit-rank a.r4-unit { left: 51px; }
|
||||
|
||||
.unit-rank a.r4-unit:hover { width: 68px; }
|
||||
|
||||
.unit-rank a.r5-unit { left: 68px; }
|
||||
|
||||
.unit-rank a.r5-unit:hover { width: 85px; }
|
||||
|
||||
.unit-rank li.current-rank {
|
||||
|
||||
background-image: url('{THEME}/forum/images/rating.gif');
|
||||
|
||||
background-position: left bottom;
|
||||
|
||||
position: absolute;
|
||||
|
||||
height: 16px;
|
||||
|
||||
display: block;
|
||||
|
||||
text-indent: -9000px;
|
||||
|
||||
z-index: 1;
|
||||
|
||||
}
|
||||
</style>
|
||||
HTML;
|
||||
|
||||
echo str_replace('{THEME}', $config['http_home_url'].'templates/'.$config['skin'], $style);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
1380
system/inc/forum/forum.php
Normal file
261
system/inc/forum/functions.php
Normal file
@@ -0,0 +1,261 @@
|
||||
<?php
|
||||
/*
|
||||
=====================================================
|
||||
DLE Forum - by DLE Files Group
|
||||
-----------------------------------------------------
|
||||
http://dle-files.ru/
|
||||
-----------------------------------------------------
|
||||
File: functions.php
|
||||
=====================================================
|
||||
Copyright (c) 2008,2010 DLE Files Group
|
||||
=====================================================
|
||||
*/
|
||||
|
||||
if(!defined('DLE_FORUM'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// ACCESS
|
||||
// ********************************************************************************
|
||||
function access_forum($user_group, $forum_id){
|
||||
global $access_forum, $db, $f_lg;
|
||||
|
||||
$access_mod = array();
|
||||
|
||||
$access_topic = array();
|
||||
|
||||
$access_write = array();
|
||||
|
||||
$access_read = array();
|
||||
|
||||
$access_upload = array();
|
||||
|
||||
$access_download = array();
|
||||
|
||||
// JavaScript by ShVad //
|
||||
$access_forum = <<<HTML
|
||||
<script language='JavaScript' type="text/javascript">
|
||||
|
||||
function access_check( id, value )
|
||||
{
|
||||
if (value == 'y'){ value = 1; } else { value = 0; }
|
||||
|
||||
document.getElementById( 'access_mod' + '[' + id + ']' ).checked = value;
|
||||
|
||||
document.getElementById( 'access_topic' + '[' + id + ']' ).checked = value;
|
||||
|
||||
document.getElementById( 'access_write' + '[' + id + ']' ).checked = value;
|
||||
|
||||
document.getElementById( 'access_read' + '[' + id + ']' ).checked = value;
|
||||
|
||||
document.getElementById( 'access_upload' + '[' + id + ']' ).checked = value;
|
||||
|
||||
document.getElementById( 'access_download' + '[' + id + ']' ).checked = value;
|
||||
}
|
||||
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
if ($forum_id)
|
||||
{
|
||||
$access_result = $db->query("SELECT * FROM " . PREFIX . "_forum_forums WHERE id = '$forum_id'");
|
||||
|
||||
while ($row = $db->get_row($access_result))
|
||||
{
|
||||
$access_mod = $row['access_mod'];
|
||||
|
||||
$access_topic = $row['access_topic'];
|
||||
|
||||
$access_write = $row['access_write'];
|
||||
|
||||
$access_read = $row['access_read'];
|
||||
|
||||
$access_upload = $row['access_upload'];
|
||||
|
||||
$access_download = $row['access_download'];
|
||||
}
|
||||
}
|
||||
|
||||
$access_forum .= "<table width='100%'><tr>
|
||||
<td class=\"option\" width='16%'><left><b>{$f_lg['access_forum_group']}</b></left></td>
|
||||
<td class=\"option\" width='10%'><center><b>{$f_lg['access_forum_mod']}</b></center></td>
|
||||
<td class=\"option\" width='14%'><center><b>{$f_lg['access_forum_topic']}</b></center></td>
|
||||
<td class=\"option\" width='14%'><center><b>{$f_lg['access_forum_write']}</b></center></td>
|
||||
<td class=\"option\" width='14%'><center><b>{$f_lg['access_forum_read']}</b></center></td>
|
||||
<td class=\"option\" width='14%'><center><b>{$f_lg['access_forum_upload']}</b></center></td>
|
||||
<td class=\"option\" width='16%'><center><b>{$f_lg['access_forum_download']}</b></center></td>
|
||||
</tr></table>
|
||||
<div class='hr_line'></div>";
|
||||
|
||||
$access_forum .= "<table width='100%'>";
|
||||
|
||||
foreach($user_group as $id => $group_name)
|
||||
{
|
||||
if ($forum_id)
|
||||
{
|
||||
$access_mod_array = explode(":",$access_mod);
|
||||
if (in_array($id, $access_mod_array)){$checked1 = "checked";}else{$checked1 = "";}
|
||||
|
||||
$access_topic_array = explode(":",$access_topic);
|
||||
if (in_array($id, $access_topic_array)){$checked2 = "checked";}else{$checked2 = "";}
|
||||
|
||||
$access_write_array = explode(":",$access_write);
|
||||
if (in_array($id, $access_write_array)){$checked3 = "checked";}else{$checked3 = "";}
|
||||
|
||||
$access_read_array = explode(":",$access_read);
|
||||
if (in_array($id, $access_read_array)){$checked4 = "checked";}else{$checked4 = "";}
|
||||
|
||||
$access_upload_array = explode(":",$access_upload);
|
||||
if (in_array($id, $access_upload_array)){$checked5 = "checked";}else{$checked5 = "";}
|
||||
|
||||
$access_download_array = explode(":",$access_download);
|
||||
if (in_array($id, $access_download_array)){$checked6 = "checked";}else{$checked6 = "";}
|
||||
}
|
||||
|
||||
$access_forum .= "<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width='16%'>
|
||||
<left>{$group_name[group_name]} [<a href=\"javascript:access_check('$id', 'y')\">+</a> |
|
||||
<a href=\"javascript:access_check('$id', 'n')\">-</a>]</left>
|
||||
</td>
|
||||
<td style=\"padding:4px\" class=\"option\" width='10%'>
|
||||
<center><input type='checkbox' name='access_mod[$id]' id='access_mod[$id]' value='$id' $checked1></center></td>
|
||||
<td style=\"padding:4px\" class=\"option\" width='14%'>
|
||||
<center><input type='checkbox' name='access_topic[$id]' id='access_topic[$id]' value='$id' $checked2></center></td>
|
||||
<td style=\"padding:4px\" class=\"option\" width='14%'>
|
||||
<center><input type='checkbox' name='access_write[$id]' id='access_write[$id]' value='$id' $checked3></center></td>
|
||||
<td style=\"padding:4px\" class=\"option\" width='14%'>
|
||||
<center><input type='checkbox' name='access_read[$id]' id='access_read[$id]' value='$id' $checked4></center></td>
|
||||
<td style=\"padding:4px\" class=\"option\" width='14%'>
|
||||
<center><input type='checkbox' name='access_upload[$id]' id='access_upload[$id]' value='$id' $checked5></center></td>
|
||||
<td style=\"padding:4px\" class=\"option\" width='16%'>
|
||||
<center><input type='checkbox' name='access_download[$id]' id='access_download[$id]' value='$id' $checked6></center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
$access_forum .= "</table>";
|
||||
|
||||
return($access_forum);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Category list
|
||||
// ********************************************************************************
|
||||
function category_list($select_id){
|
||||
global $db, $category_list;
|
||||
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_category");
|
||||
|
||||
while ($row = $db->get_row($result)){
|
||||
|
||||
if ($row['sid'] == $select_id){$sel = "selected";}
|
||||
|
||||
else {$sel = "";}
|
||||
|
||||
$row['cat_name'] = stripcslashes($row['cat_name']);
|
||||
|
||||
$category_list .= "<option $sel value=\"{$row['sid']}\">{$row['cat_name']}</option>";
|
||||
}
|
||||
|
||||
return($category_list);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Forum list
|
||||
// ********************************************************************************
|
||||
function forum_list($select_id){
|
||||
global $db, $forum_list;
|
||||
|
||||
$forum_list .= "<option value=\"0\"></option>";
|
||||
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_category LEFT JOIN ". PREFIX ."_forum_forums ON ". PREFIX ."_forum_category.sid=". PREFIX ."_forum_forums.main_id ORDER BY posi, position");
|
||||
|
||||
for ($i = 0; $row = $db->get_row($result_content); $i = $row['sid']){
|
||||
|
||||
if ($row['sid'] != $i)
|
||||
{
|
||||
$row['cat_name'] = stripcslashes($row['cat_name']);
|
||||
|
||||
$forum_list .= "<optgroup label=\"{$row['cat_name']}\">";
|
||||
}
|
||||
|
||||
if ($row['name'])
|
||||
{
|
||||
if ($row['id'] == $select_id){$sel = "selected";}
|
||||
|
||||
else {$sel = "";}
|
||||
|
||||
$row['name'] = stripcslashes($row['name']);
|
||||
|
||||
$forum_list .= "<option $sel value=\"{$row['id']}\"> - {$row['name']}</option>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return($forum_list);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Category and Forum POSITION
|
||||
// ********************************************************************************
|
||||
function category_posi($category_posi, $category_id, $result_posi){
|
||||
global $db;
|
||||
|
||||
$cat_posi = array();
|
||||
|
||||
$select_posi = "<select name=\"cat_posi[$category_id]\">";
|
||||
|
||||
for($j=1; $j<=$result_posi; $j++)
|
||||
{
|
||||
if ($j == $category_posi)
|
||||
{
|
||||
$select_posi .= "<option value='$j' selected>$j</option>";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$select_posi .= "<option value='$j'>$j</option>";
|
||||
}
|
||||
}
|
||||
|
||||
$select_posi .= "</select>";
|
||||
|
||||
return ($select_posi);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// SELECT USER GROUP
|
||||
// ********************************************************************************
|
||||
function warn_group($warn_group = false){
|
||||
global $db;
|
||||
|
||||
if ($warn_group)
|
||||
{
|
||||
$warn_list = explode (':', $warn_group);
|
||||
}
|
||||
|
||||
$db->query("SELECT * FROM " . USERPREFIX . "_usergroups GROUP BY id");
|
||||
|
||||
$group_list .= "<option value=\"\"></option>";
|
||||
|
||||
while($row = $db->get_row())
|
||||
{
|
||||
if ($warn_group)
|
||||
{
|
||||
if (in_array($row['id'], $warn_list))
|
||||
{
|
||||
$selected = "selected";
|
||||
} else
|
||||
{
|
||||
$selected = "";
|
||||
}
|
||||
}
|
||||
|
||||
$group_list .= "<option value=\"{$row['id']}\" {$selected}>{$row['group_name']}</option>";
|
||||
}
|
||||
|
||||
return ($group_list);
|
||||
}
|
||||
|
||||
?>
|
||||
BIN
system/inc/forum/ico/Usergroup.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
system/inc/forum/ico/category.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
system/inc/forum/ico/content.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
system/inc/forum/ico/discuss.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
39
system/inc/forum/ico/dle_forum.png
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die('Hacking attempt!');
|
||||
}
|
||||
$forum_link_array['textversion']=$forum_link_array['textversion'].$t_act;
|
||||
$forum_content=array(
|
||||
'{BOARD HEADER}'=>$forum_bar,
|
||||
'{last_visit}'=>$dle_forum_last_visit,
|
||||
'{now_time}'=>langdate($forum_config['timestamp'],$_TIME),
|
||||
'{STATS}'=>$tpl->result['forum_stats'],
|
||||
'[search-link]'=>"<a href=\"{$forum_link_array['search']}\">",
|
||||
'[/search-link]'=> '</a>',
|
||||
'[getnew-link]'=>"<a href=\"{$forum_link_array['getnew']}\">",
|
||||
'[/getnew-link]'=> '</a>',
|
||||
'[subscription-link]'=>"<a href=\"{$forum_link_array['subscription']}\">",
|
||||
'[/subscription-link]'=>'</a>',
|
||||
'[textversion]'=>"<a href=\"{$forum_link_array['textversion']}\">",
|
||||
'[/textversion]'=>'</a>',);
|
||||
$f_set="set";
|
||||
$compile="compile";
|
||||
$f_get="get";
|
||||
|
||||
if(!defined('FORUM_SUB_DOMAIN'))
|
||||
{
|
||||
$forum_ajax="\r\n<script language=\"javascript\" type=\"text/javascript\">\r\nvar forum_ajax = '/system/forum/ajax/';\r\nvar forum_wysiwyg = '{$forum_config['wysiwyg']}';\r\n</script>\r\n";
|
||||
$tpl->load_template($tpl_dir.'main.tpl');
|
||||
$tpl->copy_template = "{$forum_ajax}<script type='text/javascript' src='{$config['http_home_url']}system/forum/ajax/dle_forum.js'></script>".$tpl->copy_template;
|
||||
}
|
||||
$tpl->$f_set('{BOARD}',$tpl->result['dle_forum']);
|
||||
$tpl->$f_set('', $forum_content);
|
||||
$copyrigt=true;
|
||||
|
||||
$f_file_get_contents="file_get_contents";
|
||||
|
||||
$f_clear="clear";
|
||||
$tpl->$compile("content");
|
||||
$tpl->$f_clear();
|
||||
?>
|
||||
BIN
system/inc/forum/ico/filebrowser_action.gif
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
system/inc/forum/ico/filebrowser_action2.gif
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
system/inc/forum/ico/forum.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
system/inc/forum/ico/global.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
system/inc/forum/ico/help.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
1
system/inc/forum/ico/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html>
|
||||
BIN
system/inc/forum/ico/licence.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
system/inc/forum/ico/modules.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
system/inc/forum/ico/mset.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
system/inc/forum/ico/news.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
system/inc/forum/ico/preventions.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
system/inc/forum/ico/rank.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
system/inc/forum/ico/safety.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
system/inc/forum/ico/service.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
system/inc/forum/ico/show.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
system/inc/forum/ico/speed.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
system/inc/forum/ico/tools.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
system/inc/forum/ico/uploads.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
system/inc/forum/ico/usersgroup.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
19
system/inc/forum/init.class.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
define('DLE_FORUM',true);
|
||||
|
||||
class dle_forum_init
|
||||
{
|
||||
function init_admin()
|
||||
{
|
||||
global $config, $forum_config, $f_lg, $options, $l_full;
|
||||
|
||||
require_once SYSTEM_DIR.'/data/forum_config.php';
|
||||
require_once SYSTEM_DIR.'/forum/language/'.$config['langs'].'/admin.lng';
|
||||
require_once SYSTEM_DIR."/inc/forum/functions.php";
|
||||
require_once SYSTEM_DIR."/inc/forum/table.php";
|
||||
require_once SYSTEM_DIR."/inc/forum/form.php";
|
||||
require_once SYSTEM_DIR."/classes/cache.class.php";
|
||||
}
|
||||
}
|
||||
$dle_forum_init = new dle_forum_init;
|
||||
?>
|
||||
123
system/inc/forum/service.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
$subaction = $_REQUEST['subaction'];
|
||||
|
||||
switch ($subaction)
|
||||
{
|
||||
case "":
|
||||
|
||||
echo_top();
|
||||
|
||||
echo_top('1');
|
||||
|
||||
echo_title('Î÷èñòêà æóðíàëà ïîäïèñîê íà òåìû');
|
||||
|
||||
echo "<form method=\"post\" action=\"$PHP_SELF?mod=forum&action=service&subaction=subscription\">
|
||||
<table border=\"0\" width=\"100%\">
|
||||
<tr>
|
||||
<td width=\"260\">{$f_lg['titles_uname']}</td>
|
||||
<td><input class=\"edit\" type=\"text\" name=\"user_name\" value=\"\" size=\"27\"> {$f_lg['svce_full']}</td></tr>
|
||||
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>
|
||||
<tr>
|
||||
<td width=\"260\"> </td>
|
||||
<td><input type=\"submit\" class=\"buttons\" value=\"{$f_lg['button_start']}\"></td></tr>
|
||||
</table></form>";
|
||||
|
||||
echo_bottom('1');
|
||||
|
||||
echo_top('1');
|
||||
|
||||
echo_top('1');
|
||||
|
||||
echo_title('Î÷èñòêà æóðíàëà ïðîñìîòðà òåì');
|
||||
|
||||
echo "<form method=\"post\" action=\"$PHP_SELF?mod=forum&action=service&subaction=views\">
|
||||
Áóäåò î÷èùåí æóðíàë ïðîñìîòðà òåì. Âñå òåìû äî äàííîãî âðåìåíè áóäóò èìåòü ñòàòóñ ïðî÷èòàííûõ.
|
||||
<table border=\"0\" width=\"100%\">
|
||||
<tr>
|
||||
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>
|
||||
<tr>
|
||||
<td width=\"260\"> </td>
|
||||
<td><input type=\"submit\" class=\"buttons\" value=\"{$f_lg['button_start']}\"></td></tr>
|
||||
</table></form>";
|
||||
|
||||
echo_bottom('1');
|
||||
|
||||
echo_top('1');
|
||||
|
||||
echo_title('Î÷èñòêà æóðíàëà ãîëîñîâàíèé');
|
||||
|
||||
echo "<form method=\"post\" action=\"$PHP_SELF?mod=forum&action=service&subaction=poll\">
|
||||
Ïðè î÷èñòêå æóðíàëà, ïîëüçîâàòåëè ñìîãóò ïîâòîðíî ãîëîñîâàòü.
|
||||
<table border=\"0\" width=\"100%\">
|
||||
<tr>
|
||||
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>
|
||||
<tr>
|
||||
<td width=\"260\"> </td>
|
||||
<td><input type=\"submit\" class=\"buttons\" value=\"{$f_lg['button_start']}\"></td></tr>
|
||||
</table></form>";
|
||||
|
||||
echo_bottom('1');
|
||||
|
||||
echo_bottom();
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// SUBSCRIPTION
|
||||
// ********************************************************************************
|
||||
case "subscription":
|
||||
|
||||
$user_name = $db->safesql($_REQUEST['user_name']);
|
||||
|
||||
if ($user_name)
|
||||
{
|
||||
$row = $db->super_query("SELECT user_id FROM " . PREFIX . "_users WHERE name = '{$user_name}'");
|
||||
}
|
||||
|
||||
if ($row['user_id'])
|
||||
{
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_subscription WHERE user_id = '{$row['user_id']}'");
|
||||
}
|
||||
|
||||
if (!$user_name)
|
||||
{
|
||||
$db->query("TRUNCATE TABLE " . PREFIX . "_forum_subscription");
|
||||
}
|
||||
|
||||
header("Location: ?mod=forum&action=service");
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// VIEWS LOG
|
||||
// ********************************************************************************
|
||||
case "views":
|
||||
|
||||
$db->query("TRUNCATE TABLE " . PREFIX . "_forum_views");
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_users SET forum_last = '".time()."', forum_time = '".time()."'");
|
||||
|
||||
$_SESSION['member_lasttime'] = time();
|
||||
|
||||
header("Location: ?mod=forum&action=service");
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// POLL LOG
|
||||
// ********************************************************************************
|
||||
case "poll":
|
||||
|
||||
$db->query("TRUNCATE TABLE " . PREFIX . "_forum_poll_log");
|
||||
|
||||
header("Location: ?mod=forum&action=service");
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
208
system/inc/forum/table.php
Normal file
@@ -0,0 +1,208 @@
|
||||
<?php
|
||||
function echo_top($echoheader = false)
|
||||
{
|
||||
if (!$echoheader)
|
||||
{
|
||||
echoheader("", "");
|
||||
|
||||
if ($_REQUEST['action'])
|
||||
{
|
||||
echo echo_top (x);
|
||||
echo "<div class=\"quick\"><a href=\"?mod=forum\">DLE Forum</a></div>";
|
||||
echo echo_bottom (x);
|
||||
}
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
HTML;
|
||||
}
|
||||
|
||||
function echo_bottom($echofooter = false)
|
||||
{
|
||||
echo <<<HTML
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
if (!$echofooter) echofooter();
|
||||
}
|
||||
|
||||
function echo_title($title)
|
||||
{
|
||||
echo <<<HTML
|
||||
<table width="100%"><tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$title}</div></td></tr></table>
|
||||
<div class="unterline"></div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
function echo_stats($forum_config, $forum_stats)
|
||||
{
|
||||
global $f_lg;
|
||||
|
||||
echo "<table width=\"100%\">
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$f_lg['forum_status']}</td><td>{$forum_stats['line']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$f_lg['forum_topic']}</td><td>{$forum_stats['topics']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$f_lg['forum_posts']}</td><td>{$forum_stats['posts']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$f_lg['forum_db_size']}</td><td>{$forum_stats['db_size']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$f_lg['forum_files']}</td><td>{$forum_stats['sum_size']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$f_lg['forum_cache']}</td><td>{$forum_stats['cache']}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<a href=\"?mod=forum&action=clear\"><input onclick=\"document.location='?mod=forum&action=clear'\" class=\"edit\" style=\"width:150px;\" type=\"button\" value=\"{$f_lg['clear_cache']}\"></a>";
|
||||
}
|
||||
|
||||
if(!defined('DLE_FORUM')){ exit; }
|
||||
|
||||
function forum_menu()
|
||||
{
|
||||
global $f_lg;
|
||||
|
||||
echo <<<HTML
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
function MenuCategory( m_id ){
|
||||
|
||||
var menu=new Array()
|
||||
var lang_action = "";
|
||||
|
||||
menu[0]='<a onClick="document.location=\'?mod=forum&action=forum&sid=&sid=' + m_id + '\'; return(false)" href="#">{$f_lg['java_add_forum']}</a>';
|
||||
menu[1]='<a onClick="document.location=\'?mod=forum&action=content_forums&sid=' + m_id + '\'; return(false)" href="#">{$f_lg['java_sort_f']}</a>';
|
||||
menu[2]='<a onClick="document.location=\'?mod=forum&action=access&sid=' + m_id + '\'; return(false)" href="#">{$f_lg['java_access']}</a>';
|
||||
menu[3]='<a onClick="document.location=\'?mod=forum&action=category_edit&sid=' + m_id + '\'; return(false)" href="#">{$f_lg['java_edit']}</a>';
|
||||
menu[4]='<a onClick="document.location=\'?mod=forum&action=category_del&sid=' + m_id + '\'; return(false)" href="#">{$f_lg['java_del']}</a>';
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
function MenuForum( m_id, sub ){
|
||||
|
||||
var menu=new Array()
|
||||
|
||||
menu[1]='<a onClick="document.location=\'?mod=forum&action=moderator_new&id=' + m_id + '\'; return(false)" href="#">{$f_lg['java_moderator']}</a>';
|
||||
|
||||
menu[2]='<a onClick="document.location=\'?mod=forum&action=forum_edit&id=' + m_id + '\'; return(false)" href="#">{$f_lg['java_edit']}</a>';
|
||||
|
||||
if (!sub){
|
||||
menu[3]='<a onClick="document.location=\'?mod=forum&action=content_sub_forums&id=' + m_id + '\'; return(false)" href="#">{$f_lg['java_ssort']}</a>';
|
||||
}
|
||||
|
||||
menu[4]='<a onClick="document.location=\'?mod=forum&action=forum_del&id=' + m_id + '\'; return(false)" href="#">{$f_lg['java_del']}</a>';
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
function Moderators( m_id ){
|
||||
|
||||
var menu=new Array()
|
||||
|
||||
menu[1]='<a onClick="document.location=\'?mod=forum&action=moderator_edit&id=' + m_id + '\'; return(false)" href="#">{$f_lg['java_edit']}</a>';
|
||||
|
||||
menu[2]='<a onClick="document.location=\'?mod=forum&action=moderator_del&id=' + m_id + '\'; return(false)" href="#">{$f_lg['java_del']}</a>';
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
HTML;
|
||||
}
|
||||
|
||||
$options = array(
|
||||
array(
|
||||
'name' => $f_lg['m_new_cat'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=category",
|
||||
'descr' => $f_lg['m_new_cat2'],
|
||||
'image' => "category.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_new_forum'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=forum",
|
||||
'descr' => $f_lg['m_new_forum2'],
|
||||
'image' => "forum.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_content'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=content",
|
||||
'descr' => $f_lg['m_content2'],
|
||||
'image' => "content.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_usergroup'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=usergroup",
|
||||
'descr' => $f_lg['m_usergroup2'],
|
||||
'image' => "usersgroup.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_rank'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=rank",
|
||||
'descr' => $f_lg['m_rank2'],
|
||||
'image' => "rank.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_tools'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=tools",
|
||||
'descr' => $f_lg['m_tools2'],
|
||||
'image' => "tools.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_service'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=service",
|
||||
'descr' => $f_lg['m_service2'],
|
||||
'image' => "service.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_email'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=email",
|
||||
'descr' => $f_lg['m_email2'],
|
||||
'image' => "mset.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
268
system/inc/forum/tools.php
Normal file
@@ -0,0 +1,268 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
<script language='JavaScript' type="text/javascript">
|
||||
|
||||
function ChangeOption(selectedOption) {
|
||||
|
||||
document.getElementById('global').style.display = "none";
|
||||
document.getElementById('show').style.display = "none";
|
||||
document.getElementById('safety').style.display = "none";
|
||||
document.getElementById('modules').style.display = "none";
|
||||
document.getElementById('speed').style.display = "none";
|
||||
document.getElementById('uploads').style.display = "none";
|
||||
|
||||
if(selectedOption == 'global') {document.getElementById('global').style.display = "";}
|
||||
if(selectedOption == 'show') {document.getElementById('show').style.display = "";}
|
||||
if(selectedOption == 'safety') {document.getElementById('safety').style.display = "";}
|
||||
if(selectedOption == 'modules') {document.getElementById('modules').style.display = "";}
|
||||
if(selectedOption == 'speed') {document.getElementById('speed').style.display = "";}
|
||||
if(selectedOption == 'uploads') {document.getElementById('uploads').style.display = "";}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
// TOOLS MENU //
|
||||
|
||||
echo_top('tools_menu');
|
||||
|
||||
echo_title($f_lg['tools_menu']);
|
||||
|
||||
echo <<<HTML
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">
|
||||
<table style="text-align:center;" width="100%" height="35px">
|
||||
<tr style="vertical-align:middle;" >
|
||||
<td class=tableborder><a href="javascript:ChangeOption('global');"><img title="$f_lg[tools_global]" src="system/forum/admin/ico/global.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('show');"><img title="$f_lg[tools_show]" src="system/forum/admin/ico/show.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('safety');"><img title="$f_lg[tools_safety]" src="system/forum/admin/ico/safety.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('modules');"><img title="$f_lg[tools_modules]" src="system/forum/admin/ico/modules.png" border="0"></a>
|
||||
|
||||
<td class=tableborder><a href="javascript:ChangeOption('speed');"><img title="$f_lg[tools_speed]" src="system/forum/admin/ico/speed.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('uploads');"><img title="$f_lg[tools_uploads]" src="system/forum/admin/ico/uploads.png" border="0"></a>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
HTML;
|
||||
|
||||
echo_bottom('tools_menu');
|
||||
|
||||
// ********************************************************************************
|
||||
// TOOLS
|
||||
// ********************************************************************************
|
||||
|
||||
// globals tools
|
||||
|
||||
echo "<div style='' id=\"global\">";
|
||||
|
||||
echo_top('tools_global');
|
||||
|
||||
echo_title($f_lg['tools_global']);
|
||||
|
||||
echo "<table width=\"100%\">";
|
||||
|
||||
showRow($f_lg['tools_name'], $f_lg['tools_name_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[forum_title]' value='{$forum_config['forum_title']}' size=40>");
|
||||
|
||||
showRow($f_lg['tools_url'], $f_lg['tools_url_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[forum_url]' value='{$forum_config['forum_url']}' size=40>");
|
||||
|
||||
showRow($f_lg['meta_description'], $f_lg['meta_description2'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[meta_descr]' value='{$forum_config['meta_descr']}' size=40>");
|
||||
|
||||
showRow($f_lg['meta_keywords'], $f_lg['meta_keywords2'], "<textarea class=\"edit\" style=\"width:250px;height:50px;\" name='save_con[meta_keywords]'>{$forum_config['meta_keywords']}</textarea>");
|
||||
|
||||
showRow($f_lg['meta_topic'], $f_lg['meta_topic2'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[meta_topic]", "{$forum_config['meta_topic']}"));
|
||||
|
||||
showRow($f_lg['tools_abc_last'], $f_lg['tools_abc_last1'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[last_abc]' value=\"{$forum_config['last_abc']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_mrewrite'], $f_lg['tools_mrewrite_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[mod_rewrite]", "{$forum_config['mod_rewrite']}"));
|
||||
|
||||
showRow($f_lg['tools_offline'], $f_lg['tools_offline_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[offline]", "{$forum_config['offline']}"));
|
||||
|
||||
showRow($f_lg['tools_timestamp'], $f_lg['tools_timestamp2'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[timestamp]' value='{$forum_config['timestamp']}' size=40>");
|
||||
|
||||
showRow($f_lg['tools_sessions'], $f_lg['tools_sessions_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[sessions_log]", "{$forum_config['sessions_log']}"));
|
||||
|
||||
showRow($f_lg['tools_ses_time'], $f_lg['tools_ses_time_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[session_time]' value=\"{$forum_config['session_time']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_stats'], $f_lg['tools_stats_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[stats]", "{$forum_config['stats']}"));
|
||||
|
||||
showRow($f_lg['tools_online'], $f_lg['tools_online_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[online]", "{$forum_config['online']}"));
|
||||
|
||||
showRow($f_lg['tools_forum_bar'], $f_lg['tools_forum_bar_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[forum_bar]", "{$forum_config['forum_bar']}"));
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('tools_global');
|
||||
|
||||
echo "</div>";
|
||||
|
||||
// topics, posts
|
||||
|
||||
echo "<div style='display:none' id=\"show\">";
|
||||
|
||||
echo_top('tools_show');
|
||||
|
||||
echo_title($f_lg['tools_show']);
|
||||
|
||||
echo "<table style='' id=\"tools_show\" width=\"100%\">";
|
||||
|
||||
showRow($f_lg['tools_topics'], $f_lg['tools_topics_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[topic_inpage]' value=\"{$forum_config['topic_inpage']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_hot'], $f_lg['tools_hot_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[topic_hot]' value=\"{$forum_config['topic_hot']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_posts'], $f_lg['tools_posts_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[post_inpage]' value=\"{$forum_config['post_inpage']}\" size=10>");
|
||||
|
||||
|
||||
showRow("Êîëè÷åñòâî ñîîáùåíèé äëÿ ñîçäàíèÿ íîâûõ òåì", $f_lg['tools_posts_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[min_post]' value=\"{$forum_config['min_post']}\" size=10>");
|
||||
|
||||
|
||||
showRow($f_lg['tools_mhide'], $f_lg['tools_mhide_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[post_hide]' value=\"{$forum_config['post_hide']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_abc_topic'], $f_lg['tools_abc_topic_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[topic_abc]' value=\"{$forum_config['topic_abc']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_post_maxlen'], $f_lg['tools_post_maxlen2'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[post_maxlen]' value=\"{$forum_config['post_maxlen']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_auto_wrap'], $f_lg['tools_auto_wrap2'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[auto_wrap]' value=\"{$forum_config['auto_wrap']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_post_update'], $f_lg['tools_post_update2'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[post_update]", "{$forum_config['post_update']}"));
|
||||
|
||||
showRow($f_lg['tools_last_plink'], $f_lg['tools_last_plink_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[last_plink]", "{$forum_config['last_plink']}"));
|
||||
|
||||
showRow($f_lg['tools_hide_forum'], $f_lg['tools_hide_forum_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[hide_forum]", "{$forum_config['hide_forum']}"));
|
||||
|
||||
showRow($f_lg['tools_topic_sort'], $f_lg['tools_topic_sort_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[topic_sort]", "{$forum_config['topic_sort']}"));
|
||||
|
||||
showRow($f_lg['tools_topic_email'], $f_lg['tools_topic_email_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[topic_email]", "{$forum_config['topic_email']}"));
|
||||
|
||||
showRow($f_lg['tools_pr_imp'], $f_lg['tools_pr_imp_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[forum_pr_imp]' value='{$forum_config['forum_pr_imp']}' size=40>");
|
||||
|
||||
showRow($f_lg['tools_pr_vote'], $f_lg['tools_pr_vote_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[forum_pr_vote]' value='{$forum_config['forum_pr_vote']}' size=40>");
|
||||
|
||||
showRow($f_lg['tools_pr_modr'], $f_lg['tools_pr_modr_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[forum_pr_modr]' value='{$forum_config['forum_pr_modr']}' size=40>");
|
||||
|
||||
showRow($f_lg['tools_pr_sub_f'], $f_lg['tools_pr_sub_f_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[forum_pr_sub]' value='{$forum_config['forum_pr_sub']}' size=40>");
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('tools_show');
|
||||
|
||||
echo "</div>";
|
||||
|
||||
// safety
|
||||
|
||||
echo "<div style='display:none' id=\"safety\">";
|
||||
|
||||
echo_top('tools_safety');
|
||||
|
||||
echo_title($f_lg['tools_safety']);
|
||||
|
||||
echo "<table width=\"100%\">";
|
||||
|
||||
showRow($f_lg['tools_complaint'], $f_lg['tools_complaint_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[mod_report]", "{$forum_config['mod_report']}"));
|
||||
|
||||
showRow($f_lg['tools_search_captcha'], $f_lg['tools_search_captcha_'], "<select name=\"search_captcha[]\" multiple>".warn_group($forum_config['search_captcha'])."</select>");
|
||||
|
||||
showRow($f_lg['tools_topic_captcha'], $f_lg['tools_topic_captcha1'], "<select name=\"topic_captcha[]\" multiple>".warn_group($forum_config['topic_captcha'])."</select>");
|
||||
|
||||
showRow($f_lg['tools_post_captcha'], $f_lg['tools_post_captcha1'], "<select name=\"post_captcha[]\" multiple>".warn_group($forum_config['post_captcha'])."</select>");
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('tools_safety');
|
||||
|
||||
echo "</div>";
|
||||
|
||||
// modules
|
||||
|
||||
echo "<div style='display:none' id=\"modules\">";
|
||||
|
||||
echo_top('tools_modules');
|
||||
|
||||
echo_title($f_lg['tools_modules']);
|
||||
|
||||
echo "<table width=\"100%\">";
|
||||
|
||||
showRow($f_lg['tools_subscr'], $f_lg['tools_subscr_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[subscription]", "{$forum_config['subscription']}"));
|
||||
|
||||
showRow($f_lg['tools_mod_rank'], $f_lg['tools_mod_rank_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[mod_rank]", "{$forum_config['mod_rank']}"));
|
||||
|
||||
showRow($f_lg['tools_poll'], $f_lg['tools_poll_'], "<select name=\"tools_poll[]\" multiple>".warn_group($forum_config['tools_poll'])."</select>");
|
||||
|
||||
showRow($f_lg['tools_ses_forum'], $f_lg['tools_ses_forum_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[ses_forum]", "{$forum_config['ses_forum']}"));
|
||||
|
||||
showRow($f_lg['tools_ses_topic'], $f_lg['tools_ses_topic_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[ses_topic]", "{$forum_config['ses_topic']}"));
|
||||
|
||||
showRow($f_lg['tools_bot_agent'], $f_lg['tools_bot_agent2'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[bot_agent]", "{$forum_config['bot_agent']}"));
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('tools_modules');
|
||||
|
||||
echo "</div>";
|
||||
|
||||
// speed
|
||||
|
||||
echo "<div style='display:none' id=\"speed\">";
|
||||
|
||||
echo_top('tools_speed');
|
||||
|
||||
echo_title($f_lg['tools_speed']);
|
||||
|
||||
echo "<table width=\"100%\">";
|
||||
|
||||
showRow($f_lg['tools_t_as_p'], $f_lg['tools_t_as_p_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[set_topic_post]", "{$forum_config['set_topic_post']}"));
|
||||
|
||||
showRow($f_lg['tools_sp_num'], $f_lg['tools_sp_num_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[set_post_num_up]", "{$forum_config['set_post_num_up']}"));
|
||||
|
||||
showRow($f_lg['tools_sp_num_date'], $f_lg['tools_sp_num_date_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[set_post_num_day]' value=\"{$forum_config['set_post_num_day']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_new_t_day'], $f_lg['tools_new_t_day_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[topic_new_day]' value=\"{$forum_config['topic_new_day']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_sp_sublast'], $f_lg['tools_sp_sublast_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[set_sub_last_up]", "{$forum_config['set_sub_last_up']}"));
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('tools_speed');
|
||||
|
||||
echo "</div>";
|
||||
|
||||
// uploads
|
||||
|
||||
echo "<div style='display:none' id=\"uploads\">";
|
||||
|
||||
echo_top('tools_uploads');
|
||||
|
||||
echo_title($f_lg['tools_uploads']);
|
||||
|
||||
echo "<table width=\"100%\">";
|
||||
|
||||
//showRow($f_lg['tools_upload'], $f_lg['tools_upload_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[tools_upload]", "{$forum_config['tools_upload']}"));
|
||||
|
||||
showRow($f_lg['tools_upload'], $f_lg['tools_upload_'], "<select name=\"tools_upload[]\" multiple>".warn_group($forum_config['tools_upload'])."</select>");
|
||||
|
||||
showRow($f_lg['tools_upload_type'], $f_lg['tools_upload_type_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[upload_type]' value='{$forum_config['upload_type']}' size=40>");
|
||||
|
||||
showRow($f_lg['tools_img_upl'], $f_lg['tools_img_upl_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[img_upload]", "{$forum_config['img_upload']}"));
|
||||
|
||||
showRow($f_lg['tools_img_max_size'], $f_lg['tools_img_max_size_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[img_size]' value=\"{$forum_config['img_size']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_thumb_size'], $f_lg['tools_thumb_size_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[thumb_size]' value=\"{$forum_config['thumb_size']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_jpeg_quality'], $f_lg['tools_jpeg_quality_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[jpeg_quality]' value=\"{$forum_config['jpeg_quality']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_img_width'], $f_lg['tools_img_width_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[tag_img_width]' value=\"{$forum_config['tag_img_width']}\" size=10>");
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('tools_uploads');
|
||||
|
||||
echo "</div>";
|
||||
?>
|
||||
162
system/inc/forum/usergroup.php
Normal file
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
|
||||
$subaction = $_REQUEST['subaction'];
|
||||
|
||||
// ********************************************************************************
|
||||
// Get User Groups
|
||||
// ********************************************************************************
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
$db->free();
|
||||
|
||||
switch ($subaction)
|
||||
{
|
||||
case "":
|
||||
|
||||
$db->query("SELECT user_group, count(*) as count FROM " . USERPREFIX . "_users GROUP BY user_group");
|
||||
|
||||
while($row = $db->get_row())
|
||||
{
|
||||
$count_list[$row['user_group']] = $row['count'];
|
||||
}
|
||||
|
||||
$db->free();
|
||||
|
||||
foreach ($user_group as $group)
|
||||
{
|
||||
$count = intval ($count_list[$group['id']]);
|
||||
|
||||
$entries .= "
|
||||
<tr>
|
||||
<td height=22 class=\"list\"> <b>{$group['id']}</b></td>
|
||||
<td class=\"list\">{$group['group_name']}</td>
|
||||
<td class=\"list\" align=\"center\">$count</td>
|
||||
<td class=\"list\" align=\"center\"><a onClick=\"return dropdownmenu(this, event, MenuBuild('".$group['id']."'), '150px')\" href=\"#\"><img src=\"system/skins/images/browser_action.gif\" border=\"0\"></a></td>
|
||||
</tr>
|
||||
<tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=4></td></tr>";
|
||||
}
|
||||
|
||||
echo_top();
|
||||
|
||||
echo <<<HTML
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
function MenuBuild( m_id ){
|
||||
|
||||
var menu=new Array()
|
||||
|
||||
menu[0]='<a href="?mod=forum&action=usergroup&subaction=edit&id=' + m_id + '" >{$f_lg['group_sel1']}</a>';
|
||||
if (m_id > 5) {
|
||||
menu[1]='<a href="?mod=usergroup&action=del&id=' + m_id + '" >{$f_lg['group_sel2']}</a>';
|
||||
}
|
||||
else {
|
||||
menu[1]='<a href="#" onclick="return false;"><font color="black">{$f_lg['group_sel3']}</font></a>';
|
||||
}
|
||||
|
||||
return menu;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
echo_title($f_lg['group_list']);
|
||||
|
||||
echo "<table width=\"100%\">
|
||||
<tr>
|
||||
<td width=50> ID</td>
|
||||
<td>{$f_lg['group_name']}</td>
|
||||
<td width=100 align=\"center\">{$f_lg['group_users']}</td>
|
||||
<td width=70 align=\"center\"> </td>
|
||||
</tr>
|
||||
<tr><td colspan=\"4\"><div class=\"hr_line\"></div></td></tr>";
|
||||
|
||||
echo $entries."</table>";
|
||||
|
||||
echo_bottom();
|
||||
|
||||
break;
|
||||
|
||||
case "edit":
|
||||
|
||||
if ($id)
|
||||
{
|
||||
$row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_moderators WHERE group_id = '$id'");
|
||||
|
||||
echo_top();
|
||||
|
||||
echo_title ($f_lg['group_moderation']." ".$user_group[$id]['group_name']);
|
||||
|
||||
echo "<form action=\"{$PHP_SELF}?mod=forum&action=usergroup&subaction=doedit&id={$id}\" method=\"post\">";
|
||||
|
||||
echo "<table width=\"100%\">";
|
||||
|
||||
showRadio($f_lg['mod_edit_topic'], $f_lg[''], "edit_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_del_topic'], $f_lg[''], "delete_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_edit_post'], $f_lg[''], "edit_post", $row);
|
||||
|
||||
showRadio($f_lg['mod_del_post'], $f_lg[''], "delete_post", $row);
|
||||
|
||||
showRadio($f_lg['mod_open_topic'], $f_lg[''], "open_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_close_topic'], $f_lg[''], "close_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_move_topic'], $f_lg[''], "move_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_fixed_topic'], $f_lg[''], "pin_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_defixed_topic'], $f_lg[''], "unpin_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_multi_moderation'], $f_lg[''], "mass_prune", $row);
|
||||
|
||||
showRadio($f_lg['mod_combining_post'], $f_lg[''], "combining_post", $row);
|
||||
|
||||
showRadio($f_lg['mod_move_post'], $f_lg[''], "move_post", $row);
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('bottom');
|
||||
|
||||
echo_top('top');
|
||||
|
||||
echo "<input type=\"submit\" class=\"buttons\" value=\"{$f_lg['button_save']}\"></form>";
|
||||
|
||||
echo_bottom();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "doedit":
|
||||
|
||||
if ($id)
|
||||
{
|
||||
$m_group = $db->super_query("SELECT group_id FROM " . PREFIX . "_forum_moderators WHERE group_id = '$id'");
|
||||
|
||||
if (!$m_group['group_id'])
|
||||
{
|
||||
$db->query("INSERT INTO " . PREFIX . "_forum_moderators (group_id) values ('$id')");
|
||||
}
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_moderators SET edit_post = '$save[edit_post]', delete_topic = '$save[delete_topic]', edit_topic = '$save[edit_topic]', edit_post = '$save[edit_post]', delete_post = '$save[delete_post]', open_topic = '$save[open_topic]', close_topic = '$save[close_topic]', delete_post = '$save[delete_post]', move_topic = '$save[move_topic]', pin_topic = '$save[pin_topic]', delete_topic = '$save[delete_topic]', unpin_topic = '$save[unpin_topic]', mass_prune = '$save[mass_prune]', combining_post = '$save[combining_post]', move_post = '$save[move_post]' WHERE group_id = '$id'");
|
||||
}
|
||||
|
||||
$fcache->delete('forum_moderators.php');
|
||||
|
||||
msg("info",$f_lg['group_edit_ok'], $f_lg['group_edit_ok2'], "?mod=forum");
|
||||
|
||||
break;
|
||||
}
|
||||
?>
|
||||
150
system/inc/googlemap.php
Normal file
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
if( ! $user_group[$member_id['user_group']]['admin_googlemap'] ) {
|
||||
msg( "error", $lang['index_denied'], $lang['index_denied'] );
|
||||
}
|
||||
|
||||
if ($_POST['action'] == "create") {
|
||||
|
||||
include_once SYSTEM_DIR.'/classes/google.class.php';
|
||||
$map = new googlemap($config);
|
||||
|
||||
$map->limit = intval($_POST['limit']);
|
||||
$map->news_priority = strip_tags(stripslashes($_POST['priority']));
|
||||
$map->stat_priority = strip_tags(stripslashes($_POST['stat_priority']));
|
||||
$map->cat_priority = strip_tags(stripslashes($_POST['cat_priority']));
|
||||
|
||||
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post" );
|
||||
if ( !$map->limit ) $map->limit = $row['count'];
|
||||
|
||||
if ( $map->limit > 45000 ) {
|
||||
|
||||
$pages_count = @ceil( $row['count'] / 40000 );
|
||||
|
||||
$sitemap = $map->build_index( $pages_count );
|
||||
|
||||
$handler = fopen(ROOT_DIR. "/uploads/sitemap.xml", "wb+");
|
||||
fwrite($handler, $sitemap);
|
||||
fclose($handler);
|
||||
|
||||
@chmod(ROOT_DIR. "/uploads/sitemap.xml", 0666);
|
||||
|
||||
$sitemap = $map->build_stat();
|
||||
|
||||
$handler = fopen(ROOT_DIR. "/uploads/sitemap1.xml", "wb+");
|
||||
fwrite($handler, $sitemap);
|
||||
fclose($handler);
|
||||
|
||||
@chmod(ROOT_DIR. "/uploads/sitemap1.xml", 0666);
|
||||
|
||||
for ($i =0; $i < $pages_count; $i++) {
|
||||
$t = $i+2;
|
||||
$n = $n+1;
|
||||
|
||||
$sitemap = $map->build_map_news( $n );
|
||||
|
||||
$handler = fopen(ROOT_DIR. "/uploads/sitemap{$t}.xml", "wb+");
|
||||
fwrite($handler, $sitemap);
|
||||
fclose($handler);
|
||||
|
||||
@chmod(ROOT_DIR. "/uploads/sitemap{$t}.xml", 0666);
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$sitemap = $map->build_map();
|
||||
|
||||
$handler = fopen(ROOT_DIR. "/uploads/sitemap.xml", "wb+");
|
||||
fwrite($handler, $sitemap);
|
||||
fclose($handler);
|
||||
|
||||
@chmod(ROOT_DIR. "/uploads/sitemap.xml", 0666);
|
||||
}
|
||||
}
|
||||
|
||||
echoheader("", "");
|
||||
|
||||
|
||||
echo <<<HTML
|
||||
<form action="" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['google_map']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" colspan="2"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" colspan="2">
|
||||
HTML;
|
||||
|
||||
if(!@file_exists(ROOT_DIR. "/uploads/sitemap.xml")){
|
||||
echo $lang['no_google_map'];
|
||||
} else {
|
||||
|
||||
$file_date = date("d.m.Y H:i", filectime(ROOT_DIR. "/uploads/sitemap.xml"));
|
||||
$map_link = $config['http_home_url']."sitemap.xml";
|
||||
echo "<center><b>".$file_date."</b>";
|
||||
echo "<br /><br /> <a class=\"list\" href=\"http://google.com/webmasters/sitemaps/ping?sitemap=".urlencode($map_link)."\" target=\"_blank\">Google</a> | <a class=\"list\" href=\"http://search.yahooapis.com/SiteExplorerService/V1/ping?url=".urlencode($map_link)."\" target=\"_blank\">Yahoo</a> | <a class=\"list\" href=\"http://www.bing.com/webmaster/ping.aspx?siteMap=".urlencode($map_link)."\" target=\"_blank\">Bing</a> | <a class=\"list\" href=\"http://submissions.ask.com/ping?sitemap=".urlencode($map_link)."\" target=\"_blank\">Ask</a></center>";
|
||||
}
|
||||
|
||||
|
||||
echo <<<HTML
|
||||
</td>
|
||||
<tr>
|
||||
<td style="padding:2px;" colspan="2"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" nowrap>{$lang['google_nnum']}</td>
|
||||
<td style="padding:2px;" width="100%"><input class="edit" type="text" size="10" name="limit"><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_g_num]}', this, event, '220px')">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" nowrap>{$lang['google_stat_priority']}</td>
|
||||
<td style="padding:2px;" width="100%"><input class="edit" type="text" size="10" name="stat_priority" value="0.5"><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_g_priority]}', this, event, '220px')">[?]</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" nowrap>{$lang['google_priority']}</td>
|
||||
<td style="padding:2px;" width="100%"><input class="edit" type="text" size="10" name="priority" value="0.6"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" nowrap>{$lang['google_cat_priority']}</td>
|
||||
<td style="padding:2px;" width="100%"><input class="edit" type="text" size="10" name="cat_priority" value="0.7"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" colspan="2"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" colspan="2"><input type="submit" class="buttons" value="{$lang['google_create']}" style="width:250px;"><input type="hidden" name="action" value="create"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
echofooter();
|
||||
?>
|
||||
620
system/inc/include/functions.inc.php
Normal file
@@ -0,0 +1,620 @@
|
||||
<?PHP
|
||||
if( ! defined( 'DATALIFEENGINE' ) ) {die( "Hacking attempt!" );}
|
||||
|
||||
require_once SYSTEM_DIR . '/classes/cache.class.php';
|
||||
$cache = new cache($dir= ROOT_DIR . '/cache');
|
||||
|
||||
function format_uptime($seconds) {
|
||||
$secs = intval($seconds % 60);
|
||||
$mins = intval($seconds / 60 % 60);
|
||||
$hours = intval($seconds / 3600 % 24);
|
||||
$days = intval($seconds / 86400);
|
||||
|
||||
if ($days > 0) {
|
||||
$uptimeString .= $days;
|
||||
$uptimeString .= (($days == 1) ? " day" : " days");
|
||||
}
|
||||
if ($hours > 0) {
|
||||
$uptimeString .= (($days > 0) ? ", " : "") . $hours;
|
||||
$uptimeString .= (($hours == 1) ? " hour" : " hours");
|
||||
}
|
||||
if ($mins > 0) {
|
||||
$uptimeString .= (($days > 0 || $hours > 0) ? ", " : "") . $mins;
|
||||
$uptimeString .= (($mins == 1) ? " minute" : " minutes");
|
||||
}
|
||||
if ($secs > 0) {
|
||||
$uptimeString .= (($days > 0 || $hours > 0 || $mins > 0) ? ", " : "") . $secs;
|
||||
$uptimeString .= (($secs == 1) ? " second" : " seconds");
|
||||
}
|
||||
return $uptimeString;
|
||||
}
|
||||
|
||||
function dirsize($directory) {
|
||||
if( ! is_dir( $directory ) ) return - 1;
|
||||
$size = 0;
|
||||
if( $DIR = opendir( $directory ) ) {
|
||||
while ( ($dirfile = readdir( $DIR )) !== false ) {
|
||||
if( @is_link( $directory . '/' . $dirfile ) || $dirfile == '.' || $dirfile == '..' ) continue;
|
||||
if( @is_file( $directory . '/' . $dirfile ) ) $size += filesize( $directory . '/' . $dirfile );
|
||||
else if( @is_dir( $directory . '/' . $dirfile ) ) {
|
||||
$dirSize = dirsize( $directory . '/' . $dirfile );
|
||||
if( $dirSize >= 0 ) $size += $dirSize;
|
||||
else return - 1;
|
||||
}
|
||||
}
|
||||
closedir( $DIR );
|
||||
}
|
||||
return $size;
|
||||
}
|
||||
|
||||
function check_login($username, $md5_password, $post = true) {
|
||||
global $member_id, $db, $user_group, $lang, $_IP, $_TIME, $config;
|
||||
|
||||
if( $username == "" OR $md5_password == "" ) return false;
|
||||
$result = false;
|
||||
|
||||
if( $post ) {
|
||||
$username = $db->safesql( $username );
|
||||
$md5_password = md5( $md5_password );
|
||||
|
||||
if ( preg_match( "/[\||\'|\<|\>|\"|\!|\?|\$|\@|\/|\\\|\&\~\*\+]/", $username) ) return false; $where_name = "name='{$username}'";
|
||||
|
||||
$member_id = $db->super_query( "SELECT * FROM " . USERPREFIX . "_users WHERE {$where_name} AND password='{$md5_password}'" );
|
||||
|
||||
if( $member_id['user_id'] and $user_group[$member_id['user_group']]['allow_admin'] and $member_id['banned'] != 'yes' ) $result = TRUE;
|
||||
else $member_id = array ();
|
||||
} else {
|
||||
|
||||
$username = intval( $username );
|
||||
$md5_password = md5( $md5_password );
|
||||
|
||||
$member_id = $db->super_query( "SELECT * FROM " . USERPREFIX . "_users WHERE user_id='$username'" );
|
||||
|
||||
if( $member_id['user_id'] AND $member_id['password'] AND $member_id['password'] == $md5_password AND $user_group[$member_id['user_group']]['allow_admin'] AND $member_id['banned'] != 'yes' ) $result = TRUE;
|
||||
else $member_id = array ();
|
||||
}
|
||||
|
||||
if( $result ) {
|
||||
if( !allowed_ip( $row['allowed_ip'] ) ) {
|
||||
$member_id = array ();
|
||||
$result = false;
|
||||
set_cookie( "dle_user_id", "", 0 );
|
||||
set_cookie( "dle_name", "", 0 );
|
||||
set_cookie( "dle_password", "", 0 );
|
||||
set_cookie( "dle_hash", "", 0 );
|
||||
@session_destroy();
|
||||
@session_unset();
|
||||
set_cookie( session_name(), "", 0 );
|
||||
|
||||
msg( "info", $lang['index_msge'], $lang['ip_block'] );
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
function mksize($bytes) {
|
||||
if ($bytes < 1000)
|
||||
return $bytes. " b";
|
||||
if ($bytes < 1000 * 1024)
|
||||
return number_format($bytes / 1024, 2) . " Kb";
|
||||
if ($bytes < 1000 * 1048576)
|
||||
return number_format($bytes / 1048576, 2) . " Mb";
|
||||
if ($bytes < 1000 * 1073741824)
|
||||
return number_format($bytes / 1073741824, 2) . " Gb";
|
||||
if ($bytes < 1000 * 1099511627776)
|
||||
return number_format($bytes / 1099511627776, 2) . " Tb";
|
||||
if ($bytes < 1000 * 1125899906842620)
|
||||
return number_format($bytes / 1125899906842620, 2) . " Pb";
|
||||
if ($bytes < 1000 * 1152921504606850000)
|
||||
return number_format($bytes / 1152921504606850000, 2) . " Eb";
|
||||
}
|
||||
|
||||
function CheckCanGzip() {
|
||||
|
||||
if( headers_sent() || connection_aborted() || ! function_exists( 'ob_gzhandler' ) || ini_get( 'zlib.output_compression' ) ) return 0;
|
||||
|
||||
if( strpos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip' ) !== false ) return "x-gzip";
|
||||
if( strpos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) !== false ) return "gzip";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function GzipOut() {
|
||||
global $Timer, $db;
|
||||
|
||||
$ENCODING = CheckCanGzip();
|
||||
|
||||
if( $ENCODING ) {
|
||||
$Contents = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
header( "Content-Encoding: $ENCODING" );
|
||||
|
||||
$Contents = gzencode( $Contents, 1, FORCE_GZIP );
|
||||
echo $Contents;
|
||||
|
||||
exit();
|
||||
} else {
|
||||
// ob_end_flush();
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
class microTimer {
|
||||
function start() {
|
||||
global $starttime;
|
||||
$mtime = microtime();
|
||||
$mtime = explode( ' ', $mtime );
|
||||
$mtime = $mtime[1] + $mtime[0];
|
||||
$starttime = $mtime;
|
||||
}
|
||||
function stop() {
|
||||
global $starttime;
|
||||
$mtime = microtime();
|
||||
$mtime = explode( ' ', $mtime );
|
||||
$mtime = $mtime[1] + $mtime[0];
|
||||
$endtime = $mtime;
|
||||
$totaltime = round( ($endtime - $starttime), 5 );
|
||||
return $totaltime;
|
||||
}
|
||||
}
|
||||
|
||||
function allowed_ip($ip_array) {
|
||||
$ip_array = trim( $ip_array );
|
||||
|
||||
if( $ip_array == "" ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$ip_array = explode( "|", $ip_array );
|
||||
$db_ip_split = explode( ".", $_SERVER['REMOTE_ADDR'] );
|
||||
|
||||
foreach ( $ip_array as $ip ) {
|
||||
|
||||
$ip_check_matches = 0;
|
||||
$this_ip_split = explode( ".", trim( $ip ) );
|
||||
|
||||
for($i_i = 0; $i_i < 4; $i_i ++) {
|
||||
if( $this_ip_split[$i_i] == $db_ip_split[$i_i] or $this_ip_split[$i_i] == '*' ) {
|
||||
$ip_check_matches += 1;
|
||||
}
|
||||
|
||||
}
|
||||
if( $ip_check_matches == 4 ) return true;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
// Function: msg
|
||||
// Description: Displays message to user
|
||||
|
||||
|
||||
function msg($type, $title, $text, $back = FALSE) {
|
||||
global $lang;
|
||||
|
||||
if( $back ) {
|
||||
$back = "<br /><br> <a class=main href=\"$back\">$lang[func_msg]</a>";
|
||||
}
|
||||
|
||||
echoheader( $type, $title );
|
||||
|
||||
echo <<<HTML
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$title}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td height="100" align="center">{$text} {$back}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
exit();
|
||||
}
|
||||
|
||||
function echoheader($image, $header_text) {
|
||||
global $PHP_SELF, $skin_header, $member_id, $user_group;
|
||||
|
||||
$skin_header = str_replace( "{header-text}", $header_text, $skin_header );
|
||||
$skin_header = str_replace( "{user}", $member_id['name'], $skin_header );
|
||||
$skin_header = str_replace( "{group}", $user_group[$member_id['user_group']]['group_name'], $skin_header );
|
||||
|
||||
echo $skin_header;
|
||||
}
|
||||
|
||||
function echofooter() {
|
||||
|
||||
global $PHP_SELF, $is_loged_in, $skin_footer;
|
||||
|
||||
echo $skin_footer;
|
||||
|
||||
}
|
||||
|
||||
function listdir($dir) {
|
||||
|
||||
$current_dir = opendir( $dir );
|
||||
while ( $entryname = readdir( $current_dir ) ) {
|
||||
if( is_dir( "$dir/$entryname" ) and ($entryname != "." and $entryname != "..") ) {
|
||||
listdir( "${dir}/${entryname}" );
|
||||
} elseif( $entryname != "." and $entryname != ".." ) {
|
||||
unlink( "${dir}/${entryname}" );
|
||||
}
|
||||
}
|
||||
@closedir( $current_dir );
|
||||
rmdir( ${dir} );
|
||||
}
|
||||
|
||||
|
||||
function totranslit( $var, $lower = true, $punkt = true ) {
|
||||
global $langtranslit;
|
||||
|
||||
if ( is_array($var) ) return "";
|
||||
if (!is_array ( $langtranslit ) OR !count( $langtranslit ) ) {
|
||||
$langtranslit = array('à' => 'a', 'á' => 'b', 'â' => 'v', 'ã' => 'g', 'ä' => 'd', 'å' => 'e', '¸' => 'e', 'æ' => 'zh', 'ç' => 'z', 'è' => 'i', 'é' => 'y', 'ê' => 'k', 'ë' => 'l', 'ì' => 'm', 'í' => 'n', 'î' => 'o', 'ï' => 'p', 'ð' => 'r', 'ñ' => 's', 'ò' => 't', 'ó' => 'u', 'ô' => 'f', 'õ' => 'h', 'ö' => 'c', '÷' => 'ch', 'ø' => 'sh', 'ù' => 'sch', 'ü' => '', 'û' => 'y', 'ú' => '', 'ý' => 'e', 'þ' => 'yu', 'ÿ' => 'ya', "¿" => "yi", "º" => "ye",
|
||||
'À' => 'A', 'Á' => 'B', 'Â' => 'V', 'Ã' => 'G', 'Ä' => 'D', 'Å' => 'E', '¨' => 'E', 'Æ' => 'Zh', 'Ç' => 'Z', 'È' => 'I', 'É' => 'Y', 'Ê' => 'K', 'Ë' => 'L', 'Ì' => 'M', 'Í' => 'N', 'Î' => 'O', 'Ï' => 'P', 'Ð' => 'R', 'Ñ' => 'S', 'Ò' => 'T', 'Ó' => 'U', 'Ô' => 'F', 'Õ' => 'H', 'Ö' => 'C', '×' => 'Ch', 'Ø' => 'Sh', 'Ù' => 'Sch', 'Ü' => '', 'Û' => 'Y', 'Ú' => '', 'Ý' => 'E', 'Þ' => 'Yu', 'ß' => 'Ya', "¯" => "yi", "ª" => "ye",);
|
||||
}
|
||||
|
||||
$var = trim( strip_tags( $var ) );
|
||||
$var = preg_replace( "/\s+/ms", "-", $var );
|
||||
$var = str_replace( "/", "-", $var );
|
||||
|
||||
$var = strtr($var, $langtranslit);
|
||||
|
||||
if( $punkt ) {$var = preg_replace( "/[^a-z0-9\_\-.]+/mi", "", $var );}else{$var = preg_replace( "/[^a-z0-9\_\-]+/mi", "", $var );}
|
||||
|
||||
$var = preg_replace( '#[\-]+#i', '-', $var );
|
||||
|
||||
if( $lower ) {$var = strtolower( $var );}
|
||||
|
||||
$var = str_ireplace( ".php", "", $var );
|
||||
$var = str_ireplace( ".php", ".ppp", $var );
|
||||
|
||||
if( strlen( $var ) > 50 ) {
|
||||
$var = substr( $var, 0, 50 );
|
||||
if( ($temp_max = strrpos( $var, '-' )) ) $var = substr( $var, 0, $temp_max );
|
||||
}
|
||||
return $var;
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Show Radio
|
||||
// ********************************************************************************
|
||||
function showRadio($title = "", $description = "", $allow_name = "", $row = false){
|
||||
global $f_lg;
|
||||
|
||||
if ($row[$allow_name])
|
||||
{
|
||||
$o_value = "checked";
|
||||
|
||||
$t_value = "";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$o_value = "";
|
||||
|
||||
$t_value = "checked";
|
||||
}
|
||||
|
||||
echo"<tr>
|
||||
<td style=\"padding:4px\" class=\"option\">
|
||||
<b>{$title}</b><br /><span class=small>{$description}</span>
|
||||
<td width=394 align=middle >
|
||||
<input type=\"radio\" name=\"save[{$allow_name}]\" {$o_value} value=\"1\">{$f_lg['yes']}
|
||||
<input type=\"radio\" name=\"save[{$allow_name}]\" {$t_value} value=\"0\">{$f_lg['no']}
|
||||
</tr><tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=2></td></tr>";
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// showRow
|
||||
// ********************************************************************************
|
||||
function showRow($title="", $description="", $field="")
|
||||
{
|
||||
echo"<tr>
|
||||
<td style=\"padding:4px\" class=\"option\">
|
||||
<b>$title</b><br /><span class=small>$description</span>
|
||||
<td width=394 align=middle >$field
|
||||
</tr><tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=2></td></tr>";
|
||||
$bg = ""; $i++;
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// makeDropDown
|
||||
// ********************************************************************************
|
||||
function makeDropDown($options, $name, $selected)
|
||||
{
|
||||
$output = "<select name=\"$name\">\r\n";
|
||||
|
||||
foreach($options as $value => $description)
|
||||
{
|
||||
$output .= "<option value=\"$value\"";
|
||||
if($selected == $value){ $output .= " selected "; }
|
||||
$output .= ">$description</option>\n";
|
||||
}
|
||||
|
||||
$output .= "</select>";
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
function langdate($format, $stamp) {
|
||||
global $langdate;
|
||||
|
||||
return strtr( @date( $format, $stamp ), $langdate );
|
||||
|
||||
}
|
||||
|
||||
function CategoryNewsSelection($categoryid = 0, $parentid = 0, $nocat = TRUE, $sublevelmarker = '', $returnstring = '') {
|
||||
global $cat, $cat_parentid, $member_id, $user_group;
|
||||
|
||||
if ($mod == "addnews" OR $mod == "editnews")
|
||||
$allow_list = explode( ',', $user_group[$member_id['user_group']]['cat_allow_addnews'] );
|
||||
else
|
||||
$allow_list = explode( ',', $user_group[$member_id['user_group']]['allow_cats'] );
|
||||
$spec_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] );
|
||||
|
||||
if( $parentid == 0 ) {
|
||||
if( $nocat ) $returnstring .= '<option value="0"></option>';
|
||||
} else {
|
||||
$sublevelmarker .= ' ';
|
||||
}
|
||||
|
||||
if( isset( $cat_parentid ) ) {
|
||||
|
||||
$root_category = @array_keys( $cat_parentid, $parentid );
|
||||
|
||||
if( is_array( $root_category ) ) {
|
||||
|
||||
foreach ( $root_category as $id ) {
|
||||
|
||||
$category_name = $cat[$id];
|
||||
|
||||
if( $allow_list[0] == "all" or in_array( $id, $allow_list ) ) {
|
||||
|
||||
if( $spec_list[0] == "all" or in_array( $id, $spec_list ) ) $color = "black";
|
||||
else $color = "red";
|
||||
|
||||
$returnstring .= "<option style=\"color: {$color}\" value=\"" . $id . '" ';
|
||||
|
||||
if( is_array( $categoryid ) ) {
|
||||
foreach ( $categoryid as $element ) {
|
||||
if( $element == $id ) $returnstring .= 'SELECTED';
|
||||
}
|
||||
} elseif( $categoryid == $id ) $returnstring .= 'SELECTED';
|
||||
|
||||
$returnstring .= '>' . $sublevelmarker . $category_name . '</option>';
|
||||
}
|
||||
|
||||
$returnstring = CategoryNewsSelection( $categoryid, $id, $nocat, $sublevelmarker, $returnstring );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $returnstring;
|
||||
}
|
||||
|
||||
function filesize_url($url) {
|
||||
return ($data = @file_get_contents( $url )) ? strlen( $data ) : false;
|
||||
}
|
||||
|
||||
function create_metatags($story) {
|
||||
global $config, $db;
|
||||
|
||||
$keyword_count = 20;
|
||||
$newarr = array ();
|
||||
$headers = array ();
|
||||
$quotes = array ("\x22", "\x60", "\t", '\n', '\r', "\n", "\r", '\\', ",", ".", "/", "¬", "#", ";", ":", "@", "~", "[", "]", "{", "}", "=", "-", "+", ")", "(", "*", "^", "%", "$", "<", ">", "?", "!", '"' );
|
||||
$fastquotes = array ("\x22", "\x60", "\t", "\n", "\r", '"', '\r', '\n', "/", "\\", "{", "}", "[", "]" );
|
||||
|
||||
$story = preg_replace( "'\[hide\](.*?)\[/hide\]'si", "", $story );
|
||||
$story = preg_replace( "'\[file=(.*?)\]'si", "", $story );
|
||||
$story = preg_replace( "'\[torrent=(.*?)\]'si", "", $story );
|
||||
$story = str_replace( " ", " ", $story );
|
||||
|
||||
$story = str_replace( '<br />', ' ', $story );
|
||||
$story = trim( strip_tags( $story ) );
|
||||
|
||||
if( trim( $_REQUEST['meta_title'] ) != "" ) {
|
||||
$headers['title'] = trim( htmlspecialchars( strip_tags( stripslashes($_REQUEST['meta_title'] ) ) ) );
|
||||
$headers['title'] = $db->safesql(str_replace( $fastquotes, '', $headers['title'] ));
|
||||
} else $headers['title'] = "";
|
||||
|
||||
if( trim( $_REQUEST['descr'] ) != "" ) {
|
||||
$headers['description'] = substr( strip_tags( stripslashes( $_REQUEST['descr'] ) ), 0, 190 );
|
||||
$headers['description'] = $db->safesql( str_replace( $fastquotes, '', $headers['description'] ));
|
||||
} else {
|
||||
$story = str_replace( $fastquotes, '', $story );
|
||||
$headers['description'] = $db->safesql( substr( stripslashes($story), 0, 190 ) );
|
||||
}
|
||||
|
||||
if( trim( $_REQUEST['keywords'] ) != "" ) {
|
||||
$headers['keywords'] = $db->safesql( str_replace( $fastquotes, " ", strip_tags( stripslashes( $_REQUEST['keywords'] ) ) ) );
|
||||
} else {
|
||||
$story = str_replace( $quotes, '', $story );
|
||||
$arr = explode( " ", $story );
|
||||
|
||||
foreach ( $arr as $word ) {
|
||||
if( strlen( $word ) > 4 ) $newarr[] = $word;
|
||||
}
|
||||
|
||||
$arr = array_count_values( $newarr );
|
||||
arsort( $arr );
|
||||
|
||||
$arr = array_keys( $arr );
|
||||
$total = count( $arr );
|
||||
$offset = 0;
|
||||
$arr = array_slice( $arr, $offset, $keyword_count );
|
||||
$headers['keywords'] = $db->safesql( implode( ", ", $arr ) );
|
||||
}
|
||||
return $headers;
|
||||
}
|
||||
|
||||
function get_groups($id = false) {
|
||||
global $user_group;
|
||||
|
||||
$returnstring = "";
|
||||
|
||||
foreach ( $user_group as $group ) {
|
||||
$returnstring .= '<option value="' . $group['id'] . '" ';
|
||||
|
||||
if( is_array( $id ) ) {
|
||||
foreach ( $id as $element ) {
|
||||
if( $element == $group['id'] ) $returnstring .= 'SELECTED';
|
||||
}
|
||||
} elseif( $id and $id == $group['id'] ) $returnstring .= 'SELECTED';
|
||||
|
||||
$returnstring .= ">" . $group['group_name'] . "</option>\n";
|
||||
}
|
||||
|
||||
return $returnstring;
|
||||
|
||||
}
|
||||
|
||||
function permload($id) {
|
||||
|
||||
if( $id == "" ) return;
|
||||
|
||||
$data = array ();
|
||||
|
||||
$groups = explode( "|", $id );
|
||||
foreach ( $groups as $group ) {
|
||||
list ( $groupid, $groupvalue ) = explode( ":", $group );
|
||||
$data[$groupid][1] = ($groupvalue == 1) ? "selected" : "";
|
||||
$data[$groupid][2] = ($groupvalue == 2) ? "selected" : "";
|
||||
$data[$groupid][3] = ($groupvalue == 3) ? "selected" : "";
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
function check_xss() {
|
||||
$url = html_entity_decode( urldecode( $_SERVER['QUERY_STRING'] ) );
|
||||
$url = str_replace( "\\", "/", $url );
|
||||
|
||||
if( $url ) {
|
||||
if( (strpos( $url, '<' ) !== false) || (strpos( $url, '>' ) !== false) || (strpos( $url, '"' ) !== false) || (strpos( $url, './' ) !== false) || (strpos( $url, '../' ) !== false) || (strpos( $url, '\'' ) !== false) || (strpos( $url, '.php' ) !== false) ) {
|
||||
if( $_GET['mod'] != "editnews" or $_GET['action'] != "list" ) die( "Hacking attempt!" );
|
||||
}
|
||||
}
|
||||
|
||||
$url = html_entity_decode( urldecode( $_SERVER['REQUEST_URI'] ) );
|
||||
$url = str_replace( "\\", "/", $url );
|
||||
|
||||
if( $url ) {
|
||||
if( (strpos( $url, '<' ) !== false) || (strpos( $url, '>' ) !== false) || (strpos( $url, '"' ) !== false) || (strpos( $url, '\'' ) !== false) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function clean_url($url) {
|
||||
|
||||
if( $url == '' ) return;
|
||||
|
||||
$url = str_replace( "http://", "", $url );
|
||||
$url = str_replace( "https://", "", $url );
|
||||
if( strtolower( substr( $url, 0, 4 ) ) == 'www.' ) $url = substr( $url, 4 );
|
||||
$url = explode( '/', $url );
|
||||
$url = reset( $url );
|
||||
$url = explode( ':', $url );
|
||||
$url = reset( $url );
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
$domain_cookie = explode (".", clean_url( $_SERVER['HTTP_HOST'] ));
|
||||
$domain_cookie_count = count($domain_cookie);
|
||||
$domain_allow_count = -2;
|
||||
|
||||
if ( $domain_cookie_count > 2 ) {
|
||||
|
||||
if ( in_array($domain_cookie[$domain_cookie_count-2], array('com', 'net', 'org') )) $domain_allow_count = -3;
|
||||
if ( $domain_cookie[$domain_cookie_count-1] == 'ua' ) $domain_allow_count = -3;
|
||||
$domain_cookie = array_slice($domain_cookie, $domain_allow_count);
|
||||
}
|
||||
|
||||
$domain_cookie = "." . implode (".", $domain_cookie);
|
||||
|
||||
if( ip2long($_SERVER['HTTP_HOST']) != -1 AND ip2long($_SERVER['HTTP_HOST']) !== FALSE ) define( 'DOMAIN', null );
|
||||
else define( 'DOMAIN', $domain_cookie );
|
||||
|
||||
function set_cookie($name, $value, $expires) {
|
||||
if( $expires ) {$expires = time() + ($expires * 86400);
|
||||
} else {$expires = FALSE;}
|
||||
|
||||
if( PHP_VERSION < 5.2 ) {setcookie( $name, $value, $expires, "/", DOMAIN . "; HttpOnly" );
|
||||
} else {setcookie( $name, $value, $expires, "/", DOMAIN, NULL, TRUE );}
|
||||
}
|
||||
|
||||
function get_url($id) {
|
||||
global $cat_info;
|
||||
if( ! $id ) return;
|
||||
$parent_id = $cat_info[$id]['parentid'];
|
||||
$url = $cat_info[$id]['alt_name'];
|
||||
while ( $parent_id ) {
|
||||
$url = $cat_info[$parent_id]['alt_name'] . "/" . $url;
|
||||
$parent_id = $cat_info[$parent_id]['parentid'];
|
||||
if( $cat_info[$parent_id]['parentid'] == $cat_info[$parent_id]['id'] ) break;
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
function convert_unicode($t, $to = 'windows-1251') {
|
||||
$to = strtolower( $to );
|
||||
|
||||
if( $to == 'utf-8' ) {
|
||||
return $t;
|
||||
} else {
|
||||
if( function_exists( 'iconv' ) ) $t = iconv( "UTF-8", $to . "//IGNORE", $t );
|
||||
else $t = "The library iconv is not supported by your server";
|
||||
}
|
||||
return $t;
|
||||
}
|
||||
|
||||
function check_netz($ip1, $ip2) {
|
||||
|
||||
$ip1 = explode( ".", $ip1 );
|
||||
$ip2 = explode( ".", $ip2 );
|
||||
|
||||
if( $ip1[0] != $ip2[0] ) return false;
|
||||
if( $ip1[1] != $ip2[1] ) return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
function compare_filter($a, $b) {
|
||||
|
||||
$a = explode( "|", $a );
|
||||
$b = explode( "|", $b );
|
||||
|
||||
if( $a[1] == $b[1] ) return 0;
|
||||
|
||||
return strcasecmp( $a[1], $b[1] );
|
||||
|
||||
}
|
||||
?>
|
||||
192
system/inc/include/init.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
if( ! defined( 'DATALIFEENGINE' ) ) {die( "Hacking attempt!" );}
|
||||
|
||||
|
||||
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');
|
||||
|
||||
if( $config['http_home_url'] == "" ) {
|
||||
$config['http_home_url'] = explode( $config['admin_path'], $_SERVER['PHP_SELF'] );
|
||||
$config['http_home_url'] = reset( $config['http_home_url'] );
|
||||
$config['http_home_url'] = "http://" . $_SERVER['HTTP_HOST'] . $config['http_home_url'];
|
||||
$auto_detect_config = true;
|
||||
}
|
||||
|
||||
$selected_language = $config['langs'];
|
||||
if (isset( $_POST['selected_language'] )) {
|
||||
$_POST['selected_language'] = totranslit( $_POST['selected_language'], false, false );
|
||||
if (@is_dir ( ROOT_DIR . '/language/' .$_POST['selected_language'] )) {
|
||||
$selected_language = $_POST['selected_language'];
|
||||
set_cookie ("selected_language", $selected_language, 365);
|
||||
}
|
||||
} elseif (isset( $_COOKIE['selected_language'] )) {
|
||||
$_COOKIE['selected_language'] = totranslit( $_COOKIE['selected_language'], false, false );
|
||||
if (@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'];
|
||||
check_xss();
|
||||
|
||||
$Timer = new microTimer( );
|
||||
$Timer->start();
|
||||
$is_loged_in = FALSE;
|
||||
$member_id = array ();
|
||||
$result = "";
|
||||
$username = "";
|
||||
$cmd5_password = "";
|
||||
$allow_login = false;
|
||||
$PHP_SELF = $_SERVER['PHP_SELF'];
|
||||
$_IP = $db->safesql( $_SERVER['REMOTE_ADDR'] );
|
||||
$_TIME = time() + ($config['date_adjust'] * 60);
|
||||
require_once (SYSTEM_DIR . '/skins/default.skin.php');
|
||||
|
||||
if( isset( $_POST['action'] ) ) $action = $_POST['action']; else $action = $_GET['action'];
|
||||
if( isset( $_POST['mod'] ) ) $mod = $_POST['mod']; else $mod = $_GET['mod'];
|
||||
$mod = totranslit ( $mod, true, false ); $action = totranslit ( $action, false, false );
|
||||
|
||||
$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();
|
||||
}
|
||||
|
||||
$cat_info = $cache->get( "category" );
|
||||
if( ! is_array( $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();
|
||||
}
|
||||
|
||||
if( count( $cat_info ) ) {
|
||||
foreach ( $cat_info as $key ) {
|
||||
$cat[$key['id']] = $key['name'];
|
||||
$cat_parentid[$key['id']] = $key['parentid'];
|
||||
}
|
||||
}
|
||||
|
||||
if( $_REQUEST['action'] == "logout" ) {
|
||||
set_cookie( "dle_user_id", "", 0 );
|
||||
set_cookie( "dle_name", "", 0 );
|
||||
set_cookie( "dle_password", "", 0 );
|
||||
set_cookie( "dle_skin", "", 0 );
|
||||
set_cookie( "dle_newpm", "", 0 );
|
||||
set_cookie( "dle_hash", "", 0 );
|
||||
set_cookie( session_name(), "", 0 );
|
||||
|
||||
@session_unset();
|
||||
@session_destroy();
|
||||
|
||||
msg( "info", $lang['index_msge'], $lang['index_exit'] );
|
||||
}
|
||||
|
||||
if( $check_referer ) {
|
||||
if( $_SERVER['HTTP_REFERER'] == '' and $_REQUEST['subaction'] != 'dologin' ) $allow_login = true;
|
||||
elseif( clean_url( $_SERVER['HTTP_REFERER'] ) == clean_url( $_SERVER['HTTP_HOST'] ) ) $allow_login = true;
|
||||
} else {
|
||||
$allow_login = true;
|
||||
}
|
||||
|
||||
if( $allow_login ) {
|
||||
|
||||
if( intval($_SESSION['dle_user_id']) > 0 AND $_SESSION['dle_password'] ) {
|
||||
$username = $_SESSION['dle_user_id'];
|
||||
$cmd5_password = $_SESSION['dle_password'];
|
||||
$post = false;
|
||||
} elseif(intval($_COOKIE['dle_user_id']) > 0 AND $_COOKIE['dle_password']) {
|
||||
$username = $_COOKIE['dle_user_id'];
|
||||
$cmd5_password = $_COOKIE['dle_password'];
|
||||
$post = false;
|
||||
}
|
||||
if( $_REQUEST['subaction'] == 'dologin' ) {
|
||||
$username = $_POST['username'];
|
||||
$cmd5_password = md5( $_POST['password'] );
|
||||
$post = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( check_login( $username, $cmd5_password, $post ) ) {
|
||||
$is_loged_in = true;
|
||||
$_SESSION['dle_log'] = 0;
|
||||
$dle_login_hash = md5($_SERVER['HTTP_HOST'] . $member_id['user_id'] . sha1($cmd5_password) . $config['key'] . date("Ymd"));
|
||||
|
||||
if( ! $_SESSION['dle_user_id'] and $_COOKIE['dle_user_id'] ) {
|
||||
$_SESSION['dle_user_id'] = $_COOKIE['dle_user_id'];
|
||||
$_SESSION['dle_password'] = $_COOKIE['dle_password'];
|
||||
}
|
||||
} else {
|
||||
$dle_login_hash = "";
|
||||
if( $_REQUEST['subaction'] == 'dologin' ) {
|
||||
$result = "<font color=red>" . $lang['index_errpass'] . "</font>";
|
||||
} else
|
||||
$result = "";
|
||||
$is_loged_in = false;
|
||||
}
|
||||
|
||||
if( $is_loged_in and $_REQUEST['subaction'] == 'dologin' ) {
|
||||
|
||||
$_SESSION['dle_user_id'] = $member_id['user_id'];
|
||||
$_SESSION['dle_password'] = $cmd5_password;
|
||||
|
||||
set_cookie( "dle_user_id", $member_id['user_id'], 365 );
|
||||
set_cookie( "dle_password", $cmd5_password, 365 );
|
||||
|
||||
$time_now = time() + ($config['date_adjust'] * 60);
|
||||
|
||||
if( $config['log_hash'] ) {
|
||||
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
|
||||
$hash = '';
|
||||
srand( ( double ) microtime() * 1000000 );
|
||||
for($i = 0; $i < 9; $i ++) {
|
||||
$hash .= $salt{rand( 0, 33 )};
|
||||
}
|
||||
$hash = md5( $hash );
|
||||
set_cookie( "dle_hash", $hash, 365 );
|
||||
$_COOKIE['dle_hash'] = $hash;
|
||||
$member_id['hash'] = $hash;
|
||||
$db->query( "UPDATE " . USERPREFIX . "_users set hash='" . $hash . "', lastdate='{$time_now}', logged_ip='" . $_IP . "' WHERE user_id='{$member_id['user_id']}'" );
|
||||
} else
|
||||
$db->query( "UPDATE " . USERPREFIX . "_users set lastdate='{$time_now}', logged_ip='" . $_IP . "' WHERE user_id='{$member_id['user_id']}'" );
|
||||
}
|
||||
|
||||
if( $is_loged_in and $config['log_hash'] and (($_COOKIE['dle_hash'] != $member_id['hash']) or ($member_id['hash'] == "")) ) {
|
||||
$is_loged_in = FALSE;
|
||||
}
|
||||
|
||||
if( $is_loged_in and $config['ip_control'] == '1' and ! check_netz( $member_id['logged_ip'], $_IP ) and $_REQUEST['subaction'] != 'dologin' ) $is_loged_in = FALSE;
|
||||
if( ! $is_loged_in ) {
|
||||
$member_id = array();
|
||||
set_cookie( "dle_user_id","",0 );
|
||||
set_cookie( "dle_name","",0 );
|
||||
set_cookie( "dle_password","",0 );
|
||||
set_cookie( "dle_hash","",0 );
|
||||
$_SESSION['dle_user_id'] = 0;
|
||||
$_SESSION['dle_password'] = "";
|
||||
}
|
||||
|
||||
if ( $is_loged_in ) define( 'LOGGED_IN', $is_loged_in );
|
||||
?>
|
||||
445
system/inc/include/inserttag.php
Normal file
@@ -0,0 +1,445 @@
|
||||
<?PHP
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
if ($user_group[$member_id['user_group']]['allow_image_upload']){$image_upload = "<div class=\"editor_button\" onclick=image_upload()><img title=\"$lang[bb_t_up]\" src=\"system/skins/bbcodes/images/upload.gif\" width=\"23\" height=\"25\" border=\"0\"></div>";
|
||||
}else $image_upload = "";
|
||||
|
||||
if ($mod != "editnews") {$row['autor'] = $member_id['name'];}
|
||||
$p_name = urlencode($row['autor']);
|
||||
|
||||
$bb_code = <<<HTML
|
||||
<SCRIPT type=text/javascript>
|
||||
<!--
|
||||
var uagent = navigator.userAgent.toLowerCase();
|
||||
var is_safari = ( (uagent.indexOf('safari') != -1) || (navigator.vendor == "Apple Computer, Inc.") );
|
||||
var is_opera = (uagent.indexOf('opera') != -1);
|
||||
var is_ie = ( (uagent.indexOf('msie') != -1) && (!is_opera) && (!is_safari) );
|
||||
var is_ie4 = ( (is_ie) && (uagent.indexOf("msie 4.") != -1) );
|
||||
|
||||
var is_win = ( (uagent.indexOf("win") != -1) || (uagent.indexOf("16bit") !=- 1) );
|
||||
var ua_vers = parseInt(navigator.appVersion);
|
||||
|
||||
var text_enter_url = "$lang[bb_url]";
|
||||
var text_enter_size = "$lang[bb_flash]";
|
||||
var text_enter_flash = "$lang[bb_flash_url]";
|
||||
var text_enter_page = "$lang[bb_page]";
|
||||
var text_enter_url_name = "$lang[bb_url_name]";
|
||||
var text_enter_page_name = "$lang[bb_page_name]";
|
||||
var text_enter_image = "$lang[bb_image]";
|
||||
var text_enter_email = "$lang[bb_email]";
|
||||
var text_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 ie_range_cache = '';
|
||||
|
||||
var selField = "short_story";
|
||||
var bbtags = new Array();
|
||||
var fombj = document.forms[0];
|
||||
|
||||
function setFieldName(which)
|
||||
{
|
||||
if (which != selField)
|
||||
{
|
||||
selField = which;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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_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_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_kp()
|
||||
{
|
||||
var FoundErrors = '';
|
||||
|
||||
var thesel = get_sel(eval('fombj.'+ selField))
|
||||
|
||||
if (!thesel) {
|
||||
thesel ='';
|
||||
}
|
||||
|
||||
var enterURL = prompt("ID Kinopoisk", thesel);
|
||||
|
||||
if (!enterURL) {
|
||||
FoundErrors += " " + error_no_url;
|
||||
}
|
||||
|
||||
if (FoundErrors) {
|
||||
alert("Error!"+FoundErrors);
|
||||
return;
|
||||
}
|
||||
|
||||
doInsert("[center][kp="+enterURL+"][/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_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, "{$config['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_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=\"system/skins/bbcodes/color.html\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"></iframe></div>");
|
||||
|
||||
$('#cp').dialog({
|
||||
autoOpen: true,
|
||||
width: 180
|
||||
});
|
||||
}
|
||||
function setColor(color)
|
||||
{
|
||||
doInsert("[color=" +color+ "]", "[/color]", true );
|
||||
$('#cp').dialog("close");
|
||||
}
|
||||
|
||||
function image_upload(){window.open('?mod=files&action=quick&area=' + selField + '&author={$p_name}&news_id={$id}', '_Addimage', 'toolbar=0,location=0,status=0, left=0, top=0, menubar=0,scrollbars=yes,resizable=0,width=640,height=550')}
|
||||
|
||||
function insert_font(value, tag)
|
||||
{
|
||||
if (value == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( doInsert("[" +tag+ "=" +value+ "]", "[/" +tag+ "]", true ) )
|
||||
fombj.bbfont.selectedIndex = 0;
|
||||
fombj.bbsize.selectedIndex = 0;
|
||||
}
|
||||
|
||||
function spoiler() {var FoundErrors = '';var spoiler = prompt("Ââåäèòå íàçâàíèå ñïîéëåðà"); if (!spoiler){FoundErrors += " ";} if(FoundErrors){alert("îøèáêà!"+FoundErrors);return;} doInsert("[spoiler="+spoiler+"][/spoiler]", "", false); }
|
||||
|
||||
function get_sel(obj){
|
||||
|
||||
if (document.selection)
|
||||
{
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
document.getElementById(selField).focus();
|
||||
ie_range_cache = document.selection.createRange();
|
||||
}
|
||||
|
||||
var s = document.selection.createRange();
|
||||
if (s.text)
|
||||
{
|
||||
return s.text;
|
||||
}
|
||||
}
|
||||
else if (typeof(obj.selectionStart)=="number")
|
||||
{
|
||||
if (obj.selectionStart!=obj.selectionEnd)
|
||||
{
|
||||
var start = obj.selectionStart;
|
||||
var end = obj.selectionEnd;
|
||||
return (obj.value.substr(start,end-start));
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
};
|
||||
-->
|
||||
</SCRIPT>
|
||||
<div style="width:98%; height:50px; border:1px solid #BBB; background-image:url('system/skins/bbcodes/images/bg.gif');">
|
||||
<div id="b_b" class="editor_button" onclick="simpletag('b')"><img title="$lang[bb_t_b]" src="system/skins/bbcodes/images/b.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_i" class="editor_button" onclick="simpletag('i')"><img title="$lang[bb_t_i]" src="system/skins/bbcodes/images/i.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_u" class="editor_button" onclick="simpletag('u')"><img title="$lang[bb_t_u]" src="system/skins/bbcodes/images/u.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_s" class="editor_button" onclick="simpletag('s')"><img title="$lang[bb_t_s]" src="system/skins/bbcodes/images/s.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="system/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick=tag_image()><img title="$lang[bb_b_img]" src="system/skins/bbcodes/images/image.gif" width="23" height="25" border="0"></div>
|
||||
{$image_upload}
|
||||
<div class="editor_button"><img src="system/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick="tag_url()"><img title="$lang[bb_t_url]" src="system/skins/bbcodes/images/link.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick="tag_email()"><img title="$lang[bb_t_m]" src="system/skins/bbcodes/images/email.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="system/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick="tag_video()"><img title="$lang[bb_t_video]" src="system/skins/bbcodes/images/mp.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick="tag_audio()"><img src="system/skins/bbcodes/images/mp3.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="system/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div id="b_color" class="editor_button" onclick="ins_color(this);"><img src="system/skins/bbcodes/images/color.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="system/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div id="b_flash" class="editor_button" onclick="tag_flash()"><img src="system/skins/bbcodes/images/flash.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_youtube" class="editor_button" onclick="tag_media()"><img src="system/skins/bbcodes/images/youtube.gif" width="23" height="25" border="0"></div>
|
||||
<div><img src="system/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div class="editor_button" style="padding-top:3px;width:140px;"><select name="bbfont" onchange="insert_font(this.options[this.selectedIndex].value, 'font')"><option value='0'>{$lang['bb_t_font']}</option><option value='Arial'>Arial</option><option value='Arial Black'>Arial Black</option><option value='Century Gothic'>Century Gothic</option><option value='Courier New'>Courier New</option><option value='Georgia'>Georgia</option><option value='Impact'>Impact</option><option value='System'>System</option><option value='Tahoma'>Tahoma</option><option value='Times New Roman'>Times New Roman</option><option value='Verdana'>Verdana</option></select></div>
|
||||
<div class="editor_button" style="padding-top:3px;width:70px;"><select name="bbsize" onchange="insert_font(this.options[this.selectedIndex].value, 'size')"><option value='0'>{$lang['bb_t_size']}</option><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option></select></div>
|
||||
<div class="editor_button"><img src="system/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div id="b_left" class="editor_button" onclick="simpletag('left')"><img title="$lang[bb_t_l]" src="system/skins/bbcodes/images/l.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_center" class="editor_button" onclick="simpletag('center')"><img title="$lang[bb_t_c]" src="system/skins/bbcodes/images/c.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_right"class="editor_button" onclick="simpletag('right')"><img title="$lang[bb_t_r]" src="system/skins/bbcodes/images/r.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="system/skins/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="system/skins/bbcodes/images/quote.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_screens" class="editor_button" onclick="simpletag('screens')"><img title="Ñêðèíøîòû" src="system/skins/bbcodes/images/screens.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="system/skins/bbcodes/images/hide.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="system/skins/bbcodes/images/code.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="system/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div id="b_spoiler" class="editor_button" onclick="spoiler()"><img src="system/skins/bbcodes/images/spoiler.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick="tag_kp()"><img title="Ðåéòèíã ÊèíîÏîèñêà" src="system/skins/bbcodes/images/rating.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="system/skins/bbcodes/images/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
</div>
|
||||
HTML;
|
||||
?>
|
||||
354
system/inc/iptools.php
Normal file
@@ -0,0 +1,354 @@
|
||||
<?php
|
||||
if( ! defined( 'DATALIFEENGINE' ) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
|
||||
if( ! $user_group[$member_id['user_group']]['admin_iptools'] ) {
|
||||
msg( "error", $lang['index_denied'], $lang['index_denied'] );
|
||||
}
|
||||
|
||||
if( isset( $_REQUEST['ip'] ) ) $ip = $db->safesql( htmlspecialchars( strip_tags( trim( $_REQUEST['ip'] ) ) ) ); else $ip = "";
|
||||
if( isset( $_REQUEST['name'] ) ) $name = $db->safesql( htmlspecialchars( strip_tags( trim( $_REQUEST['name'] ) ) ) ); else $name = "";
|
||||
|
||||
if( $_REQUEST['doaction'] == "dodelcomments" AND $_REQUEST['id']) {
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
|
||||
|
||||
die( "Hacking attempt! User not found" );
|
||||
|
||||
}
|
||||
|
||||
$id = intval( $_REQUEST['id'] );
|
||||
|
||||
$result = $db->query( "SELECT COUNT(*) as count, post_id FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1' GROUP BY post_id" );
|
||||
|
||||
while ( $row = $db->get_array( $result ) ) {
|
||||
$db->query( "UPDATE " . PREFIX . "_post set comm_num=comm_num-{$row['count']} where id='{$row['post_id']}'" );
|
||||
}
|
||||
$db->free( $result );
|
||||
|
||||
$db->query( "UPDATE " . USERPREFIX . "_users set comm_num='0' WHERE user_id ='$id'" );
|
||||
$db->query( "DELETE FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1'" );
|
||||
}
|
||||
|
||||
echoheader( "", "" );
|
||||
|
||||
echo <<<HTML
|
||||
<form action="?mod=iptools" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_iptoolsc']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" height="70">{$lang['opt_iptoolsc']}<br /><input class="edit" style="width:250px;" type="text" name="ip" value="{$ip}"> <input type="submit" value="{$lang['b_find']}" class="edit"><br /><span class=small>{$lang['opt_ipfe']}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" height="70">{$lang['opt_iptoolsname']}<br /><input class="edit" style="width:250px;" type="text" name="name" value="{$name}"> <input type="submit" value="{$lang['b_find']}" class="edit"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<input type="hidden" name="action" value="find">
|
||||
<input type="hidden" name="mod" value="iptools">
|
||||
</form>
|
||||
HTML;
|
||||
|
||||
if( $_REQUEST['action'] == "find" and $ip != "" ) {
|
||||
|
||||
echo <<<HTML
|
||||
<script type="text/javascript" src="system/ajax/menu.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
function popupedit(id){
|
||||
window.open('?mod=editusers&action=edituser&id='+id,'User','toolbar=0,location=0,status=0, left=0, top=0, menubar=0,scrollbars=yes,resizable=0,width=540,height=500');
|
||||
}
|
||||
function cdelete(id){
|
||||
var agree=confirm("{$lang['comm_alldelconfirm']}");
|
||||
if (agree)
|
||||
document.location='?mod=iptools&action=find&ip={$ip}&doaction=dodelcomments&user_hash={$dle_login_hash}&id=' + id + '';
|
||||
}
|
||||
function MenuBuild( m_id ){
|
||||
|
||||
var menu=new Array()
|
||||
|
||||
menu[0]='<a href="{$config['http_home_url']}index.php?do=lastcomments&userid=' + m_id + '" target="_blank">{$lang['comm_view']}</a>';
|
||||
menu[1]='<a onClick="javascript:cdelete(' + m_id + '); return(false)" href="?mod=iptools&action=find&ip={$ip}&doaction=dodelcomments&user_hash={$dle_login_hash}&id=' + m_id + '" >{$lang['comm_del']}</a>';
|
||||
|
||||
return menu;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['ip_found_users']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="170" style="padding:2px;">{$lang['user_name']}</td>
|
||||
<td width="110" style="padding:2px;">IP</td>
|
||||
<td width="130">{$lang['user_reg']}</td>
|
||||
<td width="130">{$lang['user_last']}</td>
|
||||
<td width="60">{$lang['user_news']}</td>
|
||||
<td width="120" align="center">{$lang['user_coms']}</td>
|
||||
<td>{$lang['user_acc']}</td>
|
||||
</tr>
|
||||
<tr><td colspan="7"><div class="hr_line"></div></td></tr>
|
||||
HTML;
|
||||
|
||||
$db->query( "SELECT * FROM " . USERPREFIX . "_users WHERE logged_ip LIKE '{$ip}%'" );
|
||||
|
||||
$i = 0;
|
||||
while ( $row = $db->get_array() ) {
|
||||
$i ++;
|
||||
|
||||
if( $row[news_num] == 0 ) {
|
||||
$news_link = "$row[news_num]";
|
||||
} else {
|
||||
$news_link = "[<a href=\"{$config['http_home_url']}index.php?subaction=allnews&user=" . urlencode( $row['name'] ) . "\" target=\"_blank\">" . $row[news_num] . "</a>]";
|
||||
}
|
||||
if( $row[comm_num] == 0 ) {
|
||||
$comms_link = $row['comm_num'];
|
||||
} else {
|
||||
$comms_link = "[<a onClick=\"return dropdownmenu(this, event, MenuBuild('" . $row['user_id'] . "'), '150px')\" href=\"#\" >" . $row[comm_num] . "</a>]";
|
||||
}
|
||||
|
||||
if( $row['banned'] == 'yes' ) $group = "<font color=\"red\">" . $lang['user_ban'] . "</font>";
|
||||
else $group = $user_group[$row['user_group']]['group_name'];
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
<td style=\"padding:3px\">
|
||||
<a class=maintitle onClick=\"javascript:popupedit('$row[user_id]'); return(false)\" href=#>{$row['name']}</a>
|
||||
</td>
|
||||
<td>
|
||||
" . $row['logged_ip'] . "</td>
|
||||
<td>
|
||||
" . langdate( "d/m/Y - H:i", $row['reg_date'] ) . "</td>
|
||||
<td>
|
||||
" . langdate( 'd/m/Y - H:i', $row['lastdate'] ) . "</td>
|
||||
<td align=\"center\">
|
||||
" . $news_link . "</td>
|
||||
<td align=\"center\">
|
||||
" . $comms_link . "</td>
|
||||
<td>
|
||||
" . $group . "</td>
|
||||
</tr>
|
||||
<tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=7></td></tr>
|
||||
";
|
||||
}
|
||||
|
||||
if( $i == 0 ) {
|
||||
echo "<tr>
|
||||
<td height=18 colspan=7>
|
||||
<p align=center><br><b>$lang[ip_empty]<br><br></b>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['ip_found_comments']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="170" style="padding:2px;">{$lang['user_name']}</td>
|
||||
<td width="110" style="padding:2px;">IP</td>
|
||||
<td width="130">{$lang['user_reg']}</td>
|
||||
<td width="130">{$lang['user_last']}</td>
|
||||
<td width="60">{$lang['user_news']}</td>
|
||||
<td width="120" align="center">{$lang['user_coms']}</td>
|
||||
<td>{$lang['user_acc']}</td>
|
||||
</tr>
|
||||
<tr><td colspan="7"><div class="hr_line"></div></td></tr>
|
||||
HTML;
|
||||
|
||||
$db->query( "SELECT " . PREFIX . "_comments.user_id, " . PREFIX . "_comments.ip, " . USERPREFIX . "_users.comm_num, banned, user_group, reg_date, lastdate, " . USERPREFIX . "_users.name, " . USERPREFIX . "_users.news_num FROM " . PREFIX . "_comments LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id WHERE " . PREFIX . "_comments.ip LIKE '{$ip}%' AND " . PREFIX . "_comments.is_register = '1' AND " . USERPREFIX . "_users.name != '' GROUP BY " . PREFIX . "_comments.user_id" );
|
||||
|
||||
$i = 0;
|
||||
while ( $row = $db->get_array() ) {
|
||||
$i ++;
|
||||
|
||||
if( $row[news_num] == 0 ) {
|
||||
$news_link = "$row[news_num]";
|
||||
} else {
|
||||
$news_link = "[<a href=\"{$config['http_home_url']}index.php?subaction=userinfo&user=" . urlencode( $row['name'] ) . "\" target=\"_blank\">" . $row[news_num] . "</a>]";
|
||||
}
|
||||
if( $row[comm_num] == 0 ) {
|
||||
$comms_link = $row['comm_num'];
|
||||
} else {
|
||||
$comms_link = "[<a onClick=\"return dropdownmenu(this, event, MenuBuild('" . $row['user_id'] . "'), '150px')\" href=\"#\" >" . $row[comm_num] . "</a>]";
|
||||
}
|
||||
|
||||
if( $row['banned'] == 'yes' ) $group = "<font color=\"red\">" . $lang['user_ban'] . "</font>";
|
||||
else $group = $user_group[$row['user_group']]['group_name'];
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
<td style=\"padding:3px\">
|
||||
<a class=maintitle onClick=\"javascript:popupedit('$row[user_id]'); return(false)\" href=#>{$row['name']}</a>
|
||||
</td>
|
||||
<td>
|
||||
" . $row['ip'] . "</td>
|
||||
<td>
|
||||
" . langdate( "d/m/Y - H:i", $row['reg_date'] ) . "</td>
|
||||
<td>
|
||||
" . langdate( 'd/m/Y - H:i', $row['lastdate'] ) . "</td>
|
||||
<td align=\"center\">
|
||||
" . $news_link . "</td>
|
||||
<td align=\"center\">
|
||||
" . $comms_link . "</td>
|
||||
<td>
|
||||
" . $group . "</td>
|
||||
</tr>
|
||||
<tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=7></td></tr>
|
||||
";
|
||||
}
|
||||
|
||||
if( $i == 0 ) {
|
||||
echo "<tr>
|
||||
<td height=18 colspan=7>
|
||||
<p align=center><br><b>$lang[ip_empty]<br><br></b>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
if( $name != "" ) {
|
||||
|
||||
echo <<<HTML
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_iptoolsname']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" height="70">
|
||||
HTML;
|
||||
|
||||
$row = $db->super_query( "SELECT user_id, name, logged_ip FROM " . USERPREFIX . "_users WHERE name='" . $name . "'" );
|
||||
|
||||
if( ! $row['user_id'] ) {
|
||||
|
||||
echo "<center><b>" . $lang['user_nouser'] . "</b></center>";
|
||||
|
||||
} else {
|
||||
|
||||
echo $lang['user_name'] . " <b>" . $row['name'] . "</b><br /><br />" . $lang['opt_iptoollast'] . " <b>" . $row['logged_ip'] . "</b><br /><br />" . $lang['opt_iptoolcall'] . " <b>";
|
||||
|
||||
$db->query( "SELECT ip FROM " . PREFIX . "_comments WHERE user_id = '{$row['user_id']}' GROUP BY ip" );
|
||||
|
||||
$ip_list = array ();
|
||||
|
||||
while ( $row = $db->get_array() ) {
|
||||
$ip_list[] = "<a href=\"https://www.nic.ru/whois/?ip=" . $row['ip'] . "\" target=\"_blank\">" . $row['ip'] . "</a>";
|
||||
}
|
||||
|
||||
echo implode( ", ", $ip_list );
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</b></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
echofooter();
|
||||
?>
|
||||
232
system/inc/main.php
Normal file
@@ -0,0 +1,232 @@
|
||||
<?PHP
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
|
||||
echoheader( "home", "" );
|
||||
|
||||
if( $_GET['action'] == "clearsubscribe" ) {
|
||||
$db->query("TRUNCATE TABLE " . PREFIX . "_subscribe");
|
||||
}
|
||||
|
||||
if( $_GET['action'] == "clear" ) {
|
||||
$cache->delete('usergroup.php' );
|
||||
$cache->delete('category.php' );
|
||||
$cache->delete('banned.php' );
|
||||
$cache->delete('cron.php' );
|
||||
$cache->clear();
|
||||
}
|
||||
|
||||
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post" );
|
||||
$stats_news = $row['count'];
|
||||
|
||||
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_subscribe" );
|
||||
$count_subscribe = $row['count'];
|
||||
|
||||
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_comments" );
|
||||
$count_comments = $row['count'];
|
||||
|
||||
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . USERPREFIX . "_users" );
|
||||
$stats_users = $row['count'];
|
||||
|
||||
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . USERPREFIX . "_users where banned='yes'" );
|
||||
$stats_banned = $row['count'];
|
||||
if ($stats_banned) $stats_banned = "( <font color=\"red\">{$stats_banned}</font> )";
|
||||
else $stats_banned = "";
|
||||
|
||||
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post where approve = '0'" );
|
||||
$approve = $row['count'];
|
||||
|
||||
if( $approve and $user_group[$member_id['user_group']]['allow_all_edit'] ) {
|
||||
$approve = "( <b>" .$approve . "</b> ) [ <a href=\"?mod=editnews&action=list&news_status=2\">{$lang['stat_medit_link']}</a> ]";
|
||||
} else {$approve = "";}
|
||||
|
||||
$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'];
|
||||
}
|
||||
$db->free();
|
||||
|
||||
$mysql_size = mksize( $mysql_size );
|
||||
$cache_size = mksize( $cache->size() );
|
||||
|
||||
$dts = @disk_total_space(".");
|
||||
$dfs = @disk_free_space(".");
|
||||
$totalspace = mksize($dts);
|
||||
$freespace = mksize($dfs);
|
||||
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
$winstats = shell_exec("net statistics server");
|
||||
preg_match("(\d{1,2}/\d{1,2}/\d{4}\s+\d{1,2}\:\d{2}\s+\w{2})", $winstats, $matches);
|
||||
$uptimeSecs = time() - strtotime($matches[0]);
|
||||
$uptime = format_uptime($uptimeSecs);
|
||||
} else {
|
||||
/*$data = shell_exec('uptime');
|
||||
$uptime = explode(' up ', $data);
|
||||
$uptime = explode(',', $uptime[1]);
|
||||
$uptime = $uptime[0].', '.$uptime[1];*/
|
||||
$uptime = exec("cat /proc/uptime");
|
||||
$uptime = split(" ",$uptime);
|
||||
$uptimeSecs = $uptime[0];
|
||||
$uptime = format_uptime($uptimeSecs);
|
||||
}
|
||||
|
||||
if( $member_id['user_group'] == 1 ) {
|
||||
|
||||
echo <<<HTML
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['main_quick']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="70" height="70" valign="middle" align="center" style="padding-top:5px;padding-bottom:5px;"><img src="system/skins/images/tools.png" border="0"></td>
|
||||
<td valign="middle"><div class="quick"><a href="$PHP_SELF?mod=options&action=syscon"><h3>{$lang['opt_all']}</h3>{$lang['opt_allc']}</a></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="70" height="70" valign="middle" align="center" style="padding-top:5px;padding-bottom:5px;"><img src="system/skins/images/nset.png" border="0"></td>
|
||||
<td valign="middle"><div class="quick"><a href="$PHP_SELF?mod=newsletter"><h3>{$lang['main_newsl']}</h3>{$lang['main_newslc']}</a></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="70" height="70" valign="middle" align="center" style="padding-top:5px;padding-bottom:5px;"><img src="system/skins/images/spset.png" border="0"></td>
|
||||
<td valign="middle"><div class="quick"><a href="$PHP_SELF?mod=static"><h3>{$lang['opt_static']}</h3>{$lang['opt_staticd']}</a></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="70" height="70" valign="middle" align="center" style="padding-top:5px;padding-bottom:5px;"><img src="system/skins/images/clean.png" border="0"></td>
|
||||
<td valign="middle"><div class="quick"><a href="$PHP_SELF?mod=clean"><h3>{$lang['opt_clean']}</h3>{$lang['opt_cleanc']}</a></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
} else {
|
||||
|
||||
//Èíôîðìàöèÿ íå äëÿ àäìèíîâ
|
||||
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation" id="main_title">Ñòàòèñòèêà ñàéòà</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<div id="main_box"><table width="100%">
|
||||
<tr>
|
||||
<td width="265" style="padding:2px;">Àïòàéì ñåðâåðà:</td>
|
||||
<td>{$uptime} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="265" style="padding:2px;">{$lang['stat_allnews']}</td>
|
||||
<td>{$stats_news} {$approve} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;">{$lang['stat_comments']}</td>
|
||||
<td>{$count_comments} [ <a href="{$config['http_home_url']}index.php?do=lastcomments" target="_blank">{$lang['last_comm']}</a> ]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;">{$lang['stat_users']}</td>
|
||||
<td>{$stats_users} {$stats_banned} [ <a href="?mod=editusers&action=list">Ðåäàêòèðîâàòü ïîëüçîâàòåëåé</a> ]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;">{$lang['stat_bd']}</td>
|
||||
<td>{$mysql_size}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;">Ðàçìåð êåøà:</td>
|
||||
<td>{$cache_size}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;">{$lang['free_size']}</td>
|
||||
<td>{$freespace} ({$totalspace})</td>
|
||||
</tr>
|
||||
</table>
|
||||
HTML;
|
||||
|
||||
if( ! is_writable( ROOT_DIR . "/cache/" ) or ! is_writable( ROOT_DIR . "/cache/system/" ) ) {
|
||||
echo "<br><table width=\"100%\" align=\"center\"><tr><td style='padding:3px; border:1px dashed red; background-color:lightyellow;' class=main>
|
||||
$lang[stat_cache]
|
||||
</td></tr><tr><td> </td></tr></table>";
|
||||
|
||||
}
|
||||
|
||||
if( $member_id['user_group'] == 1 ) {
|
||||
|
||||
echo "<br /><input onclick=\"document.location='?mod=main&action=clear'\" class=\"edit\" style=\"width:150px;\" type=\"button\" value=\"{$lang['btn_clearcache']}\"></a>";
|
||||
|
||||
if ($count_subscribe) echo " <input onclick=\"var agree=confirm('{$lang['confirm_action']}'); if (agree) document.location='?mod=main&action=clearsubscribe'\" class=\"edit\" style=\"width:300px;\" type=\"button\" value=\"{$lang['btn_clearsubscribe']}\">";
|
||||
|
||||
echo "<br />";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</div>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
?>
|
||||
225
system/inc/mass_static_actions.php
Normal file
@@ -0,0 +1,225 @@
|
||||
<?PHP
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
|
||||
if( ! $_SESSION['admin_referrer'] ) {
|
||||
|
||||
$_SESSION['admin_referrer'] = "?mod=static&action=list";
|
||||
|
||||
}
|
||||
|
||||
if( ! $user_group[$member_id['user_group']]['admin_static'] ) {
|
||||
msg( "error", $lang['mass_error'], $lang['mass_ddenied'], $_SESSION['admin_referrer'] );
|
||||
}
|
||||
|
||||
$selected_news = $_REQUEST['selected_news'];
|
||||
|
||||
if( ! $selected_news ) {
|
||||
msg( "error", $lang['mass_error'], $lang['mass_denied'], $_SESSION['admin_referrer'] );
|
||||
}
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
|
||||
|
||||
die( "Hacking attempt! User not found" );
|
||||
|
||||
}
|
||||
|
||||
$action = htmlspecialchars( strip_tags( stripslashes( $_POST['action'] ) ) );
|
||||
|
||||
$k_mass = false;
|
||||
$field = false;
|
||||
|
||||
if( $action == "mass_date" ) {
|
||||
$field = "date";
|
||||
$value = time() + ($config['date_adjust'] * 60);
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_static_edit_date_tl'];
|
||||
$lang['mass_confirm'] = $lang['mass_static_edit_date_tl'];
|
||||
$lang['mass_confirm_1'] = $lang['mass_static_confirm_2'];
|
||||
} elseif( $action == "mass_clear_count" ) {
|
||||
$field = "views";
|
||||
$value = 0;
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_clear_count_2'];
|
||||
$lang['mass_confirm'] = $lang['mass_clear_count_1'];
|
||||
$lang['mass_confirm_1'] = $lang['mass_static_confirm_2'];
|
||||
}
|
||||
|
||||
if( $_POST['doaction'] == "mass_update" and $field ) {
|
||||
foreach ( $selected_news as $id ) {
|
||||
$id = intval( $id );
|
||||
$db->query( "UPDATE " . PREFIX . "_static SET {$field}='{$value}' WHERE id='{$id}'" );
|
||||
}
|
||||
msg( "info", $lang['db_ok'], $lang['db_ok_1'].$t1, $_SESSION['admin_referrer'] );
|
||||
}
|
||||
|
||||
if( $k_mass ) {
|
||||
|
||||
echoheader( "options", $lang['mass_head'] );
|
||||
|
||||
echo <<<HTML
|
||||
<form action="{$PHP_SELF}" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$title}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" height="100" align="center">{$lang['mass_confirm']}
|
||||
HTML;
|
||||
|
||||
echo " (<b>" . count( $selected_news ) . "</b>) $lang[mass_confirm_1]<br><br>
|
||||
<input class=bbcodes type=submit value=\" $lang[mass_yes] \"> <input type=button class=bbcodes value=\" $lang[mass_no] \" onclick=\"javascript:document.location='$PHP_SELF?mod=static&action=list'\">
|
||||
<input type=hidden name=action value=\"{$action}\">
|
||||
<input type=hidden name=user_hash value=\"{$dle_login_hash}\">
|
||||
<input type=hidden name=doaction value=\"mass_update\">
|
||||
<input type=hidden name=mod value=\"mass_static_actions\">";
|
||||
foreach ( $selected_news as $newsid ) {
|
||||
$newsid = intval($newsid);
|
||||
echo "<input type=hidden name=selected_news[] value=\"$newsid\">\n";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
exit();
|
||||
|
||||
}
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Ïîäòâðåæäåíèå óäàëåíèÿ
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
if( $action == "mass_delete" ) {
|
||||
|
||||
echoheader( "options", $lang['mass_head'] );
|
||||
|
||||
echo <<<HTML
|
||||
<form action="{$PHP_SELF}" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['mass_static_delete']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" height="100" align="center">{$lang['mass_confirm']}
|
||||
HTML;
|
||||
|
||||
echo "(<b>" . count( $selected_news ) . "</b>) $lang[mass_static_confirm_3]<br><br>
|
||||
<input class=bbcodes type=submit value=\" $lang[mass_yes] \"> <input type=button class=bbcodes value=\" $lang[mass_no] \" onclick=\"javascript:document.location='$PHP_SELF?mod=static&action=list'\">
|
||||
<input type=hidden name=action value=\"do_mass_delete\">
|
||||
<input type=hidden name=user_hash value=\"{$dle_login_hash}\">
|
||||
<input type=hidden name=mod value=\"mass_static_actions\">";
|
||||
foreach ( $selected_news as $newsid ) {
|
||||
$newsid = intval($newsid);
|
||||
echo "<input type=hidden name=selected_news[] value=\"$newsid\">\n";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
exit();
|
||||
|
||||
}
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Óäàëåíèå íîâîñòåé
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
elseif( $action == "do_mass_delete" ) {
|
||||
|
||||
$deleted_articles = 0;
|
||||
|
||||
foreach ( $selected_news as $id ) {
|
||||
|
||||
$id = intval( $id );
|
||||
|
||||
$deleted_articles ++;
|
||||
|
||||
$db->query( "DELETE FROM " . PREFIX . "_static WHERE id='$id'" );
|
||||
|
||||
$db->query( "SELECT name, onserver FROM " . PREFIX . "_static_files WHERE static_id = '$id'" );
|
||||
|
||||
while ( $row = $db->get_row() ) {
|
||||
if( $row['onserver'] ) {
|
||||
@unlink( ROOT_DIR . "/uploads/files/" . $row['onserver'] );
|
||||
} else {
|
||||
$url_image = explode( "/", $row['name'] );
|
||||
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 . "_static_files WHERE static_id = '$id'" );
|
||||
|
||||
}
|
||||
|
||||
if( count( $selected_news ) == $deleted_articles ) {
|
||||
msg( "info", $lang['mass_static_delete'], $lang['mass_delok'], $_SESSION['admin_referrer'] );
|
||||
} else {
|
||||
msg( "error", $lang['mass_notok'], "$deleted_articles $lang[mass_i] " . count( $selected_news ) . " $lang[mass_notok_1]", $_SESSION['admin_referrer'] );
|
||||
}
|
||||
}
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Íè÷åãî íå âûáðàíî
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
else {
|
||||
|
||||
msg( "info", $lang['mass_noact'], $lang['mass_noact_1'], $_SESSION['admin_referrer'] );
|
||||
|
||||
}
|
||||
?>
|
||||
398
system/inc/mass_user_actions.php
Normal file
@@ -0,0 +1,398 @@
|
||||
<?php
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
if( ! $user_group[$member_id['user_group']]['admin_editusers'] ) {
|
||||
msg( "error", $lang['index_denied'], $lang['index_denied'] );
|
||||
}
|
||||
|
||||
$selected_users = $_REQUEST['selected_users'];
|
||||
|
||||
if( ! $selected_users ) {
|
||||
msg( "error", $lang['mass_error'], $lang['massusers_denied'],"?mod=editusers&action=list" );
|
||||
}
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
|
||||
|
||||
die( "Hacking attempt! User not found" );
|
||||
|
||||
}
|
||||
|
||||
if( $_POST['action'] == "mass_delete" ) {
|
||||
|
||||
echoheader( "options", $lang['mass_head'] );
|
||||
|
||||
|
||||
echo <<<HTML
|
||||
<form action="{$PHP_SELF}" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['massusers_head']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" height="100" align="center">{$lang['massusers_confirm']}
|
||||
HTML;
|
||||
|
||||
echo " (<b>" . count( $selected_users ) . "</b>) $lang[massusers_confirm_1]<br><br>
|
||||
<input class=bbcodes type=submit value=\" $lang[mass_yes] \"> <input type=button class=bbcodes value=\" $lang[mass_no] \" onclick=\"javascript:document.location='$PHP_SELF?mod=editusers&action=list'\">
|
||||
<input type=hidden name=action value=\"do_mass_delete\">
|
||||
<input type=hidden name=user_hash value=\"{$dle_login_hash}\">
|
||||
<input type=hidden name=mod value=\"mass_user_actions\">";
|
||||
foreach ( $selected_users as $userid ) {
|
||||
$userid = intval($userid);
|
||||
echo "<input type=hidden name=selected_users[] value=\"$userid\">\n";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
|
||||
echofooter();
|
||||
exit();
|
||||
|
||||
} elseif ($_POST['action'] == "do_mass_delete") {
|
||||
|
||||
$deleted = 0;
|
||||
|
||||
foreach ( $selected_users as $id ) {
|
||||
|
||||
$id = intval( $id );
|
||||
|
||||
if( $id == 1 ) {
|
||||
msg( "error", $lang['mass_error'], $lang['user_undel'], "?mod=editusers&action=list" );
|
||||
}
|
||||
|
||||
$row = $db->super_query( "SELECT user_id, user_group, name, foto FROM " . USERPREFIX . "_users WHERE user_id='$id'" );
|
||||
|
||||
if( ! $row['user_id'] ) msg( "error", $lang['mass_error'], $lang['user_undel'], "?mod=editusers&action=list" );
|
||||
|
||||
if ($member_id['user_group'] != 1 AND $row['user_group'] == 1 )
|
||||
msg( "error", $lang['mass_error'], $lang['user_undel'], "?mod=editusers&action=list" );
|
||||
|
||||
$db->query( "DELETE FROM " . USERPREFIX . "_pm WHERE user_from = '{$row['name']}' AND folder = 'outbox'" );
|
||||
$db->query( "delete FROM " . USERPREFIX . "_users WHERE user_id='$id'" );
|
||||
$db->query( "delete FROM " . USERPREFIX . "_banned WHERE users_id='$id'" );
|
||||
$db->query( "delete FROM " . USERPREFIX . "_pm WHERE user='$id'" );
|
||||
|
||||
@unlink( ROOT_DIR . "/uploads/fotos/" . $row['foto'] );
|
||||
|
||||
$deleted ++;
|
||||
}
|
||||
|
||||
$cache->clear();
|
||||
$cache->delete('banned.php' );
|
||||
|
||||
if( count( $selected_users ) == $deleted ) {
|
||||
msg( "info", $lang['massusers_head'], $lang['massusers_delok'], "?mod=editusers&action=list" );
|
||||
} else {
|
||||
msg( "error", $lang['mass_error'], "$deleted $lang[mass_i] " . count( $selected_users ) . " $lang[massusers_confirm_2]", "?mod=editusers&action=list" );
|
||||
}
|
||||
|
||||
} elseif ($_POST['action'] == "mass_delete_comments") {
|
||||
|
||||
echoheader( "options", $lang['mass_head'] );
|
||||
|
||||
|
||||
echo <<<HTML
|
||||
<form action="{$PHP_SELF}" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['massusers_head_1']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" height="100" align="center">{$lang['massusers_confirm_3']}
|
||||
HTML;
|
||||
|
||||
echo " (<b>" . count( $selected_users ) . "</b>) $lang[massusers_confirm_1]<br><br>
|
||||
<input class=bbcodes type=submit value=\" $lang[mass_yes] \"> <input type=button class=bbcodes value=\" $lang[mass_no] \" onclick=\"javascript:document.location='$PHP_SELF?mod=editusers&action=list'\">
|
||||
<input type=hidden name=action value=\"do_mass_delete_comments\">
|
||||
<input type=hidden name=user_hash value=\"{$dle_login_hash}\">
|
||||
<input type=hidden name=mod value=\"mass_user_actions\">";
|
||||
foreach ( $selected_users as $userid ) {
|
||||
$userid = intval($userid);
|
||||
echo "<input type=hidden name=selected_users[] value=\"$userid\">\n";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
exit();
|
||||
|
||||
} elseif ($_POST['action'] == "do_mass_delete_comments") {
|
||||
|
||||
foreach ( $selected_users as $id ) {
|
||||
|
||||
$id = intval( $id );
|
||||
|
||||
$result = $db->query( "SELECT COUNT(*) as count, post_id FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1' GROUP BY post_id" );
|
||||
|
||||
while ( $row = $db->get_array( $result ) ) {
|
||||
|
||||
$db->query( "UPDATE " . PREFIX . "_post set comm_num=comm_num-{$row['count']} where id='{$row['post_id']}'" );
|
||||
|
||||
}
|
||||
$db->free( $result );
|
||||
|
||||
$db->query( "UPDATE " . USERPREFIX . "_users set comm_num='0' WHERE user_id ='$id'" );
|
||||
$db->query( "DELETE FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1'" );
|
||||
|
||||
}
|
||||
|
||||
$cache->clear();
|
||||
msg( "info", $lang['massusers_head_1'], $lang['massusers_comok'], "?mod=editusers&action=list" );
|
||||
|
||||
} elseif ($_POST['action'] == "mass_move_to_group") {
|
||||
|
||||
|
||||
echoheader( "options", $lang['mass_head'] );
|
||||
|
||||
|
||||
echo <<<HTML
|
||||
<form action="{$PHP_SELF}" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['massusers_head_2']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" height="100" align="center">{$lang['massusers_confirm_4']}
|
||||
HTML;
|
||||
|
||||
echo " (<b>" . count( $selected_users ) . "</b>) $lang[massusers_confirm_1]<br><br>
|
||||
{$lang['user_acc']} <select name=\"editlevel\" class=\"edit\">".get_groups()."</select> {$lang['user_gtlimit']} <input size=\"17\" name=\"time_limit\" id=\"time_limit\" class=\"edit\" value=\"{$row['time_limit']}\"> <img src=\"system/skins/images/img.gif\" align=\"absmiddle\" id=\"t_trigger_ent\" style=\"cursor: pointer; border: 0\" title=\"{$lang['edit_ecal']}\"/><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$lang[hint_glhel]}', this, event, '250px')\">[?]</a>
|
||||
<br><br>
|
||||
<input class=bbcodes type=submit value=\" $lang[mass_yes] \"> <input type=button class=bbcodes value=\" $lang[mass_no] \" onclick=\"javascript:document.location='$PHP_SELF?mod=editusers&action=list'\">
|
||||
<input type=hidden name=action value=\"do_mass_move_to_group\">
|
||||
<input type=hidden name=user_hash value=\"{$dle_login_hash}\">
|
||||
<input type=hidden name=mod value=\"mass_user_actions\">";
|
||||
foreach ( $selected_users as $userid ) {
|
||||
$userid = intval($userid);
|
||||
echo "<input type=hidden name=selected_users[] value=\"$userid\">\n";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="all" href="system/skins/calendar-blue.css" title="win2k-cold-1" />
|
||||
<script type="text/javascript" src="system/skins/calendar.js"></script>
|
||||
<script type="text/javascript" src="system/skins/calendar-en.js"></script>
|
||||
<script type="text/javascript" src="system/skins/calendar-setup.js"></script>
|
||||
<script type="text/javascript">
|
||||
Calendar.setup({
|
||||
inputField : "time_limit", // id of the input field
|
||||
ifFormat : "%Y-%m-%d %H:%M", // format of the input field
|
||||
button : "t_trigger_ent", // trigger for the calendar (button ID)
|
||||
align : "Br", // alignment
|
||||
timeFormat : "24",
|
||||
showsTime : true,
|
||||
singleClick : true
|
||||
});
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
exit();
|
||||
|
||||
} elseif ($_POST['action'] == "do_mass_move_to_group") {
|
||||
|
||||
$editlevel = intval( $_POST['editlevel'] );
|
||||
|
||||
if ($member_id['user_group'] != 1 AND $editlevel < 2 )
|
||||
msg( "error", $lang['mass_error'], $lang['admin_not_access'], "?mod=editusers&action=list" );
|
||||
|
||||
foreach ( $selected_users as $id ) {
|
||||
|
||||
$id = intval( $id );
|
||||
|
||||
$row = $db->super_query( "SELECT user_group FROM " . USERPREFIX . "_users WHERE user_id='$id'" );
|
||||
|
||||
if ($member_id['user_group'] != 1 AND $row['user_group'] == 1 )
|
||||
msg( "error", $lang['mass_error'], $lang['edit_not_admin'], "?mod=editusers&action=list" );
|
||||
|
||||
}
|
||||
|
||||
$cache->clear();
|
||||
msg( "info", $lang['massusers_head_2'], $lang['massusers_groupok']." <b>".$user_group[$editlevel]['group_name']."</b>", "?mod=editusers&action=list" );
|
||||
|
||||
} elseif ($_POST['action'] == "mass_move_to_ban") {
|
||||
|
||||
echoheader( "options", $lang['mass_head'] );
|
||||
|
||||
|
||||
echo <<<HTML
|
||||
<form action="{$PHP_SELF}" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['massusers_head_3']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" height="100" align="center">{$lang['massusers_confirm_5']}
|
||||
HTML;
|
||||
|
||||
echo " (<b>" . count( $selected_users ) . "</b>) $lang[massusers_confirm_1]<br><br>
|
||||
<div style=\"width:350px;\" align=\"left\">{$lang['ban_date']} <input size=\"5\" name=\"banned_date\" class=\"edit\" value=\"0\"><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$lang[hint_bandescr]}', this, event, '250px')\">[?]</a>
|
||||
<br><br>{$lang['ban_descr']}<br><textarea style=\"width:100%; height:80px;\" name=\"banned_descr\"></textarea>
|
||||
<br><br></div>
|
||||
<input class=bbcodes type=submit value=\" $lang[mass_yes] \"> <input type=button class=bbcodes value=\" $lang[mass_no] \" onclick=\"javascript:document.location='$PHP_SELF?mod=editusers&action=list'\">
|
||||
<input type=hidden name=action value=\"do_mass_move_to_ban\">
|
||||
<input type=hidden name=user_hash value=\"{$dle_login_hash}\">
|
||||
<input type=hidden name=mod value=\"mass_user_actions\">";
|
||||
foreach ( $selected_users as $userid ) {
|
||||
$userid = intval($userid);
|
||||
echo "<input type=hidden name=selected_users[] value=\"$userid\">\n";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
exit();
|
||||
|
||||
} elseif ($_POST['action'] == "do_mass_move_to_ban") {
|
||||
|
||||
|
||||
include_once SYSTEM_DIR . '/classes/parse.class.php';
|
||||
$parse = new ParseFilter( );
|
||||
|
||||
foreach ( $selected_users as $id ) {
|
||||
|
||||
$id = intval( $id );
|
||||
|
||||
$row = $db->super_query( "SELECT user_group FROM " . USERPREFIX . "_users WHERE user_id='$id'" );
|
||||
|
||||
if ($member_id['user_group'] != 1 AND $row['user_group'] == 1 )
|
||||
msg( "error", $lang['mass_error'], $lang['edit_not_admin'], "?mod=editusers&action=list" );
|
||||
|
||||
|
||||
$banned_descr = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['banned_descr'] ), false ) );
|
||||
$this_time = time() + ($config['date_adjust'] * 60);
|
||||
$banned_date = intval( $_POST['banned_date'] );
|
||||
$this_time = $banned_date ? $this_time + ($banned_date * 60 * 60 * 24) : 0;
|
||||
|
||||
$row = $db->super_query( "SELECT users_id, days FROM " . USERPREFIX . "_banned WHERE users_id = '$id'" );
|
||||
|
||||
if( ! $row['users_id'] ) $db->query( "INSERT INTO " . USERPREFIX . "_banned (users_id, descr, date, days) values ('$id', '$banned_descr', '$this_time', '$banned_date')" );
|
||||
else {
|
||||
|
||||
if( $row['days'] != $banned_date ) $db->query( "UPDATE " . USERPREFIX . "_banned SET descr='$banned_descr', days='$banned_date', date='$this_time' WHERE users_id = '$id'" );
|
||||
else $db->query( "UPDATE " . USERPREFIX . "_banned set descr='$banned_descr' WHERE users_id = '$id'" );
|
||||
|
||||
}
|
||||
|
||||
$cache->delete('banned.php' );
|
||||
|
||||
$db->query( "UPDATE " . USERPREFIX . "_users SET banned='yes' WHERE user_id ='$id'" );
|
||||
|
||||
|
||||
}
|
||||
|
||||
$cache->clear();
|
||||
msg( "info", $lang['massusers_head_3'], $lang['massusers_banok'], "?mod=editusers&action=list" );
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
msg( "info", $lang['mass_noact'], $lang['mass_noact_1'], "?mod=editusers&action=list" );
|
||||
|
||||
}
|
||||
?>
|
||||
468
system/inc/massactions.php
Normal file
@@ -0,0 +1,468 @@
|
||||
<?PHP
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
|
||||
if( ! $_SESSION['admin_referrer'] ) {
|
||||
|
||||
$_SESSION['admin_referrer'] = "?mod=editnews&action=list";
|
||||
|
||||
}
|
||||
|
||||
if( !$user_group[$member_id['user_group']]['admin_editnews'] OR !$user_group[$member_id['user_group']]['allow_all_edit'] ) {
|
||||
msg( "error", $lang['mass_error'], $lang['mass_ddenied'], $_SESSION['admin_referrer'] );
|
||||
}
|
||||
|
||||
$selected_news = $_REQUEST['selected_news'];
|
||||
|
||||
if( ! $selected_news ) {
|
||||
msg( "error", $lang['mass_error'], $lang['mass_denied'], $_SESSION['admin_referrer'] );
|
||||
}
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
|
||||
|
||||
die( "Hacking attempt! User not found" );
|
||||
|
||||
}
|
||||
|
||||
$action = htmlspecialchars( strip_tags( stripslashes( $_POST['action'] ) ) );
|
||||
|
||||
$k_mass = false;
|
||||
$field = false;
|
||||
|
||||
if( $action == "mass_approve" ) {
|
||||
$field = "approve";
|
||||
$value = 1;
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_edit_app_tl'];
|
||||
$lang['mass_confirm'] = $lang['mass_edit_app_fr1'];
|
||||
} elseif( $action == "mass_date" ) {
|
||||
$field = "date";
|
||||
$value = date( "Y-m-d H:i:s", time() + ($config['date_adjust'] * 60) );
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_edit_date_tl'];
|
||||
$lang['mass_confirm'] = $lang['mass_edit_date_fr1'];
|
||||
} elseif( $action == "mass_not_approve" ) {
|
||||
$field = "approve";
|
||||
$value = 0;
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_edit_app_tl'];
|
||||
$lang['mass_confirm'] = $lang['mass_edit_app_fr2'];
|
||||
} elseif( $action == "mass_fixed" ) {
|
||||
$field = "fixed";
|
||||
$value = 1;
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_edit_fix_tl'];
|
||||
$lang['mass_confirm'] = $lang['mass_edit_fix_fr1'];
|
||||
} elseif( $action == "mass_not_fixed" ) {
|
||||
$field = "fixed";
|
||||
$value = 0;
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_edit_fix_tl'];
|
||||
$lang['mass_confirm'] = $lang['mass_edit_fix_fr2'];
|
||||
} elseif( $action == "mass_comments" ) {
|
||||
$field = "allow_comm";
|
||||
$value = 1;
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_edit_com_tl'];
|
||||
$lang['mass_confirm'] = $lang['mass_edit_comm_fr1'];
|
||||
$lang[mass_confirm_1] = $lang[mass_confirm_2];
|
||||
} elseif( $action == "mass_not_comments" ) {
|
||||
$field = "allow_comm";
|
||||
$value = 0;
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_edit_com_tl'];
|
||||
$lang['mass_confirm'] = $lang['mass_edit_comm_fr2'];
|
||||
$lang[mass_confirm_1] = $lang[mass_confirm_2];
|
||||
} elseif( $action == "mass_rating" ) {
|
||||
$field = "allow_rate";
|
||||
$value = 1;
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_edit_rate_tl'];
|
||||
$lang['mass_confirm'] = $lang['mass_edit_rate_fr1'];
|
||||
$lang[mass_confirm_1] = $lang[mass_confirm_2];
|
||||
} elseif( $action == "mass_not_rating" ) {
|
||||
$field = "allow_rate";
|
||||
$value = 0;
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_edit_rate_tl'];
|
||||
$lang['mass_confirm'] = $lang['mass_edit_rate_fr2'];
|
||||
$lang[mass_confirm_1] = $lang[mass_confirm_2];
|
||||
} elseif( $action == "mass_main" ) {
|
||||
$field = "allow_main";
|
||||
$value = 1;
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_edit_main_tl'];
|
||||
$lang['mass_confirm'] = $lang['mass_edit_main_fr1'];
|
||||
} elseif( $action == "mass_not_main" ) {
|
||||
$field = "allow_main";
|
||||
$value = 0;
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_edit_main_tl'];
|
||||
$lang['mass_confirm'] = $lang['mass_edit_main_fr2'];
|
||||
|
||||
} elseif( $action == "mass_clear_count" ) {
|
||||
$field = "news_read";
|
||||
$value = 0;
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_clear_count_2'];
|
||||
$lang['mass_confirm'] = $lang['mass_clear_count_1'];
|
||||
$lang[mass_confirm_1] = $lang[mass_confirm_2];
|
||||
|
||||
} elseif( $action == "mass_clear_rating" ) {
|
||||
$field = "rating";
|
||||
$value = 0;
|
||||
$k_mass = true;
|
||||
$title = $lang['mass_clear_rating_2'];
|
||||
$lang['mass_confirm'] = $lang['mass_clear_rating_1'];
|
||||
$lang[mass_confirm_1] = $lang[mass_confirm_2];
|
||||
}
|
||||
|
||||
if( $_POST['doaction'] == "mass_update" and $field ) {
|
||||
|
||||
foreach ( $selected_news as $id ) {
|
||||
$id = intval( $id );
|
||||
$db->query( "UPDATE " . PREFIX . "_post SET {$field}='{$value}' WHERE id='{$id}'" );
|
||||
|
||||
if( $field == "approve" ) {
|
||||
|
||||
if( $value ) {
|
||||
|
||||
$db->query( "DELETE FROM " . PREFIX . "_tags WHERE news_id = '{$id}'" );
|
||||
$row = $db->super_query( "SELECT tags FROM " . PREFIX . "_post where id = '{$id}'" );
|
||||
|
||||
if( $row['tags'] ) {
|
||||
|
||||
$tags = array ();
|
||||
|
||||
$row['tags'] = explode( ",", $row['tags'] );
|
||||
|
||||
foreach ( $row['tags'] as $tags_value ) {
|
||||
|
||||
$tags[] = "('" . $id . "', '" . trim( $tags_value ) . "')";
|
||||
}
|
||||
|
||||
$tags = implode( ", ", $tags );
|
||||
$db->query( "INSERT INTO " . PREFIX . "_tags (news_id, tag) VALUES " . $tags );
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$db->query( "DELETE FROM " . PREFIX . "_tags WHERE news_id = '{$id}'" );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( $field == "rating" ) {
|
||||
|
||||
$db->query( "DELETE FROM " . PREFIX . "_rate WHERE type_id = '{$id}' AND type=1" );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$cache->clear();
|
||||
|
||||
msg( "info", $lang['db_ok'], $lang['db_ok_1'], $_SESSION['admin_referrer'] );
|
||||
}
|
||||
|
||||
if( $k_mass ) {
|
||||
|
||||
echoheader( "options", $lang['mass_head'] );
|
||||
|
||||
echo <<<HTML
|
||||
<form action="{$PHP_SELF}" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$title}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" height="100" align="center">{$lang['mass_confirm']}
|
||||
HTML;
|
||||
|
||||
echo " (<b>" . count( $selected_news ) . "</b>) $lang[mass_confirm_1]<br><br>
|
||||
<input class=bbcodes type=submit value=\" $lang[mass_yes] \"> <input type=button class=bbcodes value=\" $lang[mass_no] \" onclick=\"javascript:document.location='$PHP_SELF?mod=editnews&action=list'\">
|
||||
<input type=hidden name=action value=\"{$action}\">
|
||||
<input type=hidden name=user_hash value=\"{$dle_login_hash}\">
|
||||
<input type=hidden name=doaction value=\"mass_update\">
|
||||
<input type=hidden name=mod value=\"massactions\">";
|
||||
foreach ( $selected_news as $newsid ) {
|
||||
$newsid = intval($newsid);
|
||||
echo "<input type=hidden name=selected_news[] value=\"$newsid\">\n";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
exit();
|
||||
|
||||
}
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Ïîäòâðåæäåíèå óäàëåíèÿ
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
if( $action == "mass_delete" ) {
|
||||
|
||||
echoheader( "options", $lang['mass_head'] );
|
||||
|
||||
echo <<<HTML
|
||||
<form action="{$PHP_SELF}" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['mass_head']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" height="100" align="center">{$lang['mass_confirm']}
|
||||
HTML;
|
||||
|
||||
echo "(<b>" . count( $selected_news ) . "</b>) $lang[mass_confirm_1]<br><br>
|
||||
<input class=bbcodes type=submit value=\" $lang[mass_yes] \"> <input type=button class=bbcodes value=\" $lang[mass_no] \" onclick=\"javascript:document.location='$PHP_SELF?mod=editnews&action=list'\">
|
||||
<input type=hidden name=action value=\"do_mass_delete\">
|
||||
<input type=hidden name=user_hash value=\"{$dle_login_hash}\">
|
||||
<input type=hidden name=mod value=\"massactions\">";
|
||||
foreach ( $selected_news as $newsid ) {
|
||||
$newsid = intval($newsid);
|
||||
echo "<input type=hidden name=selected_news[] value=\"$newsid\">\n";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
exit();
|
||||
|
||||
}
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Óäàëåíèå íîâîñòåé
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
elseif( $action == "do_mass_delete" ) {
|
||||
|
||||
$deleted_articles = 0;
|
||||
|
||||
foreach ( $selected_news as $id ) {
|
||||
|
||||
$id = intval( $id );
|
||||
$row = $db->super_query( "SELECT autor FROM " . PREFIX . "_post where id = '$id'" );
|
||||
|
||||
$db->query( "UPDATE " . USERPREFIX . "_users set news_num=news_num-1 where name='{$row['autor']}'" );
|
||||
|
||||
$deleted_articles ++;
|
||||
|
||||
$db->query( "DELETE FROM " . PREFIX . "_post WHERE id='$id'" );
|
||||
|
||||
$db->query( "DELETE FROM " . PREFIX . "_comments WHERE post_id='$id'" );
|
||||
|
||||
$db->query( "SELECT onserver FROM " . PREFIX . "_files WHERE news_id = '$id'" );
|
||||
while ( $row = $db->get_row() ) {
|
||||
@unlink( ROOT_DIR . "/uploads/files/" . $row['onserver'] );
|
||||
}
|
||||
|
||||
$db->query("SELECT id, link, thumb FROM " . PREFIX . "_covers WHERE newsid = '$id'");
|
||||
|
||||
while($row_covers = $db->get_row()){
|
||||
|
||||
@unlink(ROOT_DIR."/uploads".$row_covers['link']);
|
||||
@unlink(ROOT_DIR."/uploads".$row_covers['thumb']);
|
||||
|
||||
}
|
||||
|
||||
$db->query("DELETE FROM " . PREFIX . "_covers WHERE newsid = '$id'");
|
||||
|
||||
$db->query("SELECT id, onserver FROM " . PREFIX . "_torrents WHERE news_id = '$id'");
|
||||
|
||||
while($row_torrents = $db->get_row()){
|
||||
|
||||
@unlink(ROOT_DIR."/uploads/torrents/".$row_torrents['onserver']);
|
||||
|
||||
}
|
||||
|
||||
$db->query( "UPDATE " . PREFIX . "_torrents SET flags=1 where news_id='$id'" );
|
||||
$db->free();
|
||||
|
||||
$db->query( "DELETE FROM " . PREFIX . "_files WHERE news_id = '$id'" );
|
||||
$db->query( "DELETE FROM " . PREFIX . "_poll WHERE news_id = '$id'" );
|
||||
$db->query( "DELETE FROM " . PREFIX . "_poll_log WHERE news_id = '$id'" );
|
||||
$db->query( "DELETE FROM " . PREFIX . "_rate WHERE type_id = '$id' AND type=1" );
|
||||
$db->query( "DELETE FROM " . PREFIX . "_tags WHERE news_id = '$id'" );
|
||||
|
||||
$row = $db->super_query( "SELECT images FROM " . PREFIX . "_images where news_id = '$id'" );
|
||||
|
||||
$listimages = explode( "|||", $row['images'] );
|
||||
|
||||
if( $row['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 = '$id'" );
|
||||
}
|
||||
|
||||
$cache->clear();
|
||||
|
||||
if( count( $selected_news ) == $deleted_articles ) {
|
||||
msg( "info", $lang['mass_head'], $lang['mass_delok'], $_SESSION['admin_referrer'] );
|
||||
} else {
|
||||
msg( "error", $lang['mass_notok'], "$deleted_articles $lang[mass_i] " . count( $selected_news ) . " $lang[mass_notok_1]", $_SESSION['admin_referrer'] );
|
||||
}
|
||||
}
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Ïîäòâåæäåíèå ñìåíû êàòåãîðèé
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
elseif( $action == "mass_move_to_cat" ) {
|
||||
|
||||
echoheader( "options", $lang['mass_cat'] );
|
||||
|
||||
$count = count( $selected_news );
|
||||
if( $config['allow_multi_category'] ) $category_multiple = "class=\"cat_select\" multiple";
|
||||
else $category_multiple = "";
|
||||
|
||||
echo <<<HTML
|
||||
<form action="{$PHP_SELF}" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['mass_cat_1']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" height="100">{$lang['mass_cat_2']} (<b>{$count}</b>) {$lang['mass_cat_3']}
|
||||
<select name="move_to_category[]" align="absmiddle" {$category_multiple}>
|
||||
HTML;
|
||||
|
||||
echo CategoryNewsSelection( 0, 0 );
|
||||
echo "</select>";
|
||||
|
||||
foreach ( $selected_news as $newsid ) {
|
||||
$newsid = intval($newsid);
|
||||
echo "<input type=hidden name=selected_news[] value=\"$newsid\">";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
<input type=hidden name=user_hash value="{$dle_login_hash}"><input type="hidden" name="action" value="do_mass_move_to_cat"><input type="hidden" name="mod" value="massactions"> <input type="submit" value="{$lang['b_start']}" class="buttons"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
exit();
|
||||
}
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
ñìåíà êàòåãîðèè
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
elseif( $action == "do_mass_move_to_cat" ) {
|
||||
|
||||
$moved_articles = 0;
|
||||
|
||||
$move_to_category = $db->safesql( implode( ',', $_REQUEST['move_to_category'] ) );
|
||||
|
||||
foreach ( $selected_news as $id ) {
|
||||
$moved_articles ++;
|
||||
$id = intval( $id );
|
||||
|
||||
$db->query( "UPDATE " . PREFIX . "_post set category='$move_to_category' WHERE id='$id'" );
|
||||
}
|
||||
|
||||
$cache->clear();
|
||||
|
||||
if( count( $selected_news ) == $moved_articles ) {
|
||||
msg( "info", $lang['mass_cat_ok'], "$lang[mass_cat_ok] ($moved_articles)", $_SESSION['admin_referrer'] );
|
||||
} else {
|
||||
msg( "error", $lang['mass_cat_notok'], $lang['mass_cat_notok_1'], $_SESSION['admin_referrer'] );
|
||||
}
|
||||
}
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Íè÷åãî íå âûáðàíî
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
else {
|
||||
|
||||
msg( "info", $lang['mass_noact'], $lang['mass_noact_1'], $_SESSION['admin_referrer'] );
|
||||
|
||||
}
|
||||
?>
|
||||
79
system/inc/newsimg/addimg.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
if( ! defined( 'DATALIFEENGINE' ) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
require_once ROOT_DIR.'/language/'.$config['langs'].'/img.lng';
|
||||
|
||||
#### IMG
|
||||
|
||||
echo "<script language=\"javascript\" type=\"text/javascript\">
|
||||
function ShowOrHideEx(id, show) {
|
||||
var item = null;
|
||||
if (document.getElementById) {
|
||||
item = document.getElementById(id);
|
||||
} else if (document.all) {
|
||||
item = document.all[id];
|
||||
} else if (document.layers){
|
||||
item = document.layers[id];
|
||||
}
|
||||
if (item && item.style) {
|
||||
item.style.display = show ? \"\" : \"none\";
|
||||
}
|
||||
}
|
||||
|
||||
var total_allow_rows = {$config['max_file_count']};
|
||||
|
||||
function AddImages() {
|
||||
var tbl = document.getElementById('tblSample');
|
||||
var lastRow = tbl.rows.length;
|
||||
|
||||
if (total_allow_rows && lastRow == total_allow_rows ) return;
|
||||
|
||||
// if there's no header row in the table, then iteration = lastRow + 1
|
||||
var iteration = lastRow+1;
|
||||
var row = tbl.insertRow(lastRow);
|
||||
|
||||
var cellRight = row.insertCell(0);
|
||||
var el = document.createElement('input');
|
||||
el.setAttribute('type', 'file');
|
||||
el.setAttribute('name', 'addimg_' + iteration);
|
||||
el.setAttribute('size', '41');
|
||||
el.setAttribute('value', iteration);
|
||||
cellRight.appendChild(el);
|
||||
|
||||
document.getElementById('images_number').value = iteration;
|
||||
}
|
||||
|
||||
function RemoveImages() {
|
||||
var tbl = document.getElementById('tblSample');
|
||||
var lastRow = tbl.rows.length;
|
||||
if (lastRow > 1){
|
||||
tbl.deleteRow(lastRow - 1);
|
||||
document.getElementById('images_number').value = document.getElementById('images_number').value - 1;
|
||||
}
|
||||
}
|
||||
</script>";
|
||||
echo <<<HTML
|
||||
<tr><td height="29" style="padding-left:5px;" colspan="2"><div class="hr_line"></div></td></tr>
|
||||
<tr><td height="29" style="padding-left:5px;">{$lang['images_uphard']}</td>
|
||||
<td>
|
||||
<input type="hidden" name="images_number" id="images_number" value="1">
|
||||
<div id="dle_tabView1">
|
||||
<table id="tblSample" class="upload">
|
||||
<tr id="row">
|
||||
<td><input type="file" size="41" name="addimg_1"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div>
|
||||
<input type=button class=buttons value=' - ' style="width:30px;" title='{$lang['images_rem_tl']}' onClick="RemoveImages();return false;">
|
||||
<input type=button class=buttons value=' + ' style="width:30px;" title='{$lang['images_add_tl']}' onClick="AddImages();return false;">
|
||||
</div>
|
||||
|
||||
</td></tr>
|
||||
HTML;
|
||||
|
||||
#### IMG
|
||||
|
||||
?>
|
||||
72
system/inc/newsimg/doaddimg.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
if( ! defined( 'DATALIFEENGINE' ) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
$thumb_size = $config['poster_width'];
|
||||
$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['poster_width'] = $thumb_size;
|
||||
$images_number = intval($_POST['images_number']);
|
||||
for($image_i = 1; $image_i < ($images_number + 1); $image_i ++) {
|
||||
$file_prefix = time() + rand( 1, 100 );
|
||||
$file_prefix .= "_";
|
||||
$image_name = "";
|
||||
$type = "";
|
||||
$current_image = 'addimg_' . $image_i;
|
||||
$image = $_FILES[$current_image]['tmp_name'];
|
||||
$image_name = $_FILES[$current_image]['name'];
|
||||
$image_size = $_FILES[$current_image]['size'];
|
||||
$error_code = $_FILES[$current_image]['error'];
|
||||
if ($error_code !== UPLOAD_ERR_OK) {
|
||||
switch ($error_code) {
|
||||
case UPLOAD_ERR_INI_SIZE:
|
||||
$error_code = 'PHP Error: The uploaded file exceeds the upload_max_filesize directive in php.ini'; break;
|
||||
case UPLOAD_ERR_FORM_SIZE:
|
||||
$error_code = 'PHP Error: The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'; break;
|
||||
case UPLOAD_ERR_PARTIAL:
|
||||
$error_code = 'PHP Error: The uploaded file was only partially uploaded'; break;
|
||||
case UPLOAD_ERR_NO_FILE:
|
||||
$error_code = 'PHP Error: No file was uploaded'; break;
|
||||
case UPLOAD_ERR_NO_TMP_DIR:
|
||||
$error_code = 'PHP Error: Missing a PHP temporary folder'; break;
|
||||
case UPLOAD_ERR_CANT_WRITE:
|
||||
$error_code = 'PHP Error: Failed to write file to disk'; break;
|
||||
case UPLOAD_ERR_EXTENSION:
|
||||
$error_code = 'PHP Error: File upload stopped by extension'; break;
|
||||
default:
|
||||
$error_code = 'Unknown upload error'; break;
|
||||
} }
|
||||
$img_name_arr = explode( ".", $image_name );
|
||||
$type = totranslit( end( $img_name_arr ) );
|
||||
if( strpos ( $type, "php" ) !== false ) die("Hacking attempt!");
|
||||
if( $image_name != "" ) {
|
||||
$curr_key = key( $img_name_arr );
|
||||
unset( $img_name_arr[$curr_key] );
|
||||
$image_name = totranslit( implode( ".", $img_name_arr ) ) . "." . $type;
|
||||
}
|
||||
@move_uploaded_file( $image, ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name );
|
||||
if( @file_exists( ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name ) ) {
|
||||
@chmod( ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name, 0666 );
|
||||
$url = '/covers/' . $file_prefix . $image_name;
|
||||
include_once SYSTEM_DIR . '/classes/thumb.class.php';
|
||||
$thumb = new thumbnail( ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name );
|
||||
if( $thumb->size_auto( $config['poster_width'], 0 ) ) {
|
||||
$thumb->jpeg_quality( $config['jpeg_quality'] );
|
||||
if( $config['allow_watermark'] == "yes" ) $thumb->insert_watermark( $config['max_watermark'] );
|
||||
$thumb->save( ROOT_DIR . "/uploads/covers/thumbs/" . $file_prefix . $image_name );
|
||||
}
|
||||
@chmod( ROOT_DIR . "/uploads/covers/thumbs/" . $file_prefix . $image_name, 0666 );
|
||||
if( @file_exists( ROOT_DIR . "/uploads/covers/thumbs/" . $file_prefix . $image_name ) ) {
|
||||
$th = '/covers/thumbs/' . $file_prefix . $image_name;
|
||||
}
|
||||
if( ($config['allow_watermark'] == "yes" ) or $config['max_up_side'] ) {
|
||||
$thumb = new thumbnail( ROOT_DIR . "/uploads/covers/" . $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( ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name );
|
||||
}}
|
||||
if ($url != '') {$db->query("INSERT INTO ".PREFIX."_covers VALUES ('0', '$row', '$url', '$th')");}
|
||||
}
|
||||
?>
|
||||
73
system/inc/newsimg/doeditimg.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
if( ! defined( 'DATALIFEENGINE' ) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
$thumb_size = $config['poster_width'];
|
||||
$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['poster_width'] = $thumb_size;
|
||||
$images_number = intval($_POST['images_number']);
|
||||
for($image_i = 1; $image_i < ($images_number + 1); $image_i ++) {
|
||||
$file_prefix = time() + rand( 1, 100 );
|
||||
$file_prefix .= "_";
|
||||
$image_name = "";
|
||||
$type = "";
|
||||
$current_image = 'addimg_' . $image_i;
|
||||
$image = $_FILES[$current_image]['tmp_name'];
|
||||
$image_name = $_FILES[$current_image]['name'];
|
||||
$image_size = $_FILES[$current_image]['size'];
|
||||
$error_code = $_FILES[$current_image]['error'];
|
||||
if ($error_code !== UPLOAD_ERR_OK) {
|
||||
switch ($error_code) {
|
||||
case UPLOAD_ERR_INI_SIZE:
|
||||
$error_code = 'PHP Error: The uploaded file exceeds the upload_max_filesize directive in php.ini'; break;
|
||||
case UPLOAD_ERR_FORM_SIZE:
|
||||
$error_code = 'PHP Error: The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'; break;
|
||||
case UPLOAD_ERR_PARTIAL:
|
||||
$error_code = 'PHP Error: The uploaded file was only partially uploaded'; break;
|
||||
case UPLOAD_ERR_NO_FILE:
|
||||
$error_code = 'PHP Error: No file was uploaded'; break;
|
||||
case UPLOAD_ERR_NO_TMP_DIR:
|
||||
$error_code = 'PHP Error: Missing a PHP temporary folder'; break;
|
||||
case UPLOAD_ERR_CANT_WRITE:
|
||||
$error_code = 'PHP Error: Failed to write file to disk'; break;
|
||||
case UPLOAD_ERR_EXTENSION:
|
||||
$error_code = 'PHP Error: File upload stopped by extension'; break;
|
||||
default:
|
||||
$error_code = 'Unknown upload error'; break;
|
||||
} }
|
||||
$img_name_arr = explode( ".", $image_name );
|
||||
$type = totranslit( end( $img_name_arr ) );
|
||||
if( strpos ( $type, "php" ) !== false ) die("Hacking attempt!");
|
||||
if( $image_name != "" ) {
|
||||
$curr_key = key( $img_name_arr );
|
||||
unset( $img_name_arr[$curr_key] );
|
||||
$image_name = totranslit( implode( ".", $img_name_arr ) ) . "." . $type;
|
||||
}
|
||||
@move_uploaded_file( $image, ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name );
|
||||
if( @file_exists( ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name ) ) {
|
||||
@chmod( ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name, 0666 );
|
||||
$url = '/covers/' . $file_prefix . $image_name;
|
||||
include_once SYSTEM_DIR . '/classes/thumb.class.php';
|
||||
$thumb = new thumbnail( ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name );
|
||||
if( $thumb->size_auto( $config['poster_width'], 0 ) ) {
|
||||
$thumb->jpeg_quality( $config['jpeg_quality'] );
|
||||
if( $config['allow_watermark'] == "yes" ) $thumb->insert_watermark( $config['max_watermark'] );
|
||||
$thumb->save( ROOT_DIR . "/uploads/covers/thumbs/" . $file_prefix . $image_name );
|
||||
}
|
||||
@chmod( ROOT_DIR . "/uploads/covers/thumbs/" . $file_prefix . $image_name, 0666 );
|
||||
if( @file_exists( ROOT_DIR . "/uploads/covers/thumbs/" . $file_prefix . $image_name ) ) {$th = '/covers/thumbs/' . $file_prefix . $image_name;}
|
||||
if( ($config['allow_watermark'] == "yes" ) or $config['max_up_side'] ) {
|
||||
$thumb = new thumbnail( ROOT_DIR . "/uploads/covers/" . $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( ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name );
|
||||
}}
|
||||
if ($url != '') {
|
||||
$newsid = $_GET['id'];
|
||||
$db->query("INSERT INTO ".PREFIX."_covers VALUES ('0', '$newsid', '$url', '$th')");
|
||||
}
|
||||
}
|
||||
?>
|
||||
116
system/inc/newsimg/editimg.php
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
if( ! defined( 'DATALIFEENGINE' ) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
|
||||
require_once ROOT_DIR.'/language/'.$config['langs'].'/img.lng';
|
||||
|
||||
#### IMG
|
||||
|
||||
$ms = '';
|
||||
|
||||
echo <<<HTML
|
||||
<tr>
|
||||
<tr><td height="29" style="padding-left:5px;">Çàãðóæåííûå êàðòèíêè</td>
|
||||
<td><table width="100%"><tr><td>
|
||||
HTML;
|
||||
|
||||
$newsimg_query = $db->query("SELECT * FROM ".PREFIX."_covers WHERE newsid='".$_GET['id']."' ORDER BY id DESC");
|
||||
while ($newsimg = $db->get_row($newsimg_query)) {
|
||||
echo <<<HTML
|
||||
<tr>
|
||||
<td height="29" style="width:150px;padding:5px;text-align:left;"><img src="/uploads{$newsimg['thumb']}" width="100px" /></td>
|
||||
<td><a href="/control.php?mod=editnews&action=editnews&id={$_GET['id']}&img={$newsimg['id']}">Óäàëèòü êàðòèíêó</a></td>
|
||||
</tr>
|
||||
HTML;
|
||||
}
|
||||
|
||||
echo '</td></tr></table></td></tr>';
|
||||
|
||||
if ($_GET['img']){
|
||||
$db->query("SELECT link, thumb FROM " . PREFIX . "_covers WHERE id = '".$_GET['img']."'");
|
||||
|
||||
while($row_covers = $db->get_row()){
|
||||
|
||||
@unlink(ROOT_DIR."/uploads".$row_covers['link']);
|
||||
@unlink(ROOT_DIR."/uploads".$row_covers['thumb']);
|
||||
|
||||
}
|
||||
$db->query("DELETE FROM ".PREFIX."_covers WHERE id='".$_GET['img']."'");
|
||||
$ms = "Óäàëåíî";
|
||||
header("Location: /control.php?mod=editnews&action=editnews&id={$_GET['id']}");
|
||||
}
|
||||
|
||||
|
||||
echo "<script language=\"javascript\" type=\"text/javascript\">
|
||||
function ShowOrHideEx(id, show) {
|
||||
var item = null;
|
||||
if (document.getElementById) {
|
||||
item = document.getElementById(id);
|
||||
} else if (document.all) {
|
||||
item = document.all[id];
|
||||
} else if (document.layers){
|
||||
item = document.layers[id];
|
||||
}
|
||||
if (item && item.style) {
|
||||
item.style.display = show ? \"\" : \"none\";
|
||||
}
|
||||
}
|
||||
|
||||
var total_allow_rows = {$config['max_file_count']};
|
||||
|
||||
function AddImages() {
|
||||
var tbl = document.getElementById('tblSample');
|
||||
var lastRow = tbl.rows.length;
|
||||
|
||||
if (total_allow_rows && lastRow == total_allow_rows ) return;
|
||||
|
||||
// if there's no header row in the table, then iteration = lastRow + 1
|
||||
var iteration = lastRow+1;
|
||||
var row = tbl.insertRow(lastRow);
|
||||
|
||||
var cellRight = row.insertCell(0);
|
||||
var el = document.createElement('input');
|
||||
el.setAttribute('type', 'file');
|
||||
el.setAttribute('name', 'addimg_' + iteration);
|
||||
el.setAttribute('size', '41');
|
||||
el.setAttribute('value', iteration);
|
||||
cellRight.appendChild(el);
|
||||
|
||||
document.getElementById('images_number').value = iteration;
|
||||
}
|
||||
|
||||
function RemoveImages() {
|
||||
var tbl = document.getElementById('tblSample');
|
||||
var lastRow = tbl.rows.length;
|
||||
if (lastRow > 1){
|
||||
tbl.deleteRow(lastRow - 1);
|
||||
document.getElementById('images_number').value = document.getElementById('images_number').value - 1;
|
||||
}
|
||||
}
|
||||
</script>";
|
||||
echo <<<HTML
|
||||
<tr><td height="29" style="padding-left:5px;" colspan="2"><div class="hr_line"></div></td></tr>
|
||||
<tr><td height="29" style="padding-left:5px;">{$lang['images_uphard']}</td>
|
||||
<td>
|
||||
<input type="hidden" name="images_number" id="images_number" value="1">
|
||||
<div id="dle_tabView1">
|
||||
<table id="tblSample" class="upload">
|
||||
<tr id="row">
|
||||
<td><input type="file" size="41" name="addimg_1"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div>
|
||||
<input type=button class=buttons value=' - ' style="width:30px;" title='{$lang['images_rem_tl']}' onClick="RemoveImages();return false;">
|
||||
<input type=button class=buttons value=' + ' style="width:30px;" title='{$lang['images_add_tl']}' onClick="AddImages();return false;">
|
||||
</div>
|
||||
|
||||
</td></tr>
|
||||
HTML;
|
||||
|
||||
#### IMG
|
||||
|
||||
|
||||
?>
|
||||
509
system/inc/newsletter.php
Normal file
@@ -0,0 +1,509 @@
|
||||
<?php
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
if( $member_id['user_group'] != 1 ) {
|
||||
msg( "error", $lang['addnews_denied'], $lang['db_denied'] );
|
||||
}
|
||||
|
||||
if (isset ($_REQUEST['empfanger'])) $empfanger = intval($_REQUEST['empfanger']); else $empfanger = "";
|
||||
if (isset ($_REQUEST['editor'])) $editor = $_REQUEST['editor']; else $editor = "";
|
||||
if (isset ($_REQUEST['type'])) $type = $_REQUEST['type']; else $type = "";
|
||||
if (isset ($_REQUEST['action'])) $action = $_REQUEST['action']; else $action = "";
|
||||
if (isset ($_REQUEST['a_mail'])) $a_mail = intval($_REQUEST['a_mail']); else $a_mail = "";
|
||||
|
||||
|
||||
if ($action=="send") {
|
||||
|
||||
include_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
|
||||
$parse = new ParseFilter(Array(), Array(), 1, 1);
|
||||
|
||||
$title = strip_tags(stripslashes($parse->process($_POST['title'])));
|
||||
$message = stripslashes($parse->process($_POST['message']));
|
||||
$start_from = intval($_GET['start_from']);
|
||||
$limit = intval($_GET['limit']);
|
||||
$interval = intval($_GET['interval']) * 1000;
|
||||
|
||||
if ($limit < 1) {
|
||||
|
||||
$limit = 20;
|
||||
|
||||
}
|
||||
|
||||
$message = $parse->BB_Parse($message, false);
|
||||
|
||||
$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 = "";
|
||||
|
||||
$row = $db->super_query("SELECT COUNT(*) as count FROM " . USERPREFIX . "_users".$where);
|
||||
|
||||
if ($start_from > $row['count'] OR $start_from < 0) $start_from = 0;
|
||||
|
||||
if ($type == "email")
|
||||
$type_send = $lang['bb_b_mail'];
|
||||
else
|
||||
$type_send = $lang['nl_pm'];
|
||||
|
||||
echo <<<HTML
|
||||
<html>
|
||||
<head>
|
||||
<meta content="text/html; charset={$config['charset']}" http-equiv="content-type" />
|
||||
<title>{$lang['nl_seng']}</title>
|
||||
<style type="text/css">
|
||||
html,body{
|
||||
height:100%;
|
||||
margin:0px;
|
||||
padding: 0px;
|
||||
background: #F4F3EE;
|
||||
}
|
||||
|
||||
form {
|
||||
margin:0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
table{
|
||||
border:0px;
|
||||
border-collapse:collapse;
|
||||
}
|
||||
|
||||
table td{
|
||||
padding:0px;
|
||||
font-size: 11px;
|
||||
font-family: verdana;
|
||||
}
|
||||
|
||||
a:active,
|
||||
a:visited,
|
||||
a:link {
|
||||
color: #4b719e;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #4b719e;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.navigation {
|
||||
color: #999898;
|
||||
font-size: 11px;
|
||||
font-family: tahoma;
|
||||
}
|
||||
.unterline {
|
||||
background: url(system/skins/images/line_bg.gif);
|
||||
width: 100%;
|
||||
height: 9px;
|
||||
font-size: 3px;
|
||||
font-family: tahoma;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.hr_line {
|
||||
background: url(system/skins/images/line.gif);
|
||||
width: 100%;
|
||||
height: 7px;
|
||||
font-size: 3px;
|
||||
font-family: tahoma;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.edit {
|
||||
border:1px solid #9E9E9E;
|
||||
color: #000000;
|
||||
font-size: 11px;
|
||||
font-family: Verdana; BACKGROUND-COLOR: #ffffff
|
||||
}
|
||||
.buttons {
|
||||
background: #FFF;
|
||||
border: 1px solid #9E9E9E;
|
||||
color: #666666;
|
||||
font-family: Verdana, Tahoma, helvetica, sans-serif;
|
||||
padding: 0px;
|
||||
vertical-align: absmiddle;
|
||||
font-size: 11px;
|
||||
height: 21px;
|
||||
}
|
||||
select, option {
|
||||
color: #000000;
|
||||
font-size: 11px;
|
||||
font-family: Verdana;
|
||||
background-color: #ffffff
|
||||
}
|
||||
|
||||
textarea {
|
||||
border: #9E9E9E 1px solid;
|
||||
color: #000000;
|
||||
font-size: 11px;
|
||||
font-family: Verdana;
|
||||
background-color: #ffffff
|
||||
}
|
||||
#hintbox{ /*CSS for pop up hint box */
|
||||
position:absolute;
|
||||
top: 0;
|
||||
background-color: lightyellow;
|
||||
width: 150px; /*Default width of hint.*/
|
||||
padding: 3px;
|
||||
border:1px solid #787878;
|
||||
font:normal 11px Verdana;
|
||||
line-height:18px;
|
||||
z-index:100;
|
||||
border-right: 2px solid #787878;
|
||||
border-bottom: 2px solid #787878;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.hintanchor{
|
||||
padding-left: 8px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="system/js/jquery.js"></script>
|
||||
<script type="text/javascript" src="system/js/jqueryui.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script language="javascript" type="text/javascript">
|
||||
var total = {$row['count']};
|
||||
$(function() {
|
||||
$("#status").ajaxError(function(event, request, settings){
|
||||
$(this).html('{$lang['nl_error']}');
|
||||
$('#button').attr("disabled", false);
|
||||
});
|
||||
$( "#progressbar" ).progressbar({
|
||||
value: 0
|
||||
});
|
||||
$('#button').click(function() {
|
||||
$('#status').html('{$lang['nl_sinfo']}');
|
||||
$('#button').attr("disabled", "disabled");
|
||||
$('#button').val("{$lang['send_forw']}");
|
||||
senden( $('#sendet_ok').val() );
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function senden( startfrom ){
|
||||
|
||||
var title = $('#title').html();
|
||||
var message = $('#message').html();
|
||||
|
||||
$.post("system/ajax/newsletter.php", { startfrom: startfrom, title: title, message: message, type: '{$type}', empfanger: '{$empfanger}', a_mail: '{$a_mail}', limit: '{$limit}' },
|
||||
function(data){
|
||||
if (data) {
|
||||
if (data.status == "ok") {
|
||||
$('#gesendet').html(data.count);
|
||||
$('#sendet_ok').val(data.count);
|
||||
var proc = Math.round( (100 * data.count) / total );
|
||||
if ( proc > 100 ) proc = 100;
|
||||
$('#progressbar').progressbar( "option", "value", proc );
|
||||
if (data.count >= total)
|
||||
{
|
||||
$('#status').html('{$lang['nl_finish']}');
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout("senden(" + data.count + ")", {$interval} );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}, "json");
|
||||
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<table align="center" width="97%">
|
||||
<tr>
|
||||
<td width="4" height="16"><img src="system/skins/images/tb_left.gif" width="4" height="16" border="0" /></td>
|
||||
<td background="system/skins/images/tb_top.gif"><img src="system/skins/images/tb_top.gif" width="1" height="16" border="0" /></td>
|
||||
<td width="4"><img src="system/skins/images/tb_right.gif" width="3" height="16" border="0" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="4" background="system/skins/images/tb_lt.gif"><img src="system/skins/images/tb_lt.gif" width="4" height="1" border="0" /></td>
|
||||
<td valign="top" style="padding:8px;" bgcolor="#FFFFFF">
|
||||
HTML;
|
||||
|
||||
echo <<<HTML
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['nl_seng']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="100" style="padding:4px;">{$lang['nl_empf']}</td>
|
||||
<td>{$row['count']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;">{$lang['nl_type']}</td>
|
||||
<td>{$type_send}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td><div id="progressbar"></div>{$lang['nl_sendet']} <span style="color:red;" id='gesendet'>{$start_from}</span> {$lang['mass_i']} <span style="color:blue;">{$row['count']}</span> {$lang['nl_status']} <span id="status"></span><br /><br /><input id="button" type="button" value="{$lang['nl_start']}" class="edit" style="width:190px;"><input type="hidden" id="sendet_ok" name="sendet_ok" value="{$start_from}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="navigation">{$lang['nl_info']}</td>
|
||||
</tr>
|
||||
</table>
|
||||
HTML;
|
||||
|
||||
$message = stripslashes($message);
|
||||
|
||||
echo <<<HTML
|
||||
</td>
|
||||
<td width="4" background="system/skins/images/tb_rt.gif"><img src="system/skins/images/tb_rt.gif" width="4" height="1" border="0" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="16" background="system/skins/images/tb_lb.gif"></td>
|
||||
<td background="system/skins/images/tb_tb.gif"></td>
|
||||
<td background="system/skins/images/tb_rb.gif"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<pre style="display:none;" id="title">{$title}</pre>
|
||||
<pre style="display:none;" id="message">{$message}</pre>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
HTML;
|
||||
|
||||
}
|
||||
elseif ($action=="preview")
|
||||
{
|
||||
include_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
|
||||
$parse = new ParseFilter(Array(), Array(), 1, 1);
|
||||
|
||||
$title = strip_tags(stripslashes($parse->process($_POST['title'])));
|
||||
$message = stripslashes($parse->process($_POST['message']));
|
||||
|
||||
$message = $parse->BB_Parse($message, false);
|
||||
|
||||
echo <<<HTML
|
||||
<html><title>{$title}</title>
|
||||
<meta content="text/html; charset={$config['charset']}" http-equiv=Content-Type>
|
||||
<style type="text/css">
|
||||
html,body{
|
||||
height:100%;
|
||||
margin:0px;
|
||||
padding: 0px;
|
||||
font-size: 11px;
|
||||
font-family: verdana;
|
||||
}
|
||||
|
||||
table{
|
||||
border:0px;
|
||||
border-collapse:collapse;
|
||||
}
|
||||
|
||||
table td{
|
||||
padding:0px;
|
||||
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>
|
||||
HTML;
|
||||
|
||||
echo "<fieldset style=\"border-style:solid; border-width:1; border-color:black;\"><legend> <span style=\"font-size: 10px; font-family: Verdana\">{$title}</span> </legend>{$message}</fieldset>";
|
||||
|
||||
|
||||
}
|
||||
elseif ($action=="message") {
|
||||
echoheader("newsletter", "");
|
||||
|
||||
|
||||
echo "
|
||||
<SCRIPT LANGUAGE=\"JavaScript\">
|
||||
function send(){";
|
||||
|
||||
echo "if(document.addnews.message.value == '' || document.addnews.title.value == ''){ alert('$lang[vote_alert]'); }
|
||||
else{
|
||||
dd=window.open('','snd','height=210,width=480,resizable=1,scrollbars=1')
|
||||
document.addnews.action.value='send';document.addnews.target='snd'
|
||||
document.addnews.submit();dd.focus()
|
||||
}
|
||||
}
|
||||
</SCRIPT>";
|
||||
|
||||
echo "
|
||||
<SCRIPT LANGUAGE=\"JavaScript\">
|
||||
function preview(){";
|
||||
|
||||
echo "if(document.addnews.message.value == '' || document.addnews.title.value == ''){ alert('$lang[vote_alert]'); }
|
||||
else{
|
||||
dd=window.open('','prv','height=300,width=600,resizable=1,scrollbars=1')
|
||||
document.addnews.action.value='preview';document.addnews.target='prv'
|
||||
document.addnews.submit();dd.focus()
|
||||
setTimeout(\"document.addnews.action.value='send';document.addnews.target='_self'\",500)
|
||||
}
|
||||
}
|
||||
</SCRIPT>";
|
||||
|
||||
echo <<<HTML
|
||||
<script type="text/javascript" src="system/ajax/dle_ajax.js"></script>
|
||||
<div id='loading-layer' style='display:none;font-family: Verdana;font-size: 11px;width:200px;height:50px;background:#FFF;padding:10px;text-align:center;border:1px solid #000'><div style='font-weight:bold' id='loading-layer-text'>{$lang['ajax_info']}</div><br /><img src='system/ajax/loading.gif' border='0' /></div>
|
||||
<form method="POST" name="addnews" id="addnews" action="">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['nl_main']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="150" style="padding:6px;">{$lang['edit_title']}</td>
|
||||
<td><input class="edit" type="text" size="55" name="title"></td>
|
||||
</tr>
|
||||
HTML;
|
||||
|
||||
include(SYSTEM_DIR.'/inc/include/inserttag.php');
|
||||
|
||||
echo <<<HTML
|
||||
<tr>
|
||||
<td width="140" height="29" style="padding-left:5px;">{$lang['nl_message']}</td>
|
||||
<td>
|
||||
<table width="100%"><tr><td>{$bb_code}
|
||||
<textarea rows=17 style="width:98%;" onclick=setFieldName(this.name) name="message" id="message"></textarea><br><br>{$lang['nl_info_1']} <b>{$lang['nl_info_2']}</b><script type=text/javascript>var selField = "message";</script></td>
|
||||
</tr></table>
|
||||
</td></tr>
|
||||
HTML;
|
||||
|
||||
$start_from = intval($_GET['start_from']);
|
||||
|
||||
echo <<<HTML
|
||||
<tr>
|
||||
<td style="padding:6px;"> </td>
|
||||
<td><input type="hidden" name="mod" value="newsletter">
|
||||
<input type="hidden" name="action" value="send">
|
||||
<input type="hidden" name="empfanger" value="{$empfanger}">
|
||||
<input type="hidden" name="type" value="{$type}">
|
||||
<input type="hidden" name="a_mail" value="{$a_mail}">
|
||||
<input type="hidden" name="editor" value="{$editor}">
|
||||
<input type="hidden" name="start_from" value="{$start_from}">
|
||||
<br /><input type="button" onClick="send(); return false;" class="buttons" value="{$lang['btn_send']}" style="width:100px;">
|
||||
<input onClick="preview()" type="button" class="buttons" value="{$lang['btn_preview']}" style="width:100px;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
}
|
||||
else {
|
||||
|
||||
echoheader("newsletter", "");
|
||||
$group_list = get_groups ();
|
||||
|
||||
echo <<<HTML
|
||||
<form method="GET" action="">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['nl_main']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="220" style="padding:6px;">{$lang['nl_empf']}</td>
|
||||
<td><select name="empfanger">
|
||||
<option value="all">{$lang['edit_all']}</option>
|
||||
{$group_list}
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:6px;">{$lang['nl_type']}</td>
|
||||
<td><select name="type">
|
||||
<option value="email">{$lang['bb_b_mail']}</option>
|
||||
<option value="pm">{$lang['nl_pm']}</option></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:6px;">{$lang['nl_startfrom']}</td>
|
||||
<td><input class="edit" type="text" size="10" name="start_from" value="0"> {$lang['nl_user']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:6px;">{$lang['nl_n_mail']}</td>
|
||||
<td><input class="edit" type="text" size="10" name="limit" value="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:6px;">{$lang['nl_interval']}</td>
|
||||
<td><input class="edit" type="text" size="10" name="interval" value="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:6px;">{$lang['nl_amail']}</td>
|
||||
<td><input type="checkbox" name="a_mail" value="1"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:6px;"> </td>
|
||||
<td><input type="hidden" name="mod" value="newsletter"><input type="hidden" name="action" value="message"><input type="submit" class="buttons" value="{$lang['edit_next']}" style="width:100px;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
echofooter();
|
||||
}
|
||||
?>
|
||||
705
system/inc/options.php
Normal file
@@ -0,0 +1,705 @@
|
||||
<?PHP
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
|
||||
if( isset( $_REQUEST['subaction'] ) ) $subaction = $_REQUEST['subaction']; else $subaction = "";
|
||||
if( isset( $_REQUEST['do_template'] ) ) $do_template = $_REQUEST['do_template']; else $do_template = "";
|
||||
|
||||
if( $action == "options" or $action == '' ) {
|
||||
echoheader( "options", $lang['opt_head'] );
|
||||
|
||||
$options = array ();
|
||||
|
||||
$options['config'] = array (
|
||||
|
||||
array (
|
||||
'name' => $lang['opt_all'],
|
||||
'url' => "$PHP_SELF?mod=options&action=syscon",
|
||||
'descr' => $lang['opt_allc'],
|
||||
'image' => "tools.png",
|
||||
'access' => "admin"
|
||||
),
|
||||
array (
|
||||
'name' => $lang['opt_cat'],
|
||||
'url' => "$PHP_SELF?mod=categories",
|
||||
'descr' => $lang['opt_catc'],
|
||||
'image' => "cats.png",
|
||||
'access' => $user_group[$member_id['user_group']]['admin_categories']
|
||||
)
|
||||
);
|
||||
|
||||
$options['user'] = array (
|
||||
|
||||
array (
|
||||
'name' => $lang['opt_user'],
|
||||
'url' => "$PHP_SELF?mod=editusers&action=list",
|
||||
'descr' => $lang['opt_userc'],
|
||||
'image' => "uset.png",
|
||||
'access' => $user_group[$member_id['user_group']]['admin_editusers']
|
||||
),
|
||||
|
||||
array (
|
||||
'name' => $lang['opt_group'],
|
||||
'url' => "$PHP_SELF?mod=usergroup",
|
||||
'descr' => $lang['opt_groupc'],
|
||||
'image' => "usersgroup.png",
|
||||
'access' => "admin"
|
||||
)
|
||||
);
|
||||
|
||||
$options['filter'] = array (
|
||||
|
||||
array (
|
||||
'name' => $lang['opt_fil'],
|
||||
'url' => "$PHP_SELF?mod=wordfilter",
|
||||
'descr' => $lang['opt_filc'],
|
||||
'image' => "fset.png",
|
||||
'access' => $user_group[$member_id['user_group']]['admin_wordfilter']
|
||||
),
|
||||
|
||||
array (
|
||||
'name' => $lang['opt_ipban'],
|
||||
'url' => "$PHP_SELF?mod=blockip",
|
||||
'descr' => $lang['opt_ipbanc'],
|
||||
'image' => "blockip.png",
|
||||
'access' => $user_group[$member_id['user_group']]['admin_blockip']
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
$options['others'] = array (
|
||||
|
||||
array (
|
||||
'name' => $lang['opt_email'],
|
||||
'url' => "$PHP_SELF?mod=email",
|
||||
'descr' => $lang['opt_emailc'],
|
||||
'image' => "mset.png",
|
||||
'access' => "admin"
|
||||
),
|
||||
|
||||
array (
|
||||
'name' => $lang['opt_static'],
|
||||
'url' => "$PHP_SELF?mod=static",
|
||||
'descr' => $lang['opt_staticd'],
|
||||
'image' => "spset.png",
|
||||
'access' => $user_group[$member_id['user_group']]['admin_static']
|
||||
),
|
||||
|
||||
array (
|
||||
'name' => $lang['opt_clean'],
|
||||
'url' => "$PHP_SELF?mod=clean",
|
||||
'descr' => $lang['opt_cleanc'],
|
||||
'image' => "clean.png",
|
||||
'access' => "admin"
|
||||
),
|
||||
|
||||
array (
|
||||
'name' => $lang['main_newsl'],
|
||||
'url' => "$PHP_SELF?mod=newsletter",
|
||||
'descr' => $lang['main_newslc'],
|
||||
'image' => "nset.png",
|
||||
'access' => "admin"
|
||||
),
|
||||
|
||||
array (
|
||||
'name' => $lang['opt_img'],
|
||||
'url' => "$PHP_SELF?mod=files",
|
||||
'descr' => $lang['opt_imgc'],
|
||||
'image' => "iset.png",
|
||||
'access' => "admin"
|
||||
),
|
||||
|
||||
array (
|
||||
'name' => 'Ñòîë çàêàçîâ',
|
||||
'url' => "$PHP_SELF?mod=table",
|
||||
'descr' => 'Îáñëóæèâàíèå ñòîëà çàêàçîâ',
|
||||
'image' => "fset.png",
|
||||
'access' => $user_group[$member_id['user_group']]['admin_table']
|
||||
),
|
||||
|
||||
array (
|
||||
'name' => $lang['opt_google'],
|
||||
'url' => "$PHP_SELF?mod=googlemap",
|
||||
'descr' => $lang['opt_googlec'],
|
||||
'image' => "googlemap.png",
|
||||
'access' => $user_group[$member_id['user_group']]['admin_googlemap']
|
||||
),
|
||||
array(
|
||||
'name' => "Mini Chat",
|
||||
'url' => "$PHP_SELF?mod=chat",
|
||||
'descr' => "Óïðàâëåíèå ÷àòîì",
|
||||
'image' => "mchat.png",
|
||||
'access' => "admin"
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => "Ðåïóòàöèÿ",
|
||||
'url' => "$PHP_SELF?mod=repa",
|
||||
'descr' => "Ðåïóòàöèÿ ïîëüçîâàòåëåé",
|
||||
'image' => "rep.png",
|
||||
'access' => "admin"
|
||||
),
|
||||
array(
|
||||
'name' => "Forum",
|
||||
'url' => "$PHP_SELF?mod=forum",
|
||||
'descr' => "Óïðàâëåíèå ôîðóìîì è åãî ñîîáùåíèÿìè",
|
||||
'image' => "dle_forum.PNG",
|
||||
'access' => "admin",
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------
|
||||
// Cut the options for wich we don't have access
|
||||
//------------------------------------------------
|
||||
foreach ( $options as $sub_options => $value ) {
|
||||
$count_options = count( $value );
|
||||
|
||||
for($i = 0; $i < $count_options; $i ++) {
|
||||
|
||||
if ($member_id['user_group'] == 1 ) continue;
|
||||
|
||||
if ($member_id['user_group'] != 1 AND $value[$i]['access'] == "admin") unset( $options[$sub_options][$i] );
|
||||
|
||||
if ( !$value[$i]['access'] ) unset( $options[$sub_options][$i] );
|
||||
}
|
||||
}
|
||||
|
||||
$subs = 0;
|
||||
|
||||
foreach ( $options as $sub_options ) {
|
||||
|
||||
if( $subs == 1 ) $lang['opt_hopt'] = $lang['opt_s_acc'];
|
||||
if( $subs == 2 ) $lang['opt_hopt'] = $lang['opt_s_tem'];
|
||||
if( $subs == 3 ) $lang['opt_hopt'] = $lang['opt_s_fil'];
|
||||
if( $subs == 4 ) $lang['opt_hopt'] = $lang['opt_s_oth'];
|
||||
|
||||
$subs ++;
|
||||
|
||||
if( ! count( $sub_options ) ) continue;
|
||||
|
||||
echo <<<HTML
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_hopt']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%"><tr>
|
||||
HTML;
|
||||
|
||||
$i = 0;
|
||||
|
||||
foreach ( $sub_options as $option ) {
|
||||
|
||||
if( $i > 1 ) {
|
||||
echo "</tr><tr>";
|
||||
$i = 0;
|
||||
}
|
||||
|
||||
$i ++;
|
||||
|
||||
echo <<<HTML
|
||||
<td width="50%">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="70" height="70" valign="middle" align="center" style="padding-top:5px;padding-bottom:5px;"><img src="system/skins/images/{$option['image']}" border="0"></td>
|
||||
<td valign="middle"><div class="quick"><a href="{$option['url']}"><h3>{$option['name']}</h3>{$option['descr']}</a></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</tr></table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
echofooter();
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Ã<>à ñòðîéêè ñêðèïòÃ
|
||||
// ********************************************************************************
|
||||
elseif( $action == "syscon" ) {
|
||||
|
||||
if( $member_id['user_group'] != 1 ) {
|
||||
msg( "error", $lang['opt_denied'], $lang['opt_denied'] );
|
||||
}
|
||||
|
||||
include_once SYSTEM_DIR . '/classes/parse.class.php';
|
||||
$parse = new ParseFilter( Array (), Array (), 1, 1 );
|
||||
|
||||
$config['offline_reason'] = str_replace( '"', '"', $config['offline_reason'] );
|
||||
|
||||
$config['offline_reason'] = $parse->decodeBBCodes( $config['offline_reason'], false );
|
||||
if( $auto_detect_config ) $config['http_home_url'] = "";
|
||||
|
||||
echoheader( "options", $lang['opt_all'] );
|
||||
|
||||
if( ! $handle = opendir( "./templates" ) ) {
|
||||
die( "Ã<EFBFBD>åâîçìîæÃî îòêðûòü äèðåêòîðèþ ./templates" );
|
||||
}
|
||||
while ( false !== ($file = readdir( $handle )) ) {
|
||||
if( is_dir( ROOT_DIR . "/templates/$file" ) and ($file != "." and $file != "..") ) {
|
||||
$sys_con_skins_arr[$file] = $file;
|
||||
}
|
||||
}
|
||||
closedir( $handle );
|
||||
|
||||
if( ! $handle = opendir( "./language" ) ) {
|
||||
die( "Ã<EFBFBD>åâîçìîæÃî îòêðûòü äèðåêòîðèþ ./data/language/" );
|
||||
}
|
||||
while ( false !== ($file = readdir( $handle )) ) {
|
||||
if( is_dir( ROOT_DIR . "/language/$file" ) and ($file != "." and $file != "..") ) {
|
||||
$sys_con_langs_arr[$file] = $file;
|
||||
}
|
||||
}
|
||||
closedir( $handle );
|
||||
|
||||
foreach ( $user_group as $group )
|
||||
$sys_group_arr[$group['id']] = $group['group_name'];
|
||||
|
||||
echo <<<HTML
|
||||
<script language='JavaScript' type="text/javascript">
|
||||
|
||||
function ChangeOption(selectedOption) {
|
||||
|
||||
document.getElementById('general').style.display = "none";
|
||||
document.getElementById('security').style.display = "none";
|
||||
document.getElementById('news').style.display = "none";
|
||||
document.getElementById('comments').style.display = "none";
|
||||
document.getElementById('optimisation').style.display = "none";
|
||||
document.getElementById('files').style.display = "none";
|
||||
document.getElementById('mail').style.display = "none";
|
||||
document.getElementById('users').style.display = "none";
|
||||
document.getElementById('imagesconf').style.display = "none";
|
||||
document.getElementById('rss').style.display = "none";
|
||||
document.getElementById('smartphone').style.display = "none";
|
||||
|
||||
if(selectedOption == 'general') {document.getElementById('general').style.display = "";}
|
||||
if(selectedOption == 'security') {document.getElementById('security').style.display = "";}
|
||||
if(selectedOption == 'news') {document.getElementById('news').style.display = "";}
|
||||
if(selectedOption == 'comments') {document.getElementById('comments').style.display = "";}
|
||||
if(selectedOption == 'optimisation') {document.getElementById('optimisation').style.display = "";}
|
||||
if(selectedOption == 'files') {document.getElementById('files').style.display = "";}
|
||||
if(selectedOption == 'mail') {document.getElementById('mail').style.display = "";}
|
||||
if(selectedOption == 'users') {document.getElementById('users').style.display = "";}
|
||||
if(selectedOption == 'imagesconf') {document.getElementById('imagesconf').style.display = "";}
|
||||
if(selectedOption == 'smartphone') {document.getElementById('smartphone').style.display = "";}
|
||||
if(selectedOption == 'rss') {document.getElementById('rss').style.display = "";}
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_general_sys']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">
|
||||
<table style="text-align:center;" width="100%" height="35px">
|
||||
<tr style="vertical-align:middle;" >
|
||||
<td class=tableborder><a href="javascript:ChangeOption('general');"><img title="$lang[opt_allsys]" src="system/skins/images/general.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('security');"><img title="$lang[opt_secrsys]" src="system/skins/images/sred.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('news');"><img title="$lang[opt_newssys]" src="system/skins/images/news.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('comments');"><img title="$lang[opt_commsys]" src="system/skins/images/comments.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('optimisation');"><img title="$lang[opt_dbsys]" src="system/skins/images/db_opt.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('files');"><img title="$lang[opt_filesys]" src="system/skins/images/folder.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('mail');"><img title="$lang[opt_sys_mail]" src="system/skins/images/email.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('users');"><img title="$lang[opt_usersys]" src="system/skins/images/users.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('imagesconf');"><img title="$lang[opt_imagesys]" src="system/skins/images/conf_images.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('smartphone');"><img title="$lang[opt_smartphone]" src="system/skins/images/smartphone.jpg" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('rss');"><img title="$lang[opt_rsssys]" src="system/skins/images/rss.gif" border="0"></a>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
echo <<<HTML
|
||||
<form action="" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
HTML;
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='' id="general"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_sys_all']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
|
||||
showRow( $lang['opt_sys_ht'], $lang['opt_sys_htd'], "<input class=edit type=text style=\"text-align: center;\" name=\"save_con[home_title]\" value=\"{$config['home_title']}\" size=40>" );
|
||||
showRow( $lang['opt_sys_hu'], $lang['opt_sys_hud'], "<input class=edit type=text style=\"text-align: center;\" name=\"save_con[http_home_url]\" value=\"{$config['http_home_url']}\" size=40>" );
|
||||
|
||||
showRow( $lang['opt_sys_chars'], $lang['opt_sys_charsd'], "<input class=edit type=text style=\"text-align: center;\" name=\"save_con[charset]\" value=\"{$config['charset']}\" size=30>" );
|
||||
|
||||
showRow( $lang['opt_sys_descr'], $lang['opt_sys_descrd'], "<input class=edit type=text name=\"save_con[description]\" value=\"{$config['description']}\" size=40>" );
|
||||
showRow( $lang['opt_sys_key'], $lang['opt_sys_keyd'], "<textarea class=edit style=\"width:250px;height:50px;\" name=\"save_con[keywords]\">{$config['keywords']}</textarea>" );
|
||||
showRow( $lang['opt_sys_short_name'], $lang['opt_sys_short_named'], "<input class=edit type=text style=\"text-align: center;\" name=\"save_con[short_title]\" value=\"{$config['short_title']}\" size=40>" );
|
||||
|
||||
showRow( $lang['opt_sys_at'], $lang['opt_sys_atd']." ".date ( "d.m.Y, H:i", time () + ($config['date_adjust'] * 60) ), "<input class=edit type=text style=\"text-align: center;\" name=\"save_con[date_adjust]\" value=\"{$config['date_adjust']}\" size=10>" );
|
||||
|
||||
showRow( $lang['opt_sys_dc'], $lang['opt_sys_dcd'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_alt_url]", "{$config['allow_alt_url']}" ) );
|
||||
|
||||
showRow( $lang['opt_sys_al'], $lang['opt_sys_ald'], makeDropDown( $sys_con_langs_arr, "save_con[langs]", "{$config['langs']}" ) );
|
||||
showRow( $lang['opt_sys_as'], $lang['opt_sys_asd'], makeDropDown( $sys_con_skins_arr, "save_con[skin]", "{$config['skin']}" ) );
|
||||
|
||||
showRow( $lang['opt_sys_ag'], $lang['opt_sys_agd'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_gzip]", "{$config['allow_gzip']}" ) );
|
||||
showRow( $lang['opt_sys_cac'], $lang['opt_sys_cad'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_cache]", "{$config['allow_cache']}" ) );
|
||||
showRow( "Òèï êåøèðîâàíèÿ", "Files - áîëåå ìåäëåííîå êåøèðîâàíèå â ôàéëû, MemCache - Êåøèðîâàíèå â îïåðàòèâíóþ ïàìÿòü", makeDropDown( array ("0" => "Files", "1" => "Memcache" ), "save_con[cache_type]", "{$config['cache_type']}" ) );
|
||||
|
||||
showRow( $lang['opt_sys_offline'], $lang['opt_sys_offlined'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[site_offline]", "{$config['site_offline']}" ) );
|
||||
showRow( $lang['opt_sys_reason'], $lang['opt_sys_reasond'], "<textarea class=edit style=\"width:350px;height:100px;\" name=\"save_con[offline_reason]\">{$config['offline_reason']}</textarea>" );
|
||||
|
||||
echo "</table></td></tr>";
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='display:none' id="security"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_secrsys']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
|
||||
showRow( $lang['opt_sys_path'], $lang['opt_sys_pathd'], "<input class=edit type=text style=\"text-align: center;\" name=\"save_con[admin_path]\" value=\"{$config['admin_path']}\" size=20>" );
|
||||
|
||||
showRow( $lang['opt_sys_ip'], $lang['opt_sys_ipd'], makeDropDown( array ("0" => $lang['opt_sys_ipn'], "1" => $lang['opt_sys_ipm'], "2" => $lang['opt_sys_iph'] ), "save_con[ip_control]", "{$config['ip_control']}" ) );
|
||||
|
||||
showRow( $lang['opt_sys_loghash'], $lang['opt_sys_loghashd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[log_hash]", "{$config['log_hash']}" ) );
|
||||
|
||||
echo "</table></td></tr>";
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='display:none' id="news"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_newssys']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
|
||||
showRow( $lang['opt_sys_newc'], $lang['opt_sys_newd'], "<input class=edit type=text style=\"text-align: center;\" name=\"save_con[news_number]\" value=\"{$config['news_number']}\" size=10>" );
|
||||
showRow( "Êîëè÷åñòâî êðàòêèõ íîâîñòåé", "Êîëè÷åòñòâî íîâîñòåé ïðîñìàòðèâàåìûå êðàòêèì ïðîñìîòðîì", "<input class=edit type=text style=\"text-align: center;\" name=\"save_con[newslist_num]\" value=\"{$config['newslist_num']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_related_num'], $lang['opt_sys_related_numd'], "<input class=edit type=text style=\"text-align: center;\" name=\"save_con[related_number]\" value=\"{$config['related_number']}\" size=10>" );
|
||||
showRow( 'Êîëè÷åñòâî òîððåíòîâ ñïèñêîì', 'Îòîáðàæàåìîå êîëè÷åòñòâî èíôîðìàöèè ïî òîððåíò ôàéëàì', "<input class=edit type=text style=\"text-align: center;\" name=\"save_con[torrent_number]\" value=\"{$config['torrent_number']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_am'], $lang['opt_sys_amd'], "<input class=edit type=text style=\"text-align: center;\" name=\"save_con[smilies]\" value=\"{$config['smilies']}\" size=40>" );
|
||||
showRow( $lang['opt_sys_an'], "<a onClick=\"javascript:Help('date')\" class=main href=\"#\">$lang[opt_sys_and]</a>", "<input class=edit type=text style=\"text-align: center;\" name=\"save_con[timestamp_active]\" value=\"{$config['timestamp_active']}\" size=40>" );
|
||||
showRow( $lang['opt_sys_sort'], $lang['opt_sys_sortd'], makeDropDown( array ("date" => $lang['opt_sys_sdate'], "rating" => $lang['opt_sys_srate'], "news_read" => $lang['opt_sys_sview'], "title" => $lang['opt_sys_salph'] ), "save_con[news_sort]", "{$config['news_sort']}" ) );
|
||||
showRow( $lang['opt_sys_msort'], $lang['opt_sys_msortd'], makeDropDown( array ("DESC" => $lang['opt_sys_mminus'], "ASC" => $lang['opt_sys_mplus'] ), "save_con[news_msort]", "{$config['news_msort']}" ) );
|
||||
showRow( $lang['opt_sys_catsort'], $lang['opt_sys_catsortd'], makeDropDown( array ("date" => $lang['opt_sys_sdate'], "rating" => $lang['opt_sys_srate'], "news_read" => $lang['opt_sys_sview'], "title" => $lang['opt_sys_salph'] ), "save_con[catalog_sort]", "{$config['catalog_sort']}" ) );
|
||||
showRow( $lang['opt_sys_catmsort'], $lang['opt_sys_catmsortd'], makeDropDown( array ("DESC" => $lang['opt_sys_mminus'], "ASC" => $lang['opt_sys_mplus'] ), "save_con[catalog_msort]", "{$config['catalog_msort']}" ) );
|
||||
showRow( $lang['opt_sys_align'], $lang['opt_sys_alignd'], makeDropDown( array ("" => $lang['opt_sys_none'], "left" => $lang['opt_sys_left'], "center" => $lang['opt_sys_center'], "right" => $lang['opt_sys_right'] ), "save_con[image_align]", "{$config['image_align']}" ) );
|
||||
|
||||
showRow( $lang['opt_sys_adt'], $lang['opt_sys_adtd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[allow_add_tags]", "{$config['allow_add_tags']}" ) );
|
||||
|
||||
echo "</table></td></tr>";
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='display:none' id="comments"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_sys_cch']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
showRow( $lang['opt_sys_alc'], $lang['opt_sys_alcd'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_comments]", "{$config['allow_comments']}" ) );
|
||||
showRow( $lang['opt_sys_maxc'], $lang['opt_sys_maxcd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[comments_maxlen]' value=\"{$config['comments_maxlen']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_cpm'], $lang['opt_sys_cpmd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[comm_nummers]' value=\"{$config['comm_nummers']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_csort'], $lang['opt_sys_csortd'], makeDropDown( array ("DESC" => $lang['opt_sys_mminus'], "ASC" => $lang['opt_sys_mplus'] ), "save_con[comm_msort]", "{$config['comm_msort']}" ) );
|
||||
showRow( $lang['opt_sys_aw'], $lang['opt_sys_awd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[auto_wrap]' value=\"{$config['auto_wrap']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_ct'], "<a onClick=\"javascript:Help('date')\" class=main href=\"#\">$lang[opt_sys_and]</a>", "<input class=edit type=text style=\"text-align: center;\" name='save_con[timestamp_comment]' value=\"{$config['timestamp_comment']}\" size=40>" );
|
||||
echo "</table></td></tr>";
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='display:none' id="optimisation"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_sys_dch']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
|
||||
showRow( $lang['opt_sys_search'], $lang['opt_sys_searchd'], makeDropDown( array ("1" => $lang['opt_sys_advance'], "0" => $lang['opt_sys_simple'] ), "save_con[full_search]", "{$config['full_search']}" ) );
|
||||
showRow( $lang['opt_sys_multiple'], $lang['opt_sys_multipled'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[allow_multi_category]", "{$config['allow_multi_category']}" ) );
|
||||
showRow( $lang['opt_sys_nodate'], $lang['opt_sys_nodated'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[no_date]", "{$config['no_date']}" ) );
|
||||
showRow( $lang['opt_sys_ajax'], $lang['opt_sys_ajaxd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[ajax]", "{$config['ajax']}" ) );
|
||||
|
||||
echo "</table></td></tr>";
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='display:none' id="files"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_filesys']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
|
||||
showRow( $lang['opt_sys_file'], $lang['opt_sys_filed'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[files_allow]", "{$config['files_allow']}" ) );
|
||||
showRow( $lang['opt_sys_file1'], $lang['opt_sys_file1d'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[files_type]' value=\"{$config['files_type']}\" size=40>" );
|
||||
|
||||
showRow( $lang['opt_sys_maxfile'], $lang['opt_sys_maxfiled'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[max_file_size]' value=\"{$config['max_file_size']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_maxfilec'], $lang['opt_sys_maxfilecd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[max_file_count]' value=\"{$config['max_file_count']}\" size=10>" );
|
||||
|
||||
showRow( $lang['opt_sys_file4'], $lang['opt_sys_file4d'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[files_force]", "{$config['files_force']}" ) );
|
||||
showRow( $lang['opt_sys_file5'], $lang['opt_sys_file5d'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[files_max_speed]' value=\"{$config['files_max_speed']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_file2'], $lang['opt_sys_file2d'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[files_count]", "{$config['files_count']}" ) );
|
||||
|
||||
echo "</table></td></tr>";
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='display:none' id="mail"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_sys_mail']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
showRow( $lang['opt_sys_amail'], $lang['opt_sys_amaild'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[admin_mail]' value='{$config['admin_mail']}' size=30>" );
|
||||
|
||||
showRow( $lang['opt_sys_mm'], $lang['opt_sys_mmd'], makeDropDown( array ("php" => "PHP Mail()", "smtp" => "SMTP" ), "save_con[mail_metod]", "{$config['mail_metod']}" ) );
|
||||
|
||||
showRow( $lang['opt_sys_smtph'], $lang['opt_sys_smtphd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[smtp_host]' value=\"{$config['smtp_host']}\" size=30>" );
|
||||
showRow( $lang['opt_sys_smtpp'], $lang['opt_sys_smtppd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[smtp_port]' value=\"{$config['smtp_port']}\" size=30>" );
|
||||
showRow( $lang['opt_sys_smtup'], $lang['opt_sys_smtpud'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[smtp_user]' value=\"{$config['smtp_user']}\" size=30>" );
|
||||
showRow( $lang['opt_sys_smtupp'], $lang['opt_sys_smtpupd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[smtp_pass]' value=\"{$config['smtp_pass']}\" size=30>" );
|
||||
|
||||
showRow( $lang['opt_sys_mbcc'], $lang['opt_sys_mbccd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[mail_bcc]", "{$config['mail_bcc']}" ) );
|
||||
|
||||
echo "</table></td></tr>";
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='display:none' id="users"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_sys_uch']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
showRow( $lang['opt_sys_reggroup'], $lang['opt_sys_reggroupd'], makeDropDown( $sys_group_arr, "save_con[reg_group]", $config['reg_group'] ) );
|
||||
|
||||
showRow( $lang['opt_sys_ut'], $lang['opt_sys_utd'], makeDropDown( array ("0" => $lang['opt_sys_reg'], "1" => $lang['opt_sys_reg_1'] ), "save_con[registration_type]", "{$config['registration_type']}" ) );
|
||||
|
||||
showRow( $lang['opt_sys_code'], $lang['opt_sys_coded'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_sec_code]", "{$config['allow_sec_code']}" ) );
|
||||
showRow( $lang['opt_sys_sc'], $lang['opt_sys_scd'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_skin_change]", "{$config['allow_skin_change']}" ) );
|
||||
showRow( $lang['opt_sys_pmail'], $lang['opt_sys_pmaild'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[mail_pm]", "{$config['mail_pm']}" ) );
|
||||
showRow( "Îíëàéí íà ïîëüçîâàòåëÿ", "Êîëè÷åñòâî ìèíóò êîòîðûå ïîëüçîâàòåëü ñ÷èòàåòñÿ îíëàéí", "<input class=edit type=text style=\"text-align: center;\" name='save_con[user_online]' value=\"{$config['user_online']}\" size=10>" );
|
||||
|
||||
echo "</table></td></tr>";
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='display:none' id="imagesconf"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_sys_ich']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
|
||||
showRow( $lang['opt_sys_maxside'], $lang['opt_sys_maxsided'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[max_up_side]' value=\"{$config['max_up_side']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_maxsize'], $lang['opt_sys_maxsized'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[max_up_size]' value=\"{$config['max_up_size']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_dim'], $lang['opt_sys_dimd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[max_image_days]' value=\"{$config['max_image_days']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_iw'], $lang['opt_sys_iwd'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_watermark]", "{$config['allow_watermark']}" ) );
|
||||
showRow( $lang['opt_sys_im'], $lang['opt_sys_imd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[max_watermark]' value=\"{$config['max_watermark']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_ia'], $lang['opt_sys_iad'], "1-<input class=\"edit bk\" type=text style=\"text-align: center;\" name='save_con[max_image_1]' value=\"{$config['max_image_1']}\" size=10> 2-<input class=\"edit bk\" type=text style=\"text-align: center;\" name='save_con[max_image_2]' value=\"{$config['max_image_2']}\" size=10> 3-<input class=\"edit bk\" type=text style=\"text-align: center;\" name='save_con[max_image_3]' value=\"{$config['max_image_3']}\" size=10>" );
|
||||
showRow( "Ôîòîãðàôèÿ ïðîôèëÿ", "1 - Ðàçìåð áîëüøîé ôîòîãðàôèè 2 - Óìåíüøåííàÿ êîïèÿ", "1-<input class=\"edit bk\" type=text style=\"text-align: center;\" name='save_con[sauto]' value=\"{$config['sauto']}\" size=10> 2-<input class=\"edit bk\" type=text style=\"text-align: center;\" name='save_con[sauto1]' value=\"{$config['sauto1']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_ij'], $lang['opt_sys_ijd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[jpeg_quality]' value=\"{$config['jpeg_quality']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_imw'], $lang['opt_sys_imwd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[tag_img_width]' value=\"{$config['tag_img_width']}\" size=10>" );
|
||||
showRow( "Øèðèíà îáëîæêè", "Ìàêñèìàëüíàÿ øèðèíà îáëîæêè, ïðè åå äîñòèæåíèè áîëüøîå èçîáðàæåíèå áóäåò óìåíüøåíî äî òåêóùåé øèðèíû.", "<input class=edit type=text style=\"text-align: center;\" name='save_con[poster_width]' value=\"{$config['poster_width']}\" size=10>" );
|
||||
showRow( "Ðàçìåð àâàòîê", "Ìàêñèìàëüíî äîïóñòèìûé ê çàãðóçêå ðàçìåð àâàòàðîê", "<input class=edit type=text style=\"text-align: center;\" name='save_con[max_ava_size]' value=\"{$config['max_ava_size']}\" size=10>" );
|
||||
echo "</table></td></tr>";
|
||||
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='display:none' id="smartphone"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_smartphone']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
|
||||
showRow( $lang['opt_sys_sm_im'], $lang['opt_sys_sm_imd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[allow_smart_images]", "{$config['allow_smart_images']}" ) );
|
||||
showRow( $lang['opt_sys_sm_iv'], $lang['opt_sys_sm_ivd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[allow_smart_video]", "{$config['allow_smart_video']}" ) );
|
||||
showRow( $lang['opt_sys_sm_fm'], $lang['opt_sys_sm_fmd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[allow_smart_format]", "{$config['allow_smart_format']}" ) );
|
||||
|
||||
echo "</table></td></tr>";
|
||||
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='display:none' id="rss"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_rsssys']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
|
||||
showRow( $lang['opt_sys_arss'], $lang['opt_sys_arssd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[allow_rss]", "{$config['allow_rss']}" ) );
|
||||
showRow( $lang['opt_sys_trss'], $lang['opt_sys_trssd'], makeDropDown( array ("0" => $lang['opt_sys_rss_type_0'], "1" => $lang['opt_sys_rss_type_1'] ), "save_con[rss_mtype]", "{$config['rss_mtype']}" ) );
|
||||
showRow( $lang['opt_sys_nrss'], $lang['opt_sys_nrssd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[rss_number]' value=\"{$config['rss_number']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_crss'], $lang['opt_sys_crssd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[rss_comm_number]' value=\"{$config['rss_comm_number']}\" size=10>" );
|
||||
showRow( $lang['opt_sys_frss'], $lang['opt_sys_frssd'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[rss_tor_number]' value=\"{$config['rss_tor_number']}\" size=10>" );
|
||||
|
||||
echo "</table></td></tr>";
|
||||
|
||||
echo <<<HTML
|
||||
<tr>
|
||||
<td style="padding-top:10px; padding-bottom:10px;padding-right:10px;"><input type=hidden name=mod value=options>
|
||||
<input type=hidden name=action value=dosavesyscon><input type="hidden" name="user_hash" value="$dle_login_hash" /><input type="submit" class="buttons" value="{$lang['user_save']}"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
} // ********************************************************************************
|
||||
// Çà ïèñü Ãà ñòðîåê
|
||||
// ********************************************************************************
|
||||
elseif( $action == "dosavesyscon" ) {
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" ); }
|
||||
|
||||
if( $member_id['user_group'] != 1 ) {msg( "error", $lang['opt_denied'], $lang['opt_denied'] );}
|
||||
|
||||
$save_con = $_POST['save_con'];
|
||||
|
||||
include_once SYSTEM_DIR . '/classes/parse.class.php';
|
||||
$parse = new ParseFilter( Array (), Array (), 1, 1 );
|
||||
|
||||
$save_con['offline_reason'] = $parse->process( stripslashes( trim( $save_con['offline_reason'] ) ) );
|
||||
$save_con['offline_reason'] = str_replace( '"', '"', $parse->BB_Parse( $save_con['offline_reason'], false ) );
|
||||
|
||||
$find[] = "'\r'";
|
||||
$replace[] = "";
|
||||
$find[] = "'\n'";
|
||||
$replace[] = "";
|
||||
|
||||
if( $auto_detect_config ) $config['http_home_url'] = "";
|
||||
|
||||
$save_con = $save_con + $config;
|
||||
|
||||
if( $member_id['user_group'] != 1 ) {
|
||||
msg( "error", $lang['opt_denied'], $lang['opt_denied'] );
|
||||
}
|
||||
|
||||
$handler = fopen( SYSTEM_DIR . '/data/config.php', "w" );
|
||||
|
||||
fwrite( $handler, "<?PHP \n\n//System Configurations\n\n\$config = array (\n\n" );
|
||||
foreach ( $save_con as $name => $value ) {
|
||||
|
||||
if( $name != "offline_reason" ) {
|
||||
|
||||
$value = trim( stripslashes( $value ) );
|
||||
$value = htmlspecialchars( $value);
|
||||
$value = preg_replace( $find, $replace, $value );
|
||||
|
||||
$name = trim( stripslashes( $name ) );
|
||||
$name = htmlspecialchars( $name, ENT_QUOTES );
|
||||
$name = preg_replace( $find, $replace, $name );
|
||||
}
|
||||
|
||||
$value = str_replace( "$", "$", $value );
|
||||
$value = str_replace( "{", "{", $value );
|
||||
$value = str_replace( "}", "}", $value );
|
||||
|
||||
$name = str_replace( "$", "$", $name );
|
||||
$name = str_replace( "{", "{", $name );
|
||||
$name = str_replace( "}", "}", $name );
|
||||
|
||||
fwrite( $handler, "'{$name}' => \"{$value}\",\n\n" );
|
||||
|
||||
}
|
||||
fwrite( $handler, ");\n\n?>" );
|
||||
fclose( $handler );
|
||||
|
||||
$cache->clear();
|
||||
msg( "info", $lang['opt_sysok'], "$lang[opt_sysok_1]<br /><br /><a href=$PHP_SELF?mod=options&action=syscon>$lang[db_prev]</a>" );
|
||||
}
|
||||
|
||||
?>
|
||||
243
system/inc/preview.php
Normal file
@@ -0,0 +1,243 @@
|
||||
<?php
|
||||
if( !defined( 'DATALIFEENGINE' ) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
|
||||
require_once ROOT_DIR.'/system/classes/templates.class.php';
|
||||
|
||||
$tpl = new dle_template;
|
||||
$tpl->allow_php_include = false;
|
||||
$dle_module = "main";
|
||||
|
||||
if ($_POST['preview_mode'] == "static" AND $_POST['skin_name'])
|
||||
{
|
||||
if (@is_dir(ROOT_DIR.'/templates/'.$_POST['skin_name']))
|
||||
{
|
||||
$config['skin'] = $_POST['skin_name'];
|
||||
}
|
||||
}
|
||||
|
||||
$tpl->dir = ROOT_DIR.'/templates/'.$config['skin'];
|
||||
$tpl->load_template('preview.css');
|
||||
|
||||
echo <<<HTML
|
||||
<html><title>Ïðåäâàðèòåëüíûé ïðîñìîòð</title>
|
||||
<meta content="text/html; charset={$config['charset']}" http-equiv=Content-Type>
|
||||
<style type="text/css">
|
||||
{$tpl->copy_template}
|
||||
</style>
|
||||
<body>
|
||||
<script type="text/javascript" src="{$config['http_home_url']}system/classes/highslide/highslide.js"></script>
|
||||
<script type="text/javascript">
|
||||
hs.graphicsDir = '{$config['http_home_url']}system/classes/highslide/graphics/';
|
||||
hs.outlineType = 'rounded-white';
|
||||
hs.numberOfImagesToPreload = 0;
|
||||
hs.showCredits = false;
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
$tpl->clear();
|
||||
|
||||
echo <<<HTML
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
function ShowBild(sPicURL) {
|
||||
window.open('{$config['http_home_url']}system/modules/imagepreview.php?image='+sPicURL, '', 'resizable=1,HEIGHT=200,WIDTH=200, scrollbars=yes');
|
||||
};
|
||||
|
||||
function ShowOrHide(d1) {
|
||||
if (d1 != '') DoDiv(d1);
|
||||
};
|
||||
|
||||
function DoDiv(id) {
|
||||
var item = null;
|
||||
if (document.getElementById) {
|
||||
item = document.getElementById(id);
|
||||
} else if (document.all){
|
||||
item = document.all[id];
|
||||
} else if (document.layers){
|
||||
item = document.layers[id];
|
||||
}
|
||||
if (!item) {
|
||||
}
|
||||
else if (item.style) {
|
||||
if (item.style.display == "none"){ item.style.display = ""; }
|
||||
else {item.style.display = "none"; }
|
||||
}else{ item.visibility = "show"; }
|
||||
};
|
||||
//-->
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
include_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
|
||||
$parse = new ParseFilter(Array(), Array(), 1, 1);
|
||||
|
||||
|
||||
if ($_POST['preview_mode'] == "static" ) {
|
||||
|
||||
$allow_br = intval( $_POST['allow_br'] );
|
||||
if ($member_id['user_group'] != 1 AND $allow_br > 1 ) $allow_br = 1;
|
||||
|
||||
if ($allow_br == 2) {
|
||||
|
||||
if( function_exists( "get_magic_quotes_gpc" ) && get_magic_quotes_gpc() ) $_POST['template'] = stripslashes( $_POST['template'] );
|
||||
|
||||
$template = trim( addslashes( $_POST['template'] ) );
|
||||
|
||||
} else {
|
||||
|
||||
$template = $parse->process( $_POST['template'] );
|
||||
|
||||
$template = $parse->BB_Parse( $template );
|
||||
|
||||
}
|
||||
|
||||
$descr = trim(htmlspecialchars(stripslashes($_POST['description'])));
|
||||
|
||||
$dle_module = "static";
|
||||
|
||||
$tpl->load_template('static.tpl');
|
||||
|
||||
$tpl->set('{static}', stripslashes( $template ) );
|
||||
$tpl->set('{description}', $descr);
|
||||
$tpl->set('{views}', "0");
|
||||
$tpl->set('{pages}', "");
|
||||
$tpl->set('{date}', "--");
|
||||
$tpl->copy_template = preg_replace ( "#\{date=(.+?)\}#ie", "", $tpl->copy_template );
|
||||
|
||||
$tpl->copy_template = "<fieldset style=\"border-style:solid; border-width:1; border-color:black;\"><legend> <span style=\"font-size: 10px; font-family: Verdana\">{$lang['preview_static']}</span> </legend>".$tpl->copy_template."</fieldset>";
|
||||
$tpl->compile('template');
|
||||
$tpl->result['template'] = preg_replace( "'\[hide\](.*?)\[/hide\]'si", "\\1", $tpl->result['template']);
|
||||
$tpl->result['template'] = str_replace ( '{THEME}', $config['http_home_url'] . 'templates/' . $config['skin'], $tpl->result['template'] );
|
||||
|
||||
echo $tpl->result['template'];
|
||||
|
||||
} else {
|
||||
|
||||
$title = stripslashes($parse->process($_POST['title']));
|
||||
|
||||
$full_story = $parse->process($_POST['full_story']);
|
||||
$short_story = $parse->process($_POST['short_story']);
|
||||
|
||||
$full_story = $parse->BB_Parse($full_story, false);
|
||||
$short_story = $parse->BB_Parse($short_story, false);
|
||||
|
||||
if (!count($category)) { $my_cat = "---"; $my_cat_link = "---";} else {
|
||||
|
||||
$my_cat = array (); $my_cat_link = array ();
|
||||
|
||||
foreach ($category as $element) {
|
||||
if ($element) { $my_cat[] = $cat[$element];
|
||||
$my_cat_link[] = "<a href=\"#\">{$cat[$element]}</a>";
|
||||
}
|
||||
}
|
||||
$my_cat = stripslashes(implode (', ', $my_cat));
|
||||
$my_cat_link = stripslashes(implode (', ', $my_cat_link));
|
||||
}
|
||||
|
||||
$dle_module = "main";
|
||||
$tpl->load_template('shortstory.tpl');
|
||||
|
||||
if ( $parse->not_allowed_text ) $tpl->copy_template = $lang['news_err_39'];
|
||||
|
||||
$tpl->set('{title}', $title);
|
||||
$tpl->set('{views}', 0);
|
||||
$date = time();
|
||||
$tpl->set( '{date}', langdate( $config['timestamp_active'], $date ) );
|
||||
$tpl->copy_template = preg_replace ( "#\{date=(.+?)\}#ie", "langdate('\\1', '{$date}')", $tpl->copy_template );
|
||||
$tpl->set('[link]',"<a href=#>");
|
||||
$tpl->set('[/link]',"</a>");
|
||||
$tpl->set('{comments-num}', 0);
|
||||
$tpl->set('[full-link]', "<a href=#>");
|
||||
$tpl->set('[/full-link]', "</a>");
|
||||
$tpl->set('[day-news]', "<a href=#>");
|
||||
$tpl->set('[/day-news]', "</a>");
|
||||
$tpl->set('[com-link]', "<a href=#>");
|
||||
$tpl->set('[/com-link]', "</a>");
|
||||
$tpl->set('{rating}', "");
|
||||
$tpl->set('{approve}', "");
|
||||
$tpl->set('{author}', "--");
|
||||
$tpl->set('{category}', $my_cat);
|
||||
$tpl->set('{favorites}', '');
|
||||
$tpl->set('{link-category}', $my_cat_link);
|
||||
$tpl->set_block("'\\[tags\\](.*?)\\[/tags\\]'si","");
|
||||
$tpl->set('{tags}', "");
|
||||
$tpl->copy_template = preg_replace ( "#\{date=(.+?)\}#ie", "", $tpl->copy_template );
|
||||
|
||||
$tpl->set('[mail]',"");
|
||||
$tpl->set('[/mail]',"");
|
||||
$tpl->set('{news-id}', "ID Unknown");
|
||||
$tpl->set('{php-self}', $PHP_SELF);
|
||||
|
||||
$tpl->copy_template = preg_replace( "#\\[category=(.+?)\\](.*?)\\[/category\\]#is","\\2", $tpl->copy_template);
|
||||
|
||||
$tpl->set_block("'\\[edit\\].*?\\[/edit\\]'si","");
|
||||
|
||||
$tpl->set('{short-story}', stripslashes($short_story));
|
||||
$tpl->set('{full-story}', stripslashes($full_story));
|
||||
|
||||
|
||||
$tpl->copy_template = "<fieldset style=\"border-style:solid; border-width:1; border-color:black;\"><legend> <span style=\"font-size: 10px; font-family: Verdana\">{$lang['preview_short']}</span> </legend>".$tpl->copy_template."</fieldset>";
|
||||
$tpl->compile('shortstory');
|
||||
|
||||
$tpl->result['shortstory'] = preg_replace( "'\[hide\](.*?)\[/hide\]'si", "\\1", $tpl->result['shortstory']);
|
||||
$tpl->result['shortstory'] = str_replace ( '{THEME}', $config['http_home_url'] . 'templates/' . $config['skin'], $tpl->result['shortstory'] );
|
||||
|
||||
echo $tpl->result['shortstory'];
|
||||
|
||||
$dle_module = "showfull";
|
||||
$tpl->load_template('fullstory.tpl');
|
||||
|
||||
if ( $parse->not_allowed_text ) $tpl->copy_template = $lang['news_err_39'];
|
||||
|
||||
if( strlen( $full_story ) < 13 AND strpos( $tpl->copy_template, "{short-story}" ) === false ) { $full_story = $short_story; }
|
||||
|
||||
$tpl->set('{title}', $title);
|
||||
$tpl->set('{views}', 0);
|
||||
$tpl->set( '{date}', langdate( $config['timestamp_active'], $date ) );
|
||||
$tpl->copy_template = preg_replace ( "#\{date=(.+?)\}#ie", "langdate('\\1', '{$date}')", $tpl->copy_template );
|
||||
$tpl->set('[link]',"<a href=#>");
|
||||
$tpl->set('[/link]',"</a>");
|
||||
$tpl->set('{comments-num}', 0);
|
||||
$tpl->set('[full-link]', "<a href=#>");
|
||||
$tpl->set('[/full-link]', "</a>");
|
||||
$tpl->set('[com-link]', "<a href=#>");
|
||||
$tpl->set('[/com-link]', "</a>");
|
||||
$tpl->set('[day-news]', "<a href=#>");
|
||||
$tpl->set('[/day-news]', "</a>");
|
||||
$tpl->set('{rating}', "");
|
||||
$tpl->set('{author}', "--");
|
||||
$tpl->copy_template = preg_replace ( "#\{date=(.+?)\}#ie", "", $tpl->copy_template );
|
||||
$tpl->set('{category}', $my_cat);
|
||||
$tpl->set('{link-category}', $my_cat_link);
|
||||
$tpl->set('{related-news}', "");
|
||||
|
||||
$tpl->set('{pages}', '');
|
||||
$tpl->set('{favorites}', '');
|
||||
$tpl->set('[mail]',"");
|
||||
$tpl->set('[/mail]',"");
|
||||
$tpl->set('{poll}', '');
|
||||
$tpl->set('{news-id}', "ID Unknown");
|
||||
$tpl->set('{php-self}', $PHP_SELF);
|
||||
|
||||
$tpl->copy_template = preg_replace( "#\\[category=(.+?)\\](.*?)\\[/category\\]#is","\\2", $tpl->copy_template);
|
||||
|
||||
$tpl->set_block("'\\[edit\\].*?\\[/edit\\]'si","");
|
||||
$tpl->set_block("'\\[tags\\](.*?)\\[/tags\\]'si","");
|
||||
$tpl->set('{tags}', "");
|
||||
|
||||
$tpl->set('{short-story}', stripslashes($short_story));
|
||||
$tpl->set('{full-story}', stripslashes($full_story));
|
||||
|
||||
$tpl->copy_template = "<fieldset style=\"border-style:solid; border-width:1; border-color:black;\"><legend> <span style=\"font-size: 10px; font-family: Verdana\">{$lang['preview_full']}</span> </legend>".$tpl->copy_template."</fieldset>";
|
||||
$tpl->compile('fullstory');
|
||||
$tpl->result['fullstory'] = preg_replace( "'\[hide\](.*?)\[/hide\]'si", "\\1", $tpl->result['fullstory']);
|
||||
$tpl->result['fullstory'] = str_replace ( '{THEME}', $config['http_home_url'] . 'templates/' . $config['skin'], $tpl->result['fullstory'] );
|
||||
|
||||
echo $tpl->result['fullstory'];
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</body></html>
|
||||
439
system/inc/rebuild.php
Normal file
@@ -0,0 +1,439 @@
|
||||
<?php
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {die("Hacking attempt!");}
|
||||
if($member_id['user_group'] != 1){ msg("error", $lang['addnews_denied'], $lang['db_denied']); }
|
||||
|
||||
|
||||
|
||||
echoheader("", "");
|
||||
|
||||
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post" );
|
||||
echo <<<HTML
|
||||
<form action="" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_srebuild']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;height:0px;"><div id="progressbar"></div>{$lang['stat_allnews']} {$row['count']}, {$lang['rebuild_count']} <font color="red"><span id="newscount">0</span></font> <span id="progress"></span></td>
|
||||
</tr>
|
||||
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" colspan="2"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"><input type="submit" id="button" class="btn btn-primary" value="{$lang['rebuild_start']}" style="width:190px;"><input type="hidden" id="rebuild_ok" name="rebuild_ok" value="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
var total = {$row['count']};
|
||||
|
||||
$(function() {
|
||||
|
||||
$( "#progressbar" ).progressbar({
|
||||
value: 0
|
||||
});
|
||||
|
||||
$('#button').click(function() {
|
||||
|
||||
$("#progress").ajaxError(function(event, request, settings){
|
||||
$(this).html('{$lang['nl_error']}');
|
||||
$('#button').attr("disabled", false);
|
||||
});
|
||||
|
||||
$('#progress').html('{$lang['rebuild_status']}');
|
||||
$('#button').attr("disabled", "disabled");
|
||||
$('#button').val("{$lang['rebuild_forw']}");
|
||||
senden( $('#rebuild_ok').val() );
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function senden( startfrom ){
|
||||
|
||||
$.post("system/ajax/rebuild.php?user_hash={$dle_login_hash}", { startfrom: startfrom },
|
||||
function(data){
|
||||
|
||||
if (data) {
|
||||
|
||||
if (data.status == "ok") {
|
||||
|
||||
$('#newscount').html(data.rebuildcount);
|
||||
$('#rebuild_ok').val(data.rebuildcount);
|
||||
|
||||
var proc = Math.round( (100 * data.rebuildcount) / total );
|
||||
|
||||
if ( proc > 100 ) proc = 100;
|
||||
|
||||
$('#progressbar').progressbar( "option", "value", proc );
|
||||
|
||||
if (data.rebuildcount >= total)
|
||||
{
|
||||
$('#progress').html('{$lang['rebuild_status_ok']}');
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout("senden(" + data.rebuildcount + ")", 5000 );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}, "json");
|
||||
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
|
||||
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_static" );
|
||||
echo <<<HTML
|
||||
<form action="" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_statrebuild']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;height:0px;"><div id="progressbar2"></div>{$lang['stat_allstaic']} {$row['count']}, {$lang['rebuild_count']} <font color="red"><span id="statcount">0</span></font> <span id="statprogress"></span></td>
|
||||
</tr>
|
||||
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" colspan="2"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"><input type="submit" id="button2" class="btn btn-primary" value="{$lang['rebuild_start']}" style="width:190px;"><input type="hidden" id="rebuild_ok2" name="rebuild_ok2" value="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
var total2 = {$row['count']};
|
||||
|
||||
$(function() {
|
||||
|
||||
$( "#progressbar2" ).progressbar({
|
||||
value: 0
|
||||
});
|
||||
|
||||
$('#button2').click(function() {
|
||||
|
||||
$("#statprogress").ajaxError(function(event, request, settings){
|
||||
$(this).html('{$lang['nl_error']}');
|
||||
$('#button2').attr("disabled", false);
|
||||
});
|
||||
|
||||
|
||||
$('#statprogress').html('{$lang['rebuild_status']}');
|
||||
$('#button2').attr("disabled", "disabled");
|
||||
$('#button2').val("{$lang['rebuild_forw']}");
|
||||
senden_stat( $('#rebuild_ok2').val() );
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function senden_stat( startfrom ){
|
||||
|
||||
$.post("system/ajax/rebuild.php?user_hash={$dle_login_hash}", { startfrom: startfrom, area: 'static' },
|
||||
function(data){
|
||||
|
||||
if (data) {
|
||||
|
||||
if (data.status == "ok") {
|
||||
|
||||
$('#statcount').html(data.rebuildcount);
|
||||
$('#rebuild_ok2').val(data.rebuildcount);
|
||||
|
||||
var proc = Math.round( (100 * data.rebuildcount) / total2 );
|
||||
|
||||
if ( proc > 100 ) proc = 100;
|
||||
|
||||
$('#progressbar2').progressbar( "option", "value", proc );
|
||||
|
||||
if (data.rebuildcount >= total2)
|
||||
{
|
||||
$('#statprogress').html('{$lang['rebuild_status_ok']}');
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout("senden_stat(" + data.rebuildcount + ")", 5000 );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}, "json");
|
||||
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
$row2 = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_comments" );
|
||||
echo <<<HTML
|
||||
<form action="" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">Ïåðåñòðîåíèå êîììåíòàðèåâ</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;height:0px;"><div id="progressbar3"></div>Îáùåå êîîëëè÷åñòâî êîììåíòàðèåâ {$row2['count']}, {$lang['rebuild_count']} <font color="red"><span id="stat_c">0</span></font> <span id="1stat_p"></span></td>
|
||||
</tr>
|
||||
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" colspan="2"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"><input type="submit" id="button3" class="btn btn-primary" value="{$lang['rebuild_start']}" style="width:190px;"><input type="hidden" id="rebuild_ok3" name="rebuild_ok3" value="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
var total3 = {$row2['count']};
|
||||
|
||||
$(function() {
|
||||
|
||||
$( "#progressbar3" ).progressbar({
|
||||
value: 0
|
||||
});
|
||||
|
||||
$('#button3').click(function() {
|
||||
|
||||
$("#1stat_p").ajaxError(function(event, request, settings){
|
||||
$(this).html('{$lang['nl_error']}');
|
||||
$('#button3').attr("disabled", false);
|
||||
});
|
||||
|
||||
|
||||
$('#1stat_p').html('{$lang['rebuild_status']}');
|
||||
$('#button3').attr("disabled", "disabled");
|
||||
$('#button3').val("{$lang['rebuild_forw']}");
|
||||
senden_comm( $('#rebuild_ok3').val() );
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function senden_comm( startfrom ){
|
||||
|
||||
$.post("system/ajax/rebuild.php?user_hash={$dle_login_hash}", { startfrom: startfrom, area: 'comments' },
|
||||
function(data){
|
||||
|
||||
if (data) {
|
||||
|
||||
if (data.status == "ok") {
|
||||
|
||||
$('#stat_c').html(data.rebuildcount);
|
||||
$('#rebuild_ok3').val(data.rebuildcount);
|
||||
|
||||
var proc = Math.round( (100 * data.rebuildcount) / total3 );
|
||||
|
||||
if ( proc > 100 ) proc = 100;
|
||||
|
||||
$('#progressbar3').progressbar( "option", "value", proc );
|
||||
|
||||
if (data.rebuildcount >= total3)
|
||||
{
|
||||
$('#1stat_p').html('{$lang['rebuild_status_ok']}');
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout("senden_comm(" + data.rebuildcount + ")", 5000 );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}, "json");
|
||||
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
$row3 = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_forum_posts" );
|
||||
echo <<<HTML
|
||||
<form action="" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">Ïåðåñòðîåíèå ïîñòîâ ôîðóìà</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;height:0px;"><div id="progressbar4"></div>Îáùåå êîîëëè÷åñòâî ïîñòîâ {$row3['count']}, {$lang['rebuild_count']} <font color="red"><span id="stat_f">0</span></font> <span id="1stat_f"></span></td>
|
||||
</tr>
|
||||
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" colspan="2"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"><input type="submit" id="button4" class="btn btn-primary" value="{$lang['rebuild_start']}" style="width:190px;"><input type="hidden" id="rebuild_ok4" name="rebuild_ok4" value="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
var total4 = {$row3['count']};
|
||||
|
||||
$(function() {
|
||||
|
||||
$( "#progressbar4" ).progressbar({
|
||||
value: 0
|
||||
});
|
||||
|
||||
$('#button4').click(function() {
|
||||
|
||||
$("#1stat_f").ajaxError(function(event, request, settings){
|
||||
$(this).html('{$lang['nl_error']}');
|
||||
$('#button4').attr("disabled", false);
|
||||
});
|
||||
|
||||
|
||||
$('#1stat_f').html('{$lang['rebuild_status']}');
|
||||
//$('#button4').attr("disabled", "disabled");
|
||||
$('#button4').val("{$lang['rebuild_forw']}");
|
||||
senden_forum( $('#rebuild_ok4').val() );
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function senden_forum ( startfrom ){
|
||||
|
||||
$.post("system/ajax/rebuild.php?user_hash={$dle_login_hash}", { startfrom: startfrom, area: 'forum' },
|
||||
function(data){
|
||||
|
||||
if (data) {
|
||||
|
||||
if (data.status == "ok") {
|
||||
|
||||
$('#stat_f').html(data.rebuildcount);
|
||||
$('#rebuild_ok4').val(data.rebuildcount);
|
||||
|
||||
var proc = Math.round( (100 * data.rebuildcount) / total4 );
|
||||
|
||||
if ( proc > 100 ) proc = 100;
|
||||
|
||||
$('#progressbar4').progressbar( "option", "value", proc );
|
||||
|
||||
if (data.rebuildcount >= total3)
|
||||
{
|
||||
$('#1stat_f').html('{$lang['rebuild_status_ok']}');
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout("senden_forum(" + data.rebuildcount + ")", 5000 );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}, "json");
|
||||
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
?>
|
||||
106
system/inc/repa.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
|
||||
|
||||
include_once (SYSTEM_DIR.'/data/repa.php');
|
||||
include_once (SYSTEM_DIR.'/data/config.php');
|
||||
|
||||
include_once ROOT_DIR . '/language/' . $config['langs'] . '/adminpanel_repa.lng';
|
||||
|
||||
$vminus_autor = $repa_cf['adm_minus'];
|
||||
$vplus_autor = $repa_cf['adm_plus'];
|
||||
|
||||
// ********************************************************************************
|
||||
// Îïöèè
|
||||
// ********************************************************************************
|
||||
|
||||
function opentable()
|
||||
{
|
||||
echo <<<HTML
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
HTML;
|
||||
}
|
||||
|
||||
function closetable()
|
||||
{
|
||||
echo <<<HTML
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
HTML;
|
||||
}
|
||||
|
||||
function tableheader($value)
|
||||
{
|
||||
echo <<<HTML
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$value}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
HTML;
|
||||
unterline();
|
||||
}
|
||||
function unterline() {
|
||||
echo <<<HTML
|
||||
<div class="unterline"></div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
if($action == "options" or $action == '')
|
||||
{
|
||||
include_once 'repa/repa_main.php';
|
||||
}
|
||||
elseif($action == "opt")
|
||||
{
|
||||
include_once 'repa/repa_options.php';
|
||||
}
|
||||
elseif ($action == "edit")
|
||||
{
|
||||
include_once 'repa/repa_edit.php';
|
||||
}
|
||||
elseif ($action == "vminus")
|
||||
{
|
||||
include_once 'repa/repa_vminus.php';
|
||||
}
|
||||
elseif ($action == "vplus")
|
||||
{
|
||||
include_once 'repa/repa_vplus.php';
|
||||
}
|
||||
elseif ($action == "delcom")
|
||||
{
|
||||
$change_com = $repa_cf['ch_com'];
|
||||
$db->query("UPDATE `".USERPREFIX."_reputation` SET `text`='$change_com' WHERE `id`='$id'");
|
||||
msg("info", $lang['delcom'], "{$lang_repa['deleted']}<br><br><input type='button' value=\" {$lang_repa['repa_go_back']} \" class='bbcodes' onclick=\"window.location='$PHP_SELF?mod=repa&action=control'\">", "");
|
||||
}
|
||||
elseif ($action == "delete")
|
||||
{
|
||||
include_once 'repa/repa_delete.php';
|
||||
}
|
||||
elseif ($action == "save")
|
||||
{
|
||||
include_once 'repa/repa_save.php';
|
||||
}
|
||||
elseif($action == 'control')
|
||||
{
|
||||
include_once 'repa/repa_control.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("error", $lang['addnews_denied'], $lang['db_denied']);
|
||||
}
|
||||
|
||||
?>
|
||||
183
system/inc/repa/repa_control.php
Normal file
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
if (!$page)
|
||||
$page = 1;
|
||||
|
||||
echoheader("","");
|
||||
|
||||
echo <<<HTML
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">Ìåíþ</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
HTML;
|
||||
echo "<td width=\"260\" style=\"padding:4px;\"><a href=\"".$config['http_home_url'].$config['admin_path']."?mod=repa\"><b>Ãëàâíîå ìåíþ</b></a></td>";
|
||||
echo <<<HTML
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
opentable();
|
||||
tableheader($lang_repa['repa_cntrl']);
|
||||
|
||||
echo <<<HTML
|
||||
<script type="text/javascript" src="system/ajax/menu.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
function MenuBuild( m_id ){
|
||||
|
||||
var menu=new Array()
|
||||
var lang_action = "";
|
||||
|
||||
menu[0]='<a onClick="document.location=\'?mod=repa&action=vminus&id=' + m_id + '\'; return(false)" href="#">{$lang_repa['avt_minus']} ($vminus_autor)</a>';
|
||||
menu[1]='<a onClick="document.location=\'?mod=repa&action=vplus&id=' + m_id + '\'; return(false)" href="#">{$lang_repa['avt_plus']} ($vplus_autor)</a>';
|
||||
menu[2]='<a onClick="javascript:confirmdelete(' + m_id + '); return(false)" href="#">{$lang_repa['full_del']}</a>';
|
||||
menu[3]='<a onClick="document.location=\'?mod=repa&action=delcom&id=' + m_id + '\'; return(false)" href="#">{$lang_repa['delcom_done']}</a>';
|
||||
menu[4]='<a onClick="document.location=\'?mod=repa&action=edit&id=' + m_id + '\'; return(false)" href="#">{$lang_repa['edit_this']}</a>';
|
||||
|
||||
return menu;
|
||||
}
|
||||
function confirmdelete(id)
|
||||
{
|
||||
var agree=confirm("{$lang_repa['del_quest']}");
|
||||
if (agree)
|
||||
document.location="?mod=repa&action=delete&id="+id;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
$query_count = "SELECT COUNT(*) as count from " . USERPREFIX . "_reputation";
|
||||
$result_count = $db->super_query($query_count);
|
||||
if ($result_count['count'] == 0)
|
||||
echo "<br><br><center>{$lang_repa['repa_nothing']}</center><br><br>";
|
||||
else
|
||||
{
|
||||
$all_count_results = $result_count['count'];
|
||||
$N = 30;
|
||||
if ( isset($_GET['page']) )
|
||||
{
|
||||
$page = intval($_GET['page']);
|
||||
if ( $page < 1 ) $page = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$cnt_pages = ceil( $result_count['count'] / $N );
|
||||
if ( $page > $cnt_pages ) $page = $cnt_pages;
|
||||
$start = ( $page - 1 ) * $N;
|
||||
$query = $db->query("SELECT * FROM `" . USERPREFIX . "_reputation` ORDER BY `date` DESC LIMIT $start, $N");
|
||||
|
||||
if ( $cnt_pages > 1 )
|
||||
{
|
||||
echo '<div align="center"> '.$lang_repa['repa_pages'];
|
||||
if ( $page > 3 )
|
||||
$startpage = '<a title="'.$lang_repa['repa_first_p'].'" href="/'.$config['admin_path'].'?mod=repa&action=control&page=1"><<</a> ... ';
|
||||
else
|
||||
$startpage = '';
|
||||
if ( $page < ($cnt_pages - 2) )
|
||||
$endpage = ' ... <a title="'.$lang_repa['repa_last_p'].'" href="/'.$config['admin_path'].'?mod=repa&action=control&page='.$cnt_pages.'">>></a>';
|
||||
else
|
||||
$endpage = '';
|
||||
if ( $page - 2 > 0 )
|
||||
$page2left = ' <a href="/'.$config['admin_path'].'?mod=repa&action=control&page='.($page - 2).'">'.($page - 2).'</a>';
|
||||
else
|
||||
$page2left = '';
|
||||
if ( $page - 1 > 0 )
|
||||
$page1left = ' <a href="/'.$config['admin_path'].'?mod=repa&action=control&page='.($page - 1).'">'.($page - 1).'</a> ';
|
||||
else
|
||||
$page1left = '';
|
||||
if ( $page + 2 <= $cnt_pages )
|
||||
$page2right = ' <a href="/'.$config['admin_path'].'?mod=repa&action=control&page='.($page + 2).'">'.($page + 2).'</a> ';
|
||||
else
|
||||
$page2right = '';
|
||||
if ( $page + 1 <= $cnt_pages )
|
||||
$page1right = ' <a href="/'.$config['admin_path'].'?mod=repa&action=control&page='.($page + 1).'">'.($page + 1).'</a> ';
|
||||
else
|
||||
$page1right = '';
|
||||
echo $startpage.$page2left.$page1left.'<strong>'.$page.'</strong>'.$page1right.$page2right.$endpage."\n";
|
||||
echo '</div>';
|
||||
echo '<div style="padding-left:5px; padding-bottom:10px;"><strong>'.$lang_repa['r_total'].' </strong>'. $result_count['count'].'</div>';
|
||||
|
||||
}
|
||||
while ($row = $db->get_row())
|
||||
{
|
||||
$res_id = $row['id'];
|
||||
if ($row['how'] > 0)
|
||||
$how = "<img src=/templates/$config[skin]/images/repa_up.gif alt=\"{$lang_repa['repa_how_pl']}\">";
|
||||
if ($row['how'] < 0)
|
||||
$how = "<img src=/templates/$config[skin]/images/repa_dn.gif alt=\"{$lang_repa['repa_how_mn']}\">";
|
||||
if ($row['how'] == "totalminus")
|
||||
$how = "<img src=/templates/$config[skin]/images/repa_adm.png alt=\"{$lang_repa['repa_how_tm']}\">";
|
||||
if ($row['how'] == "totalplus")
|
||||
$how = "<img src=/templates/$config[skin]/images/repa_adm_p.png alt=\"{$lang_repa['repa_how_tm']}\">";
|
||||
$results .= "
|
||||
<tr>
|
||||
<td class=\"list\" align=\"center\"><a class=list href=\"?mod=editusers&action=list&search=yes&search_name=".$row[author]."\">".$row[author]."</a></td>
|
||||
<td class=\"list\" align=\"center\"> <a class=list href=\"?mod=editusers&action=list&search=yes&search_name=".$row[komu]."\">".$row[komu]."</a></td>
|
||||
<td class=\"list\" align=\"center\">$row[date]</td>
|
||||
<td class=\"list\" align=\"center\">$how</td>
|
||||
<td class=\"list\" align=\"left\">$row[text]</td>
|
||||
<td class=\"list\" align=\"center\"><a onClick=\"return dropdownmenu(this, event, MenuBuild('".$res_id."'), '150px')\" href=\"#\"><img src=\"system/skins/images/browser_action.gif\" border=\"0\"></a></td>
|
||||
</tr>
|
||||
<tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=6></td></tr>";
|
||||
}
|
||||
$db->free();
|
||||
|
||||
echo <<<HTML
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="center">{$lang_repa['repa_who']}</td>
|
||||
<td align="center">{$lang_repa['repa_to']}</td>
|
||||
<td align="center">Äàòà</td>
|
||||
<td align="center">{$lang_repa['repa_supp']}</td>
|
||||
<td align="left">{$lang_repa['repa_commst']}</td>
|
||||
<td align="center">{$lang_repa[vote_action]}</td>
|
||||
</tr>
|
||||
<tr><td colspan="6"><div class="hr_line"></div></td></tr>
|
||||
{$results}
|
||||
<tr></td></tr>
|
||||
<tr><td colspan="6"></td></tr>
|
||||
</table>
|
||||
HTML;
|
||||
}
|
||||
|
||||
closetable();
|
||||
echofooter();
|
||||
closetable();
|
||||
|
||||
?>
|
||||
90
system/inc/repa/repa_delete.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
$id = intval($_REQUEST['id']);
|
||||
|
||||
$result = $db->super_query("SELECT `how`, `komu`, `author`, `text` FROM `" . USERPREFIX . "_reputation` WHERE `id`='$id'" );
|
||||
$author_log = $db->super_query("SELECT `user_id`, `name`, `repa`, `repa_mod` FROM `" . USERPREFIX . "_users` WHERE `name`='$result[author]'" );
|
||||
$to_log = $db->super_query("SELECT `user_id`, `name`, `repa`, `repa_mod` FROM `" . USERPREFIX . "_users` WHERE `name`='$result[komu]'" );
|
||||
|
||||
$target = $db->safesql( $result['komu'] );
|
||||
$how_text = $db->safesql( $result['text'] );
|
||||
|
||||
$repa_mod_mas = explode ("|", $to_log['repa_mod']);
|
||||
$user_repa = $to_log['repa'];
|
||||
$repa_delete = false;
|
||||
|
||||
if ($author_log['name'] == "")
|
||||
$author_log['name'] = $repa_cf['robot'];
|
||||
|
||||
if ($result['how'] < 0)
|
||||
{
|
||||
$user_repa = $user_repa + 1;
|
||||
$repa_mod_mas[1] = $repa_mod_mas[1] - 1;
|
||||
$user_repa_mod = $repa_mod_mas[0]."|".$repa_mod_mas[1];
|
||||
$db->query("UPDATE " . USERPREFIX . "_users SET repa = '$user_repa', repa_mod = '$user_repa_mod' WHERE name = '{$target}'");
|
||||
|
||||
$db->query("DELETE FROM `".USERPREFIX."_reputation` WHERE `id`='$id' LIMIT 1");
|
||||
|
||||
$repa_delete = true;
|
||||
}
|
||||
elseif ($result['how'] > 0)
|
||||
{
|
||||
$user_repa = $user_repa - 1;
|
||||
$repa_mod_mas[0] = $repa_mod_mas[0] - 1;
|
||||
$user_repa_mod = $repa_mod_mas[0]."|".$repa_mod_mas[1];
|
||||
$db->query("UPDATE " . USERPREFIX . "_users SET repa = '$user_repa', repa_mod = '$user_repa_mod' WHERE name = '{$target}'");
|
||||
|
||||
$db->query("DELETE FROM `".USERPREFIX."_reputation` WHERE `id`='$id' LIMIT 1");
|
||||
|
||||
$repa_delete = true;
|
||||
}
|
||||
elseif ($result['how'] == 'totalminus')
|
||||
{
|
||||
$user_repa = $user_repa - $vminus_autor;
|
||||
$repa_mod_mas[1] = $repa_mod_mas[1] - $vminus_autor;
|
||||
$user_repa_mod = $repa_mod_mas[0]."|".$repa_mod_mas[1];
|
||||
$db->query("UPDATE `".USERPREFIX."_users` SET `repa`='$user_repa', `repa_mod`='$user_repa_mod' WHERE `name`='$target'");
|
||||
|
||||
$db->query("DELETE FROM `".USERPREFIX."_reputation` WHERE `id`='$id' LIMIT 1");
|
||||
|
||||
$repa_delete = true;
|
||||
}
|
||||
elseif ($result['how'] == 'totalplus')
|
||||
{
|
||||
$user_repa = $user_repa - $repa_cf['adm_plus'];
|
||||
$repa_mod_mas[0] = $repa_mod_mas[0] - $vplus_autor;
|
||||
$user_repa_mod = $repa_mod_mas[0]."|".$repa_mod_mas[1];
|
||||
$db->query("UPDATE `".USERPREFIX."_users` SET `repa`='$user_repa', `repa_mod`='$user_repa_mod' WHERE `name`='$target'");
|
||||
|
||||
$db->query("DELETE FROM `".USERPREFIX."_reputation` WHERE `id`='$id' LIMIT 1");
|
||||
|
||||
$repa_delete = true;
|
||||
}
|
||||
else
|
||||
msg("info", $langms['sea_info'], "Íå âûáðàíî äåéñòâèå.<br><br><input type='button' value=\" {$lang_repa['repa_go_back']} \" class='bbcodes' onclick=\"window.location='$PHP_SELF?mod=repa&action=control'\">", "");
|
||||
|
||||
if ($repa_cf['msgs_del_status'] == "yes" AND $repa_delete)
|
||||
{
|
||||
if($config['allow_alt_url'] == "yes")
|
||||
$whois = "<a href=\"".$config['http_home_url']."user/$member_id[name]\">$member_id[name]</a>";
|
||||
else
|
||||
$whois = "<a href=\"$PHP_SELF?subaction=userinfo&user=".urlencode($member_id[name])."\">$member_id[name]</a>";
|
||||
$izvestie = $repa_cf['msgs_del_template'];
|
||||
$izvestie = str_replace('{%kto%}', $whois, $izvestie);
|
||||
$izvestie = str_replace('{%ot_kogo%}', $author_log[name], $izvestie);
|
||||
$izvestie = str_replace('{%text%}', $how_text, $izvestie);
|
||||
$time = time()+($config['date_adjust']*60);
|
||||
$db->query("INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values ('$lang_repa[repa_msg_changed]', '$izvestie', '$to_log[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='$to_log[user_id]'");
|
||||
}
|
||||
if ($repa_delete)
|
||||
{
|
||||
msg("info", $langms['sea_info'], "{$lang_repa['repa_done_minus_1']} {$to_log[name]} {$lang_repa['repa_done_minus_2']}<br><br><input type='button' value=\" {$lang_repa['repa_go_back']} \" class='bbcodes' onclick=\"window.location='$PHP_SELF?mod=repa&action=control'\">", "");
|
||||
}
|
||||
|
||||
?>
|
||||
114
system/inc/repa/repa_edit.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
$id = intval($_REQUEST['id']);
|
||||
|
||||
if ($id == 0)
|
||||
msg("info", $langms['sea_info'], "Âû íè÷åãî íå âûáðàëè.<br><br><input type='button' value=\" {$lang_repa['repa_go_back']} \" class='bbcodes' onclick=\"window.location='$PHP_SELF?mod=repa&action=control'\">", "");
|
||||
else
|
||||
{
|
||||
include_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
$parse = new ParseFilter();
|
||||
include_once SYSTEM_DIR . '/ajax/bbcode.php';
|
||||
|
||||
if ($_POST['submit'])
|
||||
{
|
||||
$new = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['reason'] ), false ));
|
||||
$db->query("UPDATE `".USERPREFIX."_reputation` SET `text`='$new' WHERE `id`='$id'");
|
||||
msg("info", $langms['sea_info'], "{$lang_repa['repa_msg_chd']}<br><br><input type='button' value=\" {$lang_repa['repa_go_back']} \" class='bbcodes' onclick=\"window.location='$PHP_SELF?mod=repa&action=control'\">", "");
|
||||
}
|
||||
else
|
||||
{
|
||||
echoheader("","");
|
||||
|
||||
echo <<<HTML
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
function ins_smile ( text ){
|
||||
doInsert(' ' + text + ' ', '', false);
|
||||
|
||||
document.getElementById('dle_emo').style.visibility = "hidden";
|
||||
document.getElementById('dle_emo').style.display = "none";
|
||||
ie_range_cache = null;
|
||||
};
|
||||
</script>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">Ìåíþ</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
HTML;
|
||||
echo "<td width=\"260\" style=\"padding:4px;\"><a href=\"".$config['http_home_url'].$config['admin_path']."?mod=repa\"><b>Ãëàâíîå ìåíþ</b></a></td>";
|
||||
echo <<<HTML
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
opentable();
|
||||
tableheader($lang_repa['repa_cntrl']);
|
||||
|
||||
$res = $db->super_query("SELECT * FROM ".PREFIX."_reputation where id = '$id'");
|
||||
if ($res['id'] == $id)
|
||||
{
|
||||
|
||||
$text = $parse->decodeBBCodes( $res['text'], false );
|
||||
|
||||
echo <<<HTML
|
||||
<form action="" method="post" name="ajaxcomments{$id}" id="ajaxcomments{$id}">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:4px;width:400px;" class="option"><b>{$lang_repa['repa_comm_ed']}</b></td>
|
||||
<td align=middle>{$bb_code}<textarea style="width:99%;height:100px;" class="f_textarea" name="reason" id="dleeditcomments{$id}">{$text}</textarea></td>
|
||||
</tr>
|
||||
<tr><td background="/system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td style="padding-top:10px; padding-bottom:10px;padding-right:10px;" align=right>
|
||||
<input type=hidden name=mod value=repa>
|
||||
<input type=hidden name=action value=edit>
|
||||
<input class="buttons" type="submit" value="{$lang_repa['repa_done']}" name="submit" style="width:100px;"></td>
|
||||
</tr></table></form>
|
||||
HTML;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@header("Location: $PHP_SELF?mod=repa&action=control");
|
||||
}
|
||||
closetable();
|
||||
echofooter();
|
||||
closetable();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
217
system/inc/repa/repa_main.php
Normal file
@@ -0,0 +1,217 @@
|
||||
<?php
|
||||
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Ñîñòàâëåíèå ñòàòèñòèêè
|
||||
//----------------------------------
|
||||
|
||||
$stats = array();
|
||||
$row = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation");
|
||||
$stats['changes'] = $row['count'];
|
||||
$row = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation WHERE how > '0'");
|
||||
$stats['incr'] = $row['count'];
|
||||
$row = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation WHERE how < '0'");
|
||||
$stats['decr'] = $row['count'];
|
||||
$row = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation WHERE how = 'totalminus'");
|
||||
$stats['tot_m'] = $row['count'];
|
||||
$row = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation WHERE how = 'totalplus'");
|
||||
$stats['tot_p'] = $row['count'];
|
||||
$row = $db->super_query("SELECT COUNT(*) as count FROM ".USERPREFIX."_users WHERE repa_off='1'");
|
||||
$stats['repa_off'] = $row['count'];
|
||||
$row = $db->super_query("SELECT COUNT(*) as count FROM ".USERPREFIX."_users WHERE r_freeze='1'");
|
||||
$stats['r_freeze'] = $row['count'];
|
||||
|
||||
function show_stats() {
|
||||
global $repa_cf, $stats, $lang, $lang_repa;
|
||||
|
||||
if ($repa_cf['status'] == 'yes') $repastatus = '<span style="color: #009933; font-weight: bold;">'.$lang_repa['repa_st_on'].'</span>';
|
||||
else $repastatus = '<span style="color: #FF0000; font-weight: bold;">'.$lang_repa['repa_st_off'].'';
|
||||
echo "<table width=\"100%\">
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$lang_repa['repa_st_st']}</td><td>{$repastatus}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=\"265\" style=\"padding:2px;\">{$lang_repa['repa_st_ca']}</td><td>{$stats['changes']}</td>
|
||||
</tr>
|
||||
<tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=7></td></tr>
|
||||
<tr>
|
||||
<td width=\"265\" style=\"padding:2px;\">{$lang_repa['repa_st_in']}</td><td>{$stats['incr']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=\"265\" style=\"padding:2px;\">{$lang_repa['repa_st_tot_p']}</td><td>{$stats['tot_p']}</td>
|
||||
</tr>
|
||||
<tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=7></td></tr>
|
||||
<tr>
|
||||
<td width=\"265\" style=\"padding:2px;\">{$lang_repa['repa_st_es']}</td><td>{$stats['decr']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=\"265\" style=\"padding:2px;\">{$lang_repa['repa_st_tot_m']}</td><td>{$stats['tot_m']}</td>
|
||||
</tr>
|
||||
<tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=7></td></tr>
|
||||
<tr>
|
||||
<td width=\"265\" style=\"padding:2px;\">{$lang_repa['repa_st_repa_off']}</td><td>{$stats['repa_off']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=\"265\" style=\"padding:2px;\">{$lang_repa['repa_st_freeze']}</td><td>{$stats['r_freeze']}</td>
|
||||
</tr>
|
||||
<tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=7></td></tr>
|
||||
<tr>
|
||||
</table>
|
||||
<form enctype='multipart/form-data' method='post'><table width=\"100%\"><tr><td style=\"padding-top:10px;\">
|
||||
<input type=\"hidden\" name=\"save_moderation\" value=\"1\">
|
||||
<input class=\"edit\" style=\"width:160px;\" type=\"submit\" value=\"Ïåðåñ÷èòàòü ðåïóòàöèþ\">
|
||||
</td></tr></table></form>
|
||||
";
|
||||
}
|
||||
echoheader("options", $lang_repa['repa_options']);
|
||||
|
||||
$options = array();
|
||||
|
||||
$options['menu'] = array(
|
||||
|
||||
array(
|
||||
'name' => $lang_repa['repa_m_opts'],
|
||||
'url' => "$PHP_SELF?mod=repa&action=opt",
|
||||
'descr' => $lang_repa['repa_m_sub'],
|
||||
'image' => "repa_opt.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $lang_repa['repa_control'],
|
||||
'url' => "$PHP_SELF?mod=repa&action=control",
|
||||
'descr' => $lang_repa['repa_con_sub'],
|
||||
'image' => "repa_control.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
|
||||
foreach($options as $sub_options => $value)
|
||||
{
|
||||
$count_options = count($value);
|
||||
|
||||
for($i=0; $i < $count_options; $i++){
|
||||
if($member_db[1] > $value[$i]['access'] AND $value[$i]['access'] != "all"){
|
||||
unset($options[$sub_options][$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$subs = 0;
|
||||
|
||||
foreach($options as $sub_options)
|
||||
{
|
||||
|
||||
if (!count($sub_options)) continue;
|
||||
|
||||
echo <<<HTML
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['opt_hopt']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%"><tr>
|
||||
HTML;
|
||||
|
||||
$i=0;
|
||||
|
||||
foreach($sub_options as $option)
|
||||
{
|
||||
|
||||
if ($i > 1) {echo "</tr><tr>"; $i=0;}
|
||||
|
||||
$i++;
|
||||
|
||||
echo <<<HTML
|
||||
<td width="50%">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="70" height="70" valign="middle" align="center" style="padding-top:5px;padding-bottom:5px;"><img src="system/skins/images/{$option['image']}" border="0"></td>
|
||||
<td valign="middle"><div class="quick"><a href="{$option['url']}"><h3>{$option['name']}</h3>{$option['descr']}</a></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
</tr></table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($_REQUEST['save_moderation'])
|
||||
{
|
||||
include_once SYSTEM_DIR.'/data/repa.php';
|
||||
$user = $db->query("SELECT user_id, name, repa FROM ".PREFIX."_users");
|
||||
while ($row = $db->get_row($user))
|
||||
{
|
||||
$repa_plus = 0;
|
||||
$repa_minus = 0;
|
||||
$repa_pereschet = $db->query("SELECT * FROM " . PREFIX . "_reputation WHERE komu = '$row[name]'");
|
||||
while ($row_min = $db->get_row($repa_pereschet))
|
||||
{
|
||||
if ($row_min['how'] < 0 OR $row_min['how'] == "totalminus")
|
||||
{
|
||||
if ($row_min['how'] == "totalminus")
|
||||
$repa_minus = $repa_minus + $repa_cf['adm_minus'];
|
||||
else
|
||||
$repa_minus = $repa_minus + $row_min['how'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($row_min['how'] == "totalplus")
|
||||
$repa_plus = $repa_plus + $repa_cf['adm_plus'];
|
||||
else
|
||||
$repa_plus = $repa_plus + $row_min['how'];
|
||||
}
|
||||
}
|
||||
$db->free($repa_pereschet);
|
||||
$repa_sum = $repa_plus + $repa_minus;
|
||||
$repa_mod = $repa_plus."|".$repa_minus;
|
||||
|
||||
$db->query("UPDATE " . USERPREFIX . "_users set repa='$repa_sum' WHERE user_id = '$row[user_id]'");
|
||||
$db->query("UPDATE " . USERPREFIX . "_users set repa_mod='$repa_mod' WHERE user_id = '$row[user_id]'");
|
||||
}
|
||||
$db->free($user);
|
||||
header( "Location: {$_SERVER['REQUEST_URI']}" );
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Âûâîä ñòàòèñòèêè ìîäóëÿ
|
||||
// ********************************************************************************
|
||||
opentable();
|
||||
tableheader($lang_repa['repa_stats']);
|
||||
show_stats();
|
||||
closetable();
|
||||
echofooter();
|
||||
|
||||
?>
|
||||
244
system/inc/repa/repa_options.php
Normal file
@@ -0,0 +1,244 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
|
||||
|
||||
$member_id['user_group'] = $member_id['user_group'];
|
||||
|
||||
if($member_id['user_group'] != 1){ msg("error", $lang['opt_denied'], $lang['opt_denied']); }
|
||||
|
||||
include_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
$parse = new ParseFilter(Array(), Array(), 1, 1);
|
||||
|
||||
echoheader("options", $lang['opt_all']);
|
||||
|
||||
if(!$handle = opendir("./language")){ die("Íåâîçìîæíî îòêðûòü äèðåêòîðèþ ./data/language/"); }
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if(is_dir(ROOT_DIR."/language/$file") and ($file != "." and $file!="..")){
|
||||
$sys_con_langs_arr[$file] = $file;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
foreach ($user_group as $group)
|
||||
$sys_group_arr[$group['id']] = $group['group_name'];
|
||||
|
||||
echo <<<HTML
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">Ìåíþ</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
HTML;
|
||||
echo "<td width=\"260\" style=\"padding:4px;\"><a href=\"".$config['http_home_url'].$config['admin_path']."?mod=repa\"><b>Ãëàâíîå ìåíþ</b></a></td>";
|
||||
echo <<<HTML
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="hr_line"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
echo <<<HTML
|
||||
<script language='JavaScript' type="text/javascript">
|
||||
|
||||
function ChangeOption(selectedOption) {
|
||||
|
||||
document.getElementById('general').style.display = "none";
|
||||
document.getElementById('controls').style.display = "none";
|
||||
document.getElementById('mail').style.display = "none";
|
||||
document.getElementById('ban').style.display = "none";
|
||||
|
||||
if(selectedOption == 'general') {document.getElementById('general').style.display = "";}
|
||||
if(selectedOption == 'controls') {document.getElementById('controls').style.display = "";}
|
||||
if(selectedOption == 'mail') {document.getElementById('mail').style.display = "";}
|
||||
if(selectedOption == 'ban') {document.getElementById('ban').style.display = "";}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang_repa['opt_general_repa']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">
|
||||
<table style="text-align:center;" width="100%" height="35px">
|
||||
<tr style="vertical-align:middle;" >
|
||||
<td class=tableborder><a href="javascript:ChangeOption('general');"><img title="{$lang_repa['repa_opts']}" src="system/skins/images/repa_general.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('controls');"><img title="{$lang_repa['repa_cts']}" src="system/skins/images/repa_ct_opts.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('mail');"><img title="{$lang_repa['repa_mop']}" src="system/skins/images/repa_m_opts.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('ban');"><img title="{$lang_repa['repa_ban']}" src="system/skins/images/repa_b_opts.png" border="0"></a>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
echo <<<HTML
|
||||
<form action="" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
HTML;
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='' id="general"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang_repa['repa_opts']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
|
||||
showRow($lang_repa['opt_gen_st'], $lang_repa['opt_gen_st_sub'], makeDropDown(array("yes"=>$lang_repa['repa_on'],"no"=>$lang_repa['repa_off']), "save_config[status]", "{$repa_cf['status']}", ""), "");
|
||||
showRow($lang_repa['bl_period'], $lang_repa['bl_per_su'], "<input maxlength=15 type=text style='text-align: center;' size=15 class=edit name='save_config[bl_period]' value='{$repa_cf['bl_period']}'>");
|
||||
showRow($lang_repa['repa_stop_change_min'], $lang_repa['repa_stop_change_min_sub'], "<input maxlength=15 type=text style='text-align: center;' size=15 class=edit name='save_config[repa_stop_change_min]' value='{$repa_cf['repa_stop_change_min']}'>");
|
||||
showRow($lang_repa['opt_gen_page'], $lang_repa['opt_gen_page_sub'], makeDropDown(array("1"=>$lang_repa['repa_yes'],"0"=>$lang_repa['repa_no']), "save_config[comm_page]", "{$repa_cf['comm_page']}", ""), "");
|
||||
showRow($lang_repa['opt_site_res'], $lang_repa['opt_site_sub'], "<input maxlength=5 type=text style='text-align: center;' size=15 class=edit name='save_config[res_site]' value='{$repa_cf['res_site']}'>", "");
|
||||
showRow($lang_repa['opt_cp_res'], $lang_repa['opt_cp_sub'], "<input maxlength=5 type=text style='text-align: center;' size=15 class=edit name='save_config[res_cp]' value='{$repa_cf['res_cp']}'>", "");
|
||||
showRow("Ïåðåâîäèòü â ãðóïïó ïðè äîñòèæåíèè:", "Êîëëè÷åñòâî î÷êîâ ðåéòèíãà äëÿ ïåðåõîäà â ãðóïïó", "<input maxlength=3 type=text style='text-align: center;' size=15 class=edit name='save_config[num_repa_group]' value='{$repa_cf['num_repa_group']}'>");
|
||||
|
||||
$groups = get_groups();
|
||||
$groups = get_groups(explode(',', $repa_cf['move_grouplevel']));
|
||||
|
||||
showRow("Ïåðåâîäèòü â ãðóïïó:", "Ïåðåâîäèòü â óêàçàííóþ ãðóïïó ïðè äîñòèæåíèè N î÷êîâ ðåéòèíãà", "<select name='save_config[move_grouplevel]'>{$groups}</select>");
|
||||
|
||||
echo "</table></td></tr>";
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='display:none' id="controls"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang_repa['repa_cts']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
showRow($lang_repa['repa_adm'], $lang_repa['repa_adm_sub'], "<input maxlength=5 type=text style='text-align: center;' size=15 class=edit name='save_config[adm_minus]' value='{$repa_cf['adm_minus']}'>", "");
|
||||
showRow($lang_repa['repa_adm_plus'], $lang_repa['repa_adm_plus_sub'], "<input maxlength=5 type=text style='text-align: center;' size=15 class=edit name='save_config[adm_plus]' value='{$repa_cf['adm_plus']}'>", "");
|
||||
showRow($lang_repa['repa_robot'], $lang_repa['repa_robo_sub'], "<input maxlength=15 type=text style='text-align: center;' size=15 class=edit name='save_config[robot]' value='{$repa_cf['robot']}'>", "");
|
||||
showRow($lang_repa['repa_adm_msg'], $lang_repa['repa_adm_com'], "<textarea style='width: 300px; height: 40px;' class=edit name='save_config[adm_msg]'>{$repa_cf['adm_msg']}</textarea>","");
|
||||
showRow($lang_repa['repa_adm_plus_msg'], $lang_repa['repa_adm_plus_com'], "<textarea style='width: 300px; height: 40px;' class=edit name='save_config[adm_msg_plus]'>{$repa_cf['adm_msg_plus']}</textarea>","");
|
||||
showRow($lang_repa['repa_replace'], $lang_repa['repa_adm_rpm'], "<textarea style='width: 300px; height: 40px;' class=edit name='save_config[ch_com]'>{$repa_cf['ch_com']}</textarea>");
|
||||
|
||||
echo "</table></td></tr>";
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='display:none' id="mail"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang_repa['repa_mop']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
|
||||
$repa_rules = $parse->decodeBBCodes( $repa_cf['repa_rules_tpl_tsu'], false );
|
||||
|
||||
showRow($lang_repa['repa_msgs_st'], $lang_repa['repa_msgs_su'], makeDropDown(array("yes"=>$lang_repa['repa_yes'],"no"=>$lang_repa['repa_no']), "save_config[msgs_status]", "{$repa_cf['msgs_status']}", ""), "");
|
||||
showRow($lang_repa['repa_msg_tpl'], $lang_repa['repa_msg_tsu'], "<textarea style='width: 300px; height: 65px;' class=edit name='save_config[msgs_template]'>{$repa_cf['msgs_template']}</textarea>", "");
|
||||
showRow($lang_repa['repa_rules'], $lang_repa['repa_rules_su'], makeDropDown(array("1"=>$lang_repa['repa_yes'],"0"=>$lang_repa['repa_no']), "save_config[repa_rules]", "{$repa_cf['repa_rules']}", ""), "");
|
||||
showRow($lang_repa['repa_rules_tpl'], $lang_repa['repa_rules_tpl_su'], "<textarea style='width: 300px; height: 65px;' class=edit name='save_config[repa_rules_tpl_tsu]'>{$repa_rules}</textarea>", "");
|
||||
showRow($lang_repa['repa_msgs_del_st'], $lang_repa['repa_msgs_del_su'], makeDropDown(array("yes"=>$lang_repa['repa_yes'],"no"=>$lang_repa['repa_no']), "save_config[msgs_del_status]", "{$repa_cf['msgs_del_status']}", ""), "");
|
||||
showRow($lang_repa['repa_msg_del_tpl'], $lang_repa['repa_msg_del_tsu'], "<textarea style='width: 300px; height: 65px;' class=edit name='save_config[msgs_del_template]'>{$repa_cf['msgs_del_template']}</textarea>", "");
|
||||
showRow($lang_repa['repa_msgs_adm_st'], $lang_repa['repa_msgs_adm_su'], makeDropDown(array("yes"=>$lang_repa['repa_yes'],"no"=>$lang_repa['repa_no']), "save_config[msgs_status_adm]", "{$repa_cf['msgs_status_adm']}", ""), "");
|
||||
showRow($lang_repa['repa_msg_adm_tpl'], $lang_repa['repa_msg_adm_tsu'], "<textarea style='width: 300px; height: 65px;' class=edit name='save_config[msgs_template_adm]'>{$repa_cf['msgs_template_adm']}</textarea>", "");
|
||||
|
||||
echo "</table></td></tr>";
|
||||
|
||||
|
||||
echo <<<HTML
|
||||
<tr style='display:none' id="ban"><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang_repa['repa_ban']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div><table width="100%">
|
||||
HTML;
|
||||
|
||||
$repa_ban_desc = $parse->decodeBBCodes( $repa_cf['repa_ban_desc'], false );
|
||||
showRow($lang_repa['repa_ban'], $lang_repa['repa_ban_sub'], makeDropDown(array("1"=>$lang_repa['repa_on'],"0"=>$lang_repa['repa_off']), "save_config[repa_ban]", "{$repa_cf['repa_ban']}", ""), "");
|
||||
showRow($lang_repa['repa_ban_num'], $lang_repa['repa_ban_num_sub'], "<input maxlength=15 type=text style='text-align: center;' size=15 class=edit name='save_config[repa_ban_num]' value='{$repa_cf['repa_ban_num']}'>");
|
||||
showRow($lang_repa['repa_ban_days'], $lang_repa['repa_ban_days_sub'], "<input maxlength=15 type=text style='text-align: center;' size=15 class=edit name='save_config[repa_ban_days]' value='{$repa_cf['repa_ban_days']}'>");
|
||||
showRow($lang_repa['repa_ban_desc'], $lang_repa['repa_ban_desc_sub'], "<textarea style='width: 300px; height: 65px;' class=edit name='save_config[repa_ban_desc]'>{$repa_ban_desc}</textarea>", "");
|
||||
echo "</table></td></tr>";
|
||||
|
||||
echo <<<HTML
|
||||
<tr>
|
||||
<td style="padding-top:10px; padding-bottom:10px;padding-right:10px;">
|
||||
<input type=hidden name=mod value=repa>
|
||||
<input type=hidden name=action value=save>
|
||||
<input type=hidden name=savecfg value="savecfg">
|
||||
<input type="submit" class="buttons" value="{$lang_repa['repa_save']}"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></form>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
|
||||
?>
|
||||
74
system/inc/repa/repa_save.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
if ($_REQUEST['savecfg'] != "savecfg")
|
||||
require_once SYSTEM_DIR.'/data/repa.php';
|
||||
if($_REQUEST['savecfg'] == "savecfg")
|
||||
{
|
||||
$find[] = "'\r'";
|
||||
$replace[] = "";
|
||||
$find[] = "'\n'";
|
||||
$replace[] = "";
|
||||
$save_con['version'] = "6.5";
|
||||
$save_config = $save_config + $save_con;
|
||||
|
||||
$handler = fopen(SYSTEM_DIR.'/data/repa.php', "w");
|
||||
fwrite($handler, "<?PHP\r\n\$repa_cf = array (\r\n");
|
||||
|
||||
foreach($save_config as $name => $value)
|
||||
{
|
||||
if ($name == "repa_rules_tpl_tsu" OR $name == "repa_ban_desc")
|
||||
{
|
||||
include_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
$parse = new ParseFilter();
|
||||
$value = $db->safesql( $parse->BB_Parse( $parse->process( $value ), false ));
|
||||
$value = preg_split( '((>)|(<))', $value, - 1, PREG_SPLIT_DELIM_CAPTURE );
|
||||
$n = count( $value );
|
||||
for($i = 0; $i < $n; $i ++)
|
||||
{
|
||||
if( $value[$i] == "<" )
|
||||
{
|
||||
$i ++;
|
||||
continue;
|
||||
}
|
||||
$value[$i] = preg_replace( "#([^\s\n\r]{" . intval( 50 ) . "})#i", "\\1<br />", $value[$i] );
|
||||
}
|
||||
$value = join( "", $value );
|
||||
}
|
||||
elseif ($name == "bl_period" OR $name == "res_site" OR $name == "res_cp" OR $name == "sp_num")
|
||||
{
|
||||
$value = intval($value);
|
||||
}
|
||||
elseif ($name == "adm_minus" OR $name == "repa_stop_change_min")
|
||||
{
|
||||
$value = intval($value);
|
||||
if ($value > 0 AND $value != 0)
|
||||
$value = 0 - $value;
|
||||
}
|
||||
elseif ($name == "adm_plus")
|
||||
{
|
||||
$value = intval($value);
|
||||
if ($value < 0 AND $value != 0)
|
||||
$value = 0 - $value;
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = stripslashes ($value);
|
||||
$value = addslashes($value);
|
||||
$value = preg_replace($find, $replace, $value);
|
||||
}
|
||||
fwrite($handler, "'{$name}' => \"{$value}\",\r\n");
|
||||
}
|
||||
|
||||
fwrite($handler, ");\r\n?>");
|
||||
fclose($handler);
|
||||
|
||||
$cache->clear();
|
||||
msg("info", $langms['sea_info'], "{$lang_repa['opt_saved']}<br><br><input type='button' value=\" {$lang_repa['repa_go_back']} \" class='bbcodes' onclick=\"window.location='$PHP_SELF?mod=repa&action=opt'\">", "");
|
||||
}
|
||||
|
||||
?>
|
||||
59
system/inc/repa/repa_vminus.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
$id = intval($_REQUEST['id']);
|
||||
|
||||
if ($id == 0)
|
||||
msg("info", $langms['sea_info'], "Âû íè÷åãî íå âûáðàëè.<br><br><input type='button' value=\" {$lang_repa['repa_go_back']} \" class='bbcodes' onclick=\"window.location='$PHP_SELF?mod=repa&action=control'\">", "");
|
||||
else
|
||||
{
|
||||
$result = $db->super_query("SELECT author, id FROM " . PREFIX . "_reputation WHERE id='$id' AND author <> '$repa_cf[robot]'");
|
||||
if ($result['id'] == $id)
|
||||
{
|
||||
$row2 = $db->super_query("SELECT name, user_id, repa, repa_mod, banned, user_group FROM " . USERPREFIX . "_users WHERE name='$result[author]'");
|
||||
$target = $result['author'];
|
||||
$date = date ("Y-m-d H:i:s");
|
||||
$robot = $repa_cf['robot'];
|
||||
$adm_msg = $repa_cf['adm_msg'];
|
||||
$admin = 'totalminus';
|
||||
|
||||
$how = $row2['repa'] + $vminus_autor;
|
||||
$repa_mod_mas = explode ("|", $row2['repa_mod']);
|
||||
$repa_mod_mas[1] = $repa_mod_mas[1] + $vminus_autor;
|
||||
$repa_mod = $repa_mod_mas[0]."|".$repa_mod_mas[1];
|
||||
|
||||
$db->query("INSERT INTO " . USERPREFIX . "_reputation (how, date, author, komu, text) values ('$admin', '$date', '$robot', '$target', '$adm_msg')");
|
||||
$db->query("UPDATE `".USERPREFIX."_users` SET `repa` = '$how', `repa_mod` = '$repa_mod' WHERE `name`='$target'");
|
||||
|
||||
$_TIME = time()+($config['date_adjust']*60);
|
||||
if ($repa_cf['repa_ban'] AND $row2['banned'] != "yes" AND $repa_cf['group_'.$row2[user_group]] != 1)
|
||||
{
|
||||
if (($row2['repa'] + $vminus_autor) <= $repa_cf['repa_ban_num'] OR $row2['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 = '{$row2[user_id]}'" );
|
||||
$db->query( "INSERT INTO " . USERPREFIX . "_banned (users_id, descr, date, days, ip) values ('$row2[user_id]', '$repa_cf[repa_ban_desc]', '$this_time', '$repa_cf[repa_ban_days]', '')" );
|
||||
$cache->delete('banned.php' );
|
||||
}
|
||||
}
|
||||
|
||||
if($repa_cf['msgs_status_adm'] == 'yes')
|
||||
{
|
||||
$what = $repa_cf['adm_msg'];
|
||||
$izvestie = $repa_cf['msgs_template_adm'];
|
||||
$izvestie = str_replace('{%text%}', $what, $izvestie);
|
||||
$db->query("INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values ('$lang_repa[repa_adm_msg_lc]', '$izvestie', '$row2[user_id]', '$robot', '$_TIME', 'no', 'inbox')");
|
||||
$db->query("UPDATE " . USERPREFIX . "_users set pm_all=pm_all+1, pm_unread=pm_unread+1 where user_id='$row2[user_id]'");
|
||||
}
|
||||
|
||||
msg("info", $langms['sea_info'], "{$lang_repa['repa_done_minus_1']} $target {$lang_repa['repa_done_minus_2']} $vminus_autor <br><br><input type='button' value=\" {$lang_repa['repa_go_back']} \" class='bbcodes' onclick=\"window.location='$PHP_SELF?mod=repa&action=control'\">", "");
|
||||
}
|
||||
else
|
||||
msg("info", $langms['sea_info'], " áàçå äàííûõ íè÷åãî íå íàéäåíî.<br><br><input type='button' value=\" {$lang_repa['repa_go_back']} \" class='bbcodes' onclick=\"window.location='$PHP_SELF?mod=repa&action=control'\">", "");
|
||||
}
|
||||
|
||||
?>
|
||||
59
system/inc/repa/repa_vplus.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
$id = intval($_REQUEST['id']);
|
||||
|
||||
if ($id == 0)
|
||||
msg("info", $langms['sea_info'], "Âû íè÷åãî íå âûáðàëè.<br><br><input type='button' value=\" {$lang_repa['repa_go_back']} \" class='bbcodes' onclick=\"window.location='$PHP_SELF?mod=repa&action=control'\">", "");
|
||||
else
|
||||
{
|
||||
$result = $db->super_query("SELECT author, id FROM " . PREFIX . "_reputation WHERE id='$id' AND author <> '$repa_cf[robot]'");
|
||||
if ($result['id'] == $id)
|
||||
{
|
||||
$row2 = $db->super_query("SELECT name, user_id, repa, repa_mod, banned, user_group FROM " . USERPREFIX . "_users WHERE name='$result[author]'");
|
||||
$target = $result['author'];
|
||||
$date = date ("Y-m-d H:i:s");
|
||||
$robot = $repa_cf['robot'];
|
||||
$adm_msg = $repa_cf['adm_msg_plus'];
|
||||
$admin = 'totalplus';
|
||||
|
||||
$how = $row2['repa'] + $vplus_autor;
|
||||
$repa_mod_mas = explode ("|", $row2['repa_mod']);
|
||||
$repa_mod_mas[0] = $repa_mod_mas[0] + $vplus_autor;
|
||||
$repa_mod = $repa_mod_mas[0]."|".$repa_mod_mas[1];
|
||||
|
||||
$db->query("INSERT INTO " . USERPREFIX . "_reputation (how, date, author, komu, text) values ('$admin', '$date', '$robot', '$target', '$adm_msg')");
|
||||
$db->query("UPDATE `".USERPREFIX."_users` SET `repa` = '$how', `repa_mod` = '$repa_mod' WHERE `name`='$target'");
|
||||
|
||||
$_TIME = time()+($config['date_adjust']*60);
|
||||
if ($repa_cf['repa_ban'] AND $row2['banned'] != "yes" AND $repa_cf['group_'.$row2[user_group]] != 1)
|
||||
{
|
||||
if (($row2['repa'] + $vplus_autor) <= $repa_cf['repa_ban_num'] OR $row2['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 = '{$row2[user_id]}'" );
|
||||
$db->query( "INSERT INTO " . USERPREFIX . "_banned (users_id, descr, date, days, ip) values ('$row2[user_id]', '$repa_cf[repa_ban_desc]', '$this_time', '$repa_cf[repa_ban_days]', '')" );
|
||||
$cache->delete('banned.php' );
|
||||
}
|
||||
}
|
||||
|
||||
if($repa_cf['msgs_status_adm'] == 'yes')
|
||||
{
|
||||
$what = $repa_cf['adm_msg_plus'];
|
||||
$izvestie = $repa_cf['msgs_template_adm'];
|
||||
$izvestie = str_replace('{%text%}', $what, $izvestie);
|
||||
$db->query("INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values ('$lang_repa[repa_adm_msg_lc]', '$izvestie', '$row2[user_id]', '$robot', '$_TIME', 'no', 'inbox')");
|
||||
$db->query("UPDATE " . USERPREFIX . "_users set pm_all=pm_all+1, pm_unread=pm_unread+1 where user_id='$row2[user_id]'");
|
||||
}
|
||||
|
||||
msg("info", $langms['sea_info'], "{$lang_repa['repa_done_minus_1']} $target {$lang_repa['repa_done_minus_2']} $vplus_autor <br><br><input type='button' value=\" {$lang_repa['repa_go_back']} \" class='bbcodes' onclick=\"window.location='$PHP_SELF?mod=repa&action=control'\">", "");
|
||||
}
|
||||
else
|
||||
msg("info", $langms['sea_info'], " áàçå äàííûõ íè÷åãî íå íàéäåíî.<br><br><input type='button' value=\" {$lang_repa['repa_go_back']} \" class='bbcodes' onclick=\"window.location='$PHP_SELF?mod=repa&action=control'\">", "");
|
||||
}
|
||||
|
||||
?>
|
||||
1013
system/inc/static.php
Normal file
1209
system/inc/table.php
Normal file
646
system/inc/usergroup.php
Normal file
@@ -0,0 +1,646 @@
|
||||
<?php
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {die( "Hacking attempt!" );}
|
||||
|
||||
if( $member_id['user_group'] != 1 ) {msg( "error", $lang['addnews_denied'], $lang['db_denied'] );}
|
||||
|
||||
if( $action == "del" ) {
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );}
|
||||
|
||||
$id = intval( $_REQUEST['id'] );
|
||||
$grouplevel = intval( $_REQUEST['grouplevel'] );
|
||||
|
||||
if( $id < 6 ) msg( "error", $lang['addnews_error'], $lang['group_notdel'], "$PHP_SELF?mod=usergroup" );
|
||||
|
||||
$row = $db->super_query( "SELECT count(*) as count FROM " . USERPREFIX . "_users WHERE user_group='$id'" );
|
||||
|
||||
if( ! $row['count'] ) {
|
||||
$db->query( "DELETE FROM " . USERPREFIX . "_usergroups WHERE id = '$id'" );
|
||||
$cache->delete('usergroup.php');
|
||||
$cache->clear();
|
||||
msg( "info", $lang['all_info'], $lang['group_del'], "$PHP_SELF?mod=usergroup" );
|
||||
} else {
|
||||
if( $grouplevel and $grouplevel != $id ) {
|
||||
$db->query( "UPDATE " . USERPREFIX . "_users set user_group='$grouplevel' WHERE user_group='$id'" );
|
||||
$db->query( "DELETE FROM " . USERPREFIX . "_usergroups WHERE id = '$id'" );
|
||||
$cache->delete('usergroup.php' );
|
||||
$cache->clear();
|
||||
msg( "info", $lang['all_info'], $lang['group_del'], "$PHP_SELF?mod=usergroup" );
|
||||
} else
|
||||
msg( "info", $lang['all_info'], "<form action=\"\" method=\"post\">{$lang['group_move']} <select name=\"grouplevel\">" . get_groups( 4 ) . "</select> <input class=\"edit\" type=\"submit\" value=\"{$lang['b_start']}\"></form>", "$PHP_SELF?mod=usergroup" );
|
||||
}
|
||||
|
||||
} elseif( $action == "doadd" or $action == "doedit" ) {
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );}
|
||||
|
||||
if( ! count( $_REQUEST['allow_cats'] ) ) $_REQUEST['allow_cats'][] = "all";
|
||||
if( ! count( $_REQUEST['cat_add'] ) ) $_REQUEST['cat_add'][] = "all";
|
||||
|
||||
$group_name = $db->safesql( strip_tags( $_REQUEST['group_name'] ) );
|
||||
$group_color = $db->safesql( strip_tags( $_REQUEST['group_color'] ) );
|
||||
|
||||
$allow_cats = $db->safesql( implode( ',', $_REQUEST['allow_cats'] ) );
|
||||
$cat_add = $db->safesql( implode( ',', $_REQUEST['cat_add'] ) );
|
||||
|
||||
$allow_admin = intval( $_REQUEST['allow_admin'] );
|
||||
$allow_offline = intval( $_REQUEST['allow_offline'] );
|
||||
$allow_main = intval( $_REQUEST['allow_main'] );
|
||||
$allow_adds = intval( $_REQUEST['allow_adds'] );
|
||||
$moderation = intval( $_REQUEST['moderation'] );
|
||||
$allow_edit = intval( $_REQUEST['allow_edit'] );
|
||||
$allow_all_edit = intval( $_REQUEST['allow_all_edit'] );
|
||||
$allow_addc = intval( $_REQUEST['allow_addc'] );
|
||||
$allow_editc = intval( $_REQUEST['allow_editc'] );
|
||||
$allow_delc = intval( $_REQUEST['allow_delc'] );
|
||||
$edit_allc = intval( $_REQUEST['edit_allc'] );
|
||||
$del_allc = intval( $_REQUEST['del_allc'] );
|
||||
$allow_hide = intval( $_REQUEST['allow_hide'] );
|
||||
$allow_pm = intval( $_REQUEST['allow_pm'] );
|
||||
$allow_files = intval( $_REQUEST['allow_files'] );
|
||||
$allow_feed = intval( $_REQUEST['allow_feed'] );
|
||||
$allow_search = intval( $_REQUEST['allow_search'] );
|
||||
$allow_rating = intval( $_REQUEST['allow_rating'] );
|
||||
$max_foto = $db->safesql( $_REQUEST['max_foto'] );
|
||||
$allow_short = intval( $_REQUEST['allow_short'] );
|
||||
$allow_fixed = intval( $_REQUEST['allow_fixed'] );
|
||||
$allow_poll = intval( $_REQUEST['allow_poll'] );
|
||||
$max_signature = intval( $_REQUEST['max_signature'] );
|
||||
$max_info = intval( $_REQUEST['max_info'] );
|
||||
|
||||
$forum_post_edit = intval( $_REQUEST['forum_post_edit']);
|
||||
$forum_post_del = intval( $_REQUEST['forum_post_del']);
|
||||
$forum_topic_set = intval( $_REQUEST['forum_topic_set']);
|
||||
$forum_topic_edit = intval( $_REQUEST['forum_topic_edit']);
|
||||
$forum_topic_del = intval( $_REQUEST['forum_topic_del']);
|
||||
|
||||
$admin_addnews = intval( $_REQUEST['admin_addnews'] );
|
||||
$admin_editnews = intval( $_REQUEST['admin_editnews'] );
|
||||
$admin_categories = intval( $_REQUEST['admin_categories'] );
|
||||
$admin_editusers = intval( $_REQUEST['admin_editusers'] );
|
||||
$admin_wordfilter = intval( $_REQUEST['admin_wordfilter'] );
|
||||
$admin_static = intval( $_REQUEST['admin_static'] );
|
||||
$admin_blockip = intval( $_REQUEST['admin_blockip'] );
|
||||
$admin_iptools = intval( $_REQUEST['admin_iptools'] );
|
||||
$admin_googlemap = intval( $_REQUEST['admin_googlemap'] );
|
||||
$admin_table = intval( $_REQUEST['admin_table'] );
|
||||
|
||||
$allow_image_upload = intval( $_REQUEST['allow_image_upload'] );
|
||||
$allow_file_upload = intval( $_REQUEST['allow_file_upload'] );
|
||||
$allow_tor_upload = intval( $_REQUEST['allow_tor_upload'] );
|
||||
$allow_signature = intval( $_REQUEST['allow_signature'] );
|
||||
$allow_url = intval( $_REQUEST['allow_url'] );
|
||||
$allow_image = intval( $_REQUEST['allow_image'] );
|
||||
|
||||
if( $group_name == "" ) msg( "error", $lang['addnews_error'], $lang['group_err1'], "$PHP_SELF?mod=usergroup&action=add" );
|
||||
|
||||
$cache->delete('usergroup.php' );
|
||||
|
||||
if( $action == "doadd" ) {
|
||||
$db->query( "INSERT INTO " . USERPREFIX . "_usergroups (group_name, colour, allow_cats, allow_adds, cat_add, allow_admin, allow_addc, allow_editc, allow_delc, edit_allc, del_allc, moderation, allow_all_edit, allow_edit, allow_pm, max_foto, allow_files, allow_hide, allow_short, allow_fixed, allow_feed, allow_search, allow_poll, allow_main, allow_rating, allow_offline, allow_image_upload, allow_file_upload, allow_tor_upload, allow_signature, allow_url, allow_image, max_signature, max_info, forum_post_edit, forum_post_del, forum_topic_set, forum_topic_edit, forum_topic_del, admin_addnews, admin_editnews, admin_categories, admin_editusers, admin_wordfilter, admin_static, admin_blockip, admin_iptools, admin_googlemap, admin_table) values ('$group_name', '$group_color', '$allow_cats', '$allow_adds', '$cat_add', '$allow_admin', '$allow_addc', '$allow_editc', '$allow_delc', '$edit_allc', '$del_allc', '$moderation', '$allow_all_edit', '$allow_edit', '$allow_pm', '$max_foto', '$allow_files', '$allow_hide', '$allow_short', '$allow_fixed', '$allow_feed', '$allow_search', '$allow_poll', '$allow_main', '$allow_rating', '$allow_offline', '$allow_image_upload', '$allow_file_upload', '$allow_tor_upload', '$allow_signature', '$allow_url', '$allow_image', '$max_signature', '$max_info', '$forum_post_edit', '$forum_post_del', '$forum_topic_set', '$forum_topic_edit', '$forum_topic_del', '$admin_addnews', '$admin_editnews', '$admin_categories', '$admin_editusers', '$admin_wordfilter', '$admin_static', '$admin_blockip', '$admin_iptools', '$admin_googlemap', '$admin_table')" );
|
||||
msg( "info", $lang['all_info'], $lang['group_ok1'], "$PHP_SELF?mod=usergroup" );
|
||||
} else {
|
||||
$id = intval( $_REQUEST['id'] );
|
||||
$db->query( "UPDATE " . USERPREFIX . "_usergroups set group_name='$group_name', colour='$group_color', allow_cats='$allow_cats', allow_adds='$allow_adds', cat_add='$cat_add', allow_admin='$allow_admin', allow_addc='$allow_addc', allow_editc='$allow_editc', allow_delc='$allow_delc', edit_allc='$edit_allc', del_allc='$del_allc', moderation='$moderation', allow_all_edit='$allow_all_edit', allow_edit='$allow_edit', allow_pm='$allow_pm', max_foto='$max_foto', allow_files='$allow_files', allow_hide='$allow_hide', allow_short='$allow_short', allow_fixed='$allow_fixed', allow_feed='$allow_feed', allow_search='$allow_search', allow_poll='$allow_poll', allow_main='$allow_main', allow_rating='$allow_rating', allow_offline='$allow_offline', allow_image_upload='$allow_image_upload', allow_file_upload='$allow_file_upload', allow_tor_upload='$allow_tor_upload', allow_signature='$allow_signature', allow_url='$allow_url', allow_image='$allow_image', max_signature='$max_signature', max_info='$max_info', forum_post_edit='$forum_post_edit', forum_post_del='$forum_post_del', forum_topic_set='$forum_topic_set', forum_topic_edit='$forum_topic_edit', forum_topic_del='$forum_topic_del', admin_addnews='$admin_addnews', admin_editnews='$admin_editnews', admin_categories='$admin_categories', admin_editusers='$admin_editusers', admin_wordfilter='$admin_wordfilter', admin_static='$admin_static', admin_blockip='$admin_blockip', admin_iptools='$admin_iptools', admin_googlemap='$admin_googlemap', admin_table='$admin_table' WHERE id='{$id}'" );
|
||||
msg( "info", $lang['all_info'], $lang['group_ok2'], "$PHP_SELF?mod=usergroup" );
|
||||
}
|
||||
$cache->clear();
|
||||
} elseif( $action == "add" or $action == "edit" ) {
|
||||
echoheader( "", "" );
|
||||
|
||||
if( $action == "add" ) {
|
||||
|
||||
$group_name_value = "";
|
||||
$group_color_value = "";
|
||||
|
||||
$allow_admin_no = "checked";
|
||||
$allow_offline_no = "checked";
|
||||
$allow_adds_yes = "checked";
|
||||
$allow_short_yes = "checked";
|
||||
$moderation_no = "checked";
|
||||
$allow_edit_no = "checked";
|
||||
$allow_all_edit_no = "checked";
|
||||
$allow_image_upload_yes = "checked";
|
||||
$allow_file_upload_yes = "checked";
|
||||
$allow_tor_upload_yes = "checked";
|
||||
|
||||
$allow_addc_yes = "checked";
|
||||
$allow_editc_yes = "checked";
|
||||
$allow_delc_yes = "checked";
|
||||
$edit_allc_no = "checked";
|
||||
$del_allc_no = "checked";
|
||||
$allow_hide_yes = "checked";
|
||||
$allow_pm_yes = "checked";
|
||||
$allow_files_yes = "checked";
|
||||
$allow_feed_yes = "checked";
|
||||
$allow_search_yes = "checked";
|
||||
$allow_rating_yes = "checked";
|
||||
$allow_fixed_no = "checked";
|
||||
$allow_poll_yes = "checked";
|
||||
$allow_main_yes = "checked";
|
||||
$allow_signature_yes = "checked";
|
||||
$allow_url_yes = "checked";
|
||||
$allow_image_no = "checked";
|
||||
|
||||
$forum_post_edit_no = "checked";
|
||||
$forum_post_del_no = "checked";
|
||||
$forum_topic_set_no = "checked";
|
||||
$forum_topic_edit_no = "checked";
|
||||
$forum_topic_del_no = "checked";
|
||||
|
||||
$admin_addnews_no = "checked";
|
||||
$admin_editnews_no = "checked";
|
||||
$admin_categories_no = "checked";
|
||||
$admin_editusers_no = "checked";
|
||||
$admin_wordfilter_no = "checked";
|
||||
$admin_static_no = "checked";
|
||||
$admin_blockip_no = "checked";
|
||||
$admin_iptools_no = "checked";
|
||||
$admin_googlemap_no = "checked";
|
||||
$admin_table_no = "checked";
|
||||
|
||||
$max_foto_value = "100";
|
||||
$max_signature_value = "500";
|
||||
$max_info_value = "1000";
|
||||
$submit_value = $lang['group_new'];
|
||||
$form_title = $lang['group_new1'];
|
||||
$form_action = "$PHP_SELF?mod=usergroup&action=doadd";
|
||||
$group_list = get_groups( 4 );
|
||||
|
||||
$cat_add_value = "selected";
|
||||
$allow_cats_value = "selected";
|
||||
$categories_list = CategoryNewsSelection( 0, 0, false );
|
||||
$cat_add_list = CategoryNewsSelection( 0, 0, false );
|
||||
|
||||
} else {
|
||||
|
||||
$id = intval( $_REQUEST['id'] );
|
||||
$group_name_value = htmlspecialchars( stripslashes( $user_group[$id]['group_name'] ) );
|
||||
$group_color_value = htmlspecialchars( stripslashes( $user_group[$id]['colour'] ) );
|
||||
|
||||
if( $user_group[$id]['allow_offline'] ) $allow_offline_yes = "checked"; else $allow_offline_no = "checked";
|
||||
if( $user_group[$id]['allow_admin'] ) $allow_admin_yes = "checked"; else $allow_admin_no = "checked";
|
||||
if( $user_group[$id]['allow_adds'] ) $allow_adds_yes = "checked"; else $allow_adds_no = "checked";
|
||||
if( $user_group[$id]['moderation'] ) $moderation_yes = "checked"; else $moderation_no = "checked";
|
||||
if( $user_group[$id]['allow_edit'] ) $allow_edit_yes = "checked"; else $allow_edit_no = "checked";
|
||||
if( $user_group[$id]['allow_all_edit'] ) $allow_all_edit_yes = "checked"; else $allow_all_edit_no = "checked";
|
||||
if( $user_group[$id]['allow_addc'] ) $allow_addc_yes = "checked"; else $allow_addc_no = "checked";
|
||||
if( $user_group[$id]['allow_editc'] ) $allow_editc_yes = "checked"; else $allow_editc_no = "checked";
|
||||
if( $user_group[$id]['allow_delc'] ) $allow_delc_yes = "checked"; else $allow_delc_no = "checked";
|
||||
if( $user_group[$id]['edit_allc'] ) $edit_allc_yes = "checked"; else $edit_allc_no = "checked";
|
||||
if( $user_group[$id]['del_allc'] ) $del_allc_yes = "checked"; else $del_allc_no = "checked";
|
||||
if( $user_group[$id]['allow_hide'] ) $allow_hide_yes = "checked"; else $allow_hide_no = "checked";
|
||||
if( $user_group[$id]['allow_pm'] ) $allow_pm_yes = "checked"; else $allow_pm_no = "checked";
|
||||
if( $user_group[$id]['allow_files'] ) $allow_files_yes = "checked"; else $allow_files_no = "checked";
|
||||
if( $user_group[$id]['allow_feed'] ) $allow_feed_yes = "checked"; else $allow_feed_no = "checked";
|
||||
if( $user_group[$id]['allow_search'] ) $allow_search_yes = "checked"; else $allow_search_no = "checked";
|
||||
if( $user_group[$id]['allow_rating'] ) $allow_rating_yes = "checked"; else $allow_rating_no = "checked";
|
||||
if( $user_group[$id]['allow_short'] ) $allow_short_yes = "checked"; else $allow_short_no = "checked";
|
||||
if( $user_group[$id]['allow_fixed'] ) $allow_fixed_yes = "checked"; else $allow_fixed_no = "checked";
|
||||
if( $user_group[$id]['allow_poll'] ) $allow_poll_yes = "checked"; else $allow_poll_no = "checked";
|
||||
if( $user_group[$id]['allow_main'] ) $allow_main_yes = "checked"; else $allow_main_no = "checked";
|
||||
if( $user_group[$id]['allow_image_upload'] ) $allow_image_upload_yes = "checked"; else $allow_image_upload_no = "checked";
|
||||
if( $user_group[$id]['allow_file_upload'] ) $allow_file_upload_yes = "checked"; else $allow_file_upload_no = "checked";
|
||||
if( $user_group[$id]['allow_tor_upload'] ) $allow_tor_upload_yes = "checked"; else $allow_tor_upload_no = "checked";
|
||||
if( $user_group[$id]['allow_signature'] ) $allow_signature_yes = "checked"; else $allow_signature_no = "checked";
|
||||
if( $user_group[$id]['allow_url'] ) $allow_url_yes = "checked"; else $allow_url_no = "checked";
|
||||
if( $user_group[$id]['allow_image'] ) $allow_image_yes = "checked"; else $allow_image_no = "checked";
|
||||
|
||||
if( $user_group[$id]['forum_post_edit'] ) $forum_post_edit_yes = "checked"; else $forum_post_edit_no = "checked";
|
||||
if( $user_group[$id]['forum_post_del'] ) $forum_post_del_yes = "checked"; else $forum_post_del_no = "checked";
|
||||
if( $user_group[$id]['forum_topic_set'] ) $forum_topic_set_yes = "checked"; else $forum_topic_set_no = "checked";
|
||||
if( $user_group[$id]['forum_topic_edit'] ) $forum_topic_edit_yes = "checked"; else $forum_topic_edit_no = "checked";
|
||||
if( $user_group[$id]['forum_topic_del'] ) $forum_topic_del_yes = "checked"; else $forum_topic_del_no = "checked";
|
||||
|
||||
if( $user_group[$id]['admin_addnews'] ) $admin_addnews_yes = "checked"; else $admin_addnews_no = "checked";
|
||||
if( $user_group[$id]['admin_editnews'] ) $admin_editnews_yes = "checked"; else $admin_editnews_no = "checked";
|
||||
if( $user_group[$id]['admin_categories'] ) $admin_categories_yes = "checked"; else $admin_categories_no = "checked";
|
||||
if( $user_group[$id]['admin_editusers'] ) $admin_editusers_yes = "checked"; else $admin_editusers_no = "checked";
|
||||
if( $user_group[$id]['admin_wordfilter'] ) $admin_wordfilter_yes = "checked"; else $admin_wordfilter_no = "checked";
|
||||
if( $user_group[$id]['admin_static'] ) $admin_static_yes = "checked"; else $admin_static_no = "checked";
|
||||
if( $user_group[$id]['admin_blockip'] ) $admin_blockip_yes = "checked"; else $admin_blockip_no = "checked";
|
||||
if( $user_group[$id]['admin_iptools'] ) $admin_iptools_yes = "checked"; else $admin_iptools_no = "checked";
|
||||
if( $user_group[$id]['admin_googlemap'] ) $admin_googlemap_yes = "checked"; else $admin_googlemap_no = "checked";
|
||||
if( $user_group[$id]['admin_table'] ) $admin_table_yes = "checked"; else $admin_table_no = "checked";
|
||||
|
||||
if( $id == 1 ) $admingroup = "disabled";
|
||||
if( $id == 5 ) $gastgroup = "disabled";
|
||||
|
||||
if( $user_group[$id]['allow_cats'] == "all" ) $allow_cats_value = "selected";
|
||||
$categories_list = CategoryNewsSelection( explode( ',', $user_group[$id]['allow_cats'] ), 0, false );
|
||||
|
||||
if( $user_group[$id]['cat_add'] == "all" ) $cat_add_value = "selected";
|
||||
$cat_add_list = CategoryNewsSelection( explode( ',', $user_group[$id]['cat_add'] ), 0, false );
|
||||
|
||||
$max_foto_value = $user_group[$id]['max_foto'];
|
||||
$max_signature_value = $user_group[$id]['max_signature'];
|
||||
$max_info_value = $user_group[$id]['max_info'];
|
||||
$submit_value = $lang['group_edit'];
|
||||
$form_title = $lang['group_edit1'] . $group_name_value;
|
||||
$form_action = "$PHP_SELF?mod=usergroup&action=doedit&id=" . $id;
|
||||
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
<script type="text/javascript" src="system/skins/tabs.js"></script>
|
||||
<form action="{$form_action}" method="post">
|
||||
<input type="hidden" name="user_hash" value="$dle_login_hash" />
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$form_title}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
|
||||
<div id="dle_tabView1">
|
||||
|
||||
<!--main area-->
|
||||
<div class="dle_aTab" style="display:none;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_name']}</b><br /><span class="small">{$lang[hint_gtitle]}</span></td>
|
||||
<td width="480" style="padding-top:2px;padding-bottom:2px;"><input class="edit" type="text" size="25" name="group_name" value="{$group_name_value}"></td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>Öâåò ãðóïïû</b><br /><span class="small">Öâåò ãðóïïû ïðè îòîáðàæåíèå â ñïèñêå àêòèâíûõ ïîëüçîâàòåëåé. (Íàïðèìåð: #CC0000)</span></td>
|
||||
<td width="480" style="padding-top:2px;padding-bottom:2px;"><input class="edit" type="text" size="25" name="group_color" value="{$group_color_value}"></td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_offline']}</b><br /><span class="small">{$lang['hint_goffline']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_offline" {$allow_offline_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_offline" {$allow_offline_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_hic']}</b><br /><span class="small">{$lang['hint_gvhide']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_hide" {$allow_hide_yes} value="1" > {$lang['opt_sys_yes']} <input type="radio" name="allow_hide" {$allow_hide_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_apm']}</b><br /><span class="small">{$lang['hint_gapm']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_pm" {$allow_pm_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_pm" {$allow_pm_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_afil']}</b><br /><span class="small">{$lang['hint_gafile']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_files" {$allow_files_yes} value="1" > {$lang['opt_sys_yes']} <input type="radio" name="allow_files" {$allow_files_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['a_feed']}</b><br /><span class="small">{$lang['hint_gafeed']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_feed" {$allow_feed_yes} value="1" > {$lang['opt_sys_yes']} <input type="radio" name="allow_feed" {$allow_feed_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['a_search']}</b><br /><span class="small">{$lang['hint_gasearch']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_search" {$allow_search_yes} value="1" > {$lang['opt_sys_yes']} <input type="radio" name="allow_search" {$allow_search_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_mfot']}</b><br /><span class="small">{$lang['hint_gmphoto']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input class="edit" type="text" size="10" name="max_foto" value="{$max_foto_value}"></td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_max_info']}</b><br /><span class="small">{$lang['hint_max_info']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input class="edit" type="text" size="10" name="max_info" value="{$max_info_value}"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!--news area-->
|
||||
<div class="dle_aTab" style="display:none;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_ct']}</b></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><select name="allow_cats[]" class="cat_select" multiple >
|
||||
<option value="all" {$allow_cats_value}>{$lang['edit_all']}</option>
|
||||
{$categories_list}
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_alct']}</b><br /><span class="small">{$lang['hint_gadc']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><select name="cat_add[]" class="cat_select" multiple >
|
||||
<option value="all" {$cat_add_value}>{$lang['edit_all']}</option>
|
||||
{$cat_add_list}
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_shid']}</b><br /><span class="small">{$lang['hint_gasr']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_short" {$allow_short_yes} value="1"> {$lang['opt_sys_yes']} <input type="radio" name="allow_short" {$allow_short_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_poll']}</b><br /><span class="small">{$lang['group_poll_hint']}</span></td>
|
||||
<td width="480" style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_poll" {$allow_poll_yes} value="1"> {$lang['opt_sys_yes']} <input type="radio" name="allow_poll" {$allow_poll_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['a_rating']}</b><br /><span class="small">{$lang['hint_garating']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_rating" {$allow_rating_yes} value="1" > {$lang['opt_sys_yes']} <input type="radio" name="allow_rating" {$allow_rating_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_adds']}</b><br /><span class="small">{$lang['hint_gaad']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_adds" {$allow_adds_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_adds" {$allow_adds_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_moder']}</b><br /><span class="small">{$lang['hint_gmod']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="moderation" {$moderation_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="moderation" {$moderation_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_main']}</b><br /><span class="small">{$lang['group_main_hint']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_main" {$allow_main_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_main" {$allow_main_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_fixed']}</b><br /><span class="small">{$lang['hint_gfixed']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_fixed" {$allow_fixed_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_fixed" {$allow_fixed_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['opt_sys_aiu']}</b><br /><span class="small">{$lang['opt_sys_aiud']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_image_upload" {$allow_image_upload_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_image_upload" {$allow_image_upload_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['opt_sys_file']}</b><br /><span class="small">{$lang['opt_sys_filed']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_file_upload" {$allow_file_upload_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_file_upload" {$allow_file_upload_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>Ðàçðåøèòü çàãðóçêó òîððåíòîâ íà ñåðâåð</b><br /><span class="small">{$lang['opt_sys_filed']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_tor_upload" {$allow_tor_upload_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_tor_upload" {$allow_tor_upload_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!--comments area-->
|
||||
<div class="dle_aTab" style="display:none;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_addc']}</b><br /><span class="small">{$lang['hint_gañ']}</span></td>
|
||||
<td width="480" style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_addc" {$allow_addc_yes} value="1" > {$lang['opt_sys_yes']} <input type="radio" name="allow_addc" {$allow_addc_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_signature']}</b><br /><span class="small">{$lang['hint_signature']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_signature" {$allow_signature_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_signature" {$allow_signature_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_max_signature']}</b><br /><span class="small">{$lang['hint_max_signature']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input class="edit" type="text" size="10" name="max_signature" value="{$max_signature_value}"></td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_url']}</b><br /><span class="small">{$lang['hint_group_url']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_url" {$allow_url_yes} value="1" > {$lang['opt_sys_yes']} <input type="radio" name="allow_url" {$allow_url_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_image']}</b><br /><span class="small">{$lang['hint_group_image']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_image" {$allow_image_yes} value="1"> {$lang['opt_sys_yes']} <input type="radio" name="allow_image" {$allow_image_no} value="0"> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_editc']}</b><br /><span class="small">{$lang['hint_geñ']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_editc" {$allow_editc_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_editc" {$allow_editc_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_delc']}</b><br /><span class="small">{$lang['hint_gdñ']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_delc" {$allow_delc_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_delc" {$allow_delc_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_allc']}</b><br /><span class="small">{$lang['hint_gaeñ']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="edit_allc" {$edit_allc_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="edit_allc" {$edit_allc_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_dllc']}</b><br /><span class="small">{$lang['hint_gadñ']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="del_allc" {$del_allc_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="del_allc" {$del_allc_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!--forum area-->
|
||||
<div class="dle_aTab" style="display:none;">
|
||||
<table width="100%">
|
||||
<tr><td style="padding:4px;" class="option"><b>Ìîãóò ðåäàêòèðîâàòü ñâîè ñîîáùåíèÿ?</b></td><td width="480" style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="forum_post_edit" {$forum_post_edit_yes} value="1" > {$lang['opt_sys_yes']} <input type="radio" name="forum_post_edit" {$forum_post_edit_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td></tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr><td style="padding:4px;" class="option"><b>Ìîãóò óäàëÿòü ñâîè ñîîáùåíèÿ?</b></td><td width="480" style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="forum_post_del" {$forum_post_del_yes} value="1" > {$lang['opt_sys_yes']} <input type="radio" name="forum_post_del" {$forum_post_del_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td></tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr><td style="padding:4px;" class="option"><b>Ìîãóò îòêðûâàòü/çàêðûâàòü ñâîè òåìû?</b></td><td width="480" style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="forum_topic_set" {$forum_topic_set_yes} value="1" > {$lang['opt_sys_yes']} <input type="radio" name="forum_topic_set" {$forum_topic_set_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td></tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr><td style="padding:4px;" class="option"><b>Ìîãóò èçìåíÿòü íàçâàíèÿ è îïèñàíèÿ ñâîèõ òåì?</b></td><td width="480" style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="forum_topic_edit" {$forum_topic_edit_yes} value="1" > {$lang['opt_sys_yes']} <input type="radio" name="forum_topic_edit" {$forum_topic_edit_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td></tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>Ìîãóò óäàëÿòü ñâîè òåìû?</b></td>
|
||||
<td width="480" style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="forum_topic_del" {$forum_topic_del_yes} value="1" > {$lang['opt_sys_yes']} <input type="radio" name="forum_topic_del" {$forum_topic_del_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!--admin area-->
|
||||
<div class="dle_aTab" style="display:none;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_aadm']}</b><br /><span class="small">{$lang['hint_gadmin']}</span></td>
|
||||
<td width="480" style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_admin" {$allow_admin_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_admin" {$allow_admin_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_a_addnews']}</b><br /><span class="small">{$lang['group_h_addnews']}</span></td>
|
||||
<td width="480" style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="admin_addnews" {$admin_addnews_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="admin_addnews" {$admin_addnews_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_a_editnews']}</b><br /><span class="small">{$lang['group_h_editnews']}</span></td>
|
||||
<td width="480" style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="admin_editnews" {$admin_editnews_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="admin_editnews" {$admin_editnews_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_edit2']}</b><br /><span class="small">{$lang['hint_gned']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_edit" {$allow_edit_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_edit" {$allow_edit_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_edit3']}</b><br /><span class="small">{$lang['hint_gnaed']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="allow_all_edit" {$allow_all_edit_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="allow_all_edit" {$allow_all_edit_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_a_categories']}</b><br /><span class="small">{$lang['group_h_categories']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="admin_categories" {$admin_categories_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="admin_categories" {$admin_categories_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_a_editusers']}</b><br /><span class="small">{$lang['group_h_editusers']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="admin_editusers" {$admin_editusers_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="admin_editusers" {$admin_editusers_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_a_wordfilter']}</b><br /><span class="small">{$lang['group_h_wordfilter']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="admin_wordfilter" {$admin_wordfilter_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="admin_wordfilter" {$admin_wordfilter_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_a_static']}</b><br /><span class="small">{$lang['group_h_static']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="admin_static" {$admin_static_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="admin_static" {$admin_static_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_a_blockip']}</b><br /><span class="small">{$lang['group_h_blockip']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="admin_blockip" {$admin_blockip_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="admin_blockip" {$admin_blockip_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_a_iptools']}</b><br /><span class="small">{$lang['group_h_iptools']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="admin_iptools" {$admin_iptools_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="admin_iptools" {$admin_iptools_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr><td background="system/skins/images/mline.gif" height=1 colspan=2></td></tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>{$lang['group_a_googlemap']}</b><br /><span class="small">{$lang['group_h_googlemap']}</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="admin_googlemap" {$admin_googlemap_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="admin_googlemap" {$admin_googlemap_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:4px;" class="option"><b>Ðàçðåøèòü óïðàâëåíèå ñòîëîì çàêàçîâ â àäìèíïàíåëè</b><br /><span class="small">Äàííàÿ îïöèÿ ïîçâîëèò ïîëüçîâàòåëÿì, èìåþùèì äîñòóï â àäìèíïàíåëü, óïðàâëÿòü çàêàçàìè â ñòîëå çàêàçîâ íà ñàéòå.</span></td>
|
||||
<td style="padding-top:2px;padding-bottom:2px;"><input type="radio" name="admin_table" {$admin_table_yes} value="1" {$gastgroup}> {$lang['opt_sys_yes']} <input type="radio" name="admin_table" {$admin_table_no} value="0" {$admingroup}> {$lang['opt_sys_no']}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:4px;"><input class="bbcodes" type="submit" value="$submit_value"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
initTabs('dle_tabView1',Array('{$lang['tabs_gr_all']}', '{$lang['tabs_gr_news']}', '{$lang['tabs_gr_comments']}', 'Ôîðóì', '{$lang['tabs_gr_admin']}'),0, '100%');
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
} else {
|
||||
echoheader( "", "" );
|
||||
|
||||
$db->query( "SELECT user_group, count(*) as count FROM " . USERPREFIX . "_users GROUP BY user_group" );
|
||||
while ( $row = $db->get_row() )
|
||||
$count_list[$row['user_group']] = $row['count'];
|
||||
$db->free();
|
||||
foreach ( $user_group as $group ) {
|
||||
$count = intval( $count_list[$group['id']] );
|
||||
$entries .= "
|
||||
<tr>
|
||||
<td height=22 class=\"list\"> <b>{$group['id']}</b></td>
|
||||
<td class=\"list\">{$group['group_name']}</td>
|
||||
<td class=\"list\" align=\"center\">$count</td>
|
||||
<td class=\"list\" align=\"center\"><a onClick=\"return dropdownmenu(this, event, MenuBuild('" . $group['id'] . "'), '150px')\" href=\"#\"><img src=\"system/skins/images/browser_action.gif\" border=\"0\"></a></td>
|
||||
</tr>
|
||||
<tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=4></td></tr>";
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
function MenuBuild( m_id ){
|
||||
|
||||
var menu=new Array()
|
||||
|
||||
menu[0]='<a href="?mod=usergroup&action=edit&id=' + m_id + '" >{$lang['group_sel1']}</a>';
|
||||
if (m_id > 5) {
|
||||
menu[1]='<a href="?mod=usergroup&action=del&user_hash={$dle_login_hash}&id=' + m_id + '" >{$lang['group_sel2']}</a>';
|
||||
}
|
||||
else {
|
||||
menu[1]='<a href="#" onclick="return false;"><font color="black">{$lang['group_sel3']}</font></a>';
|
||||
}
|
||||
|
||||
return menu;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['group_list']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width=50> ID</td>
|
||||
<td>{$lang['group_name']}</td>
|
||||
<td width=100 align="center">{$lang['group_sel4']}</td>
|
||||
<td width=70 align="center"> </td>
|
||||
</tr>
|
||||
<tr><td colspan="4"><div class="hr_line"></div></td></tr>
|
||||
{$entries}
|
||||
<tr><td colspan="4"><div class="hr_line"></div></td></tr>
|
||||
<tr><td colspan="4"><a href="?mod=usergroup&action=add"><input onclick="document.location='?mod=usergroup&action=add'" type="button" class="buttons" value="{$lang['group_sel5']}"></a></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
}
|
||||
?>
|
||||
394
system/inc/wordfilter.php
Normal file
@@ -0,0 +1,394 @@
|
||||
<?PHP
|
||||
if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {
|
||||
die( "Hacking attempt!" );
|
||||
}
|
||||
if( ! $user_group[$member_id['user_group']]['admin_wordfilter'] ) {
|
||||
msg( "error", $lang['index_denied'], $lang['index_denied'] );
|
||||
}
|
||||
|
||||
$result = "";
|
||||
$word_id = intval( $_REQUEST['word_id'] );
|
||||
|
||||
include_once SYSTEM_DIR . '/classes/parse.class.php';
|
||||
|
||||
$parse = new ParseFilter( Array (), Array (), 1, 1 );
|
||||
$parse->filter_mode = false;
|
||||
|
||||
// ********************************************************************************
|
||||
// Äîáàâëåíèå ñëîâà
|
||||
// ********************************************************************************
|
||||
if( $action == "add" ) {
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );}
|
||||
|
||||
$word_find = trim( strip_tags( stripslashes( $_POST['word_find'] ) ) );
|
||||
|
||||
if( $word_find == "" ) {
|
||||
msg( "error", $lang['word_error'], $lang['word_word'], "?mod=wordfilter" );
|
||||
}
|
||||
|
||||
if( $word_replace == "($lang[word_del])" ) {
|
||||
$word_replace = "";
|
||||
}
|
||||
|
||||
$word_replace = stripslashes( $parse->BB_Parse( $parse->process( $_POST['word_replace'] ), false ) );
|
||||
|
||||
$word_id = time();
|
||||
|
||||
$all_items = file( SYSTEM_DIR . '/data/wordfilter.db.php' );
|
||||
foreach ( $all_items as $item_line ) {
|
||||
$item_arr = explode( "|", $item_line );
|
||||
if( $item_arr[0] == $word_id ) {
|
||||
$word_id ++;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $all_items as $word_line ) {
|
||||
$word_arr = explode( "|", $word_line );
|
||||
if( $word_arr[1] == $word_find ) {
|
||||
msg( "error", $lang['word_error'], $lang['word_ar'], "?mod=wordfilter" );
|
||||
}
|
||||
}
|
||||
|
||||
$new_words = fopen( SYSTEM_DIR . '/data/wordfilter.db.php', "a" );
|
||||
$word_find = str_replace( "|", "|", $word_find );
|
||||
$word_replace = str_replace( "|", "|", $word_replace );
|
||||
|
||||
$word_find = str_replace( "$", "$", $word_find );
|
||||
$word_find = str_replace( "{", "{", $word_find );
|
||||
$word_find = str_replace( "}", "}", $word_find );
|
||||
|
||||
$word_replace = str_replace( "$", "$", $word_replace );
|
||||
$word_replace = str_replace( "{", "{", $word_replace );
|
||||
$word_replace = str_replace( "}", "}", $word_replace );
|
||||
|
||||
fwrite( $new_words, "$word_id|$word_find|$word_replace|" . intval( $_POST['type'] ) . "|". intval( $_POST['register'] ) ."|". intval( $_POST['filter_search'] ) ."|". intval( $_POST['filter_action'] ) ."||\n" );
|
||||
fclose( $new_words );
|
||||
}
|
||||
// ********************************************************************************
|
||||
// Óäàëåíèå ñëîâà
|
||||
// ********************************************************************************
|
||||
elseif( $action == "remove" ) {
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
|
||||
|
||||
die( "Hacking attempt! User not found" );
|
||||
|
||||
}
|
||||
|
||||
if( ! $word_id ) {
|
||||
msg( "error", $lang['word_error'], $lang['word_nof'], "$PHP_SELF?mod=wordfilter" );
|
||||
}
|
||||
|
||||
$old_words = file( SYSTEM_DIR . '/data/wordfilter.db.php' );
|
||||
$new_words = fopen( SYSTEM_DIR . '/data/wordfilter.db.php', "w" );
|
||||
|
||||
foreach ( $old_words as $old_words_line ) {
|
||||
$word_arr = explode( "|", $old_words_line );
|
||||
if( $word_arr[0] != $word_id ) {
|
||||
fwrite( $new_words, $old_words_line );
|
||||
}
|
||||
}
|
||||
fclose( $new_words );
|
||||
}
|
||||
// ********************************************************************************
|
||||
// Ðåäàêòèðîâàíèå ñëîâà
|
||||
// ********************************************************************************
|
||||
elseif( $action == "edit" ) {
|
||||
|
||||
// Check if Filter was specified
|
||||
if( ! $word_id ) {
|
||||
msg( "error", $lang['word_error'], $lang['word_nof'], "$PHP_SELF?mod=wordfilter" );
|
||||
}
|
||||
|
||||
// Search & Load filter in to the Form
|
||||
$all_words = file( SYSTEM_DIR . '/data/wordfilter.db.php' );
|
||||
foreach ( $all_words as $word_line ) {
|
||||
$word_arr = explode( "|", $word_line );
|
||||
if( $word_arr[0] == $word_id ) {
|
||||
|
||||
$word_arr[1] = $parse->decodeBBCodes( $word_arr[1], false );
|
||||
$word_arr[2] = $parse->decodeBBCodes( $word_arr[2], false );
|
||||
|
||||
if( $word_arr[3] ) $selected = "selected";
|
||||
else $selected = "";
|
||||
|
||||
if( $word_arr[4] ) $selected_1 = "selected";
|
||||
else $selected_1 = "";
|
||||
|
||||
$selected_2[$word_arr[5]] = "selected";
|
||||
$selected_3[$word_arr[6]] = "selected";
|
||||
|
||||
$msg = "<script type=\"text/javascript\" language=\"javascript\">onload=focus;function focus(){document.forms[0].word_find.focus();}</script>
|
||||
<form action=\"$PHP_SELF\" method=post>
|
||||
|
||||
<table width=\"100%\">
|
||||
<tr>
|
||||
<td style=\"padding:2px;\" width=\"140px;\">{$lang['word_word']}</td>
|
||||
<td style=\"padding:2px;\"><input class=edit style=\"width:250px;\" value=\"$word_arr[1]\" type=text name=word_find></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$lang['word_rep']}</td>
|
||||
<td style=\"padding:2px;\"><input class=\"edit\" style=\"width:250px;\" value=\"$word_arr[2]\" type=text name=word_replace></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$lang['filter_type']}</td>
|
||||
<td style=\"padding:2px;\"><select name=type><option value=\"0\">{$lang['filter_type_1']}</option><option value=\"1\" {$selected}>{$lang['filter_type_2']}</option></select></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$lang['filter_register']}</td>
|
||||
<td style=\"padding:2px;\"><select name=register><option value=\"0\">{$lang['opt_sys_no']}</option><option value=\"1\" {$selected_1}>{$lang['opt_sys_yes']}</option></select></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$lang['filter_search']}</td>
|
||||
<td style=\"padding:2px;\"><select name=\"filter_search\"><option value=\"0\" {$selected_2[0]}>{$lang['filter_search_0']}</option><option value=\"1\" {$selected_2[1]}>{$lang['filter_search_1']}</option><option value=\"2\" {$selected_2[2]}>{$lang['filter_search_2']}</option></select></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$lang['filter_action']}</td>
|
||||
<td style=\"padding:2px;\"><select name=\"filter_action\"><option value=\"0\" {$selected_3[0]}>{$lang['filter_action_0']}</option><option value=\"1\" {$selected_3[1]}>{$lang['filter_action_1']}</option></select></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\"> </td>
|
||||
<td style=\"padding:2px;\"><input type=\"submit\" value=\" {$lang['user_save']} \" class=\"edit\"></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<input type=hidden name=action value=doedit>
|
||||
<input type=hidden name=word_id value=\"$word_arr[0]\">
|
||||
<input type=hidden name=mod value=wordfilter>
|
||||
<input type=hidden name=user_hash value=\"$dle_login_hash\">
|
||||
</form>";
|
||||
|
||||
// Messages
|
||||
msg( "wordfilter", $lang['word_head'], $msg );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
// ********************************************************************************
|
||||
// Ñîõðàíåíèå ñëîâà
|
||||
// ********************************************************************************
|
||||
elseif( $action == "doedit" ) {
|
||||
|
||||
if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
|
||||
|
||||
die( "Hacking attempt! User not found" );
|
||||
|
||||
}
|
||||
|
||||
$word_find = trim( strip_tags( stripslashes( $_POST['word_find'] ) ) );
|
||||
|
||||
if( $word_find == "" ) {
|
||||
msg( "error", $lang['word_error'], $lang['word_word'], "javascript:history.go(-1)" );
|
||||
}
|
||||
|
||||
$word_replace = stripslashes( $parse->BB_Parse( $parse->process( $_POST['word_replace'] ), false ) );
|
||||
|
||||
$word_find = str_replace( "|", "|", $word_find );
|
||||
$word_replace = str_replace( "|", "|", $word_replace );
|
||||
|
||||
$word_find = str_replace( "$", "$", $word_find );
|
||||
$word_find = str_replace( "{", "{", $word_find );
|
||||
$word_find = str_replace( "}", "}", $word_find );
|
||||
|
||||
$word_replace = str_replace( "$", "$", $word_replace );
|
||||
$word_replace = str_replace( "{", "{", $word_replace );
|
||||
$word_replace = str_replace( "}", "}", $word_replace );
|
||||
|
||||
$old_words = file( SYSTEM_DIR . '/data/wordfilter.db.php' );
|
||||
$new_words = fopen( SYSTEM_DIR . '/data/wordfilter.db.php', "w" );
|
||||
|
||||
foreach ( $old_words as $word_line ) {
|
||||
$word_arr = explode( "|", $word_line );
|
||||
if( $word_arr[0] == $word_id ) {
|
||||
fwrite( $new_words, "$word_id|$word_find|$word_replace|" . intval( $_POST['type'] ) . "|". intval( $_POST['register'] ) ."|". intval( $_POST['filter_search'] ) ."|". intval( $_POST['filter_action'] ) ."||\n" );
|
||||
} else {
|
||||
fwrite( $new_words, $word_line );
|
||||
}
|
||||
}
|
||||
|
||||
fclose( $new_words );
|
||||
}
|
||||
// ********************************************************************************
|
||||
// Ñïèñîê ñëîâ
|
||||
// ********************************************************************************
|
||||
echoheader( "wordfilter", $lang['word_head'] );
|
||||
|
||||
echo <<<HTML
|
||||
<form action="{$PHP_SELF}" method="post">
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['word_new']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;" width="140px;">{$lang['word_word']}</td>
|
||||
<td style="padding:2px;"><input class="edit" type="text" style="width:250px;" name="word_find" title="{$lang['word_help']}" ></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;">{$lang['word_rep']}</td>
|
||||
<td style="padding:2px;"><input class="edit" style="width:250px;" type="text" name="word_replace" title="$lang[word_help_1]"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" width="140px;">{$lang['filter_type']}</td>
|
||||
<td style="padding:2px;"><select name=type><option value="0">{$lang['filter_type_1']}</option><option value="1">{$lang['filter_type_2']}</option></select></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" width="140px;">{$lang['filter_register']}</td>
|
||||
<td style="padding:2px;"><select name=register><option value="0">{$lang['opt_sys_no']}</option><option value="1">{$lang['opt_sys_yes']}</option></select></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" width="140px;">{$lang['filter_search']}</td>
|
||||
<td style="padding:2px;"><select name="filter_search"><option value="0">{$lang['filter_search_0']}</option><option value="1">{$lang['filter_search_1']}</option><option value="2">{$lang['filter_search_2']}</option></select></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;" width="140px;">{$lang['filter_action']}</td>
|
||||
<td style="padding:2px;"><select name="filter_action"><option value="0">{$lang['filter_action_0']}</option><option value="1">{$lang['filter_action_1']}</option></select></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:2px;"> </td>
|
||||
<td style="padding:2px;"><input type="submit" value=" {$lang['user_save']} " class="edit"></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<input type="hidden" name="action" value="add">
|
||||
<input type="hidden" name="mod" value="wordfilter">
|
||||
<input type="hidden" name="user_hash" value="$dle_login_hash" />
|
||||
</form>
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['word_worte']}</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="unterline"></div>
|
||||
<table width="100%">
|
||||
HTML;
|
||||
|
||||
$all_words = file( SYSTEM_DIR . '/data/wordfilter.db.php' );
|
||||
$count_words = 0;
|
||||
|
||||
usort( $all_words, "compare_filter" );
|
||||
|
||||
foreach ( $all_words as $word_line ) {
|
||||
$word_arr = explode( "|", $word_line );
|
||||
|
||||
$result .= "
|
||||
<tr>
|
||||
<td style=\"padding:3px\">
|
||||
$word_arr[1]
|
||||
</td><td>";
|
||||
|
||||
if( $word_arr[2] == "" ) {
|
||||
$result .= "<font color=\"red\">$lang[word_del]</font>";
|
||||
} else {
|
||||
$result .= "$word_arr[2]";
|
||||
}
|
||||
|
||||
$type = ($word_arr[3]) ? $lang['filter_type_2'] : $lang['filter_type_1'];
|
||||
$register = ($word_arr[4]) ? $lang['opt_sys_yes'] : $lang['opt_sys_no'];
|
||||
|
||||
|
||||
$result .= "</td><td>{$register}</td><td>{$type}</td><td>{$lang['filter_search_'.$word_arr[5]]}</td><td>{$lang['filter_action_'.$word_arr[6]]}</td><td>
|
||||
<a class=maintitle href=\"$PHP_SELF?mod=wordfilter&action=edit&word_id=$word_arr[0]\">[ {$lang[word_ledit]} ]</a>
|
||||
</td> <td >
|
||||
<a class=maintitle href=\"$PHP_SELF?mod=wordfilter&action=remove&user_hash={$dle_login_hash}&word_id=$word_arr[0]\">[ $lang[word_ldel] ]</a>
|
||||
</tr></tr><tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=8></td></tr>";
|
||||
$count_words ++;
|
||||
}
|
||||
|
||||
if( $count_words == 0 ) {
|
||||
echo "
|
||||
<tr>
|
||||
<td height=18 colspan=8>
|
||||
<p align=center><br><b>$lang[word_empty]</b>
|
||||
</tr>";
|
||||
} else {
|
||||
|
||||
echo "<tr>
|
||||
<td>
|
||||
$lang[word_worte]
|
||||
<td>
|
||||
$lang[word_lred]
|
||||
<td width=150>
|
||||
$lang[filter_register]
|
||||
<td width=150>
|
||||
$lang[filter_type]
|
||||
<td width=150>
|
||||
$lang[filter_search]
|
||||
<td width=120>
|
||||
$lang[filter_action]
|
||||
<td width=100>
|
||||
|
||||
<td width=100>
|
||||
|
||||
</tr><tr>
|
||||
<td colspan=\"8\"><div class=\"hr_line\"></div></td>
|
||||
</tr>";
|
||||
|
||||
echo $result;
|
||||
|
||||
}
|
||||
|
||||
echo "<tr>
|
||||
<td colspan=2 class=\"main\"><br>{$lang['word_help_2']}
|
||||
</tr>";
|
||||
|
||||
echo <<<HTML
|
||||
</table>
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
echofooter();
|
||||
?>
|
||||