Помощник
|
Интеграция репутации из DLE Forum в DLE, Помогите исправить баг |
Simur
|
Сообщение
#1
|
||
|
|
||
|
|||
Misha |
13.2.2011, 19:04;
Ответить: Misha
Сообщение
#2
|
|
Нет времени открывать, вы бы сюда выложили процесс установки, было бы проще. Смею сказать, что проблема именно в обновление таблицы в БД, копать нужно именно в эту сторону.
|
|
|
Simur
|
Сообщение
#3
|
|
Инструкция по установки интеграции репутации и замечаний из DLE-Forum в DLE.
Инструкция для 8.3: 1. В файле: engine/modules/show.full.php, найти строчку: $comments->query = "SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, date, autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . USERPREFIX . "_users.email, news_num, comm_num, user_group, reg_date, signature, foto, fullname, land, icq, xfields FROM " . PREFIX . "_comments LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id WHERE " . PREFIX . "_comments.post_id = '$news_id'" . $where_approve . " ORDER BY date " . $config['comm_msort']; И заменить на: $comments->query = "SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, date, autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . USERPREFIX . "_users.email, news_num, comm_num, user_group, reg_date, signature, foto, fullname, land, icq, forum_reputation, xfields FROM " . PREFIX . "_comments LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id WHERE " . PREFIX . "_comments.post_id = '$news_id'" . $where_approve . " ORDER BY date " . $config['comm_msort']; 2. В файле: engine/modules/lastcomments.php, найти строчку: $comments->query = "SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, " . PREFIX . "_comments.date, " . PREFIX . "_comments.autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . USERPREFIX . "_users.email, news_num, " . USERPREFIX . "_users.comm_num, user_group, reg_date, signature, foto, fullname, land, icq, " . USERPREFIX . "_users.xfields as xprofile, " . PREFIX . "_post.title, " . PREFIX . "_post.date as newsdate, " . PREFIX . "_post.alt_name, " . PREFIX . "_post.category, " . PREFIX . "_post.flag FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_post ON " . PREFIX . "_comments.post_id=" . PREFIX . "_post.id LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id " . $where . " ORDER BY id desc"; И заменить на: $comments->query = "SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, " . PREFIX . "_comments.date, " . PREFIX . "_comments.autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . USERPREFIX . "_users.email, news_num, " . USERPREFIX . "_users.comm_num, user_group, reg_date, signature, foto, fullname, land, icq, forum_reputation, " . USERPREFIX . "_users.xfields as xprofile, " . PREFIX . "_post.title, " . PREFIX . "_post.date as newsdate, " . PREFIX . "_post.alt_name, " . PREFIX . "_post.category, " . PREFIX . "_post.flag FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_post ON " . PREFIX . "_comments.post_id=" . PREFIX . "_post.id LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id " . $where . " ORDER BY id desc"; 3. В файле engine/classes/comments.class.php Найти строчку: $tpl->set( '{comment}', "<div id='comm-id-" . $row['id'] . "'>" . stripslashes( $row['text'] ) . "</div>" ); Ниже добавить: //reputation require_once ENGINE_DIR . '/data/forum_config.php'; require_once ENGINE_DIR . '/forum/sources/modules/dle_func.php'; if ($forum_config['reputation']) { $rep_m = "<a OnClick=\"FRep('-', '$row[user_id]', '$row[id]', '0');\"><img src='{THEME}/forum/images/rep_m.gif' alt='-' border='0' /></a> "; $rep_p = " <a OnClick=\"FRep('+', '$row[user_id]', '$row[id]', '0');\"><img src='{THEME}/forum/images/rep_p.gif' alt='+' border='0' /></a>"; $reputation = $rep_m . link_rep($row['name'], $row['forum_reputation']) . $rep_p; $tpl->set('{reputation}', "<span id='rep-".$row['id']."'>".$reputation."</span>"); } else { $tpl->set('{reputation}', "--"); } unset ($reputation); // 4. В файле engine/modules/profile.php Ищем строчку: $tpl->set( '{lastdate}', langdate( "j F Y H:i", $row['lastdate'] ) ); Ниже добавим: //reputation require_once ENGINE_DIR . '/data/forum_config.php'; require_once ENGINE_DIR . '/forum/sources/modules/dle_func.php'; if ($forum_config['reputation']) { $rep_m = "<a OnClick=\"FRep('-', '$row[user_id]', '$row[id]', '0');\"><img src='{THEME}/forum/images/rep_m.gif' alt='-' border='0' /></a> "; $rep_p = " <a OnClick=\"FRep('+', '$row[user_id]', '$row[id]', '0');\"><img src='{THEME}/forum/images/rep_p.gif' alt='+' border='0' /></a>"; $reputation = $rep_m . link_rep($row['name'], $row['forum_reputation']) . $rep_p; $tpl->set('{reputation}', "<span id='rep-".$row['id']."'>".$reputation."</span>"); } else { $tpl->set('{reputation}', "--"); } unset ($reputation); // 5. В директории engine/forum/sources/modules/ создать файл dle_func.php, с кодом: <?php if(!defined('DATALIFEENGINE')) die("Hacking attempt!"); //reputation if (!function_exists("link_rep")) { function link_rep($user, $title = false) { global $config; if (!$title) $title = "0"; if ($config['allow_alt_url'] == "yes") { $forum_url = $config['http_home_url']."forum"; return("<a href='{$forum_url}/reputation/".urlencode($user)."/'>{$title}</a>"); } else { $forum_url = $config['http_home_url']."index.php?do=forum&"; return("<a href='{$forum_url}act=reputation&user=".urlencode($user)."'>{$title}</a>"); } } } ?> 6. В файле main.tpl вашего шаблона, после строки: {AJAX} вставить код: [aviable=showfull|lastcomments|userinfo] <script language="javascript" type="text/javascript"> function FRep(action, user_id, post_id, forum_id) { var cause = prompt("Введите причину", ""); if (cause) { var ajax = new dle_ajax(); ajax.onShow (''); var varsString = "user_id=" + user_id; ajax.setVar("skin", dle_skin); ajax.setVar("action", action); ajax.setVar("forum_id", forum_id); ajax.setVar("post_id", post_id); ajax.setVar("cause", ajax.encodeVAR(cause)); ajax.requestFile = dle_root + "engine/forum/ajax/reputation.php"; ajax.method = 'POST'; ajax.element = 'rep-' + post_id; ajax.sendAJAX(varsString); } return false; }; </script> [/aviable] 7. Ну и на последок в файлах шаблона: comments.tpl и userinfo.tpl, вставляем {reputation} куда вам надо. Это для ДЛЕ 8.3. У меня 9.2 форум 2.6 Сообщение отредактировал Simur - 13.2.2011, 19:59 -------------------- |
|
|
Simur
|
Сообщение
#4
|
|
Помогите плиззз!!!
-------------------- |
|
|
Simur
|
Сообщение
#5
|
|
Люди добрые! Ну помогите пожалуйста
-------------------- |
|
|
Simur
|
Сообщение
#6
|
|
Что никто не знает?
-------------------- |
|
|
Simur
|
Сообщение
#7
|
|
Кто сколько возьмет за подгонку хака под ДЛЕ 9.2?
-------------------- |
|
|
Splendid |
21.2.2011, 15:47;
Ответить: Splendid
Сообщение
#8
|
|
А вы на специалезированый форум не пробовали обращаться?
|
|
|
Simur
|
Сообщение
#9
|
|
эт на какой?
-------------------- |
|
|
Gomer1705 |
21.2.2011, 22:53;
Ответить: Gomer1705
Сообщение
#10
|
|
эт на какой? forum.dle-news.ru Сообщение отредактировал Gomer1705 - 21.2.2011, 22:54 -------------------- Самые свежие игровые новости |
|
|
|
Похожие темы
Тема | Ответов | Автор | Просмотров | Последний ответ | |
---|---|---|---|---|---|
Интеграция спортивных данных API. Коэффициенты БК, Live результаты | 15 | yaroslav89 | 6877 | 8.4.2024, 17:17 автор: spoyer_ru |
|
DLE xProtect | 2 | xoopw | 5989 | 15.1.2024, 21:06 автор: Diana_Wesley |
|
Обновить сайт на CMS DLE | 1 | Sawich | 1671 | 2.9.2023, 10:10 автор: WoWeb |
|
Изготовление красивых сайтов на DLE под ключ | Доступные цены от 2000 руб. |
1 | Admiral_ukr | 1603 | 20.11.2022, 10:08 автор: Webmaster24 |
|
Ищу спеца по DLE вылечить сайт | 4 | Reactive | 2644 | 22.10.2022, 9:01 автор: Fozik77 |
Текстовая версия | Сейчас: 25.4.2024, 21:31 |