From: Verdon V. <ve...@ve...> - 2005-10-04 23:22:48
|
hi all :) Has anyone worked out a simple/reliable method to detect the category(s) of whatever content is currently being displayed in your phpws site? I've come up with a few hacks that work in some mods and not in others, and I've spent hours looking at the $_SESSION and $GLOBALS arrays for something reliable, as well as the fatcat class files, but I haven't been able to work out a bullet-proof method yet. All I'm really trying to achieve is a way to capture the id of any fatcat categories the curent content may belong to, in my theme.php file, so I can use this variable. So far, I've been poking at things like this, just to see what'll happen, but the results are pretty inconsistant... $cur_mod = $GLOBALS["core"]->requestModule; $my_cats = $_SESSION["OBJ_fatcat"]->listModuleElements($cur_mod); foreach ($my_cats as $my_cat_title){ $cat_title = $my_cat_title["title"]; $cat_id = $_SESSION["OBJ_fatcat"]->getCatId($cat_title); echo $cat_id . '<br />'; echo $cat_title . '<br />'; } Does anyone have any better ideas? Thanks, verdon |