From: Ton O. <ton...@he...> - 2005-01-25 19:50:43
|
I've made a few hacks for menumanager and blockmaker and in those hacks I used the following code: $pagecatids = $_SESSION["OBJ_fatcat"]->getModulesCategories('pagemaster', $my_currentpage_id); A page can have more than one category so $pagecatids here is an array. Maybe this one works? Ton. -----Oorspronkelijk bericht----- Van: php...@li... [mailto:php...@li...] Namens yawstick Verzonden: dinsdag 25 januari 2005 15:15 Aan: php...@li... Onderwerp: Re: [Phpwebsite-developers] formating amd themes The page_id is working and am using it to switch styles in the example below is there not another method of retrieving the category > Maybe it has something to do with the line just before it: that the current > page_id isn't retrieved correctly. You could also use this one to retrieve > the current page_id: > $my_pageid=(int)$_REQUEST['PAGE_id'] > > Regards, > Ton Oosterhoff > > > -----Oorspronkelijk bericht----- > Van: php...@li... > [mailto:php...@li...] Namens yawstick > Verzonden: dinsdag 25 januari 2005 4:04 > Aan: php...@li... > Onderwerp: Re: [Phpwebsite-developers] formating amd themes > > I've learned quite a bit about theme.php theme.tpl style sheets and even > found the function getElementCatId in fatcat. I have been able to change > style sheets and even the logo image but had to do it using the page id. > Most of this is derived from the example of Ton Oosterhoff, which included > the syntax for retrieving the page id and page category. The page category > one always comes back empty, as I have added $THEME varibles to show the > results in the web page. So if you could enlighten me as to the proper calls > to get the page category for the current page I would greatly appreciate it. > > $THEME["is_user"] = $_SESSION['OBJ_user']->isUser() ; > $THEME["page_id"] = $_SESSION["SES_PM_page"]->id ; > > // get the page id: > $my_pageid = $_SESSION["SES_PM_page"]->id; > > ******* the line below always comes back empty could comment on the > correctness of the syntax ***** > > $THEME["page_category"] = > $_SESSION["OBJ_fatcat"]->getElementCatId($my_pageid) ; > > // get the category of this page: > //$my_category = $_SESSION["OBJ_fatcat"]->getElementCatId($my_pageid); > > $my_category = $_SESSION["SES_PM_page"]->id; > > switch ($my_category){ > case "3": > $my_style = "page1.css"; > break; > case "6": > $my_style = "midnight.css"; > break; > default: > $my_style = "classic.css"; > } > > // output it to the template... > $THEME["my_style"] = $my_style; > > switch ($my_style){ > case "midnight.css": > $logo = "logo1.jpg"; > break; > case "modernist.css": > $logo = "logo2.jpg"; > break; > case "classic.css": > $logo = "logo.jpg"; > break; > } > $THEME["logo"] =$logo; > > ?> > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ Phpwebsite-developers mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers |