Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; exit(); } /** * @class warnings_forums * @brief Warnings Extension for forums */ class warnings_forums { /** * Get Content URL * * @param array $warning Row from members_warn_logs * @return @e array array( url => URL to the content the warning came from, title => Title ) */ public function getContentUrl( $warning ) { if ( is_numeric( $warning['wl_content_id1'] ) ) { $post = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'posts', 'where' => "pid={$warning['wl_content_id1']}" ) ); if ( ! empty($post['topic_id']) ) { $topic = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => "tid={$post['topic_id']}" ) ); if ( ! empty($topic['tid']) ) { return array( 'url' => ipsRegistry::getClass('output')->buildSEOUrl( "showtopic={$topic['tid']}&findpost={$post['pid']}", 'public', $topic['title_seo'], 'showtopic' ), 'title' => $topic['title'] ); } } } elseif ( $warning['wl_content_id1'] == 'announcement' ) { $announcement = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'announcements', 'where' => "announce_id=" . intval( $warning['wl_content_id2'] ) ) ); if ( ! empty($announcement['announce_id']) ) { return array( 'url' => ipsRegistry::getClass('output')->buildSEOUrl( "showannouncement={$announcement['announce_id']}", 'public', IPSText::makeSeoTitle( $announcement['announce_title'] ), 'showannouncement' ), 'title' => $announcement['announce_title'] ); } } return NULL; } }