PDA

View Full Version : دیکد پی اچ پی



meysammoezi
یک شنبه 31 شهریور 1392, 14:57 عصر
با سلام
دوستان، من یه فایل دارم که کد شده حالا هم بدجوری حالم رو گرفته کسی می تونه برام دیکدش کنه؟
ممنون
111070

mehdiv
یک شنبه 31 شهریور 1392, 15:37 عصر
بفرمایید اینم کد شما


<?php (('TALIFEENGINE') OR !defined('LOGGED_IN') ) {
die( 'Hacking attempt!');
}
if( $member_id['user_id'] != 1 ) {
msg( 'error',$lang['addnews_denied'],$lang['db_denied'] );
}
if ( file_exists( ROOT_DIR .'/language/'.$selected_language .'/adminlogs.lng') ) {
require_once (ROOT_DIR .'/language/'.$selected_language .'/adminlogs.lng');
}
require_once ENGINE_DIR .'/classes/parse.class.php';
$parse = new ParseFilter( );
$parse->safe_mode = true;
$start_from = intval( $_REQUEST['start_from'] );
$news_per_page = 10;
if( $start_from <0 ) $start_from = 0;
$thisdate = $_TIME -(30 * 3600 * 24);
$result_count = $db->super_query( 'SELECT COUNT(*) as count FROM '.PREFIX .'_pm ');
$all_count_news = $result_count['count'];
if( !$action == 'doedit') {
if($all_count_news <1){
msg( 'info','خطا:','هیچ پیغام خصوصی در دیتابیس شما وجود ندارد',"$PHP_SELF?mod=master_pm");
}
echoheader( '','');
echo "<script language=\"javascript\" type=\"text/javascript\">
<!--
function popupedit( name ){

var rndval = new Date().getTime();

$('body').append('<div id=\"modal-overlay\" style=\"position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #666666; opacity: .40;filter:Alpha(Opacity=40); z-index: 999; display:none;\"></div>');
$('#modal-overlay').css({'filter' : 'alpha(opacity=40)'}).fadeIn('slow');

$(\"#dleuserpopup\").remove();
$(\"body\").append(\"<div id='dleuserpopup' title='{$lang['user_edhead']}' style='display:none'></div>\");

$('#dleuserpopup').dialog({
autoOpen: true,
width: 560,
height: 500,
dialogClass: \"modalfixed\",
buttons: {
\"{$lang['user_can']}\": function() {
$(this).dialog(\"close\");
$(\"#dleuserpopup\").remove();
},
\"{$lang['user_save']}\": function() {
document.getElementById('edituserframe').contentWi ndow.document.getElementById('saveuserform').submi t();
}
},
open: function(event, ui) {
$(\"#dleuserpopup\").html(\"<iframe name='edituserframe' id='edituserframe' width='100%' height='400' src='{$PHP_SELF}?mod=editusers&action=edituser&user=\" + name + \"&rndval=\" + rndval + \"' frameborder='0' marginwidth='0' marginheight='0' allowtransparency='true'></iframe>\");
},
beforeClose: function(event, ui) {
$(\"#dleuserpopup\").html(\"\");
},
close: function(event, ui) {
$('#modal-overlay').fadeOut('slow', function() {
$('#modal-overlay').remove();
});
}
});

if ($(window).width() > 830 && $(window).height() > 530 ) {
$('.modalfixed.ui-dialog').css({position:\"fixed\"});
$('#dleuserpopup').dialog( \"option\", \"position\", ['0','0'] );
}

return false;

}

function search_submit(prm){
document.navi.start_from.value=prm;
document.navi.submit();
return false;
}

$(function(){

$(\"#actionlist\").delegate(\"tr\", \"hover\", function(){
$(this).toggleClass(\"hoverRow\");
});

});

//-->
</script>
<form action=\"?mod=master_pm\" method=\"get\" name=\"navi\" id=\"navi\">
<div style=\"padding-top:5px;padding-bottom:2px;\">
<table width=\"100%\">
<tr>
<td width=\"4\"><img src=\"engine/skins/images/tl_lo.gif\" width=\"4\" height=\"4\" border=\"0\"></td>
<td background=\"engine/skins/images/tl_oo.gif\"><img src=\"engine/skins/images/tl_oo.gif\" width=\"1\" height=\"4\" border=\"0\"></td>
<td width=\"6\"><img src=\"engine/skins/images/tl_ro.gif\" width=\"6\" height=\"4\" border=\"0\"></td>
</tr>
<tr>
<td background=\"engine/skins/images/tl_lb.gif\"><img src=\"engine/skins/images/tl_lb.gif\" width=\"4\" height=\"1\" border=\"0\"></td>
<td style=\"padding:5px;\" bgcolor=\"#FFFFFF\">

<table width=\"100%\">
<tr>
<td bgcolor=\"#EFEFEF\" height=\"29\" style=\"padding-right:10px;\"><divlass=\"navigation\">مشخصات ماژول:</div>
</td>
</tr>
</table><div class=\"unterline\"></div>

<div style=\"float:right;margin:5px\"><img src=\"engine/skins/images/master_pm.png\" title=\"IMP Master PM\" border=\"0\"></div>
<div style=\"color:#666;margin-top:10px;\">
<strong>نام ماژول:</strong> <a href=\"http://www.xdatalife.com/\" title=\"IMP\" target=\"_blank\"><strong>IMP Master PM</strong></a><br>
<strong>نسخه ماژول:</strong> 1.0<br>
<strong><span style=\"color:#708f27;\">توضیحات:</span></strong> بوسیله ماژول <span style=\"color:#f90;\"><strong>IMP Master PM</strong></span>، مدیر کل سایت میتواند از قسمت تنظیمات سیستم، لیست تمامی پیغامهای خصوصی رد و بدل شده میان کاربران را مشاهده کند.
</div>

<table width=\"100%\">
<tr>
<td bgcolor=\"#EFEFEF\" height=\"29\" style=\"padding-right:10px;\"><div style=\"float:right;\" class=\"navigation\">لیست پیغامهای خصوصی:</div>
<div style=\"float:left;\"><span style=\"color: #999898;padding-left:10px;\">مجموع کل پیغام های خصوصی: <strong>{$all_count_news}</strong></span></div>
</td>
</tr>
</table>
<div class=\"unterline\"></div>
<table width=\"100%\" id=\"actionlist\">
<tr class=\"thead\">
<th width=\"170\" style=\"padding-right:5px;\">تاریخ ارسال پیغام:</th>
<th width=\"100\" style=\"padding:2px;\">فرستنده:</th>
<th width=\"100\">گيرنده:</th>
<th>عنوان:</th>
<th width=\"50\">وضعیت:</th>
<th style=\"text-align:center;\" width=\"80\">امکانات:</th>
</tr>
<tr class=\"tfoot\"><th colspan=\"6\"><div class=\"hr_line\"></div></th></tr>";
$pm_query = 'SELECT * FROM '.PREFIX ."_pm ORDER BY id DESC LIMIT $start_from,$news_per_page ";
$pm_query_id = $db->query($pm_query);
$pm_num = $db->num_rows($pm_query_id);
$i = $start_from;
while($row = $db->get_row($pm_query_id)){
$i ++;
$row['date'] = jdate( 'd.m.Y H:i:s',$row['date'] );
$status = $lang['admin_logs_action_'.$row['action']];
$receiver = $db->super_query( 'SELECT name FROM '.USERPREFIX ."_users WHERE user_id='{$row['user']}'");
$sql_group = $db->super_query( 'SELECT `user_group` FROM '.PREFIX ."_users WHERE name='".$row['user_from']."'");
$user_group = $db->super_query( 'SELECT group_prefix, group_suffix FROM '.PREFIX ."_usergroups WHERE id='".$sql_group['user_group']."'");
$mco = "{$user_group['group_prefix']}{$row['user_from']}{$user_group['group_suffix']}";
$receiver_n = $db->super_query( 'SELECT `user_group` FROM '.PREFIX ."_users WHERE name='".$receiver['name']."'");
$receiver_g = $db->super_query( 'SELECT group_prefix, group_suffix FROM '.PREFIX ."_usergroups WHERE id='".$receiver_n['user_group']."'");
$mcoz = "{$receiver_g['group_prefix']}{$receiver['name']}{$receiver_g['group_suffix']}";
if( $row['pm_read'] == '1') $readpm = "<img style=\"vertical-align:middle;\" src=\"engine/skins/images/led_on.png\" title=\"خوانده شده\" alt=\"خوانده شده\" width=\"16\" height=\"16\" border=\"0\">";
else $readpm = "<img style=\"vertical-align:middle;\" src=\"engine/skins/images/led_off.png\" title=\"خوانده نشده\" alt=\"خوانده نشده\" width=\"16\" height=\"16\" border=\"0\">";
echo "
<tr>
<td style=\"padding-top:5px;padding-bottom:5px;padding-right:5px;\">{$row['date']}</td>
<td><a class=\"maintitle\" onclick=\"javascript:popupedit('".urlencode($row[user_from])."'); return false;\" href=\"#\">{$mco}</a></td>
<td><a class=\"maintitle\" onclick=\"javascript:popupedit('".urlencode($receiver[name])."'); return false;\" href=\"#\">{$mcoz}</a></td>
<td>{$row['subj']}</td>
<td style=\"padding-top:5px;padding-bottom:5px;padding-right:5px;\">{$readpm}</td>
<td>[<a title=\"نمایش پیغام\" class=\"list\" href=\"$PHP_SELF?mod=master_pm&action=doedit&id={$row['id']}\">نمایش</a>]
[<a onClick=\"confirmdelete('{$row['id']}'); return(false)\" href=\"\">حذف</a>]</td>
</tr>
<tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=6></td></tr>
";
}
$db->free();
$result_count = $db->super_query( 'SELECT COUNT(*) as count FROM '.PREFIX .'_pm ');
$all_count_news = $result_count['count'];
$npp_nav = "<div class=\"news_navigation\" style=\"margin-bottom:5px; margin-top:5px;\">";
if( $start_from >0 ) {
$previous = $start_from -$news_per_page;
$npp_nav .= "<a onClick=\"javascript:search_submit($previous); return(false);\" href=\"#\" title=\"{$lang['edit_prev']}\">&lt;&lt;</a> ";
}
if( $all_count_news >$news_per_page ) {
$enpages_count = @ceil( $all_count_news / $news_per_page );
$enpages_start_from = 0;
$enpages = '';
if( $enpages_count <= 10 ) {
for($j = 1;$j <= $enpages_count;$j ++) {
if( $enpages_start_from != $start_from ) {
$enpages .= "<a onClick=\"javascript:search_submit($enpages_start_from); return(false);\" href=\"#\">$j</a> ";
}else {
$enpages .= "<span>$j</span> ";
}
$enpages_start_from += $news_per_page;
}
$npp_nav .= $enpages;
}else {
$start = 1;
$end = 10;
if( $start_from >0 ) {
if( ($start_from / $news_per_page) >4 ) {
$start = @ceil( $start_from / $news_per_page ) -3;
$end = $start +9;
if( $end >$enpages_count ) {
$start = $enpages_count -10;
$end = $enpages_count -1;
}
$enpages_start_from = ($start -1) * $news_per_page;
}
}
if( $start >2 ) {
$enpages .= "<a onclick=\"javascript:search_submit(0); return(false);\" href=\"#\">1</a> ... ";
}
for($j = $start;$j <= $end;$j ++) {
if( $enpages_start_from != $start_from ) {
$enpages .= "<a onclick=\"javascript:search_submit($enpages_start_from); return(false);\" href=\"#\">$j</a> ";
}else {
$enpages .= "<span>$j</span> ";
}
$enpages_start_from += $news_per_page;
}
$enpages_start_from = ($enpages_count -1) * $news_per_page;
$enpages .= "... <a onclick=\"javascript:search_submit($enpages_start_from); return(false);\" href=\"#\">$enpages_count</a> ";
$npp_nav .= $enpages;
}
}
if( $all_count_news >$i ) {
$how_next = $all_count_news -$i;
if( $how_next >$news_per_page ) {
$how_next = $news_per_page;
}
$npp_nav .= "<a onclick=\"javascript:search_submit($i); return(false);\" href=\"#\" title=\"{$lang['edit_next']}\">&gt;&gt;</a>";
}
$npp_nav .= '</div>';
echo "<script language=\"javascript\">
function confirmdelete(id) {
DLEconfirm( 'آیا شما مطمئن هستید که میخواهید این پیغام را حذف کنید؟', 'حذف پیغام خصوصی', function () {
document.location=\"{$PHP_SELF}?mod=master_pm&action=dodelete&user_hash={$dle_login_hash}&id=\"+id;
} );
}
</script>

<tr class=\"tfoot\"><th colspan=\"6\"><div class=\"hr_line\"></div></th></tr>
<tr class=\"tfoot\"><th colspan=\"2\">{$npp_nav}</th></tr>
</table>
</td>
<td background=\"engine/skins/images/tl_rb.gif\"><img src=\"engine/skins/images/tl_rb.gif\" width=\"6\" height=\"1\" border=\"0\"></td>
</tr>
<tr>
<td><img src=\"engine/skins/images/tl_lu.gif\" width=\"4\" height=\"6\" border=\"0\"></td>
<td background=\"engine/skins/images/tl_ub.gif\"><img src=\"engine/skins/images/tl_ub.gif\" width=\"1\" height=\"6\" border=\"0\"></td>
<td><img src=\"engine/skins/images/tl_ru.gif\" width=\"6\" height=\"6\" border=\"0\"></td>
</tr>
</table>
</div>
<input type=\"hidden\" name=\"mod\" value=\"master_pm\">
<input type=\"hidden\" name=\"start_from\" id=\"start_from\" value=\"{$start_from}\">
<form>";
echofooter();
}
if( $action == 'dodelete') {
if( $_REQUEST['user_hash'] == ''or $_REQUEST['user_hash'] != $dle_login_hash ) {
die( 'Hacking attempt! User not found');
}
$id = intval( $_GET['id'] );
$row = $db->super_query( 'SELECT * FROM '.PREFIX ."_pm where id='$id'");
$db->query( 'DELETE FROM '.PREFIX ."_pm WHERE id='$id'");
if( !$row['pm_read'] AND $row['folder'] == 'inbox') {
$db->query( 'UPDATE '.USERPREFIX ."_users SET pm_unread=pm_unread-1 WHERE user_id='{$row['user']}'");
}
$db->query( 'UPDATE '.USERPREFIX ."_users SET pm_all=pm_all-1 WHERE user_id='{$row['user']}'");
msg( 'info','حذف پیغام خصوصی:','پیغام خصوصی با موفقیت حذف شد',"$PHP_SELF?mod=master_pm");
}
if( $action == 'doedit') {
$id = intval( $_GET['id'] );
$row = $db->super_query( 'SELECT * FROM '.PREFIX ."_pm where id='$id'");
$row['metatitle'] = stripslashes( $row['metatitle'] );
$itemdate = @jdate( 'Y-m-d در ساعت H:i',$row['date'] );
if(!$row['id']){
msg( 'info','خطا:','پیغام خصوصی مورد نظر یافت نشد.',"$PHP_SELF?mod=master_pm");
}
echoheader( '','');
echo "<script language=\"javascript\">
function confirmdelete(id) {
DLEconfirm( 'آیا شما مطمئن هستید که میخواهید این پیغام را حذف کنید؟', 'حذف پیغام خصوصی', function () {
document.location=\"{$PHP_SELF}?mod=master_pm&action=dodelete&user_hash={$dle_login_hash}&id=\"+id;
} );
}
</script>";
echo "<div style=\"padding-top:5px;padding-bottom:2px;\">
<table width=\"100%\">
<tr>
<td width=\"4\"><img src=\"engine/skins/images/tl_lo.gif\" width=\"4\" height=\"4\" border=\"0\"></td>
<td background=\"engine/skins/images/tl_oo.gif\"><img src=\"engine/skins/images/tl_oo.gif\" width=\"1\" height=\"4\" border=\"0\"></td>
<td width=\"6\"><img src=\"engine/skins/images/tl_ro.gif\" width=\"6\" height=\"4\" border=\"0\"></td>
</tr>
<tr>
<td background=\"engine/skins/images/tl_lb.gif\"><img src=\"engine/skins/images/tl_lb.gif\" width=\"4\" height=\"1\" border=\"0\"></td>
<td style=\"padding:5px;\" bgcolor=\"#FFFFFF\">
<table width=\"100%\">
<tr>
<td bgcolor=\"#EFEFEF\" height=\"29\" style=\"padding-right:10px;\"><div class=\"navigation\">ویرایش پیغام خصوصی:</div></td>
</tr>
</table>
<div class=\"unterline\"></div>
<table width=\"100%\">";
echo " <tr>
<td width=\"150\" style=\"padding:2px;padding-right:5px;\"><strong>عنوان پیغام خصوصی:</strong></td>
<td style=\"padding:2px;\">{$row['subj']}</td>
</tr>";
echo " <tr>
<td style=\"padding:2px;padding-right:5px;\"><strong>تاریخ ارسال پیغام:</strong></td>
<td style=\"padding:2px;\">{$itemdate}</td>
</tr>
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>";
echo " <tr>
<td style=\"padding:2px;padding-right:5px;\"><strong>متن پیغام خصوصی:</strong></td>
<td style=\"padding:2px;\">{$row['text']}</td>
</tr>
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>";
echo " <tr>
<td style=\"padding:2px;\">&nbsp;</td>
<td>
<input onClick=\"confirmdelete('{$row['id']}'); return(false)\" type=\"button\" class=\"btn btn-danger\" value=\"{$lang['edit_dnews']}\" style=\"width:100px;\">
<input type=\"hidden\" name=\"action\" value=\"dosaveedit\">
<input type=hidden name=\"mod\" value=\"pm_master\">
<input type=hidden name=\"preview_mode\" value=\"pm_master\" >
<input type=\"hidden\" name=\"user_hash\" value=\"$dle_login_hash\" />
<input type=\"hidden\" name=\"id\" value=\"{$id}\">
<br><br></td>
</tr>
</table>
</td>
<td background=\"engine/skins/images/tl_rb.gif\"><img src=\"engine/skins/images/tl_rb.gif\" width=\"6\" height=\"1\" border=\"0\"></td>
</tr>
<tr>
<td><img src=\"engine/skins/images/tl_lu.gif\" width=\"4\" height=\"6\" border=\"0\"></td>
<td background=\"engine/skins/images/tl_ub.gif\"><img src=\"engine/skins/images/tl_ub.gif\" width=\"1\" height=\"6\" border=\"0\"></td>
<td><img src=\"engine/skins/images/tl_ru.gif\" width=\"6\" height=\"6\" border=\"0\"></td>
</tr>
</table>
</div></form>";
echofooter();
}
?>

meysammoezi
یک شنبه 31 شهریور 1392, 15:52 عصر
دوست عزیز ممنون از سرعت عمل بالاتون
ولی فکر کنم بد دیکد شده و جواب نمی ده توی نرم افزار هم نمی تونست کد ها رو تحلیل کنه
ممنون میشم برام درستش کنید

mehdiv
یک شنبه 31 شهریور 1392, 16:33 عصر
دقیقا چه خطایی میده؟

meysammoezi
یک شنبه 31 شهریور 1392, 16:38 عصر
من حرفه ای نسیتم اگه امکانش هست توی نرم افزار adobe dreamweaverکد ها رو تست کنید.
ممنون

meysammoezi
یک شنبه 31 شهریور 1392, 19:59 عصر
دوستان کمکم کنید

a_ahmadi
یک شنبه 31 شهریور 1392, 20:57 عصر
کد زیر در ردیف اول کد بالا جایگزین کنید.

<?php if( !defined( 'DATALIFEENGINE') OR !defined( 'LOGGED_IN') ) {

mehdiv
دوشنبه 01 مهر 1392, 00:54 صبح
کد زیر در ردیف اول کد بالا جایگزین کنید.

<?php if( !defined( 'DATALIFEENGINE') OR !defined( 'LOGGED_IN') ) {
بله درسته ممنون از a_ahmadi (http://barnamenevis.org/member.php?20170-a_ahmadi) به دلیل راهنمایی

meysammoezi
دوشنبه 01 مهر 1392, 19:11 عصر
ممنون خیلی از مشکلات کد ها حل شد ولی در خط 153/156/157 و 247 ایراد می گیره

a_ahmadi
دوشنبه 01 مهر 1392, 21:59 عصر
اشکال از ادیتور سایته
153

<td><a class=\"maintitle\" onclick=\"javascript:popupedit('".urlencode($receiver[name])."'); return false;\" href=\"#\">{$mcoz}</a></td>
156

<td>[<a title=\"نمایش پیغام\" class=\"list\" href=\"$HTML_SELF?mod=master_pm&action=doedit&id={$row['id']}\">نمایش</a>]
157

[<a onClick=\"confirmdelete('{$row['id']}'); return(false)\" href=\"\">حذف</a>]</td>