| @@ 2081-2112 (lines=32) @@ | ||
| 2078 | $topten = []; |
|
| 2079 | $data = []; |
|
| 2080 | ||
| 2081 | while ($row = $this->_config->getDb()->fetchObject($result)) { |
|
| 2082 | if ($this->groupSupport) { |
|
| 2083 | if (!in_array($row->user_id, array(-1, $this->user)) || !in_array($row->group_id, $this->groups)) { |
|
| 2084 | continue; |
|
| 2085 | } |
|
| 2086 | } else { |
|
| 2087 | if (!in_array($row->user_id, array(-1, $this->user))) { |
|
| 2088 | continue; |
|
| 2089 | } |
|
| 2090 | } |
|
| 2091 | ||
| 2092 | $data['visits'] = $row->visits; |
|
| 2093 | $data['question'] = $row->thema; |
|
| 2094 | $data['date'] = $row->updated; |
|
| 2095 | $data['last_visit'] = $row->last_visit; |
|
| 2096 | ||
| 2097 | $title = $row->thema; |
|
| 2098 | $url = sprintf( |
|
| 2099 | '%sindex.php?%saction=artikel&cat=%d&id=%d&artlang=%s', |
|
| 2100 | $this->_config->getDefaultUrl(), |
|
| 2101 | $sids, |
|
| 2102 | $row->category_id, |
|
| 2103 | $row->id, |
|
| 2104 | $row->lang |
|
| 2105 | ); |
|
| 2106 | $oLink = new PMF_Link($url, $this->_config); |
|
| 2107 | $oLink->itemTitle = $row->thema; |
|
| 2108 | $oLink->tooltip = $title; |
|
| 2109 | $data['url'] = $oLink->toString(); |
|
| 2110 | ||
| 2111 | $topten[] = $data; |
|
| 2112 | } |
|
| 2113 | ||
| 2114 | return $topten; |
|
| 2115 | } |
|
| @@ 2182-2213 (lines=32) @@ | ||
| 2179 | $latest = []; |
|
| 2180 | $data = []; |
|
| 2181 | ||
| 2182 | while (($row = $this->_config->getDb()->fetchObject($result))) { |
|
| 2183 | if ($this->groupSupport) { |
|
| 2184 | if (!in_array($row->user_id, array(-1, $this->user)) || !in_array($row->group_id, $this->groups)) { |
|
| 2185 | continue; |
|
| 2186 | } |
|
| 2187 | } else { |
|
| 2188 | if (!in_array($row->user_id, array(-1, $this->user))) { |
|
| 2189 | continue; |
|
| 2190 | } |
|
| 2191 | } |
|
| 2192 | ||
| 2193 | $data['date'] = $row->updated; |
|
| 2194 | $data['question'] = $row->thema; |
|
| 2195 | $data['answer'] = $row->content; |
|
| 2196 | $data['visits'] = $row->visits; |
|
| 2197 | ||
| 2198 | $title = $row->thema; |
|
| 2199 | $url = sprintf( |
|
| 2200 | '%sindex.php?%saction=artikel&cat=%d&id=%d&artlang=%s', |
|
| 2201 | $this->_config->getDefaultUrl(), |
|
| 2202 | $sids, |
|
| 2203 | $row->category_id, |
|
| 2204 | $row->id, |
|
| 2205 | $row->lang |
|
| 2206 | ); |
|
| 2207 | $oLink = new PMF_Link($url, $this->_config); |
|
| 2208 | $oLink->itemTitle = $row->thema; |
|
| 2209 | $oLink->tooltip = $title; |
|
| 2210 | $data['url'] = $oLink->toString(); |
|
| 2211 | ||
| 2212 | $latest[] = $data; |
|
| 2213 | } |
|
| 2214 | ||
| 2215 | return $latest; |
|
| 2216 | } |
|