<script src="http://site_name.ru/vb_info.php"></script>
<? Define('URL', 'http://site_name.ru/' ); SetLocale(LC_ALL, 'ru_RU.CP1251'); ################################## CONNECT TO DB ############################################## Require_Once('./includes/config.php'); Define('TBL_PFX', $config['Database']['tableprefix'] ); $ConnID = MySQL_Connect( $config['MasterServer']['servername'], $config['MasterServer']['username'], $config['MasterServer']['password'] ); If(!$ConnID)Die('CanNotConnectDB'); If(!MySQL_Select_DB($config['Database']['dbname'], $ConnID)) { MySQL_Close($ConnID); Die('CanNotSelectDB'); } Else UnSet($config); #################################### OUT SCRIPT ############################################### $Res = MySQL_Query('SELECT `p`.`postid`, `p`.`username`, IF(`p`.`title` = NULL OR `p`.`title` = "", `t`.`title`, `p`.`title`) AS `title` FROM `' . TBL_PFX . 'post` AS `p` INNER JOIN `' . TBL_PFX . 'thread` AS `t` USING(`threadid`) ORDER BY `p`.`postid` DESC LIMIT 1', $ConnID); If(!$Res)Die('ForumDBNotFound'); $Result = MySQL_Fetch_Array($Res); Extract($Result); MySQL_Close($ConnID); Echo 'document.write(\'<a href="' . URL . 'showthread.php?p=' . $postid . '#post' . $postid . '" target=_blank title="Новое сообщение от ' . HTMLEnTities($username, ENT_QUOTES, 'cp1251') . '"><font color=red><i>А на форуме у нас новая тема:</i></font><img alt="Сейчас в форуме..." src="' . URL . 'images/icons/icon1.gif" border=0 hspace=0 vspace=0>' . HTMLEnTities($title, ENT_QUOTES, 'cp1251') . '</a>\');'; ?>