Hi all,
I have it made so that when a user clicks on my 'photos' menu item, he or she will go directly to the page where subcategories or images of the main category are listed (because i don't want them to see the main category). My goal is to only have subcategories (and no images) in the main category, and only images in the subcategories.
Now, when a user (the author) logs in via the frontend, he or she can directly create a subfolder or upload an image. This can be done in the subcategories overview, and the photo's overview. However, when the user is in the subcategorie overview (inside the main category), i want him only to be able to create (or edit) subcategories, so no photo upload tab. But when the user is in the photo overview view (inside the subcategory), i want him only to be able to upload photo's (and no creating subcategories).
I found the code where the tabs are made, so i know how to hide them. I only need the condition: how can i find out if he's 'inside' the main category (subcategories overview view) or 'inside' a subcategory (photo overview view) ?
How to check for main category
- Jan
- Phoca Hero

- Posts: 49150
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: How to check for main category
Hi, you should get the GET parameter with tab=
Jan
Jan
If you find Phoca extensions useful, please support the project
-
nbarten
- Phoca Newbie

- Posts: 3
- Joined: 07 Jul 2012, 17:01
Re: How to check for main category
Hi,
Thanks for replying.
When i var_dump the $_GET, i get this:
array(4) { ["Itemid"]=> string(3) "127" ["option"]=> string(16) "com_phocagallery" ["view"]=> string(8) "category" ["id"]=> string(1) "2" }
No 'tab' parameter in there?
Thanks for replying.
When i var_dump the $_GET, i get this:
array(4) { ["Itemid"]=> string(3) "127" ["option"]=> string(16) "com_phocagallery" ["view"]=> string(8) "category" ["id"]=> string(1) "2" }
No 'tab' parameter in there?
- Jan
- Phoca Hero

- Posts: 49150
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: How to check for main category
Hmmm then the first tab is displayed if no one is set by GET
... so then you need to customize in the code - to change the tab number to higher value, etc. 
Jan
Jan
If you find Phoca extensions useful, please support the project
-
nbarten
- Phoca Newbie

- Posts: 3
- Joined: 07 Jul 2012, 17:01
Re: How to check for main category
Ah found it.
I just can use.
If its value is '0', then i'm in the main category (only subcategories visible), and if it has a value higher than 0, i'm in a subcategory (only photo's visible).
I just can use
Code: Select all
$this->category->parent_idIf its value is '0', then i'm in the main category (only subcategories visible), and if it has a value higher than 0, i'm in a subcategory (only photo's visible).
- Jan
- Phoca Hero

- Posts: 49150
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: How to check for main category
Ok
If you find Phoca extensions useful, please support the project