1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00

fix отображения топиков по тегу

This commit is contained in:
Mzhelskiy Maxim 2010-04-25 13:56:03 +00:00
parent 48895e9a94
commit adb22e7ab7
2 changed files with 8 additions and 8 deletions

View file

@ -851,13 +851,13 @@ class LsTopic extends Module {
* @return array
*/
public function GetTopicsByTag($sTag,$iPage,$iPerPage,$bAddAccessible=true) {
$aCloseTopics = ($this->oUserCurrent && $bAddAccessible)
? $this->GetTopicsCloseByUser($this->oUserCurrent->getId())
: $this->GetTopicsCloseByUser();
$aCloseBlogs = ($this->oUserCurrent && $bAddAccessible)
? $this->Blog_GetInaccessibleBlogsByUser($this->oUserCurrent)
: $this->Blog_GetInaccessibleBlogsByUser();
$s = serialize($aCloseTopics);
$s = serialize($aCloseBlogs);
if (false === ($data = $this->Cache_Get("topic_tag_{$sTag}_{$iPage}_{$iPerPage}_{$s}"))) {
$data = array('collection'=>$this->oMapperTopic->GetTopicsByTag($sTag,$aCloseTopics,$iCount,$iPage,$iPerPage),'count'=>$iCount);
$data = array('collection'=>$this->oMapperTopic->GetTopicsByTag($sTag,$aCloseBlogs,$iCount,$iPage,$iPerPage),'count'=>$iCount);
$this->Cache_Set($data, "topic_tag_{$sTag}_{$iPage}_{$iPerPage}_{$s}", array('topic_update','topic_new'), 60*60*24*2);
}
$data['collection']=$this->GetTopicsAdditionalData($data['collection']);

View file

@ -218,7 +218,7 @@ class Mapper_Topic extends Mapper {
return $aTopics;
}
public function GetTopicsByTag($sTag,$aExcludeTopic,&$iCount,$iCurrPage,$iPerPage) {
public function GetTopicsByTag($sTag,$aExcludeBlog,&$iCount,$iCurrPage,$iPerPage) {
$sql = "
SELECT
topic_id
@ -226,14 +226,14 @@ class Mapper_Topic extends Mapper {
".Config::Get('db.table.topic_tag')."
WHERE
topic_tag_text = ?
{ AND topic_id NOT IN (?a) }
{ AND blog_id NOT IN (?a) }
ORDER BY topic_id DESC
LIMIT ?d, ?d ";
$aTopics=array();
if ($aRows=$this->oDb->selectPage(
$iCount,$sql,$sTag,
(is_array($aExcludeTopic)&&count($aExcludeTopic)) ? $aExcludeTopic : DBSIMPLE_SKIP,
(is_array($aExcludeBlog)&&count($aExcludeBlog)) ? $aExcludeBlog : DBSIMPLE_SKIP,
($iCurrPage-1)*$iPerPage, $iPerPage
)
) {