• Автор:

    Flesha
  • Добавлено:

    май 06, 2014
  • Комментариев:

    0
  • Просмотров:

    1083

Хак Вывод аватара в личных сообщениях

Хак Вывод аватара в личных сообщениях

Хак позволит вывести аватар пользователя, который отправил сообщение, через форму персональных сообщении DLE.

Установка:

Открыть файл engine/modules/pm.php и найти:
    if( $_GET['folder'] == "outbox" ) {

$lang['pm_from'] = $lang['pm_to'];
$sql = "SELECT SQL_CALC_FOUND_ROWS id, subj, name as user_from, date, pm_read FROM " . USERPREFIX . "_pm LEFT JOIN " . USERPREFIX . "_users ON " . USERPREFIX . "_pm.user=" . USERPREFIX . "_users.user_id WHERE user_from = '{$member_id['name']}' AND folder = 'outbox' ORDER BY date DESC LIMIT " . $cstart . "," . $pm_per_page;
$user_query = "do=pm&folder=outbox";

} else {

$sql = "SELECT SQL_CALC_FOUND_ROWS id, subj, user_from, date, pm_read, reply FROM " . USERPREFIX . "_pm where user = '{$member_id['user_id']}' AND folder = 'inbox' ORDER BY pm_read ASC, date DESC LIMIT " . $cstart . "," . $pm_per_page;
$user_query = "do=pm";

}


Заменить на:
    if( $_GET['folder'] == "outbox" ) {
$lang['pm_from'] = $lang['pm_to'];
// Старый запрос
//$sql = "SELECT SQL_CALC_FOUND_ROWS id, subj, name as user_from, date, pm_read FROM " . USERPREFIX . "_pm LEFT JOIN " . USERPREFIX . "_users ON " . USERPREFIX . "_pm.user=" . USERPREFIX . "_users.user_id WHERE user_from = '{$member_id['name']}' AND folder = 'outbox' ORDER BY date DESC LIMIT " . $cstart . "," . $pm_per_page;
$sql = "SELECT SQL_CALC_FOUND_ROWS id, subj, text, foto, name as user_from, date, pm_read FROM " . USERPREFIX . "_pm LEFT JOIN " . USERPREFIX . "_users ON " . USERPREFIX . "_pm.user=" . USERPREFIX . "_users.user_id WHERE user_from = '{$member_id['name']}' AND folder = 'outbox' ORDER BY date DESC LIMIT " . $cstart . "," . $pm_per_page;
$user_query = "do=pm&folder=outbox";
} else {
// Старый запрос
//$sql = "SELECT SQL_CALC_FOUND_ROWS id, subj, user_from, date, pm_read, reply FROM " . USERPREFIX . "_pm where user = '{$member_id['user_id']}' AND folder = 'inbox' ORDER BY pm_read ASC, date DESC LIMIT " . $cstart . "," . $pm_per_page;

$sql = "SELECT SQL_CALC_FOUND_ROWS id, subj, text, foto, user_from, date, pm_read, reply FROM " . PREFIX . "_pm pm LEFT JOIN " . USERPREFIX . "_users u ON u.name=pm.user_from WHERE user='{$member_id['user_id']}' AND folder='inbox' ORDER BY pm_read ASC, date DESC LIMIT " . $cstart . "," . $pm_per_page;
$user_query = "do=pm";
}



Найти далее:
        if( $row['reply'] ) $icon = "{THEME}/dleimages/send.gif";


Добавить ниже:
        $foto = ( $row['foto'] AND (file_exists( ROOT_DIR . "/uploads/fotos/{$row['foto']}" )) ) ? "/uploads/fotos/{$row['foto']}" : "/templates/{$config['skin']}/dleimages/noavatar.png";


Найти далее:
        $pmlist .= "<tr><td><img src=\"{$icon}\" border=\"0\" alt=\"\" /></td><td class=\"pm_list\">{$subj}</td><td class=\"pm_list\"><img src=\"{$foto}\" width=\"25px\" border=\"0\" alt=\"\" /> {$user_from}</td><td class=\"pm_list\" align=\"center\">" . langdate( "j.m.Y H:i", $row['date'] ) . "</td><td class=\"pm_list\" align=\"center\"><input name=\"selected_pm[]\" value=\"{$row['id']}\" type=\"checkbox\" /></td></tr>";


В нужном месте вывода аватара добавить:
<img src=\"{$foto}\" width=\"ваш размер px\" border=\"0\" alt=\"\" />


Версия DLE: 9.x-10.x
Автор: VITNET
Источник: dle-faq.ru
Вернуться
Информация
Посетители, находящиеся в группе Гости, не могут оставлять комментарии к данной публикации.