$parentId = ($postId == 0) ? $postId : $articleId; // db -table and stored procedure $tblTopic = DBT_Topic; $spGetTopicAndAttachment = DBSP_PGetTopicAndAttachment; // path to javascript $javaPath = WS_JAVASCRIPT; $attachedFile = ""; //--------------------------------------------------------------------------------------------- // // creating necessary objects // $artNav = new CNavigation(); $articleNav = $artNav->CreateLinksToArticles(); $pc = new CPageController(); //--------------------------------------------------------------------------------------------- // // preparing and performing query // //checking if quering is needed if($newtopic == 'newtopic') { $parentId = $articleId; $articleId = 0; $topicId = 0; }