PDA

View Full Version : Site Map - highlighting of current category


Chan Kong-sang
08-20-2005, 09:11 PM
Hello,
i was pointed at the subdreamer.com forums to post this here.

I would like to use the "Site Map" ('http://www.subdreamer.com/sd_plugins/p13_sectionid/3/p13_fileid/116') on every category. If it's possible than i would like to get a highlighting of the category that i'm browsing currently.

Than i noticed it isn't supporting friendly urls. I'm a happy man if i could this in the next version too :D

This are my two cents. And thanks for your time making a great and free plugin! :)

Chan Kong-sang
08-25-2005, 06:54 PM
I really hate to bump but this is now an *officially bumped thread*.

I'm really sorry for your wasted time if you thought to find something rich in content.

vista
08-25-2005, 07:11 PM
I don't have an answer for you but wanted to point out that Site Map isn't a free plugin. It is available as part of the annual download fee or for purchase at http://subdreamerplugins.com/.

Questions about official plugins are handled at http://www.subdreamer.com/forum/forumdisplay.php?f=24

Terminator1138
08-25-2005, 07:53 PM
Technically, a sitemap encompasses your whole site...having it display the categories is kind of defeating the purpose of a site map. Perhaps you want a custom plugin to display some info about each category?

Chan Kong-sang
08-26-2005, 02:24 PM
It's still free... for pro user...

I'm using the sitemap currently as menu. Normally the menu entry is highlighted in that part of the site i'm currently browsing.

Should i post this at the subdreamerplugins.com? I think not because of:
Originally posted by labrekke @ subdreamer.com/forum
Hi Chan.

I suggest you ask this question on www.subdreamer.org (http://www.subdreamer.org), our code modifications site. It should be possible to make the current category be highlighted.

www.daspace.net

abcohen
08-26-2005, 03:07 PM
nope your correct this is the right place posting about a mod...
but this is spib's plugin so hell have to chime in on this one..

spib
08-26-2005, 03:22 PM
I won't give you the answer (that would be too easy) but I'll tell you how to do it.

Basically, you need to find out what the categoryid is of the current page and then as you display the options you need to highlight the one which matches the current categoryid.

The category of the current page is held in a global variable called $categoryid. If you want to reference it within a function you need to declare it in the function as global. So, in the sitemap plugin you can change

Function p46_DisplayCategories()
{
*global $DB;
to
Function p46_DisplayCategories()
{
*global $DB, $categoryid;

Now all you need to do is compare each item in the list with the $categoryid. So, again looking at the p46_DisplayCategories function

while($category = $DB->fetch_array($getcategories))
*{

while($category = $DB->fetch_array($getcategories))
*{
* *if($categoryid == $category['categoryid'])
* * *echo 'This is the current category';

That will only match the top level categories however so to make it match subcategories you would need to repeat the above in the p46_DisplaySubCats function

Tomatos
08-27-2005, 04:57 PM
I have this working. Swap out the file. Make a back up first just in case.

http://www.subdreamermods.com/images/sitemap.jpg

[attachmentid=87]

TD

Chan Kong-sang
08-27-2005, 09:58 PM
Woohoo! Thank you guys!