mSql = $sql; $this->mAlbumMgr = new AlbumManager($this->mSql); $this->mAlbumMgr->setPage($this); //check if the session does not exists then redirect } public function displayAd(){ if (@include_once(getenv('DOCUMENT_ROOT').'/pulse/phpads/phpadsnew.inc.php')) { if (!isset($phpAds_context)) $phpAds_context = array(); $phpAds_raw = view_raw ('', 12, '', '', '0', $phpAds_context); $this->assign("albumHeaderAd",$phpAds_raw['html']); $phpAds_raw = view_raw ('', 10, '', '', '0', $phpAds_context); $this->assign("albumRightAd",$phpAds_raw['html']); $phpAds_raw = view_raw ('', 14, '', '', '0', $phpAds_context); $this->assign("pulseHeaderTopAd",$phpAds_raw['html']); //end assigning ad here } } public function displayFeatureStrip(){ $mCfeatureManager = new CfeatureManager($this->mSql); $magid = $mCfeatureManager->setMagzine(); $this->assign("magid",$magid); $dataSource = new Datasource(); $CFeatureWidget = new CFeatureWidget(); $dataSource->addObserver($CFeatureWidget); $dataSource->addDataManager($mCfeatureManager); //echo $CFeatureWidget->draw();exit; $this->assign("Feature", $CFeatureWidget->draw()); //end displaying feature } public function displayAlbum(){ $dataSource = new Datasource (); $album = new CAlbumWidget(); $album->setPage($this); $dataSource->addObserver($album); $dataSource->addDataManager($this->mAlbumMgr); $this->assign("albumList", $album->draw()); $datagrid = $album->getDataGrid(); //get navigation $pagination = $datagrid->getNavigation(); //display it $this->assign("pagination",$pagination); echo $this->fetch("albumGrid.tpl"); } /** * This method is from our Smarty template engine it must be overriden here * else it will give you error as it is abstract method in smarty * */ public function initialize(){ $this->assign("HTTP_PATH",ConfigurationSingleton::HTTP_PATH ); //get configuration there should be only one instance of the class //this class contains all the site configuration $config = ConfigurationSingleton::getConfiguration(); //get smarty template engine configuration $config->getSmartyConfiguration( $this ); //populare widget $dataSource = new Datasource(); $popWidget = new PopularWidget(); $popMgr = new PopularDataManager($this->mSql); //add popular widget observer $dataSource->addObserver($popWidget); $dataSource->addDataManager($popMgr); $this->assign("popular",$popWidget->draw()); //end popular $this->displayFeatureStrip(); $this->displayAd(); RegisterCallback::register($this,$_REQUEST["_method"]); //page on wchich all this content is going to be displayed $this->display("photoAlbum.html"); } } $page = new PhotoAlbumPage(); $page->initialize(); ?>