Просмотр юзером лайков, которые он же и выдал. Ну типа закладок как-бы... - Автор: madv1ch Работает функция так же как и обычный просмотр симпатий, но результат выдает другой. [b]Начнем же, мучить файл \engine\bullet_energy\action\site\user.php[/b] Найти [code] case 'like': [/code] Выше добавить [code] case 'user_like': return $this->_user_like() ; break; [/code] Найти [code]private function _like()[/code] Выше добавить [code]private function _user_like() { $option['joinAprove'] = parent::$helper->ckeckModulesConfig('be_moder_moder_view') ? '' : "AND post.message_approve = 1" ; $row = parent::$db->super_query("SELECT count( * ) AS count FROM " . PREFIX . "_be_thanks AS thanks WHERE thanks.thanks_id_user = {$this->user['user_id']}") ; $pag = parent::$helper->setPaginator(array( 'unreadCount' => $row['count'], 'name_user' => $this->user['name'], 'linck' => parent::$link->user_Like($this->user['name']))) ; parent::$db->query("SELECT thanks.thanks_date, post.message_text, post.id AS post_id, post.id_topic, user.user_id, user.name,user.foto, topic.title FROM " . PREFIX . "_be_thanks AS thanks LEFT JOIN " . PREFIX . "_be_message AS post ON thanks.thanks_msg_id = post.id LEFT JOIN " . PREFIX . "_users AS user ON thanks.thanks_id_user = user.user_id LEFT JOIN " . PREFIX . "_be_topic AS topic ON topic.id = post.id_topic WHERE thanks.thanks_id_user = {$this->user['user_id']} {$option['joinAprove']} LIMIT {$pag['start']},{$pag['nums']}") ; if(!parent::$db->num_rows()) { if(parent::$ajax) { return parent::$helper->getJson(array('param' => 0, 'data' => parent::$bullet_energy_lang['like_8'])) ; } else { return parent::$helper->setTplMainBlock($this->setTplViewFullTopic(array('message' => parent::$helper->setTplError(parent::$bullet_energy_lang['user_6'], parent::$bullet_energy_lang['like_8']))), array("Сообщения понравившиеся мне"), array('spedbar' => array('titlAction' => "Сообщения понравившиеся мне"))) ; } } else { while ($row = parent::$db->get_row()) { parent::$tpl->load_template('user.tpl') ; parent::$tpl->set_block("'\\[msg\\](.*?)\\[/msg\\]'si", "") ; parent::$tpl->set_block("'\\[like\\](.*?)\\[/like\\]'si", "") ; parent::$tpl->set_block("'\\[topic\\](.*?)\\[/topic\\]'si", "") ; parent::$tpl->set('[user_Like]', '') ; parent::$tpl->set('[/user_Like]', '') ; parent::$tpl->set('{userLiked}', $row['name']) ; parent::$tpl->set('[popupUserLikedCard]', parent::$link->card_user(array($row['name'], $row['user_id']))) ; parent::$tpl->set('[/popupUserLikedCard]', '') ; parent::$tpl->set('[profileUserLiked]', parent::$link->linckUserSiteProfile($row['name'])) ; parent::$tpl->set('[/profileUserLiked]', '') ; parent::$tpl->set('{titleTopic}', stripslashes($row['title'])) ; parent::$tpl->set('[linckTopic]', parent::$link->topic_linck($row['id_topic'], totranslit($row['title'], true, true))) ; parent::$tpl->set('[/linckTopic]', '') ; parent::$tpl->set('{fotoUserLiked}', parent::$helper->isAvatarUser($row['foto'])) ; parent::$tpl->set('{likedDate}', parent::$helper->setDate($row['thanks_date'])) ; if(parent::$helper->ckeckModulesConfig('be_access_hide')) { $row['message_text'] = str_ireplace("[hide]", "", str_ireplace("[/hide]", "", $row['message_text'])) ; } else { $row['message_text'] = preg_replace("#\[hide\](.+?)\[/hide\]#ims", "
" . parent::$bullet_energy_lang['msg_11'] . "
", $row['message_text']) ; } parent::$tpl->set('[linckMessage]', '') ; parent::$tpl->set('[/linckMessage]', '') ; parent::$tpl->set('{messageText}', $row['message_text']) ; parent::$tpl->compile('user') ; } return parent::$helper->setTplMainBlock($this->setTplViewFullTopic(array('message' => parent::$tpl->result['user'], 'paginator' => $pag['paginator'])), array("Сообщения понравившиеся мне"), array('spedbar' => array('titlAction' => "Сообщения понравившиеся мне"))) ; } } [/code] Найти [code]parent::$tpl->set('[like]', '') ;[/code] Выше добавить [code]parent::$tpl->set_block("'\\[user_Like\\](.*?)\\[/user_Like\\]'si", "") ;[/code] Найти [code]parent::$tpl->set('[topic]', '') ;[/code] Выше добавить [code]parent::$tpl->set_block("'\\[user_Like\\](.*?)\\[/user_Like\\]'si", "") ;[/code] Найти [code]parent::$tpl->set('[msg]', '') ;[/code] Выше добавить [code]parent::$tpl->set_block("'\\[user_Like\\](.*?)\\[/user_Like\\]'si", "") ;[/code] [b]Теперь открываем \engine\bullet_energy\classes\link.class.php[/b] Найти [code]public function userLike($userName = '')[/code] Выше добавить [code] public function user_Like($userName = '') { return $this->cpu ? "{$this->root}user/" . urlencode($userName) . "/user_like{$this->endLinckSymbol}" : "{$this->root}?do={$this->router['main']}&action=like_user&name=" . urlencode($userName) ; } [/code] [b]Так, далее открываем .htaccess в корне сайта и после RewriteEngine On добавляем[/b] [code]RewriteRule ^user/([^/]*)/user_like(/?)+$ index.php?do=forum&action=user&name=$1¶m=user_like [L] RewriteRule ^user/([^/]*)/user_like/page-([0-9]+)(/?)+$ index.php?do=forum&action=user&name=$1&page=$2¶m=user_like [L][/code] [b]Открываем \www\templates\ЧТО_ТО_ТАМ\bullet_energy\user.tpl и в самый конец добавить[/b] [code][user_Like]
  • [popupUserLikedCard][/popupUserLikedCard]

    Понравилось сообщение в теме [linckMessage]{titleTopic}[/linckMessage].

    {likedDate}
    {messageText}
  • [/user_Like][/code] [b]Открываем \engine\modules\profile.php находим[/b] [code]$tpl->set( '{lastdate}', langdate( "j F Y H:i", $row['lastdate'] ) );[/code] Ниже добавить [code] if($is_logged and ($member_id['user_id'] == $row['user_id'])) { $tpl->set('[user_Like]', '') ; $tpl->set('[/user_Like]', '') ; } else { $tpl->set_block("'\\[user_Like\\](.*?)\\[/user_Like\\]'si", "") ; } [/code] [b]Теперь в userinfo.tpl шаблона вставляем что-то вроде этого[/b] [code][user_Like]Сообщения понравившиеся мне[/user_Like][/code] [b]В файле: actions/site/search.php[/b] Найти: [code]parent::$tpl->set_block("'\\[like\\](.*?)\\[/like\\]'si", "") ;[/code] Заменить на: [code] parent::$tpl->set_block("'\\[like\\](.*?)\\[/like\\]'si", "") ; // fix rdn team parent::$tpl->set_block("'\\[user_Like\\](.*?)\[/user_Like\\]'si", "") ; // [/code] В файле site.lng найти [code]'like_8' => '',[/code] И присвоить ей значение: [code]'like_8' => 'Вы ещё ничего не помечали.',[/code] Строка "Полученные пользователем симпатии" меняется по такому же принципу, меняем "like_7", на "like_9", задаём нужный текст. [b]Для отображения понравившихся в навбаре:[/b] [b]В файле: /engine/bullet_energy/helper/primary.php[/b] Найти: [code]$navigate .= '
  • ' . parent::$bullet_energy_lang['topicVis'] . '
  • ' ;[/code] Добавить ниже: [code]$navigate .= '
  • Понравившиеся
  • ' ;[/code] Вот и всё. Вроде ничего не забыл, кажется... Посторонние ссылку не будут видеть в профиле.